/* =====================================================================
   dobby POS · Website CMS — admin-styles.css
   Theming: [data-theme="dark"] (default) / [data-theme="light"] on <html>
   Built on Bootstrap 5.1.3 (no native color modes → custom tokens + overrides)
   ===================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
    --brand: #FF3655;
    --brand-hover: #FF4D68;
    --brand-press: #E62645;
    --brand-rgb: 255, 54, 85;
    --violet: #8B7CFF;
    --violet-rgb: 139, 124, 255;
    --success: #22C38E;
    --success-rgb: 34, 195, 142;
    --warning: #F5A524;
    --warning-rgb: 245, 165, 36;
    --danger: #F04B4B;
    --danger-rgb: 240, 75, 75;

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --sidebar-w: 268px;
    --topbar-h: 72px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

/* Dark (default) */
:root,
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #07080B;
    --frame: #0F1016;
    --panel: #0A0B0F;
    --surface: #15161D;
    --surface-2: #1B1C25;
    --surface-3: #252632;
    --input-bg: #101118;
    --border: rgba(255, 255, 255, .06);
    --border-strong: rgba(255, 255, 255, .11);
    --text: #ECEDF2;
    --text-muted: #9A9CAB;
    --text-subtle: #676979;
    --brand-text: #FF6B83;
    --brand-soft: rgba(var(--brand-rgb), .14);
    --violet-soft: rgba(var(--violet-rgb), .16);
    --success-soft: rgba(var(--success-rgb), .14);
    --warning-soft: rgba(var(--warning-rgb), .14);
    --danger-soft: rgba(var(--danger-rgb), .14);
    --nav-active-bg: #F2F2F5;
    --nav-active-text: #0B0C10;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .75);
    --logo-filter: none;
    --switch-knob: rgba(255, 255, 255, .55);
    --backdrop: rgba(3, 4, 6, .72);
}

/* Light */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #E6E8EE;
    --frame: #FFFFFF;
    --panel: #F3F4F7;
    --surface: #FFFFFF;
    --surface-2: #F4F5F8;
    --surface-3: #E9EBF0;
    --input-bg: #FFFFFF;
    --border: rgba(15, 17, 26, .07);
    --border-strong: rgba(15, 17, 26, .13);
    --text: #14151B;
    --text-muted: #646776;
    --text-subtle: #9496A3;
    --brand-text: #E5203E;
    --brand-soft: rgba(var(--brand-rgb), .10);
    --violet-soft: rgba(var(--violet-rgb), .13);
    --success-soft: rgba(var(--success-rgb), .12);
    --warning-soft: rgba(var(--warning-rgb), .14);
    --danger-soft: rgba(var(--danger-rgb), .10);
    --nav-active-bg: #121318;
    --nav-active-text: #FFFFFF;
    --shadow-sm: 0 1px 2px rgba(16, 18, 27, .06);
    --shadow: 0 10px 30px -14px rgba(16, 18, 27, .18);
    --shadow-lg: 0 30px 60px -24px rgba(16, 18, 27, .28);
    --logo-filter: invert(1) brightness(.12);
    --switch-knob: rgba(0, 0, 0, .28);
    --backdrop: rgba(20, 22, 30, .45);
}

/* ---------- 2. Base ---------- */
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .25s var(--ease), color .25s var(--ease);
}

::selection { background: rgba(var(--brand-rgb), .3); }

a { color: var(--brand-text); text-decoration: none; }
a:hover { color: var(--brand); }

h1, h2, h3, h4, h5, h6 { color: var(--text); letter-spacing: -.02em; font-weight: 700; }

.text-muted { color: var(--text-muted) !important; }
.text-subtle { color: var(--text-subtle) !important; }
.text-brand { color: var(--brand-text) !important; }

kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--text-muted);
    border: 1px solid var(--border);
    box-shadow: none;
}

* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid rgba(var(--brand-rgb), .65); outline-offset: 2px; }

/* ---------- 3. Bootstrap overrides (theme-aware) ---------- */
.btn {
    --radius: var(--radius-sm);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    padding: .55rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:focus { box-shadow: none; }
.btn:focus-visible { box-shadow: 0 0 0 4px var(--brand-soft); }
.btn .bi { font-size: 1.05em; line-height: 1; }

.btn-primary,
.btn-brand {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}
.btn-primary:hover, .btn-brand:hover,
.btn-primary:focus, .btn-brand:focus { color: #fff; background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-primary:active, .btn-brand:active { background: var(--brand-press) !important; border-color: var(--brand-press) !important; }
.btn-primary:disabled, .btn-brand:disabled { color: #fff; background: var(--brand); border-color: var(--brand); opacity: .55; }

.btn-soft {
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.btn-soft:hover, .btn-soft:focus { color: var(--text); background: var(--surface-3); border-color: var(--border-strong); }

.btn-ghost { color: var(--text-muted); background: transparent; border: 1px solid transparent; }
.btn-ghost:hover, .btn-ghost:focus { color: var(--text); background: var(--surface-2); }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover, .btn-danger:focus { background: #E13A3A; border-color: #E13A3A; color: #fff; }

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    flex: 0 0 auto;
    border-radius: var(--radius-sm);
}
.btn-icon.btn-sm { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }
.btn-icon.danger:hover { color: var(--danger); background: var(--danger-soft); }

.form-label { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: .45rem; }
.form-text { color: var(--text-subtle); font-size: 12px; }

.form-control,
.form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: .65rem .9rem;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.form-control::placeholder { color: var(--text-subtle); }
.form-control:focus,
.form-select:focus {
    background-color: var(--input-bg);
    color: var(--text);
    border-color: rgba(var(--brand-rgb), .7);
    box-shadow: 0 0 0 4px var(--brand-soft);
}
.form-control:disabled { background-color: var(--surface-2); opacity: .7; }
textarea.form-control { resize: vertical; min-height: 120px; line-height: 1.6; }

.was-validated .form-control:invalid, .form-control.is-invalid { border-color: var(--danger); background-image: none; padding-right: .9rem; }
.was-validated .form-control:invalid:focus, .form-control.is-invalid:focus { box-shadow: 0 0 0 4px var(--danger-soft); }
.was-validated .form-control:valid, .form-control.is-valid { border-color: var(--border-strong); background-image: none; padding-right: .9rem; }
.was-validated .form-control:valid:focus { border-color: rgba(var(--brand-rgb), .7); box-shadow: 0 0 0 4px var(--brand-soft); }
.invalid-feedback { color: var(--danger); font-size: 12px; font-weight: 500; }

.form-check-input {
    background-color: var(--surface-3);
    border: 1px solid var(--border-strong);
}
.form-check-input:focus { border-color: rgba(var(--brand-rgb), .6); box-shadow: 0 0 0 4px var(--brand-soft); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-switch .form-check-input {
    width: 2.4em;
    height: 1.3em;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(255,255,255,.55)'/%3e%3c/svg%3e");
}
:root[data-theme="light"] .form-switch .form-check-input:not(:checked) {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(0,0,0,.28)'/%3e%3c/svg%3e");
}
.form-switch .form-check-input:checked,
.form-switch .form-check-input:checked:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}
.form-switch .form-check-input.is-success:checked { background-color: var(--success); border-color: var(--success); }
.form-check-label { color: var(--text); cursor: pointer; }

.modal-backdrop { background-color: var(--backdrop); }
.modal-backdrop.show { opacity: 1; backdrop-filter: blur(4px); }
.modal-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--border); padding: 1.25rem 1.5rem; gap: .9rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { border-top: 1px solid var(--border); padding: 1rem 1.5rem; gap: .5rem; }
.modal-footer > * { margin: 0; }
.modal-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.modal-subtitle { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 0; }
.modal.fade .modal-dialog { transform: translateY(14px) scale(.98); transition: transform .25s var(--ease); }
.modal.show .modal-dialog { transform: none; }

.btn-close { opacity: .55; box-shadow: none !important; }
.btn-close:hover { opacity: .9; }
:root:not([data-theme="light"]) .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

.alert {
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    padding: .75rem 1rem;
    border: 1px solid transparent;
    display: flex;
    gap: .6rem;
    align-items: flex-start;
}
.alert .bi { font-size: 1.05rem; line-height: 1.3; }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(var(--danger-rgb), .25); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(var(--success-rgb), .25); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(var(--warning-rgb), .25); }
.alert-info { background: var(--violet-soft); color: var(--violet); border-color: rgba(var(--violet-rgb), .25); }

.table {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    --bs-table-hover-bg: var(--surface-2);
    --bs-table-hover-color: var(--text);
    color: var(--text);
    border-color: var(--border);
    margin: 0;
}
/* BS 5.1 draws a 2px currentColor line between thead and tbody */
.table > :not(:first-child) { border-top: 0; }

.toast { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }

.dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .4rem;
}
.dropdown-item { color: var(--text); border-radius: 10px; padding: .5rem .75rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-2); color: var(--text); }

