
/* ═══════════════════════════════════════════════════════════════ */
/* 1. DESIGN TOKENS — LIGHT MODE                                  */
/* ═══════════════════════════════════════════════════════════════ */
:root {
    /* ── Brand color ────────────────────────────────────────── */
    --brand-50:  #eff6ff;
    --brand-100: #dbeafe;
    --brand-200: #bfdbfe;
    --brand-300: #93c5fd;
    --brand-400: #60a5fa;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-800: #1e40af;
    --brand-900: #1e3a8a;

    /* ── Text ───────────────────────────────────────────────── */
    --text-strong:  #111827;
    --text-body:    #374151;
    --text-muted:   #6b7280;
    --text-faint:   #9ca3af;
    --text-inverse: #ffffff;

    /* ── Borders ────────────────────────────────────────────── */
    --border-soft:   #e5e7eb;
    --border-strong: #d1d5db;

    /* ── Radius ─────────────────────────────────────────────── */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* ── Layout ─────────────────────────────────────────────── */
    --shell-width: 64rem;

    /* ── Shadows ────────────────────────────────────────────── */
    --shadow-card:  0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-hover: 0 4px 12px -2px rgb(0 0 0 / 0.08);

    /* ── Status colors (badges) ─────────────────────────────── */
    --status-active-bg:    #dcfce7;
    --status-active-fg:    #166534;
    --status-pending-bg:   #fef3c7;
    --status-pending-fg:   #92400e;
    --status-danger-bg:    #fee2e2;
    --status-danger-fg:    #991b1b;

    /* ── Surface tokens (per-layout override below) ────────── */
    --bg-page:    #ffffff;
    --bg-surface: #ffffff;
    --bg-inner:   transparent;
    --bg-muted:   #f3f4f6;
    --bg-hover:   #f9fafb;

    /* ── Alert colors ───────────────────────────────────────── */
    --alert-info-bg:     #eff6ff;
    --alert-info-fg:     #1e40af;
    --alert-info-border: #bfdbfe;
    --alert-warn-bg:     #fffbeb;
    --alert-warn-fg:     #92400e;
    --alert-warn-border: #fde68a;
    --alert-error-bg:    #fef2f2;
    --alert-error-fg:    #991b1b;
    --alert-error-border:#fecaca;

    --icon-bg: #eff6ff;
    --icon-fg: #2563eb;

    /* ── Result card tints (softer than status-*-bg) ─────── */
    --result-success-bg:     #f0fdf4;
    --result-success-border: #bbf7d0;
    --result-error-bg:       #fef2f2;
    --result-error-border:   #fecaca;
}

/* ═══════════════════════════════════════════════════════════════ */
/* 2. DARK MODE OVERRIDES                                         */
/* ═══════════════════════════════════════════════════════════════ */
html.dark {
    --text-strong:  #f1f5f9;
    --text-body:    #cbd5e1;
    --text-muted:   #94a3b8;
    --text-faint:   #64748b;
    --text-inverse: #0f172a;

    --border-soft:   #334155;
    --border-strong: #475569;

    --shadow-card:  0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-hover: 0 4px 12px -2px rgb(0 0 0 / 0.5);

    --status-active-bg:  #14532d;
    --status-active-fg:  #bbf7d0;
    --status-pending-bg: #78350f;
    --status-pending-fg: #fde68a;
    --status-danger-bg:  #7f1d1d;
    --status-danger-fg:  #fecaca;

    /* Dark base surfaces */
    --bg-page:    #0f172a;
    --bg-surface: #1e293b;
    --bg-inner:   transparent;
    --bg-muted:   #334155;
    --bg-hover:   #1e293b;

    --alert-info-bg:     #1e3a8a;
    --alert-info-fg:     #bfdbfe;
    --alert-info-border: #1e40af;
    --alert-warn-bg:     #78350f;
    --alert-warn-fg:     #fde68a;
    --alert-warn-border: #92400e;
    --alert-error-bg:    #7f1d1d;
    --alert-error-fg:    #fecaca;
    --alert-error-border:#991b1b;

    --icon-bg: #1e3a8a33;
    --icon-fg: #60a5fa;

    --result-success-bg:     rgba(34, 197, 94, 0.08);
    --result-success-border: rgba(34, 197, 94, 0.25);
    --result-error-bg:       rgba(239, 68, 68, 0.08);
    --result-error-border:   rgba(239, 68, 68, 0.25);
}

/* ═══════════════════════════════════════════════════════════════ */
/* 3. LAYOUT OVERRIDES                                            */
/* ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────── */
/* 1. LIGHT — body: gray | section: white | inner: no extra bg    */
/* ─────────────────────────────────────────────────────────────── */
html.layout-light {
    --bg-page:    #f9fafb;   /* gray-50 */
    --bg-surface: #ffffff;
    --bg-inner:   transparent;
    --bg-muted:   #f3f4f6;
    --bg-hover:   #f3f4f6;
}
html.dark.layout-light {
    --bg-page:    #0f172a;
    --bg-surface: #1e293b;
    --bg-inner:   transparent;
    --bg-muted:   #334155;
    --bg-hover:   #334155;
}

