:root {
    /* Brand */
    --brand-orange: #FF7A00;
    --brand-orange-hover: #E66E00;
    --brand-orange-soft: rgba(255, 122, 0, 0.14);

    --brand-blue: #2F80ED;
    --brand-blue-hover: #256DD0;
    --brand-blue-soft: rgba(47, 128, 237, 0.14);

    --brand-green: #27AE60;
    --brand-green-hover: #219150;
    --brand-green-soft: rgba(39, 174, 96, 0.14);

    --brand-yellow: #FFB800;
    --brand-yellow-soft: rgba(255, 184, 0, 0.14);

    --danger: #DC2626;
    --danger-soft: rgba(220, 38, 38, 0.14);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 30px;

    --gradient-brand: linear-gradient(135deg, #FF7A00 0%, #2F80ED 52%, #27AE60 100%);
    --gradient-primary: linear-gradient(135deg, #2F80ED 0%, #27AE60 100%);
    --gradient-cta: linear-gradient(135deg, #FF7A00 0%, #FFB800 100%);
}




/* #bulkBar special-case removed — dropdown is now portalled to <body> */


.logoImg {
    width: 100%;
    padding:0 1rem;
}
/* =========================
   DARK THEME
========================= */
.theme-dark {
    --bg: #081522;
    --bg-soft: #0d2033;
    --surface: rgba(13, 32, 51, 0.78);
    --surface-strong: #10263b;
    --surface-dark: #081522;

    --line: rgba(176, 190, 197, 0.14);
    --line-strong: rgba(176, 190, 197, 0.28);

    --text: #ffffff;
    --text-soft: #d9e4ec;
    --muted: #9fb3c3;

    --primary: var(--brand-blue);
    --primary-hover: var(--brand-blue-hover);
    --primary-soft: var(--brand-blue-soft);

    --secondary: var(--brand-orange);
    --secondary-hover: var(--brand-orange-hover);
    --secondary-soft: var(--brand-orange-soft);

    --success: var(--brand-green);
    --success-soft: var(--brand-green-soft);

    --warning: var(--brand-yellow);
    --warning-soft: var(--brand-yellow-soft);

    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.16);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.22);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.30);

    --panel-glass: rgba(255, 255, 255, 0.04);
/*    ---bg-bg: linear-gradient(180deg, #081522 0%, #0B1C2C 55%, #10263b 100%);*/
    --sidebar-bg: #081522;
    --body-bg:
        radial-gradient(circle at top left, rgba(47, 128, 237, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(39, 174, 96, 0.10), transparent 24%),
        radial-gradient(circle at bottom left, rgba(255, 122, 0, 0.10), transparent 22%),
        linear-gradient(180deg, #081522 0%, #0B1C2C 100%);
}

/* =========================
   LIGHT THEME
========================= */
.theme-light {
    --bg: #f4f8fc;
    --bg-soft: #edf4fb;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --surface-dark: #0B1C2C;

    --line: rgba(11, 28, 44, 0.10);
    --line-strong: rgba(11, 28, 44, 0.18);

    --text: #2b4b69;
    --text-soft: #264154;
    --muted: #6B7C93;

    --primary: var(--brand-blue);
    --primary-hover: var(--brand-blue-hover);
    --primary-soft: rgba(47, 128, 237, 0.10);

    --secondary: var(--brand-orange);
    --secondary-hover: var(--brand-orange-hover);
    --secondary-soft: rgba(255, 122, 0, 0.10);

    --success: var(--brand-green);
    --success-soft: rgba(39, 174, 96, 0.10);

    --warning: var(--brand-yellow);
    --warning-soft: rgba(255, 184, 0, 0.12);

    --shadow-sm: 0 8px 24px rgba(11, 28, 44, 0.06);
    --shadow-md: 0 18px 40px rgba(11, 28, 44, 0.10);
    --shadow-lg: 0 30px 80px rgba(11, 28, 44, 0.14);

    --panel-glass: rgba(255, 255, 255, 0.72);
    --sidebar-bg: #163851;
    --body-bg:
        radial-gradient(circle at top left, rgba(47, 128, 237, 0.10), transparent 28%),
        radial-gradient(circle at top right, rgba(39, 174, 96, 0.08), transparent 24%),
        radial-gradient(circle at bottom left, rgba(255, 122, 0, 0.08), transparent 22%),
        linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    color: var(--text);
    background: var(--body-bg);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.checkbox-inline input:checked + * {
    color: var(--primary);
}

.checkbox-inline:has(input:checked) {
    border-color: rgba(47, 128, 237, 0.35);
    background: var(--primary-soft);
}

.override-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel-glass);
    border: 1px solid var(--line);
    padding: 12px 14px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-soft);
}