/* ---------- 4. Shared components ---------- */
.brand-wordmark { height: 22px; width: auto; filter: var(--logo-filter); display: block; }

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: 11.5px;
    font-weight: 600;
    padding: .25rem .6rem;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    white-space: nowrap;
    line-height: 1.4;
}
.badge-soft.brand { background: var(--brand-soft); color: var(--brand-text); }
.badge-soft.violet { background: var(--violet-soft); color: var(--violet); }
.badge-soft.success { background: var(--success-soft); color: var(--success); }
.badge-soft.warning { background: var(--warning-soft); color: var(--warning); }
.badge-soft .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.card-x {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--violet));
    flex: 0 0 auto;
    letter-spacing: .02em;
}

.icon-tile {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 19px;
    flex: 0 0 auto;
    background: var(--surface-3);
    color: var(--text);
}
.icon-tile.brand { background: var(--brand-soft); color: var(--brand-text); }
.icon-tile.violet { background: var(--violet-soft); color: var(--violet); }
.icon-tile.success { background: var(--success-soft); color: var(--success); }
.icon-tile.muted { background: var(--surface-3); color: var(--text-muted); }

/* Segmented theme toggle (reference: sun / moon pill) */
.theme-switch {
    display: inline-flex;
    padding: 4px;
    gap: 2px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.theme-switch button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    display: grid;
    place-items: center;
    font-size: 15px;
    transition: background-color .2s, color .2s, box-shadow .2s;
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    box-shadow: var(--shadow-sm);
}

/* Boot screen */
.boot-screen {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--bg);
    z-index: 2000;
    transition: opacity .3s;
}
.boot-screen.is-hidden { opacity: 0; pointer-events: none; }
.boot-spinner { width: 34px; height: 34px; border-width: 3px; color: var(--brand); }

@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.9); opacity: .7; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }

/* ---------- 5. Login ---------- */
.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    padding: 14px;
    gap: 14px;
}
.auth-brand {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        radial-gradient(60% 50% at 85% 10%, rgba(var(--violet-rgb), .45), transparent 70%),
        radial-gradient(70% 60% at 10% 100%, rgba(var(--brand-rgb), .65), transparent 70%),
        linear-gradient(160deg, #1A0E16 0%, #0C0D12 60%, #120A10 100%);
}
.auth-brand::after {
    content: '';
    position: absolute;
    right: -60px;
    bottom: -40px;
    width: 420px;
    height: 420px;
    background: url('../images/dobby-auth.png') center / contain no-repeat;
    opacity: .07;
    pointer-events: none;
}
.auth-brand .brand-wordmark { filter: none; height: 28px; }
.auth-brand h2 { color: #fff; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.12; font-weight: 800; letter-spacing: -.035em; max-width: 14ch; margin: 0 0 16px; }
.auth-brand p { color: rgba(255, 255, 255, .7); max-width: 42ch; font-size: 15px; margin: 0; }
.auth-features { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.auth-features li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .85); font-size: 14px; }
.auth-features .bi {
    width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1);
}
.auth-brand-foot { color: rgba(255, 255, 255, .45); font-size: 12.5px; position: relative; z-index: 1; }

.auth-panel {
    border-radius: var(--radius-xl);
    background: var(--frame);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px;
}
.auth-panel-top { display: flex; justify-content: space-between; align-items: center; }
.auth-card { width: 100%; max-width: 400px; margin: auto; padding: 32px 0; animation: fadeUp .4s var(--ease); }
.auth-logo {
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--brand) url('../images/dobby-auth.png') center / 70% no-repeat;
}
.auth-card h1 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px; text-align: center; }
.auth-card .lead-text { color: var(--text-muted); margin: 0 0 28px; text-align: center; }
.auth-card.is-shaking { animation: shake .45s; }
.auth-note { margin-top: 22px; font-size: 12.5px; color: var(--text-subtle); display: flex; gap: .5rem; align-items: center; }