/* ─────────────────────────────────────────────────────────────── */
/* 2. GRAY — body: white | section: gray | inner: no extra bg     */
/* ─────────────────────────────────────────────────────────────── */
html.layout-gray {
    --bg-page:    #ffffff;
    --bg-surface: #f9fafb;   /* gray-50 */
    --bg-inner:   transparent;
    --bg-muted:   #f3f4f6;
    --bg-hover:   #ffffff;
}
html.dark.layout-gray {
    --bg-page:    #0f172a;
    --bg-surface: #1e293b;
    --bg-inner:   transparent;
    --bg-muted:   #334155;
    --bg-hover:   #334155;
}

/* ─────────────────────────────────────────────────────────────── */
/* 3. WHITE — body: white | section: white + shadow | inner: none */
/* ─────────────────────────────────────────────────────────────── */
html.layout-white {
    --bg-page:    #ffffff;
    --bg-surface: #ffffff;
    --bg-inner:   transparent;
    --bg-muted:   #f3f4f6;
    --bg-hover:   #f9fafb;
    /* Slightly stronger shadow so white sections separate from white body */
    --shadow-card:  0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow-hover: 0 6px 16px -4px rgb(0 0 0 / 0.12);
}
html.dark.layout-white {
    --bg-page:    #0f172a;
    --bg-surface: #1e293b;
    --bg-inner:   transparent;
    --bg-muted:   #334155;
    --bg-hover:   #334155;
    --shadow-card:  0 1px 3px 0 rgb(0 0 0 / 0.5), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --shadow-hover: 0 6px 16px -4px rgb(0 0 0 / 0.6);
}

/* ─────────────────────────────────────────────────────────────── */
/* 4. LAYERED — body: white | section: gray | inner: white        */
/* ─────────────────────────────────────────────────────────────── */
html.layout-layered {
    --bg-page:    #ffffff;   /* body */
    --bg-surface: #f9fafb;   /* section */
    --bg-inner:   #ffffff;   /* nested div / inner card */
    --bg-muted:   #f3f4f6;
    --bg-hover:   #ffffff;
}
html.dark.layout-layered {
    --bg-page:    #0f172a;
    --bg-surface: #1e293b;
    --bg-inner:   #0f172a;
    --bg-muted:   #334155;
    --bg-hover:   #1e293b;
}