.checkbox-inline input {
    width: 18px;
    height: 18px;
}

.override-block {
    margin-bottom: 16px;
}

/* Layout */
.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 26px 20px;
    color: #fff;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-top {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    color: rgba(226, 232, 240, 0.84);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.sidebar-logout-btn:hover {
    background: rgba(220, 38, 38, 0.14);
    border-color: rgba(220, 38, 38, 0.28);
    color: #fca5a5;
}

.sidebar .theme-toggle {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 14px;
}

.brand {
    margin-bottom: 26px;
    padding: 0 12px;
}

.brand-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #fff;
}

.brand-subtitle {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.02em;
    text-align: center;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(226, 232, 240, 0.84);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: 0.22s ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.content {
    padding: 28px 32px 40px;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
}

.topbar-left h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.topbar-left p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.topbar-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.card-title-row h2,
.card h2 {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 760;
    letter-spacing: -0.03em;
    color: var(--text);
}

.card p {
    margin-top: 0;
    color: var(--text-soft);
}

/* KPI stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.stats-grid.compact {
    margin-top: 18px;
}

.stat {
    position: relative;
    overflow: hidden;
    min-height: 138px;
    text-align: center;
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-brand);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(6px);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 700px;
    max-width: 95%;
    background: var(--surface-strong);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    border: 1px solid var(--line);
    overflow-y: scroll;
    max-height: 80%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

.modal textarea {
    width: 100%;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    font-family: monospace;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.import-result {
    margin-top: 12px;
    font-size: 14px;
}

/* ── Legacy button aliases (use .button variants for new code) ── */
.dashButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
    background: var(--panel-glass);
    color: var(--text-soft);
    border: 1px solid var(--line);
    text-decoration: none;
}
.dashButton:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}

.deleteButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.22);
}
.deleteButton:hover {
    background: var(--danger);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.22);
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.stat strong {
    display: block;
    margin-top: 10px;
    font-size: 34px;
    font-weight: 820;
    letter-spacing: -0.05em;
    color: var(--text);
}

.stat small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}

/* Layout helpers */
.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.grid-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Forms */
.field {
    margin-bottom: 16px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-soft);
    letter-spacing: 0.01em;
    padding-top: 1rem;
}

input,
textarea,
select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    font: inherit;
    padding: 12px 14px;
    outline: none;
    transition: 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.theme-dark input,
.theme-dark textarea,
.theme-dark select {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

input::placeholder,
textarea::placeholder {
    color: #8ea0b3;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(47, 128, 237, 0.36);
    box-shadow:
        0 0 0 4px rgba(47, 128, 237, 0.12),
        0 12px 30px rgba(47, 128, 237, 0.08);
    background: #fff;
}

.theme-dark input:focus,
.theme-dark textarea:focus,
.theme-dark select:focus {
    background: rgba(255, 255, 255, 0.06);
}

textarea {
    resize: vertical;
    min-height: 110px;
}

textarea[readonly] {
    background: rgba(248, 250, 252, 0.72);
    color: #334155;
    border-style: dashed;
}

.theme-dark textarea[readonly] {
    background: rgba(255, 255, 255, 0.03);
    color: #c2d1db;
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 16px;
    border: none;
    border-radius: 14px;
    background: var(--gradient-cta);
    color: #fff;
    font-weight: 760;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: 0 12px 24px rgba(255, 122, 0, 0.20);
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(255, 122, 0, 0.26);
}

.button.secondary {
    background: var(--gradient-primary);
    box-shadow: 0 12px 24px rgba(47, 128, 237, 0.18);
}

.button.ghost {
    background: rgba(255,255,255,0.78);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}

.theme-dark .button.ghost {
    background: rgba(255,255,255,0.04);
}

.button.ghost:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.button.danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.20);
}

.button.danger:hover {
    box-shadow: 0 16px 28px rgba(220, 38, 38, 0.30);
}

.button.success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 12px 24px rgba(39, 174, 96, 0.20);
}

.button.success:hover {
    box-shadow: 0 16px 28px rgba(39, 174, 96, 0.28);
}