.input-icon { position: relative; }
.input-icon > .bi:first-child {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    pointer-events: none;
    font-size: 16px;
}
.input-icon .form-control { padding-left: 44px; height: 48px; }
.input-icon .input-action {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--text-subtle);
    border-radius: 10px;
}
.input-icon .input-action:hover { color: var(--text); background: var(--surface-2); }
.input-icon.has-action .form-control { padding-right: 48px; }
.caps-warning { font-size: 12px; color: var(--warning); margin-top: 6px; display: none; }
.caps-warning.show { display: flex; gap: .35rem; align-items: center; }

.btn-lg-block { width: 100%; height: 48px; font-size: 15px; }

/* ---------- 6. App shell ---------- */
.app {
    min-height: 100vh;
    padding: 14px;
}
.app-frame {
    min-height: calc(100vh - 28px);
    background: var(--frame);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    grid-template-rows: var(--topbar-h) minmax(0, 1fr);
    grid-template-areas: "top top" "side main";
    box-shadow: var(--shadow);
}

/* Topbar */
.topbar {
    grid-area: top;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px 0 22px;
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--frame);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.topbar-brand {
    width: calc(var(--sidebar-w) - 38px);
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}
.topbar-brand .env-tag { margin-left: 2px; }
/* Theme-specific logo: white wordmark on dark, logo.png (brand color, no filter) on light */
.topbar-brand .logo-on-light { display: none; filter: none; }
:root[data-theme="light"] .topbar-brand .logo-on-dark { display: none; }
:root[data-theme="light"] .topbar-brand .logo-on-light { display: block; }

.quick-search { position: relative; flex: 1 1 auto; max-width: 440px; margin: 0 auto; }
.quick-search .form-control {
    height: 42px;
    border-radius: 999px;
    background: var(--surface-2);
    border-color: var(--border);
    padding-left: 42px;
    padding-right: 56px;
}
.quick-search > .bi { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); }
.quick-search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.quick-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    max-height: 320px;
    overflow: auto;
    z-index: 40;
}
.quick-results.show { display: block; animation: fadeUp .15s var(--ease); }
.quick-results a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--text);
}
.quick-results a .bi { color: var(--text-muted); width: 18px; text-align: center; }
.quick-results a small { margin-left: auto; color: var(--text-subtle); font-size: 11.5px; }
.quick-results a.is-active, .quick-results a:hover { background: var(--surface-2); }
.quick-results .empty { padding: 14px; text-align: center; color: var(--text-subtle); font-size: 13px; }

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-divider { width: 1px; height: 26px; background: var(--border-strong); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 4px; }
.user-chip .meta { line-height: 1.2; }
.user-chip .name { font-weight: 600; font-size: 13.5px; }
.user-chip .role { font-size: 11.5px; color: var(--text-muted); text-transform: capitalize; }
.menu-toggle { display: none; }

/* Sidebar */
.sidebar {
    grid-area: side;
    padding: 8px 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h) - 30px);
    overflow-y: auto;
}
.workspace-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.workspace-card .title { font-weight: 700; font-size: 14px; line-height: 1.2; }
.workspace-card .sub { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: 0 12px 6px;
}
.nav-link-x {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 42px;
    padding: 0 12px;
    border-radius: 14px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    transition: background-color .15s, color .15s, box-shadow .2s;
    position: relative;
}
.nav-link-x .bi { font-size: 17px; width: 20px; text-align: center; }
.nav-link-x:hover { color: var(--text); background: var(--surface-2); }
.nav-link-x.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    font-weight: 600;
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5);
}
.nav-count {
    margin-left: auto;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    display: inline-grid;
    place-items: center;
    background: var(--violet-soft);
    color: var(--violet);
}
.nav-count:empty { display: none; }
.nav-link-x.active .nav-count { background: var(--brand); color: #fff; }
.nav-soon {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-subtle);
    border: 1px dashed var(--border-strong);
    border-radius: 999px;
    padding: 1px 7px;
}
.nav-link-x.active .nav-soon { color: inherit; opacity: .6; }

.sidebar-foot { margin-top: auto; }
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
}
.sidebar-user .meta { min-width: 0; line-height: 1.25; }
.sidebar-user .name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .btn-icon { margin-left: auto; }

.sidebar-backdrop { display: none; }

/* Main content */
.main {
    grid-area: main;
    min-width: 0;
    background: var(--panel);
    border-radius: var(--radius-lg);
    margin: 0 14px 14px 0;
    border: 1px solid var(--border);
    padding: 26px 28px 40px;
}

.view { display: none; }
.view.active { display: block; animation: fadeUp .3s var(--ease); }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-subtle); margin-bottom: 6px; }
.crumbs .bi { font-size: 10px; }
.crumbs .current { color: var(--text-muted); font-weight: 500; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.035em; margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-desc { color: var(--text-muted); margin: 6px 0 0; max-width: 60ch; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-card .label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.stat-card .value { font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }

/* Toolbar inside list card */
.list-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.search-input { position: relative; flex: 1 1 240px; max-width: 340px; }
.search-input .bi { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); }
.search-input .form-control { padding-left: 38px; height: 40px; background: var(--surface-2); border-color: var(--border); }

.segmented {
    display: inline-flex;
    padding: 3px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.segmented button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: 9px;
    transition: background-color .15s, color .15s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
:root:not([data-theme="light"]) .segmented button.active { background: var(--surface-3); }

.toolbar-hint { margin-left: auto; font-size: 12.5px; color: var(--text-subtle); display: flex; align-items: center; gap: 6px; }

.save-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 999px;
}
.save-indicator.saving { display: inline-flex; background: var(--surface-3); color: var(--text-muted); }
.save-indicator.saved { display: inline-flex; background: var(--success-soft); color: var(--success); }
.save-indicator.error { display: inline-flex; background: var(--danger-soft); color: var(--danger); }
.save-indicator .spinner-border { width: 12px; height: 12px; border-width: 2px; }

/* CMS table */
.table-cms thead th {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table-cms tbody td { padding: 14px 12px; border-color: var(--border); vertical-align: middle; }
.table-cms tbody tr:last-child td { border-bottom: 0; }
.table-cms tbody tr { transition: background-color .15s; }
.table-cms tbody tr:hover { background: var(--surface-2); }
.table-cms .col-handle { width: 44px; padding-left: 18px; padding-right: 0; }
.table-cms .col-order { width: 64px; }
.table-cms .col-status { width: 150px; }
.table-cms .col-actions { width: 110px; padding-right: 18px; }

.drag-handle {
    width: 28px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--text-subtle);
    cursor: grab;
    font-size: 16px;
    transition: color .15s, background-color .15s;
    touch-action: none;
}
.drag-handle:hover { color: var(--text); background: var(--surface-3); }
.drag-handle:active { cursor: grabbing; }
.is-drag-disabled .drag-handle { opacity: .25; cursor: not-allowed; pointer-events: none; }

.order-badge {
    min-width: 30px;
    height: 26px;
    padding: 0 8px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    background: var(--surface-3);
    color: var(--text-muted);
}

.row-title {
    border: 0;
    background: none;
    padding: 0;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    text-align: left;
    line-height: 1.4;
}
.row-title:hover { color: var(--brand-text); }
.row-sub {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 680px;
}
.status-cell { display: flex; align-items: center; gap: 8px; }
.status-cell .form-check { margin: 0; min-height: 0; padding-left: 2.6em; }
.status-cell .status-text { font-size: 12.5px; font-weight: 600; }
.status-cell .status-text.on { color: var(--success); }
.status-cell .status-text.off { color: var(--text-subtle); }
.row-actions { display: inline-flex; gap: 4px; }

/* Sortable states */
.sortable-ghost { background: var(--brand-soft) !important; }
.sortable-ghost td { opacity: .55; }
.sortable-chosen { background: var(--surface-2); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
tr.row-flash { animation: rowFlash 1.2s var(--ease); }
@keyframes rowFlash { 0% { background: rgba(var(--brand-rgb), .18); } 100% { background: transparent; } }

/* Skeleton */
.skeleton {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--surface-2) 0, var(--surface-3) 40%, var(--surface-2) 80%);
    background-size: 800px 100%;
    animation: shimmer 1.3s linear infinite;
}