/* ─────────────────────────────────────────────────────────────── */
/* 5. GRADIENT — body: brand gradient | section: white | inner: brand tint */
/* ─────────────────────────────────────────────────────────────── */
html.layout-gradient {
    --bg-page:    linear-gradient(135deg, var(--brand-50) 0%, #ffffff 45%, var(--brand-100) 100%);
    --bg-surface: #ffffff;
    --bg-inner:   var(--brand-50);
    --bg-muted:   var(--brand-50);
    --bg-hover:   #ffffff;
    --border-soft: var(--brand-100);
}
html.dark.layout-gradient {
    --bg-page:    linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #1e3a8a 100%);
    --bg-surface: #1e293b;
    --bg-inner:   #0f172a33;
    --bg-muted:   #334155;
    --bg-hover:   #334155;
    --border-soft: #334155;
}

/* ─────────────────────────────────────────────────────────────── */
/* 6. SOFT — body: faint brand tint | section: white | icon accent */
/* ─────────────────────────────────────────────────────────────── */
html.layout-soft {
    --bg-page:    #f5f8ff;
    --bg-surface: #ffffff;
    --bg-inner:   transparent;
    --bg-muted:   #eff6ff;
    --bg-hover:   #eff6ff;
    --icon-bg:    #dbeafe;
    --icon-fg:    #1d4ed8;
}
html.dark.layout-soft {
    --bg-page:    #0b1220;
    --bg-surface: #1e293b;
    --bg-inner:   transparent;
    --bg-muted:   #1e3a8a33;
    --bg-hover:   #1e3a8a33;
    --icon-bg:    #1e3a8a55;
    --icon-fg:    #93c5fd;
}

/* ─────────────────────────────────────────────────────────────── */
/* 7. BORDERED — body: white | section: white, no shadow, strong border */
/* ─────────────────────────────────────────────────────────────── */
html.layout-bordered {
    --bg-page:      #ffffff;
    --bg-surface:   #ffffff;
    --bg-inner:     transparent;
    --bg-muted:     #f9fafb;
    --bg-hover:     #f9fafb;
    --border-soft:  #d1d5db;
    --shadow-card:  none;
    --shadow-hover: none;
}
html.dark.layout-bordered {
    --bg-page:      #0f172a;
    --bg-surface:   #0f172a;
    --bg-inner:     transparent;
    --bg-muted:     #1e293b;
    --bg-hover:     #1e293b;
    --border-soft:  #475569;
    --shadow-card:  none;
    --shadow-hover: none;
}

/* ─────────────────────────────────────────────────────────────── */
/* 8. ELEVATED — body: gray-100 | section: white floating + shadow */
/* ─────────────────────────────────────────────────────────────── */
html.layout-elevated {
    --bg-page:      #f3f4f6;
    --bg-surface:   #ffffff;
    --bg-inner:     transparent;
    --bg-muted:     #f9fafb;
    --bg-hover:     #ffffff;
    --border-soft:  transparent;
    --shadow-card:  0 2px 8px -1px rgb(0 0 0 / 0.08), 0 1px 3px -1px rgb(0 0 0 / 0.06);
    --shadow-hover: 0 8px 20px -4px rgb(0 0 0 / 0.14);
}
html.dark.layout-elevated {
    --bg-page:      #0f172a;
    --bg-surface:   #1e293b;
    --bg-inner:     transparent;
    --bg-muted:     #334155;
    --bg-hover:     #334155;
    --border-soft:  transparent;
    --shadow-card:  0 2px 8px -1px rgb(0 0 0 / 0.5);
    --shadow-hover: 0 8px 20px -4px rgb(0 0 0 / 0.6);
}

/* ─────────────────────────────────────────────────────────────── */
/* 9. PAPER — warm off-white tones (soft, editorial)              */
/* ─────────────────────────────────────────────────────────────── */
html.layout-paper {
    --bg-page:    #faf9f6;
    --bg-surface: #ffffff;
    --bg-inner:   #faf9f6;
    --bg-muted:   #f5f3ee;
    --bg-hover:   #f5f3ee;
    --border-soft:#e7e4dc;
}
html.dark.layout-paper {
    --bg-page:    #1c1917;
    --bg-surface: #292524;
    --bg-inner:   #1c1917;
    --bg-muted:   #3f3a34;
    --bg-hover:   #3f3a34;
    --border-soft:#44403c;
}

/* ─────────────────────────────────────────────────────────────── */
/* 10. MINIMAL — all white, hairline borders, shadow on hover only */
/* ─────────────────────────────────────────────────────────────── */
html.layout-minimal {
    --bg-page:      #ffffff;
    --bg-surface:   #ffffff;
    --bg-inner:     transparent;
    --bg-muted:     #fafafa;
    --bg-hover:     #fafafa;
    --border-soft:  #f0f0f1;
    --shadow-card:  none;
}
html.dark.layout-minimal {
    --bg-page:      #0f172a;
    --bg-surface:   #0f172a;
    --bg-inner:     transparent;
    --bg-muted:     #1e293b;
    --bg-hover:     #1e293b;
    --border-soft:  #1e293b;
    --shadow-card:  none;
}

/* ── Special: layout-gradient body uses image gradient ────────── */
html.layout-gradient body {
    background-attachment: fixed;
    background-size: cover;
}


/* ─────────────────────────────────────────────────────────────── */
/* 11. MODERN — body: gray-50 | section: white | section-header: brand gradient */
/* ─────────────────────────────────────────────────────────────── */
html.layout-modern {
    --bg-page:    #f9fafb;   /* gray-50 */
    --bg-surface: #ffffff;
    --bg-inner:   transparent;
    --bg-muted:   #f3f4f6;
    --bg-hover:   #f9fafb;

    --border-soft:   #e5e7eb;
    --border-strong: #d1d5db;

    --shadow-card:  0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
    --shadow-hover: 0 12px 28px -8px rgb(37 99 235 / 0.18), 0 6px 14px -4px rgb(0 0 0 / 0.08);

    /* Gradient header tokens (used by .section-header in this layout) */
    --modern-header-bg:      linear-gradient(120deg, var(--brand-600) 0%, var(--brand-700) 45%, #4f46e5 100%);
    --modern-header-bg-size: 200% 200%;
    --modern-header-fg:      #ffffff;
    --modern-header-fg-soft: rgba(255, 255, 255, 0.82);
    --modern-header-border:  transparent;
}

html.dark.layout-modern {
    --bg-page:    #0b1220;
    --bg-surface: #1e293b;
    --bg-inner:   transparent;
    --bg-muted:   #334155;
    --bg-hover:   #334155;

    --border-soft:   #334155;
    --border-strong: #475569;

    --shadow-card:  0 1px 3px 0 rgb(0 0 0 / 0.4);
    --shadow-hover: 0 12px 28px -8px rgb(37 99 235 / 0.35), 0 6px 14px -4px rgb(0 0 0 / 0.5);

    --modern-header-bg:      linear-gradient(120deg, #1e40af 0%, #1d4ed8 45%, #4338ca 100%);
    --modern-header-bg-size: 200% 200%;
    --modern-header-fg:      #ffffff;
    --modern-header-fg-soft: rgba(255, 255, 255, 0.75);
    --modern-header-border:  transparent;
}

/* ── Modern layout: category dropdown fix ── */

/* Toggle button: give it the header's ghost-button treatment so the
   selected value stays white/legible on the gradient */
html.layout-modern #categoryDropdown > button {
    background-color: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}
html.layout-modern #categoryDropdown > button,
html.layout-modern #categoryDropdown > button #categoryDropdownLabel,
html.layout-modern #categoryDropdown > button #categoryDropdownIcon,
html.layout-modern #categoryDropdown > button #categoryDropdownChevron {
    color: #ffffff !important;
}
html.layout-modern #categoryDropdown > button:hover {
    background-color: rgba(255, 255, 255, 0.26) !important;
}