.button.warning {
    background: var(--warning);
    color: #1a1a1a;
    box-shadow: 0 12px 24px rgba(255, 184, 0, 0.20);
}

.button.sm {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 10px;
    box-shadow: none;
}

.button.sm:hover {
    box-shadow: var(--shadow-sm);
}

.button.xs {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 12px;
    border-radius: 8px;
    box-shadow: none;
}

.button.disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

.grid-one {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.preview-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.preview-tab.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(47, 128, 237, 0.18);
}

.preview-panel {
    display: none;
}

.preview-panel.active {
    display: block;
}

.page-preview-frame {
    width: 100%;
    min-height: 920px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin: 16px 0 22px;
}

.actions-group {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px 10px 4px 8px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.actions-group-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-right: 6px;
    border-right: 1px solid var(--line);
    margin-right: 2px;
    white-space: nowrap;
}

/* Tables */
.table-card {
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
text-align: left;
    padding: 10px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    font-size: 0.9rem;
}

td {
    color: var(--text-soft);
}

th {
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

tbody tr {
    transition: 0.16s ease;
}

tbody tr:hover {
    background: rgba(47, 128, 237, 0.045);
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0.01em;
}

.badge.primary {
    background: var(--primary-soft);
    color: var(--primary);
}

.badge.success {
    background: var(--success-soft);
    color: var(--success);
}

.badge.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge.warning {
    background: var(--warning-soft);
    color: #c78500;
}

.theme-dark .badge.warning {
    color: #ffd25a;
}

.badge.dark {
    background: var(--secondary-soft);
    color: var(--secondary);
}

/* Flash messages */
.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 650;
    border: 1px solid transparent;
    transition: opacity 0.32s ease, transform 0.32s ease;
}

.flash-dismissed {
    opacity: 0;
    transform: translateY(-6px);
}

.flash-close {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    color: inherit;
    opacity: 0.6;
    flex-shrink: 0;
}

.flash-close:hover { opacity: 1; }

.flash-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(39, 174, 96, 0.18);
}

.flash-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.18);
}

.flash-warning {
    background: var(--warning-soft);
    color: #c78500;
    border-color: rgba(255, 184, 0, 0.20);
}

/* CTA preview */
.amofordesign-cta-preview {
    padding: 18px;
    border-radius: 18px;
    border: 1px dashed rgba(47, 128, 237, 0.24);
    background: linear-gradient(180deg, rgba(47,128,237,0.04), rgba(255,255,255,0.55));
}

.theme-dark .amofordesign-cta-preview {
    background: linear-gradient(180deg, rgba(47,128,237,0.06), rgba(255,255,255,0.02));
}

.amofordesign-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 14px;
    color: #fff;
    font-weight: 760;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(11, 28, 44, 0.14);
    transition: 0.2s ease;
}

.amofordesign-cta:hover {
    transform: translateY(-1px);
    color: #fff;
}

.amofordesign-cta-primary {
    background: var(--gradient-cta);
}

.amofordesign-cta-secondary {
    background: var(--gradient-primary);
}

.amofordesign-cta-dark {
    background: linear-gradient(135deg, #0B1C2C, #10263b);
}

/* Section helpers */
.section-title {
    margin-bottom: 16px;
}

.section-title h2 {
    margin: 0;
}

.section-title p {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--muted);
}

/* Small helper panels */
.info-box {
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--panel-glass);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1080px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .content {
        padding: 20px;
    }

    .grid-two,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .topbar {
        flex-direction: column;
    }

    .actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-group {
        flex-wrap: wrap;
    }

    .button {
        width: 100%;
    }
}







.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.image-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-strong);
  display: flex;
  flex-direction: column;
}

.image-thumb-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  overflow: hidden;
}

.image-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-thumb-wrapper img {
  transition: transform 0.2s ease;
}

.image-card:hover img {
  transform: scale(1.05);
}
.image-info {
  padding: 12px;
  font-size: 0.9rem;
  display: grid;
  gap: 6px;
}

.image-alt {
  font-weight: 500;
}

.image-url {
  font-size: 0.75rem;
  color: #64748b;
  word-break: break-all;
}

.button.small {
  margin: 12px;
  padding: 8px 10px;
  font-size: 0.85rem;
}
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel-glass);
    color: var(--text);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    transform: translateY(-1px) ;
    border-color: var(--line-strong);
}