/* Empty / error states */
.empty-state { text-align: center; padding: 56px 20px; }
.empty-state .icon-tile { width: 56px; height: 56px; border-radius: 18px; font-size: 24px; margin: 0 auto 16px; }
.empty-state h3 { font-size: 16px; margin: 0 0 6px; }
.empty-state p { color: var(--text-muted); margin: 0 auto 18px; max-width: 42ch; }

/* Modal bits */
.field-head { display: flex; justify-content: space-between; align-items: baseline; }
.char-count { font-size: 11.5px; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.char-count.warn { color: var(--warning); }
.switch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.switch-card .title { font-weight: 600; font-size: 14px; }
.switch-card .desc { font-size: 12.5px; color: var(--text-muted); }
.switch-card .form-check { margin: 0; min-height: 0; }
.switch-card .form-switch .form-check-input { width: 2.8em; height: 1.5em; margin: 0; }
.modal-hint { margin-right: auto !important; font-size: 12px; color: var(--text-subtle); }
.switch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Language tabs (bilingual content: *_gr / *_en) */
.lang-tabs { display: flex; width: fit-content; }
.lang-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; }
.lang-code {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--surface-3);
    color: var(--text-muted);
}
.lang-tabs button.active .lang-code { background: var(--brand-soft); color: var(--brand-text); }
.lang-error { display: none; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.lang-tabs button.has-error .lang-error { display: inline-block; }

/* Featured (homepage) star toggle */
.table-cms .col-featured { width: 90px; }
.star-toggle {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-subtle);
    font-size: 17px;
    display: inline-grid;
    place-items: center;
    transition: color .15s, background-color .15s, transform .15s;
}
.star-toggle:hover { background: var(--surface-3); color: var(--text); }
.star-toggle.on { color: var(--warning); }
.star-toggle.on:hover { background: var(--warning-soft); color: var(--warning); }
.star-toggle:active { transform: scale(.9); }
.star-toggle:disabled { opacity: .5; }
.row-sub .lang-code { margin-right: 6px; }

/* ---------- Hardware module ---------- */
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.toolbar-select { width: auto; min-width: 190px; height: 40px; padding-top: 0; padding-bottom: 0; background-color: var(--surface-2); border-color: var(--border); }
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239A9CAB' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}
.form-select option { background: var(--surface); color: var(--text); }

.table-cms .col-product { min-width: 240px; }
.table-cms .col-count { width: 110px; }
.count-link { text-decoration: none; transition: filter .15s; }
.count-link:hover { filter: brightness(1.2); color: var(--violet); }
.product-sub { display: flex; align-items: center; gap: 8px; -webkit-line-clamp: unset; }
.product-sub .cat-tag { padding: 1px 8px; font-size: 11px; }
.table-cms .col-price { width: 120px; }
.table-cms .col-avail { width: 140px; }

.product-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-thumb {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--surface-3) center / cover no-repeat;
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--text-subtle);
    font-size: 18px;
}
.product-meta { min-width: 0; }
.sku { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-subtle); }

.price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price .per { font-size: 11.5px; font-weight: 500; color: var(--text-subtle); margin-left: 2px; }
.price-old { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-subtle); text-decoration: line-through; }
.price .badge-soft { margin-left: 6px; padding: 1px 6px; font-size: 10.5px; }

.avail-toggle { border: 0; background: none; padding: 0; }
.avail-toggle:disabled { opacity: .5; }
.avail-toggle .badge-soft { cursor: pointer; transition: filter .15s; }
.avail-toggle:hover .badge-soft { filter: brightness(1.15); }

/* Modal: right column + sections */
.side-panel { padding: 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.side-panel .switch-card { background: var(--surface); }
:root:not([data-theme="light"]) .side-panel .form-control,
:root:not([data-theme="light"]) .side-panel .form-select { background-color: var(--input-bg); }
.form-section { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border-strong); }
.form-section-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 12px; display: flex; gap: 6px; align-items: center; }
.form-section-title .text-subtle { text-transform: none; letter-spacing: 0; font-weight: 500; }

.input-group-text {
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 13px;
    border-radius: var(--radius-sm);
}
.input-group-prefix .input-group-text { font-family: var(--font-mono); font-size: 12px; }
.input-group > .form-control:focus { z-index: 3; }

/* Image list editor */
.image-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.image-list:empty { display: none; }
.image-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
}
.image-item .drag-handle { width: 22px; }
.image-item .thumb {
    width: 52px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 8px;
    background: var(--surface-3) center / cover no-repeat;
    display: grid;
    place-items: center;
    color: var(--text-subtle);
}
.image-item .thumb.is-broken { color: var(--danger); }
.image-item .url { flex: 1; min-width: 0; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-item .main-tag { font-size: 10.5px; }
.image-list.sortable-active .image-item { cursor: grabbing; }

/* Upload: mode switch, dropzone, staging card */
.image-mode { display: flex; width: 100%; }
.image-mode button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 14px;
    margin-bottom: 8px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}