/* Panel: it's still a DOM child of .section-header, so the modern
   layout's global i/.text-faint/.text-muted → white rule leaks in here
   too — restore normal colors since the panel itself has a white bg */
html.layout-modern #categoryDropdownPanel .text-faint { color: var(--text-faint) !important; }
html.layout-modern #categoryDropdownPanel .text-muted  { color: var(--text-muted)  !important; }
html.layout-modern #categoryDropdownPanel i.text-brand { color: var(--brand-600)   !important; }



/* ═══════════════════════════════════════════════════════════════ */
/* 4. BASE                                                        */
/* ═══════════════════════════════════════════════════════════════ */
html { font-family: 'Inter', system-ui, sans-serif; }

body {
    background-color: var(--bg-page);
    background-image: var(--bg-page); /* enables gradient layouts */
    color: var(--text-body);
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════════ */
/* 5. SEMANTIC COMPONENT CLASSES                                  */
/* ═══════════════════════════════════════════════════════════════ */

/* ── Layout shell ──────────────────────────────────────────── */
.shell {
    max-width: var(--shell-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 640px) {
    .shell { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* ── Page heading ──────────────────────────────────────────── */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-strong);
    line-height: 1.2;
}
.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Section (uses layout surface) ─────────────────────────── */
.section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.section + .section { margin-top: 1.5rem; }

/* Bordered layout: thicker outline instead of shadow */
html.layout-bordered .section {
    border-width: 1.5px;
}

/* Elevated layout: no border, only shadow; lifts on hover */
html.layout-elevated .section {
    border-color: transparent;
}
html.layout-elevated .section:hover {
    box-shadow: var(--shadow-hover);
}

/* Minimal layout: shadow only appears on hover */
html.layout-minimal .section:hover {
    box-shadow: var(--shadow-hover);
}

.section-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-soft);
}
.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
}
.section-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

/* ── Inner: any direct child div of a section ─────────────── */
/* Layouts with --bg-inner: transparent will simply show no bg. */
/* Layouts with an actual color (layered, gradient, paper) will  */
/* paint the inner content area accordingly.                     */
.section-inner {
    background-color: var(--bg-inner);
    transition: background-color 0.2s ease;
}

/* ── Card (nested inside section) ──────────────────────────── */
.card {
    background-color: var(--bg-inner);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.card-hover:hover {
    border-color: var(--brand-400);
    box-shadow: var(--shadow-hover);
}

/* Bordered layout: thicker outline instead of shadow */
html.layout-bordered .card {
    border-width: 1.5px;
}

/* Elevated layout: cards float with a shadow instead of a border */
html.layout-elevated .card {
    border-color: transparent;
    box-shadow: var(--shadow-card);
}
html.layout-elevated .card-hover:hover {
    border-color: transparent;
    box-shadow: var(--shadow-hover);
}

/* ── Text helpers ──────────────────────────────────────────── */
.text-strong { color: var(--text-strong); }
.text-body   { color: var(--text-body); }
.text-muted  { color: var(--text-muted); }
.text-faint  { color: var(--text-faint); }
.text-brand  { color: var(--brand-600); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background-color: var(--brand-600);
    color: #ffffff;
}
.btn-primary:hover { background-color: var(--brand-700); }

.btn-outline {
    background-color: transparent;
    border-color: var(--brand-600);
    color: var(--brand-600);
}
.btn-outline:hover {
    background-color: var(--brand-50);
}
html.dark .btn-outline:hover {
    background-color: color-mix(in srgb, var(--brand-600) 15%, transparent);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-body);
}
.btn-ghost:hover { background-color: var(--bg-muted); }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.badge-active  { background-color: var(--status-active-bg);  color: var(--status-active-fg); }
.badge-pending { background-color: var(--status-pending-bg); color: var(--status-pending-fg); }
.badge-danger  { background-color: var(--status-danger-bg);  color: var(--status-danger-fg); }
.badge-neutral { background-color: var(--bg-muted);          color: var(--text-muted); }
.badge-brand   { background-color: var(--brand-100);         color: var(--brand-800); }
html.dark .badge-brand {
    background-color: var(--brand-900);
    color: var(--brand-200);
}