/* topBodyNavBar removed — logout + theme toggle now live in sidebar-footer */

.theme-toggle:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px rgba(47, 128, 237, 0.14),
        var(--shadow-sm);
}

.theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 15px;
    line-height: 1;
}

.theme-toggle-label {
    white-space: nowrap;
}


.users-page {
  display: grid;
  gap: 24px;
}

.users-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

.users-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.users-card h2 {
  margin: 0 0 8px 0;
  color: var(--text);
}

.users-card p.helper {
  margin: 0 0 20px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.users-form {
  display: grid;
  gap: 16px;
}

.users-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

.users-form input,
.users-form .cs-trigger {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
  background: transparent;
  color: var(--text);
}

.users-checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
}

.users-checkbox input {
  width: auto;
  min-height: auto;
}

.user-list {
  display: grid;
  gap: 16px;
}

.user-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: var(--panel-glass);
}

.user-item-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.user-item-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-item-title h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--panel-glass);
  color: var(--text-soft);
  border: 1px solid var(--line);
}

.user-pill.admin {
  background: var(--secondary-soft);
  color: var(--secondary);
}

.user-pill.client {
  background: var(--success-soft);
  color: var(--success);
}

.user-pill.site {
  background: var(--primary-soft);
  color: var(--primary);
}

.user-actions-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr auto;
  gap: 12px;
  align-items: end;
}

.user-actions-grid form {
  margin: 0;
}

.user-inline-form {
  display: grid;
  gap: 12px;
}

.user-inline-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 12px;
  align-items: end;
}

.user-inline-row.password-row {
  grid-template-columns: 1fr auto;
}

.danger-inline {
  display: flex;
  align-items: end;
  height: 100%;
}

.button-danger-soft {
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.button-danger-soft:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  .users-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .user-inline-row,
  .user-inline-row.password-row {
    grid-template-columns: 1fr;
  }

  .user-item-header {
    flex-direction: column;
    align-items: start;
  }
}


.image-card-highlight {
  animation: imageCardPulse 1.2s ease;
}

@keyframes imageCardPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
    transform: scale(1);
  }
  40% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.12);
    transform: scale(1.01);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    transform: scale(1);
  }
}



.catalog-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.catalog-modal.is-open {
  display: block;
}

.catalog-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.catalog-modal-panel {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    margin: 24px auto;
    overflow: auto;
    border-radius: 24px;
    padding: 0 24px 24px 24px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
}

.catalog-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
  position: sticky;
  top: 0;
  background: var(--surface-strong);
  padding-bottom: 12px;
  padding-top: 12px;
  z-index: 2;
}

.catalog-modal .image-grid {
  margin-top: 8px;
}

.catalog-modal .image-card {
  background: var(--surface);
}

body.catalog-open {
  overflow: hidden;
}

.image-card-highlight {
  animation: imageCardPulse 1.2s ease;
}

@keyframes imageCardPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
    transform: scale(1);
  }
  40% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.12);
    transform: scale(1.01);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    transform: scale(1);
  }
}

@media (max-width: 760px) {
  .catalog-modal-panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
    padding: 16px;
    border-radius: 18px;
  }

  .catalog-modal-header {
    flex-direction: column;
    align-items: stretch;
  }
}


/* ── Confirm modal ─────────────────────────────────────────── */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.confirm-modal.is-open {
    display: flex;
}

.confirm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.60);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.confirm-modal-panel {
    position: relative;
    z-index: 1;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
    width: min(420px, calc(100vw - 32px));
    text-align: center;
}

.confirm-modal-message {
    font-size: 16px;
    font-weight: 650;
    color: var(--text);
    margin: 0 0 22px;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ── SEO progress bar ──────────────────────────────────────── */
.seo-score-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.seo-bar-wrap {
    width: 80px;
    height: 5px;
    border-radius: 99px;
    background: var(--line-strong);
    overflow: hidden;
    display: none;
}

.seo-bar {
    height: 100%;
    border-radius: 99px;
    transition: width 0.4s ease;
}

.seo-bar-good { background: var(--brand-green); }
.seo-bar-mid  { background: var(--brand-yellow); }
.seo-bar-bad  { background: var(--danger); }

/* Stat card SEO bar */
.stat-seo-bar {
    width: 70%;
    height: 5px;
    border-radius: 99px;
    background: var(--line-strong);
    overflow: hidden;
    margin: 8px auto 0;
}

.stat-seo-fill {
    height: 100%;
    border-radius: 99px;
}

.stat-seo-good { background: var(--brand-green); }
.stat-seo-mid  { background: var(--brand-yellow); }
.stat-seo-bad  { background: var(--danger); }

/* ── FAQ builder ───────────────────────────────────────────── */
.faq-builder {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.faq-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--panel-glass);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
}