.dropzone .bi { font-size: 24px; color: var(--brand-text); }
.dropzone strong { color: var(--text); }
.dropzone small { font-size: 11.5px; color: var(--text-subtle); }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
.dropzone:focus-within { outline: 2px solid rgba(var(--brand-rgb), .65); outline-offset: 2px; }

.upload-staging {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid rgba(var(--brand-rgb), .35);
}
.upload-staging.d-none { display: none; }
.upload-staging .thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: var(--surface-3) center / cover no-repeat;
}
.upload-staging .form-label { font-size: 12px; margin-bottom: 4px; }
.upload-staging .form-control { padding-top: .45rem; padding-bottom: .45rem; }
.upload-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }
.upload-hint-error { color: var(--danger) !important; }
.upload-hint-error .btn-link { color: inherit; font-weight: 700; font-size: inherit; padding: 0; vertical-align: baseline; text-decoration: underline; }

/* Dashboard */
.hero-card {
    position: relative;
    overflow: hidden;
    padding: 28px;
    margin-bottom: 18px;
    background:
        radial-gradient(60% 120% at 100% 0%, rgba(var(--violet-rgb), .22), transparent 60%),
        radial-gradient(50% 120% at 0% 100%, rgba(var(--brand-rgb), .20), transparent 60%),
        var(--surface);
}
.hero-card h2 { font-size: 24px; font-weight: 800; margin: 10px 0 6px; letter-spacing: -.03em; }
.hero-card p { color: var(--text-muted); margin: 0; max-width: 60ch; }
.hero-card::after {
    content: '';
    position: absolute;
    right: 24px;
    top: 50%;
    width: 140px;
    height: 140px;
    transform: translateY(-50%);
    background: url('../images/dobby-auth.png') center / contain no-repeat;
    opacity: .08;
    filter: var(--logo-filter);
}
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.module-tile {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    color: var(--text);
    transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.module-tile:hover { color: var(--text); transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.module-tile .tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.module-tile h3 { font-size: 15px; margin: 0 0 3px; }
.module-tile p { font-size: 12.5px; color: var(--text-muted); margin: 0; }
.module-tile .tile-cta { font-size: 12.5px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: auto; }
.module-tile:hover .tile-cta { color: var(--brand-text); }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin: 26px 0 12px; }

/* Toasts */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; }
.toast-cms {
    min-width: 300px;
    max-width: 380px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 12px 12px 14px;
}
.toast-cms .icon-tile { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
.toast-cms .toast-msg { flex: 1; font-size: 13.5px; padding-top: 5px; }
.toast-cms .btn-close { margin-top: 4px; font-size: 11px; }
.toast-cms.danger .icon-tile { background: var(--danger-soft); color: var(--danger); }
.toast-cms.warning .icon-tile { background: var(--warning-soft); color: var(--warning); }

/* ---------- Offers module ---------- */
.seg-count { font-size: 11px; font-weight: 700; color: var(--text-subtle); margin-left: 2px; }
.seg-count:empty { display: none; }
.segmented button.active .seg-count { color: var(--brand-text); }
.segmented-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented-scroll::-webkit-scrollbar { display: none; }
.segmented-scroll button { white-space: nowrap; }

.table-cms .col-discount { width: 84px; }
#ofTable .col-product { min-width: 170px; }
.table-cms .col-period { width: 200px; }
.table-cms .col-targets { width: 150px; }
.table-cms .col-state { width: 150px; }
#ofTable .col-actions { width: 120px; }
.table-cms tr.is-muted .row-title, .table-cms tr.is-muted .period { color: var(--text-muted); }
.table-cms tr.is-muted .discount-badge { filter: grayscale(1); opacity: .6; }

.discount-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    background: var(--brand-soft);
    color: var(--brand-text);
}
.period { font-size: 13px; font-weight: 600; }
.period .bi { font-size: 11px; color: var(--text-subtle); margin: 0 2px; }
.target-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.target-chip { cursor: help; }
.state-badge { font-size: 11px; }
.offer-mobile-meta { display: none; font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.offer-mobile-meta strong { color: var(--brand-text); }

.btn-xs { padding: 3px 9px; font-size: 12px; border-radius: 8px; }
.duration-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.text-warning-x { color: var(--warning); }

/* Target picker */
.target-panel { display: flex; flex-direction: column; height: 100%; }
.target-tabs { display: flex; width: 100%; }
.target-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.target-toolbar { display: flex; gap: 4px; align-items: center; margin-bottom: 8px; }
.target-toolbar .search-input { flex: 1; max-width: none; }
.target-toolbar .search-input .form-control { height: 36px; background: var(--surface); }
.target-list {
    list-style: none;
    margin: 0 0 8px;
    padding: 4px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    max-height: 340px;
    min-height: 120px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
}
.target-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color .12s;
}
.target-item:hover { background: var(--surface-2); }
.target-item.is-checked { background: var(--brand-soft); }
.target-item .form-check-input { margin: 0; flex: 0 0 auto; }
.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-meta { display: flex; gap: 6px; align-items: center; font-size: 11.5px; }
.t-meta:empty { display: none; }
.t-meta .badge-soft { padding: 0 6px; font-size: 10.5px; }
.overlap { color: var(--warning); cursor: help; }
.t-price { text-align: right; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-price .price-old { display: block; font-size: 11px; }
.t-price strong { color: var(--brand-text); }
.t-price .per { font-size: 11px; color: var(--text-subtle); margin-left: 2px; }
.target-empty { padding: 28px 10px; text-align: center; color: var(--text-subtle); font-size: 13px; }

/* ---------- Package features ---------- */
/* «Τι περιλαμβάνει» picker in the package modal (plans.js) — reuses the target picker above */
.features-panel { height: auto; }
.features-panel .target-list { max-height: 260px; min-height: 0; }
.t-sub { font-size: 11.5px; color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feature-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; margin-bottom: 6px; }
.feature-add .form-control { background: var(--surface); }
.row-sub .row-features { padding: 0 7px; font-size: 10.5px; vertical-align: 1px; }
/* Bulk add preview (package-features.js) */
.bulk-preview {
    list-style: none;
    margin: 0;
    padding: 4px;
    max-height: 260px;
    min-height: 60px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
}
.bulk-preview li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.bulk-preview li.is-warning { background: var(--warning-soft); }
.bulk-preview li.is-muted { opacity: .6; }
.bulk-preview .bp-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-preview .bp-note { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.text-success-x { color: var(--success); }
@media (max-width: 575.98px) {
    .feature-add { grid-template-columns: minmax(0, 1fr); }
    .bulk-preview .bp-note { display: none; }
}

/* ---------- Package setup ---------- */
/* «Εφάπαξ εγκατάσταση» editor in the package modal (plans.js) */
.setup-grid {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 58px 118px 86px 32px;
    gap: 6px;
    align-items: center;
}
.setup-head { padding: 0 8px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); }
.setup-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.setup-row { padding: 8px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.setup-handle { cursor: grab; }
.setup-title { min-width: 0; display: flex; flex-direction: column; }
.setup-line { text-align: right; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.setup-addon-opt { margin: 6px 38px 0 24px; }
.setup-addon-opt .form-select { font-size: 12px; }
.setup-empty { padding: 14px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px dashed var(--border); }
.setup-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 6px; }
.setup-foot .form-select { max-width: 340px; background-color: var(--surface); }
.setup-total { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; font-variant-numeric: tabular-nums; }
.setup-total strong { font-size: 17px; color: var(--brand-text); }
.setup-monthly { flex-basis: 100%; text-align: right; font-size: 12px; color: var(--text-muted); }
.setup-monthly:empty { display: none; }
@media (max-width: 575.98px) {
    .setup-head { display: none; }
    .setup-grid { grid-template-columns: 18px minmax(0, 1fr) minmax(0, 1fr) 32px; }
    .setup-grid .setup-title { grid-column: 2 / 4; }
    .setup-grid [data-setup="quantity"] { grid-row: 2; grid-column: 2; }
    .setup-grid .input-group { grid-row: 2; grid-column: 3; }
    .setup-grid .setup-line { grid-row: 3; grid-column: 2 / 4; }
    .setup-grid [data-setup-remove] { grid-row: 1; grid-column: 4; }
    .setup-addon-opt { margin: 6px 0 0; }
    .setup-foot .form-select { max-width: none; }
}

/* ---------- Blog module ---------- */
.table-cms .col-author { width: 170px; }
.table-cms .col-date { width: 150px; }
#blogTable:not(.sort-mode) .col-handle { display: none; }
.post-thumb { width: 64px; height: 46px; border-radius: 10px; }
.author { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }

.blog-loading { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.blog-loading.d-none { display: none; }
.blog-title-input { font-weight: 700; font-size: 18px; }

/* Quill, themed with the CMS tokens */
.editor-wrap { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--input-bg); overflow: hidden; }
.editor-wrap:focus-within { border-color: rgba(var(--brand-rgb), .7); box-shadow: 0 0 0 4px var(--brand-soft); }
.editor-wrap .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--border); background: var(--surface-2); padding: 6px 8px; font-family: var(--font); }
.editor-wrap .ql-container.ql-snow { border: 0; font-family: var(--font); font-size: 15px; }
.editor-wrap .ql-editor { min-height: 320px; max-height: 60vh; color: var(--text); line-height: 1.7; padding: 16px 18px; }
.editor-wrap .ql-editor.ql-blank::before { color: var(--text-subtle); font-style: normal; left: 18px; }
.editor-wrap .ql-editor h2 { font-size: 1.45em; margin: .8em 0 .4em; }
.editor-wrap .ql-editor h3 { font-size: 1.2em; margin: .8em 0 .4em; }
.editor-wrap .ql-editor img { max-width: 100%; border-radius: 10px; margin: .4em 0; }
.editor-wrap .ql-editor blockquote { border-left: 3px solid var(--brand); padding-left: 14px; color: var(--text-muted); }
.editor-wrap .ql-editor a { color: var(--brand-text); }
.editor-wrap .ql-snow .ql-stroke { stroke: var(--text-muted); }
.editor-wrap .ql-snow .ql-fill { fill: var(--text-muted); }
.editor-wrap .ql-snow .ql-picker { color: var(--text-muted); }
.editor-wrap .ql-snow button:hover .ql-stroke, .editor-wrap .ql-snow button.ql-active .ql-stroke,
.editor-wrap .ql-snow .ql-picker-label:hover .ql-stroke, .editor-wrap .ql-snow .ql-picker-label.ql-active .ql-stroke { stroke: var(--brand-text); }
.editor-wrap .ql-snow button:hover .ql-fill, .editor-wrap .ql-snow button.ql-active .ql-fill { fill: var(--brand-text); }
.editor-wrap .ql-snow .ql-picker-label:hover, .editor-wrap .ql-snow .ql-picker-label.ql-active,
.editor-wrap .ql-snow .ql-picker-item:hover, .editor-wrap .ql-snow .ql-picker-item.ql-selected { color: var(--brand-text); }
.editor-wrap .ql-snow .ql-picker-options { background: var(--surface); border-color: var(--border-strong) !important; border-radius: 10px; box-shadow: var(--shadow); }
.editor-wrap .ql-snow .ql-tooltip { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); z-index: 5; }
.editor-wrap .ql-snow .ql-tooltip input[type=text] { background: var(--input-bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; }
.editor-wrap .ql-snow .ql-tooltip a { color: var(--brand-text); }

/* Inline image insert panel */
.editor-insert { padding: 14px; margin-bottom: 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed rgba(var(--brand-rgb), .45); }
.editor-insert.d-none { display: none; }
.dropzone-compact { padding: 12px; flex-direction: row; justify-content: center; gap: 10px; flex-wrap: wrap; }
.dropzone-compact .bi { font-size: 18px; }

/* SEO collapsible */
.seo-details > summary { cursor: pointer; list-style: none; }
.seo-details > summary::-webkit-details-marker { display: none; }
.seo-details > summary::after { content: '\F282'; font-family: 'bootstrap-icons'; margin-left: auto; transition: transform .2s; }
.seo-details[open] > summary::after { transform: rotate(180deg); }

/* Publishing panel */
.status-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.status-option { position: relative; margin: 0; cursor: pointer; }
.status-option input { position: absolute; opacity: 0; pointer-events: none; }
.status-option > span {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color .15s, background-color .15s;
}
.status-option > span .bi { font-size: 16px; color: var(--text-muted); margin-bottom: 2px; }
.status-option strong { font-size: 13px; }
.status-option small { font-size: 11.5px; color: var(--text-subtle); }
.status-option:hover > span { border-color: var(--border-strong); }
.status-option.is-checked > span { border-color: rgba(var(--brand-rgb), .7); background: var(--brand-soft); }
.status-option.is-checked > span .bi { color: var(--brand-text); }
.status-option input:focus-visible + span { outline: 2px solid rgba(var(--brand-rgb), .65); outline-offset: 2px; }
.publish-summary { margin-top: 12px; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.publish-summary:empty { display: none; }

/* Cover */
.cover-preview {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    background: var(--surface) center / cover no-repeat;
    border: 1px dashed var(--border-strong);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-subtle);
    font-size: 12.5px;
}
.cover-preview .bi { font-size: 26px; }
.cover-preview.has-image { border-style: solid; border-color: var(--border); }
.cover-path { font-family: var(--font-mono); font-size: 11px; color: var(--text-subtle); margin-top: 4px; word-break: break-all; }
.cover-path:empty { display: none; }

/* Unsaved changes */
.unsaved-bar {
    margin-right: auto !important;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--warning);
    animation: fadeUp .2s var(--ease);
}
.unsaved-bar ~ .modal-hint { display: none; }