/* ── Form controls ─────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-strong);
    background-color: var(--bg-page);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 15%, transparent);
}

.field-icon-left {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    pointer-events: none;
}
.field-icon-right {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
}
.field-icon-right:hover {
    color: var(--brand-600);
}


/* ── Alerts ────────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border: 1px solid;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}
.alert-info  { background: var(--alert-info-bg);  color: var(--alert-info-fg);  border-color: var(--alert-info-border); }
.alert-warn  { background: var(--alert-warn-bg);  color: var(--alert-warn-fg);  border-color: var(--alert-warn-border); }
.alert-error { background: var(--alert-error-bg); color: var(--alert-error-fg); border-color: var(--alert-error-border); }

/* ── Links ─────────────────────────────────────────────────── */
.link {
    color: var(--brand-600);
    transition: color 0.15s ease;
}
.link:hover {
    color: var(--brand-700);
    text-decoration: underline;
}

/* ── Section label ─────────────────────────────────────────── */
.label-section {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Dividers ──────────────────────────────────────────────── */
.divider-y > * + * {
    border-top: 1px solid var(--border-soft);
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── Utility: hover bg using token ─────────────────────────── */
.bg-\[var\(--bg-hover\)\]:hover { background-color: var(--bg-hover); }

/* ── Hero / Page-header layouts ───────────────────────────── */
.hero-default {
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
}
.hero-default .hero-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-strong);
    line-height: 1.2;
    margin: 0;
}
.hero-default .hero-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.hero-banner {
    background: linear-gradient(to right, var(--brand-600), var(--brand-700));
    border-radius: var(--radius-md);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    color: #ffffff;
}
.hero-banner .hero-greeting {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-100);
    margin: 0;
}
.hero-banner .hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.25rem 0 0;
    line-height: 1.2;
}
.hero-banner .hero-subtitle {
    font-size: 0.875rem;
    color: var(--brand-100);
    margin: 0.25rem 0 0;
}
.hero-banner .hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.hero-banner .hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}
.hero-banner .hero-btn-ghost {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}
.hero-banner .hero-btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.hero-banner .hero-btn-primary {
    background-color: #ffffff;
    color: var(--brand-700);
}
.hero-banner .hero-btn-primary:hover {
    background-color: var(--brand-50);
}

@media (min-width: 640px) {
    .hero-banner { padding: 1.5rem 2rem; }
    .hero-banner .hero-title { font-size: 1.875rem; }
}
@media (max-width: 639px) {
    .hero-banner { padding: 1.25rem 1.25rem; }
    .hero-banner .hero-title { font-size: 1.375rem; }
}