.faq-row-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-row-inputs input,
.faq-row-inputs textarea {
    padding-top: 0;
    margin: 0;
    font-size: 14px;
}

.faq-row-inputs label {
    padding-top: 0;
}

.faq-remove-btn {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 18px;
    flex-shrink: 0;
}

/* ── Tag input (keywords_secondary) ───────────────────────── */
.tag-input-wrap {
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    cursor: text;
    transition: 0.2s ease;
    margin-top: 4px;
}

.theme-dark .tag-input-wrap {
    background: rgba(255, 255, 255, 0.04);
}

.tag-input-wrap:focus-within {
    border-color: rgba(47, 128, 237, 0.36);
    box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.12);
}

.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kw-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
}

.kw-chip-del {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0;
    font-size: 15px;
    line-height: 1;
}

.kw-chip-del:hover { opacity: 1; }

.tag-input-wrap input {
    border: none;
    background: none;
    box-shadow: none;
    padding: 4px 4px;
    min-width: 140px;
    flex: 1;
    font-size: 14px;
}

.tag-input-wrap input:focus {
    border: none;
    box-shadow: none;
    background: none;
}

/* ── Sticky save bar ───────────────────────────────────────── */
.sticky-save-bar {
    position: fixed;
    bottom: 0;
    left: 280px;
    right: 0;
    z-index: 900;
    background: var(--surface-strong);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 30px rgba(0,0,0,0.10);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transform: translateY(100%);
    transition: transform 0.28s ease;
}

.sticky-save-bar.is-visible {
    transform: translateY(0);
}

.sticky-save-msg {
    font-size: 14px;
    color: var(--muted);
    font-weight: 600;
}

/* ── Pages list — count badge ──────────────────────────────── */
.pages-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    padding: 3px 10px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ── Filters bar ───────────────────────────────────────────── */
.pages-filters {
    margin-bottom: 18px;
}

.filters-row {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-field {
    flex: 1;
    min-width: 160px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    padding-bottom: 2px;
}

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: 0.18s ease;
}

.page-btn:hover:not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.page-info {
    font-size: 14px;
    color: var(--muted);
    font-weight: 600;
}

/* ── Bar chart (dashboard) ─────────────────────────────────── */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.bar-row {
    display: grid;
    grid-template-columns: 160px 1fr 44px;
    align-items: center;
    gap: 12px;
}

.bar-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    height: 10px;
    border-radius: 99px;
    background: var(--line-strong);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--gradient-primary);
    transition: width 0.5s ease;
}

.bar-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-align: right;
}

/* ── CTA Builder ───────────────────────────────────────────── */
.cta-builder-section {
    margin-top: 22px;
}

.cta-new-form {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 22px;
}

.cta-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}

.cta-form-grid label {
    grid-column: span 1;
}

.cta-form-footer {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.cta-preview-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.muted-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.cta-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cta-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    background: var(--panel-glass);
    transition: 0.18s ease;
}

.cta-item:hover {
    border-color: var(--line-strong);
}

.cta-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cta-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cta-code-pill {
    display: inline-flex;
    align-items: center;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 700;
    font-family: monospace;
    color: var(--text);
    letter-spacing: 0.02em;
}

.cta-item-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.cta-url-muted {
    font-size: 13px;
    color: var(--muted);
    word-break: break-all;
}

.cta-edit-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

/* ── Bulk action bar ───────────────────────────────────────── */
.col-check {
    width: 40px;
    text-align: center;
    vertical-align: middle;
}

.col-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    padding: 0;
    border-radius: 5px;
}

.bulk-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    z-index: 950;
    background: var(--surface-strong);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    min-width: min(680px, calc(100vw - 48px));
    transition: transform 0.30s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.bulk-action-bar.is-visible {
    transform: translateX(-50%) translateY(0);
}

.bulk-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    background: var(--primary-soft);
    padding: 6px 12px;
    border-radius: 999px;
}