/* ---------- Users module ---------- */
.table-cms .col-role { width: 120px; }
.table-cms .col-login { width: 100px; }
.table-cms .col-last { width: 160px; }
.avatar.role-admin { background: linear-gradient(135deg, var(--brand), #ff7a8f); }
.avatar.role-editor { background: linear-gradient(135deg, var(--violet), #b3a8ff); }
.avatar.role-customer { background: linear-gradient(135deg, #1fa77a, var(--success)); }
.avatar.has-img { background: var(--surface-3) center / cover no-repeat; }
.you-tag { margin-left: 6px; padding: 0 7px; font-size: 10.5px; vertical-align: 2px; }
.text-verified { color: var(--success); font-size: 12px; }
.login-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    margin-right: 4px;
    border-radius: 8px;
    font-size: 11.5px;
    background: var(--surface-3);
    color: var(--text-muted);
}
.login-methods { display: inline-flex; }

.role-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.role-options .status-option input:disabled + span { opacity: .55; cursor: not-allowed; }

.pw-meter { height: 4px; border-radius: 4px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--danger); transition: width .25s var(--ease), background-color .25s; }
.pw-meter[data-score="2"] span { background: var(--warning); }
.pw-meter[data-score="3"] span { background: #8bd450; }
.pw-meter[data-score="4"] span { background: var(--success); }

.biz-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.biz-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.biz-item .icon-tile { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
.biz-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.biz-main strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-main small { font-size: 11.5px; color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-item .form-select { width: auto; min-width: 130px; }
.biz-empty { padding: 14px; text-align: center; font-size: 13px; color: var(--text-subtle); }
.biz-add { display: flex; gap: 6px; }
.biz-add .form-control { max-width: 150px; }
.biz-add .form-select { max-width: 170px; }

/* ---------- SEO auto-fill ---------- */
/* Fields that still follow the title: dashed violet border; a hand edit turns them back to normal */
.form-control.is-auto { border-style: dashed; border-color: rgba(var(--violet-rgb), .55); }
.form-control.is-auto:focus { border-style: solid; }
.form-section-title [data-seo-autofill] { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--violet); }
.form-section-title [data-seo-autofill]:hover { background: var(--violet-soft); color: var(--violet); }
.seo-autofill-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 2px; }
.seo-autofill-row [data-seo-autofill] { color: var(--violet); }

/* ---------- 7. Responsive ---------- */
@media (max-width: 1399.98px) {
    /* Laptop with sidebar (≤1399): secondary columns live in the modal / state badge */
    #blogTable .col-author, #blogTable .cell-author, #blogTable .col-date, #blogTable .cell-date { display: none; }
    .table-cms .col-avail, .table-cms td.cell-avail { display: none; }
    .table-cms .col-product { min-width: 180px; }
    #ofTable .col-targets, #ofTable td:nth-child(4) { display: none; }
    #usrTable .col-last, #usrTable .cell-last { display: none; }
    #hwTable .col-order, #hwTable td.cell-order { display: none; }
}

@media (max-width: 1099.98px) {
    .status-cell .status-text { display: none; }
    .state-badge { white-space: normal; text-align: left; }
    /* Offers: discount + period move under the title */
    #ofTable th:nth-child(2), #ofTable td:nth-child(2), #ofTable th:nth-child(3), #ofTable td:nth-child(3) { display: none; }
    #ofTable .col-product { min-width: 0; }
    .offer-mobile-meta { display: block; }
}

@media (max-width: 1199.98px) {
    .stat-grid { gap: 10px; }
    #usrTable .col-login, #usrTable .cell-login { display: none; }
    .toolbar-hint { display: none; }
}

@media (max-width: 991.98px) {
    .auth { grid-template-columns: 1fr; padding: 0; }
    .auth-brand { display: none; }
    .auth-panel { border-radius: 0; border: 0; min-height: 100vh; }

    .app { padding: 0; }
    .app-frame {
        border-radius: 0;
        border: 0;
        min-height: 100vh;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "top" "main";
    }
    .topbar { border-radius: 0; padding: 0 14px; gap: 10px; border-bottom: 1px solid var(--border); }
    .topbar-brand { width: auto; }
    .topbar-brand .env-tag { display: none; }
    .menu-toggle { display: inline-flex; }
    .quick-search { display: none; }
    .user-chip .meta, .topbar-divider { display: none; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        width: min(300px, 86vw);
        background: var(--frame);
        z-index: 1050;
        padding-top: 18px;
        transform: translateX(-100%);
        transition: transform .28s var(--ease);
        border-right: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }
    .app.sidebar-open .sidebar { transform: none; }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--backdrop);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s;
    }
    .app.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

    .main { margin: 0; border-radius: 0; border: 0; padding: 20px 16px 32px; }

    /* Tablet: drop one secondary column per wide table */
    #blogTable .col-author, #blogTable .cell-author { display: none; }
    .table-cms .col-avail, .table-cms td.cell-avail { display: none; }
    #ofTable .col-targets, #ofTable td:nth-child(4) { display: none; }
}

@media (max-width: 767.98px) {
    .page-title { font-size: 23px; }
    .page-head { align-items: flex-start; }
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stat-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
    .stat-card .icon-tile { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }
    .stat-card .value { font-size: 20px; }
    .list-toolbar { padding: 12px; }
    .search-input { max-width: none; flex-basis: 100%; }
    .table-cms .col-order, .table-cms td.cell-order { display: none; }
    .table-cms .col-status { width: auto; }
    .status-cell .status-text { display: none; }
    .row-sub { display: none; }
    .row-sub.product-sub { display: flex; }
    .product-sub .sku { display: none; }
    .table-cms .col-product { min-width: 0; }
    .table-cms .col-price { width: auto; }
    .price-old, .price .badge-soft { display: none; }
    .table-cms .col-actions { width: auto; padding-right: 12px; font-size: 0; }
    .table-cms .col-handle { padding-left: 10px; }
    .row-actions [data-action="edit"] { display: none; }   /* the title already opens the editor */
    .table-cms .col-featured { width: auto; font-size: 0; }
    .switch-grid { grid-template-columns: 1fr; }
    .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .toolbar-select { flex: 1 1 auto; min-width: 0; }
    .table-cms .col-avail, .table-cms td.cell-avail { display: none; }
    .product-thumb { display: none; }
    .table-cms .col-status { font-size: 0; }
    .table-cms tbody td { padding-left: 8px; padding-right: 8px; }
    .product-sub { flex-wrap: wrap; }
    #ofTable th:nth-child(2), #ofTable td:nth-child(2), #ofTable th:nth-child(3), #ofTable td:nth-child(3),
    #ofTable .col-targets, #ofTable td:nth-child(4) { display: none; }
    #ofTable .col-product { min-width: 0; }
    .offer-mobile-meta { display: block; }
    #ofTable [data-action="duplicate"] { display: none; }
    #blogTable .col-author, #blogTable .cell-author { display: none; }
    #blogTable .col-date, #blogTable .cell-date { display: none; }
    #usrTable .col-login, #usrTable .cell-login, #usrTable .col-last, #usrTable .cell-last { display: none; }
    #usrTable .avatar { display: none; }
    .role-options { grid-template-columns: 1fr; }
    .biz-add { flex-wrap: wrap; }
    .biz-item { flex-wrap: wrap; }
    .status-options { grid-template-columns: 1fr 1fr; }
    .table-cms .col-period { width: auto; }
    .period { white-space: normal; }
    .table-cms .col-state { width: auto; font-size: 0; }
    .target-tabs button { font-size: 0; gap: 4px; }
    .target-tabs button .bi, .target-tabs button .seg-count { font-size: 14px; }
    .hero-card::after { display: none; }
    .toast-stack { left: 12px; right: 12px; bottom: 12px; }
    .toast-cms { max-width: none; min-width: 0; }
    .modal-hint { display: none; }
}

/* ---------- Add-on pricing (modules/addon-pricing.js) ---------- */
.pricing-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pricing-type {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.pricing-type:hover { border-color: var(--border-strong); }
.pricing-type .bi { grid-row: span 2; font-size: 18px; color: var(--text-subtle); }
.pricing-type .pt-title { font-size: 13.5px; font-weight: 600; }
.pricing-type .pt-hint { font-size: 11.5px; line-height: 1.35; color: var(--text-muted); }
.pricing-type.is-active { border-color: var(--violet); background: var(--violet-soft); }
.pricing-type.is-active .bi { color: var(--violet); }
.pricing-type:focus-within { box-shadow: 0 0 0 3px rgba(var(--violet-rgb), .3); }
.pricing-section { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }

.tier-grid {
    display: grid;
    grid-template-columns: 18px minmax(0, 1.2fr) minmax(0, 1fr) 96px 92px 84px 32px;
    gap: 6px;
    align-items: center;
}
.tier-head { padding: 0 8px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); }
.tier-head .lang-code { font-size: 9.5px; }
.tier-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.tier-row { padding: 8px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.tier-row .form-select-sm { padding-right: 1.6rem; }
.tier-handle { cursor: grab; }
.tier-notes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; margin: 6px 38px 0 24px; }
.tier-notes .form-control { font-size: 12px; }
.tier-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.pricing-error { margin-top: 10px; font-size: 12.5px; color: var(--danger); display: flex; gap: 6px; align-items: center; }

.group-preview { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; font-size: 12.5px; }
.rate-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rate-chip {
    display: inline-flex; align-items: baseline; gap: 4px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap;
    background: var(--surface-2); border: 1px solid var(--border);
}
.rate-chip .per { font-size: 11px; color: var(--text-subtle); }
.rate-chip.extra { background: var(--violet-soft); border-color: transparent; color: var(--violet); }
.rate-chip.extra .per { color: inherit; opacity: .8; }

.groups-card { margin-top: 20px; }
.groups-head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.groups-title { font-size: 16px; font-weight: 700; margin: 2px 0 3px; }
.groups-desc { font-size: 12.5px; color: var(--text-muted); margin: 0; max-width: 640px; }
.groups-list { padding: 6px 8px; }
.groups-empty { padding: 18px 12px; font-size: 13px; color: var(--text-muted); }
.group-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius-sm); }
.group-item + .group-item { border-top: 1px solid var(--border); }
.group-item:hover { background: var(--surface-2); }
.group-main { flex: 1; min-width: 0; }

@media (min-width: 576px) { #adGroupModal .modal-dialog { max-width: 640px; } }
.rate-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.rate-row { display: grid; grid-template-columns: 30px 72px auto minmax(0, 1fr) 32px; gap: 8px; align-items: center; }
.rate-label { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.rate-row input[readonly] { background: transparent; border-color: transparent; font-weight: 700; }
.group-example { margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.group-example:empty { display: none; }
.group-example-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 6px; display: flex; gap: 6px; }
.group-example ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 16px; }
.group-example li { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.group-example li span { color: var(--text-muted); }

@media (max-width: 767.98px) {
    .pricing-types { grid-template-columns: minmax(0, 1fr); }
    .pricing-type .pt-hint { display: none; }
    .tier-head { display: none; }
    .tier-grid { grid-template-columns: 18px minmax(0, 1fr) minmax(0, 1fr) 32px; }
    .tier-grid [data-tier="quota"] { grid-column: 2; }
    .tier-grid [data-tier="price"] { grid-column: 3; }
    .tier-grid [data-tier="billing_period"] { grid-column: 2 / 4; }
    .tier-grid [data-tier-remove] { grid-row: 1; grid-column: 4; }
    .tier-notes { grid-template-columns: minmax(0, 1fr); margin: 6px 0 0; }
    .groups-head { flex-wrap: wrap; }
    .group-item { flex-wrap: wrap; }
    .rate-row { grid-template-columns: 30px 64px auto minmax(0, 1fr) 32px; }
    .rate-row .input-group-text { font-size: 0; }
    .rate-row .input-group-text::before { content: '€'; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