/* ═══════════════════════════════════════════════════════════════ */
/* APP HEADER                                                      */
/* ═══════════════════════════════════════════════════════════════ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--bg-card, var(--bg-surface));
    border-bottom: 1px solid var(--border-soft);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    backdrop-filter: saturate(180%) blur(8px);
}
.app-header-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 4rem;
    padding: 0 1rem;
}
@media (min-width: 640px) {
    .app-header-inner { padding: 0 1.5rem; }
}

.hdr-logo img { height: 1.75rem; width: auto; display: block; }

.hdr-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    color: var(--text-body);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-size: 1.125rem;
}
.hdr-icon-btn:hover {
    background-color: var(--bg-muted);
    color: var(--brand-600);
}

.hdr-balance {
    display: none;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: var(--brand-50);
    color: var(--brand-700);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}
html.dark .hdr-balance {
    background-color: var(--brand-900);
    color: var(--brand-200);
}
@media (min-width: 1024px) { .hdr-balance { display: inline-block; } }

.hdr-desktop-nav {
    display: none;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}
@media (min-width: 1024px) { .hdr-desktop-nav { display: flex; } }

.hdr-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-body);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.hdr-nav-link:hover {
    background-color: var(--bg-muted);
    color: var(--brand-600);
}
.hdr-nav-chev { font-size: 0.625rem; opacity: 0.6; margin-left: 0.125rem; }

.hdr-nav-item { position: relative; }

.hdr-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 15rem;
    padding: 0.5rem 0;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 60;
}
.hdr-nav-item:hover .hdr-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hdr-sub-group { position: relative; }
.hdr-sub-dropdown {
    position: absolute;
    left: 100%;
    top: -0.5rem;
    min-width: 15rem;
    padding: 0.5rem 0;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateX(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 61;
}
.hdr-sub-group:hover .hdr-sub-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.hdr-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: var(--text-body);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
    cursor: pointer;
}
.hdr-dropdown-item:hover {
    background-color: var(--bg-muted);
    color: var(--brand-600);
}
.hdr-dropdown-icon {
    width: 1rem;
    text-align: center;
    color: var(--brand-500);
    font-size: 0.75rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}
.hdr-dropdown-chev {
    font-size: 0.625rem;
    color: var(--text-faint);
    flex-shrink: 0;
}

.hdr-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}
@media (min-width: 1024px) {
    .hdr-right { margin-left: 0; }
}

.hdr-currency-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-body);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.hdr-currency-btn:hover {
    border-color: var(--brand-400);
    color: var(--brand-600);
    background-color: var(--bg-muted);
}
.hdr-currency-chev { font-size: 0.625rem; opacity: 0.6; }

.hdr-theme-sun { display: none; }
html.dark .hdr-theme-moon { display: none; }
html.dark .hdr-theme-sun  { display: inline; }

.hdr-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 11rem;
    padding: 0.375rem 0;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    z-index: 60;
}

.hdr-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: var(--text-body);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.hdr-menu-item:hover {
    background-color: var(--bg-muted);
    color: var(--brand-600);
}
.hdr-menu-icon {
    width: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
    flex-shrink: 0;
}
.hdr-menu-item-danger { color: #dc2626; }
.hdr-menu-item-danger:hover {
    background-color: #fef2f2;
    color: #b91c1c;
}
html.dark .hdr-menu-item-danger:hover { background-color: rgba(220,38,38,0.15); }

.hdr-menu-sep {
    height: 1px;
    background-color: var(--border-soft);
    margin: 0.375rem 0;
}

.hdr-badge-count {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    background-color: var(--brand-600);
    color: white;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hdr-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 9999px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.hdr-profile-btn:hover { background-color: var(--bg-muted); }

.user-avatar-fallback {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background-color: var(--brand-600);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}
.user-avatar-fallback.user-avatar-lg {
    width: 3rem;
    height: 3rem;
    font-size: 1.125rem;
}

.profile-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    min-width: 14rem;
}
.profile.active .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
} 

/* ═══════════════════════════════════════════════════════════════ */
/* SIDEBAR                                                         */
/* ═══════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 17rem;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-soft);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
}
.sidebar.active { transform: translateX(0); }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 90;
}
.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.sidebar-user {
    padding: 1rem;
    border-bottom: 1px solid var(--border-soft);
    background: linear-gradient(90deg, var(--brand-50), var(--brand-100));
    flex-shrink: 0;
}
html.dark .sidebar-user {
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--brand-900) 60%, transparent),
        color-mix(in srgb, var(--brand-800) 60%, transparent));
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar-nav > ul > li { margin-bottom: 0.125rem; }

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    color: var(--text-body);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
    cursor: pointer;
}
.sidebar-link:hover {
    background-color: var(--bg-muted);
    color: var(--brand-600);
}
.sidebar-link-danger {
    background-color: #dc2626;
    color: white !important;
}
.sidebar-link-danger:hover { background-color: #b91c1c; }

.sidebar-sublink {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
    cursor: pointer;
}
.sidebar-sublink:hover {
    background-color: var(--bg-muted);
    color: var(--brand-600);
}

.nav-fa-icon {
    width: 1.25rem;
    text-align: center;
    color: var(--text-faint);
    font-size: 0.875rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
    transition: color 0.12s ease;
}
.sidebar-link:hover .nav-fa-icon,
.sidebar-sublink:hover .nav-fa-icon {
    color: var(--brand-600);
}

.nav-svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}
.nav-svg-icon svg { width: 100%; height: 100%; }

.sidebar-chev {
    font-size: 0.625rem;
    color: var(--text-faint);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.has-submenu.active > .sidebar-link .sidebar-chev,
.has-submenu.active > .sidebar-sublink .sidebar-chev {
    transform: rotate(180deg);
}

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    margin-left: 0.75rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-soft);
}
.sidebar-submenu.active { max-height: 1200px; }

.sidebar-currency-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem;
}
.sidebar-currency-pills {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem;
    background-color: var(--bg-muted);
    border-radius: var(--radius-sm);
    gap: 0.125rem;
}
.sidebar-currency-btn {
    padding: 0.25rem 0.625rem;
    border-radius: calc(var(--radius-sm) - 2px);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.sidebar-currency-btn.active {
    background-color: var(--bg-surface);
    color: var(--brand-700);
    box-shadow: var(--shadow-card);
}

/* Desktop: sidebar hidden, main uses full width */
@media (min-width: 1024px) {
    .sidebar { display: none; }
    .sidebar-overlay { display: none; }
    #menuToggle { display: none; }
}

/* Responsive header tweaks */
@media (max-width: 480px) {
    .hdr-currency-label { display: none; }
    .hdr-currency-btn { padding: 0.3rem 0.5rem; gap: 0.25rem; font-size: 0.75rem; }
    .hdr-icon-btn { width: 2rem; height: 2rem; font-size: 1rem; }
    .app-header-inner { gap: 0.5rem; padding: 0 0.75rem; }
    .hdr-right { gap: 0.125rem; }
}