.bulk-controls {
    display: flex;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

/* .bulk-select styles are now handled by .cs-compact via the custom select component */

/* ── Responsive adjustments ────────────────────────────────── */
@media (max-width: 1080px) {
    .sticky-save-bar { left: 0; }
    .bar-row { grid-template-columns: 120px 1fr 36px; }
    .cta-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .filters-row { flex-direction: column; }
    .filter-field { min-width: 100%; }
    .bar-row { grid-template-columns: 90px 1fr 32px; }
    .bulk-action-bar { bottom: 12px; padding: 12px 14px; gap: 10px; }
    .bulk-controls { flex-direction: column; }
    .cta-item-header { flex-direction: column; align-items: flex-start; }
}



/* ── Mobile hamburger + sidebar drawer ──────────────────────── */
.sidebar-hamburger {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1100;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    background: var(--sidebar-bg);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

@media (max-width: 760px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh !important;
        width: 280px;
        z-index: 1060;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-overlay.is-open {
        display: block;
    }

    .sidebar-hamburger {
        display: flex;
    }

    .content {
        padding: 16px 14px 16px;
        padding-top: 64px;
    }
}

/* ── Sortable table headers ─────────────────────────────────── */
th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover {
    color: var(--primary);
}

.sort-icon {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.45;
    font-size: 10px;
}

th.sort-asc .sort-icon,
th.sort-desc .sort-icon {
    opacity: 1;
    color: var(--primary);
}

/* ── SEO score breakdown ────────────────────────────────────── */


.seo-popover-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: var(--text-soft);
    border-bottom: 1px solid var(--line);
}

.seo-popover-row:last-child {
    border-bottom: none;
    font-weight: 700;
    color: var(--text);
    padding-top: 8px;
}

.seo-criterion-pts {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 11px;
}

.seo-criterion-pts.earned { color: var(--brand-green); }
.seo-criterion-pts.missed { color: var(--danger); opacity: 0.7; }

/* ── CTA full-width block ───────────────────────────────────── */
.cta-block-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.cta-block-grid > * {
    flex: 1 1 180px;
}

.cta-block-preview {
    flex: 0 0 auto;
}

/* ── SEO details panel (sous stats-grid) ───────────────────── */
.seo-details-panel {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 20px;
    margin-top: -4px;
    margin-bottom: 20px;
}

.seo-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
}


.seo-details-rows {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0 24px;
}

/* ── Heading TOC inside SEO panel ───────────────────────────── */
.seo-toc-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.seo-toc-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
}

.seo-toc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.seo-toc-empty {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
}

.seo-toc-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.seo-toc-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: monospace;
    min-width: 28px;
    text-align: center;
}

.seo-toc-h1 { background: #dbeafe; color: #1d4ed8; }
.seo-toc-h2 { background: #ede9fe; color: #6d28d9; }
.seo-toc-h3 { background: #d1fae5; color: #065f46; }
.seo-toc-h4 { background: #fef9c3; color: #92400e; }
.seo-toc-h5 { background: #fee2e2; color: #991b1b; }
.seo-toc-h6 { background: #f1f5f9; color: #475569; }

.seo-toc-input {
    flex: 1;
    font-size: 12px;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    transition: border-color .15s;
}

.seo-toc-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-sep {
    opacity: 0.45;
}

.breadcrumb-current {
    color: var(--text-soft);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

/* ── FAQ drag handle ────────────────────────────────────────── */
.faq-drag-handle {
    display: flex;
    align-items: center;
    padding: 4px;
    cursor: grab;
    color: var(--muted);
    opacity: 0.5;
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1;
}

.faq-drag-handle:hover {
    opacity: 1;
    color: var(--primary);
}

.faq-row.is-dragging {
    opacity: 0.4;
    border-style: dashed;
}

.faq-row.drag-over {
    border-color: var(--primary);
    background: var(--primary-soft);
}

/* ── Collapsible details sections ───────────────────────────── */
.collapsible-section {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 20px 0;
}

.collapsible-section summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    background: var(--panel-glass);
    list-style: none;
    user-select: none;
    transition: background 0.15s;
}

.collapsible-section summary::-webkit-details-marker {
    display: none;
}

.collapsible-section summary:hover {
    background: var(--primary-soft);
}

.collapsible-section[open] summary {
    border-bottom: 1px solid var(--line);
}

.collapsible-chevron {
    margin-left: auto;
    width: 16px;
    height: 16px;
    color: var(--muted);
    transition: transform 0.22s ease;
}

.collapsible-section[open] .collapsible-chevron {
    transform: rotate(180deg);
}

.collapsible-body {
    padding: 18px;
}

.zIndexContainer {
    display: block;
    width: 100%;
    position: relative;
    min-height: 125px;
    z-index: 99;
}

.zIndexContainer form {
    width: 100%;
    position: absolute;
    left:0;
    right:0;
    top:0;
    bottom:0;
    z-index: 99;
}


#statsFilter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 99;
}


#statsFilter form {
    width:100%;
}


#statsFilter  .preFilter {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

#statsFilter  .dateRange {
    flex-grow: 1;
        display: flex;
    align-items: center;
}

#statsFilter  .websiteSelector {
    flex-grow: 1;
        display: flex;
    align-items: center;
}
#statsFilter  .submitStatsFilter {
    flex-grow: 1;
    justify-content: flex-end;
    display: flex;
}


#statsFilter label {
    display: flex;
    flex-direction: row;
}
#statsFilter .cs-wrapper {
    max-width: 400px;
}