/* ═══════════════════════════════════════════════ */
/* BADGE — icon/text gap fix (applies to ALL layouts) */
/* ═══════════════════════════════════════════════ */
.badge {
    gap: 0.375rem;
}

/* ═══════════════════════════════════════════════════════════════ */
/* LAYOUT: MODERN — gradient section headers, animated             */
/* ═══════════════════════════════════════════════════════════════ */

/* Section hover lift */
html.layout-modern .section {
    overflow: visible;
    transition: background-color 0.25s ease,
                border-color 0.25s ease,
                box-shadow 0.35s ease,
                transform 0.35s ease;
}
html.layout-modern .section:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* Section header — gradient background + animated shift */
html.layout-modern .section-header {
    position: relative;
    background: var(--modern-header-bg);
    background-size: var(--modern-header-bg-size);
    border-bottom-color: var(--modern-header-border);
    color: var(--modern-header-fg);
    animation: modernHeaderShift 12s ease infinite;
    /* clips the shimmer sweep below to the header's own box —
       restored to the proven transform-based technique */
    overflow: hidden;
}

/* Animated gradient shift */
@keyframes modernHeaderShift {
    0%   { background-position:   0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position:   0% 50%; }
}

/* Shimmer sweep (subtle light passing across) */
html.layout-modern .section-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 0%,
        transparent 35%,
        rgba(255, 255, 255, 0.18) 50%,
        transparent 65%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: modernHeaderShimmer 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes modernHeaderShimmer {
    0%   { transform: translateX(-100%); opacity: 0; }
    30%  { opacity: 1; }
    60%  { transform: translateX(100%); opacity: 0.9; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* Header text colors — force white inside gradient header */
html.layout-modern .section-header .section-title,
html.layout-modern .section-header h1,
html.layout-modern .section-header h2,
html.layout-modern .section-header h3 {
    color: var(--modern-header-fg) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
html.layout-modern .section-header .section-subtitle,
html.layout-modern .section-header p {
    color: var(--modern-header-fg-soft) !important;
}

/* Icons inside gradient header */
html.layout-modern .section-header i,
html.layout-modern .section-header .text-faint,
html.layout-modern .section-header .text-muted {
    color: var(--modern-header-fg-soft) !important;
}

/* Buttons inside gradient header — invert to white outline style */
html.layout-modern .section-header .btn-outline {
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff;
}
html.layout-modern .section-header .btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.18);
    border-color: #ffffff;
    color: #ffffff;
}
html.layout-modern .section-header .btn-outline i {
    color: #ffffff !important;
}
html.layout-modern .section-header .btn-primary {
    background-color: #ffffff;
    color: var(--brand-700);
}
html.layout-modern .section-header .btn-primary:hover {
    background-color: var(--brand-50);
    color: var(--brand-800);
}
/* Button icons need their own override — the header's generic
   i → white rule above would otherwise make icons invisible on
   the white .btn-primary background */
html.layout-modern .section-header .btn-primary i,
html.layout-modern .section-header .btn-primary .text-faint,
html.layout-modern .section-header .btn-primary .text-muted {
    color: var(--brand-700) !important;
}
html.layout-modern .section-header .btn-primary:hover i {
    color: var(--brand-800) !important;
}

/* Badges inside gradient header */
html.layout-modern .section-header .badge {
    background-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    backdrop-filter: blur(4px);
}

/* Form select inside gradient header — match translucent-white style */
html.layout-modern .section-header .form-select {
    background-color: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}
html.layout-modern .section-header .form-select:focus {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}
html.layout-modern .section-header .form-select option {
    color: #000000;
    background-color: #ffffff;
}

/* Section content — entry animation (fade + slight rise) */
@keyframes modernFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
html.layout-modern .section > *:not(.section-header) {
    animation: modernFadeIn 0.5s ease-out both;
}

/* Cards lift + fade on hover */
html.layout-modern .card {
    transition: transform 0.3s ease,
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}
html.layout-modern .card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* Buttons — subtle glow on hover */
html.layout-modern .btn-primary {
    box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--brand-600) 40%, transparent);
    transition: background-color 0.15s ease,
                box-shadow 0.3s ease,
                transform 0.15s ease;
}
html.layout-modern .btn-primary:hover {
    box-shadow: 0 6px 20px -4px color-mix(in srgb, var(--brand-600) 55%, transparent);
    transform: translateY(-1px);
}

/* ── Plan card header — used by index.php & view-plans.php via the
   shared `.plan-card-header` class. Class-scoped (not structural),
   so it only applies wherever the markup explicitly opts in. ── */