/* ═══════════════════════════════════════════════════════════════
   CUSTOM SELECT
═══════════════════════════════════════════════════════════════ */

/* Hide the native select; keep it in the DOM for form submission */
.cs-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

.cs-wrapper {
    position: relative;
    width: 100%;
}

/* Trigger button */
.cs-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    user-select: none;
    text-align: left;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.theme-dark .cs-trigger {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.cs-trigger:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.97);
}

.theme-dark .cs-trigger:hover {
    background: rgba(255, 255, 255, 0.07);
}

.cs-trigger:focus,
.cs-wrapper.is-open .cs-trigger {
    border-color: rgba(47, 128, 237, 0.45);
    box-shadow:
        0 0 0 4px rgba(47, 128, 237, 0.12),
        0 8px 24px rgba(47, 128, 237, 0.08);
    background: #fff;
}

.theme-dark .cs-trigger:focus,
.theme-dark .cs-wrapper.is-open .cs-trigger {
    background: rgba(255, 255, 255, 0.06);
}

.cs-trigger-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.cs-trigger-label.is-placeholder {
    color: var(--muted);
}

.cs-chevron {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    color: var(--muted);
    transition: transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.cs-wrapper.is-open .cs-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Dropdown panel — portalled to <body> via JS, position:fixed set by JS */
.cs-dropdown {
    position: fixed;   /* coordinates set by JS via getBoundingClientRect */
    z-index: 99999;    /* above all stacking contexts */
    background: var(--surface-strong);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    box-shadow:
        var(--shadow-md),
        0 0 0 1px rgba(255, 255, 255, 0.04);
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top center;
    pointer-events: none;
    transition:
        opacity 0.15s ease,
        transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
    max-height: 288px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.cs-dropdown.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Option items */
.cs-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.1s ease, color 0.1s ease;
    border-bottom: 1px solid var(--line);
}

.cs-option:last-child {
    border-bottom: none;
}

.cs-option:hover,
.cs-option.is-focused {
    background: var(--primary-soft);
    color: var(--primary);
}

.cs-option.is-selected {
    color: var(--primary);
    font-weight: 600;
}

.cs-option.is-selected .cs-check {
    display: block;
}

.cs-check {
    display: none;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--primary);
}

/* Compact variant — for filter bars, bulk controls */
.cs-compact .cs-trigger {
    min-height: 36px;
    padding: 7px 11px;
    border-radius: 12px;
    font-size: 13px;
}

.cs-compact .cs-dropdown {
    border-radius: 12px;
}

.cs-compact .cs-option {
    padding: 8px 11px;
    font-size: 13px;
}

.cs-compact.cs-wrapper {
    min-width: 180px;
}


/* ═══════════════════════════════════════════════════════════════
   ACE CODE EDITOR
═══════════════════════════════════════════════════════════════ */

.ace-wrap {
    position: relative;
    border-radius: 14px;
    border: 1px solid var(--line);
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    background: #1d2433;
}

.theme-light .ace-wrap {
    background: #f8f9fc;
}

.ace-wrap:focus-within {
    border-color: rgba(47, 128, 237, 0.45);
    box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.12);
}

.ace-wrap .ace_editor {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace !important;
    font-size: 13px !important;
    line-height: 1.65 !important;
    width: 100% !important;
}