html.layout-modern .plan-card-header {
    background: var(--modern-header-bg);
    background-size: var(--modern-header-bg-size);
    color: var(--modern-header-fg);
    animation: modernHeaderShift 12s ease infinite;
    border-bottom-color: transparent !important;
}
html.layout-modern .plan-card-header * {
    color: var(--modern-header-fg) !important;
}
html.layout-modern .plan-card-header .text-muted {
    color: var(--modern-header-fg-soft) !important;
}
html.layout-modern .plan-card-header h3 {
    color: var(--modern-header-fg) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
html.layout-modern .plan-card-header .plan-icon {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

/* ── Shared toolbar status dropdown — used across My Services,
   My Domains, and any future page via `.toolbar-status-dropdown`.
   One generic, class-based fix instead of per-page ID rules. ── */
html.layout-modern .section-header .toolbar-status-btn {
    background-color: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #ffffff !important;
}
html.layout-modern .section-header .toolbar-status-btn i,
html.layout-modern .section-header .toolbar-status-btn span,
html.layout-modern .section-header .toolbar-status-chevron {
    color: #ffffff !important;
}
html.layout-modern .section-header .toolbar-status-count {
    background-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}
html.layout-modern .section-header .toolbar-status-btn:hover {
    background-color: rgba(255, 255, 255, 0.26) !important;
}
/* Panel sits inside .section-header in the DOM (fixed positioning
   doesn't remove it from the tree), so the generic header
   i/.text-faint/.text-muted → white rule leaks in here too —
   restore normal colors since the panel's own background is white */
html.layout-modern .toolbar-status-panel .toolbar-status-option {
    color: var(--text-body) !important;
}
html.layout-modern .toolbar-status-panel .toolbar-status-option-active {
    color: #ffffff !important;
}
html.layout-modern .toolbar-status-panel .toolbar-status-option-count {
    color: var(--text-faint) !important;
}
html.layout-modern .toolbar-status-panel .toolbar-status-option-active .toolbar-status-option-count {
    color: #ffffff !important;
}

/* ═══════════════════════════════════════════════ */
/* SHARED TOOLBAR STATUS DROPDOWN (base, all layouts) */
/* ═══════════════════════════════════════════════ */
.toolbar-status-dropdown { position: relative; }

.toolbar-status-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-strong);
    color: var(--text-body);
    cursor: pointer;
    transition: all 0.15s ease;
}
.toolbar-status-count {
    background-color: var(--bg-muted);
    color: var(--text-muted);
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    line-height: 1.2;
    flex-shrink: 0;
}
.toolbar-status-chevron { transition: transform 0.15s ease; }

.toolbar-status-panel {
    position: fixed;
    border-radius: var(--radius-sm);
    z-index: 30;
    max-height: 18rem;
    overflow-y: auto;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-hover);
}
.toolbar-status-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-body);
    text-decoration: none;
    transition: background-color 0.15s ease;
}
.toolbar-status-option:hover { background-color: var(--bg-muted); }
.toolbar-status-option-count {
    color: var(--text-faint);
    margin-left: auto;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.toolbar-status-option-active {
    background-color: var(--brand-600);
    color: #ffffff !important;
}
.toolbar-status-option-active .toolbar-status-option-count { color: #ffffff; }
.toolbar-status-option-active:hover { background-color: var(--brand-700); }

/* Manage button (replaces 3-dot menu) */
.manage-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Respect reduced-motion users */
@media (prefers-reduced-motion: reduce) {
    html.layout-modern .section,
    html.layout-modern .section-header,
    html.layout-modern .section-header::after,
    html.layout-modern .section > *:not(.section-header),
    html.layout-modern .card,
    html.layout-modern .btn-primary,
    html.layout-modern .plan-card-header {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}



/* ── Quick Action rows (shared: profile settings + service quick-actions) ── */
.quick-action-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid var(--border-soft);
}
.quick-action-row:last-child {
    border-bottom: none !important;
}
.quick-action-row:hover {
    background-color: var(--bg-muted);
}
.quick-action-row[data-active="1"] {
    background-color: var(--brand-50);
}
html.dark .quick-action-row[data-active="1"] {
    background-color: color-mix(in srgb, var(--brand-600) 15%, transparent);
}

.quick-action-icon {
    background-color: var(--bg-muted);
    color: var(--text-faint);
    transition: background-color 0.15s ease, color 0.15s ease;
}
.quick-action-row:hover .quick-action-icon {
    background-color: var(--brand-100);
    color: var(--brand-600);
}
.quick-action-row[data-active="1"] .quick-action-icon {
    background-color: var(--brand-600);
    color: #fff;
}

.quick-action-title {
    color: var(--text-body);
    transition: color 0.15s ease;
}
.quick-action-row:hover .quick-action-title {
    color: var(--brand-600);
}
.quick-action-row[data-active="1"] .quick-action-title {
    color: var(--brand-700);
}
html.dark .quick-action-row[data-active="1"] .quick-action-title {
    color: var(--brand-200);
}