/* Hide the original textarea — keep it in the DOM for form submission */
textarea.ace-replaced {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

/* ═══════════════════════════════════════════════════════════════
   ACCENT COLOUR SCHEMES  (set via html[data-accent="..."])
   Admin can choose in /admin/app-settings
   Default (no attribute) = kwoord blue/orange/green
═══════════════════════════════════════════════════════════════ */

/* Acier — Blue-grey / steel corporate */
html[data-accent="acier"] {
    --brand-orange:       #2e6da4;
    --brand-orange-hover: #235a8f;
    --brand-orange-soft:  rgba(46, 109, 164, 0.12);
    --brand-blue:         #3d7ab5;
    --brand-blue-hover:   #2e6da4;
    --brand-blue-soft:    rgba(61, 122, 181, 0.12);
    --brand-green:        #546e7a;
    --brand-green-hover:  #37474f;
    --brand-green-soft:   rgba(84, 110, 122, 0.12);
    --gradient-brand:     linear-gradient(135deg, #90a4ae 0%, #3d7ab5 52%, #1a4f7c 100%);
    --gradient-primary:   linear-gradient(135deg, #546e7a 0%, #2e6da4 100%);
    --gradient-cta:       linear-gradient(135deg, #2e6da4 0%, #1a4f7c 100%);
}

/* Marine — Deep navy corporate */
html[data-accent="marine"] {
    --brand-orange:       #1a3a6e;
    --brand-orange-hover: #122b55;
    --brand-orange-soft:  rgba(26, 58, 110, 0.12);
    --brand-blue:         #1e4d99;
    --brand-blue-hover:   #1a3a6e;
    --brand-blue-soft:    rgba(30, 77, 153, 0.12);
    --brand-green:        #2563eb;
    --brand-green-hover:  #1d4ed8;
    --brand-green-soft:   rgba(37, 99, 235, 0.12);
    --gradient-brand:     linear-gradient(135deg, #2563eb 0%, #1e4d99 52%, #0d2137 100%);
    --gradient-primary:   linear-gradient(135deg, #1e4d99 0%, #1a3a6e 100%);
    --gradient-cta:       linear-gradient(135deg, #1a3a6e 0%, #0d2137 100%);
}

/* Azur — Light cerulean blue */
html[data-accent="azur"] {
    --brand-orange:       #0284c7;
    --brand-orange-hover: #0369a1;
    --brand-orange-soft:  rgba(2, 132, 199, 0.12);
    --brand-blue:         #0ea5e9;
    --brand-blue-hover:   #0284c7;
    --brand-blue-soft:    rgba(14, 165, 233, 0.12);
    --brand-green:        #38bdf8;
    --brand-green-hover:  #0ea5e9;
    --brand-green-soft:   rgba(56, 189, 248, 0.12);
    --gradient-brand:     linear-gradient(135deg, #7dd3fc 0%, #0ea5e9 52%, #0369a1 100%);
    --gradient-primary:   linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --gradient-cta:       linear-gradient(135deg, #0ea5e9 0%, #075985 100%);
}

/* Iris — Blue-mauve / periwinkle-indigo */
html[data-accent="iris"] {
    --brand-orange:       #4f46e5;
    --brand-orange-hover: #4338ca;
    --brand-orange-soft:  rgba(79, 70, 229, 0.12);
    --brand-blue:         #6366f1;
    --brand-blue-hover:   #4f46e5;
    --brand-blue-soft:    rgba(99, 102, 241, 0.12);
    --brand-green:        #818cf8;
    --brand-green-hover:  #6366f1;
    --brand-green-soft:   rgba(129, 140, 248, 0.12);
    --gradient-brand:     linear-gradient(135deg, #a5b4fc 0%, #6366f1 52%, #3730a3 100%);
    --gradient-primary:   linear-gradient(135deg, #818cf8 0%, #4f46e5 100%);
    --gradient-cta:       linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

/* ── App Settings colour scheme preview swatches ─────────────── */
.accent-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.accent-swatch {
    border: 2px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s ease;
    background: var(--surface);
}

.accent-swatch:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.accent-swatch.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.accent-swatch-preview {
    height: 80px;
    position: relative;
    overflow: hidden;
}

.accent-swatch-body {
    padding: 12px 14px;
}

.accent-swatch-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    margin: 0 0 4px;
}

.accent-swatch-desc {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
}
