:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --brand: #123b66;
    --accent: #0f766e;
    --line: #e2e8f0;
    --danger: #b42318;
    --success: #067647;
    --warning: #b54708;
    --soft: #f1f5f9;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --blue: #2563eb;
    --teal: #0e7490;
    --green: #059669;
    --amber: #b45309;
    --red: #dc2626;
    --violet: #7c3aed;
    --cyan: #0891b2;
    --slate: #475569;
}

* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        linear-gradient(180deg, rgba(240, 253, 250, 0.72), rgba(248, 250, 252, 0.96) 320px),
        var(--bg);
    color: var(--text);
}

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.96);
    border-right: 1px solid var(--line);
    color: var(--text);
    padding: 24px 18px;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 6px 6px 18px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-align: center;
    text-decoration: none;
}

.brand img {
    width: min(168px, 100%);
    height: 44px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.14em;
    line-height: 1.2;
    text-transform: uppercase;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    text-decoration: none;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 800;
    transition: 0.16s ease;
}

.sidebar a i {
    color: var(--accent);
    font-size: 18px;
}

.sidebar a.active,
.sidebar a:hover {
    background: #f0fdfa;
    border-color: #99f6e4;
    color: #0f766e;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.08);
}

.sidebar a.active i,
.sidebar a:hover i {
    color: #0f766e;
}

.sidebar a:hover {
    transform: translateX(2px);
}

.main {
    padding: 28px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.topbar h1 {
    margin: 0 0 6px;
    font-size: clamp(24px, 4vw, 30px);
    color: var(--text);
    overflow-wrap: anywhere;
}

.topbar p {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

button {
    border: 0;
    background: #0f766e;
    color: #fff;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.refresh-note {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #99f6e4;
    background: #f0fdfa;
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
}

.refresh-note::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(6, 118, 71, 0.13);
}

.report-section {
    display: none;
}

body[data-admin-page="overview"] .overview-section,
body[data-admin-page="api-health"] .api-health-section,
body[data-admin-page="users"] .users-section,
body[data-admin-page="usage"] .usage-section,
body[data-admin-page="error-logs"] .error-logs-section,
body[data-admin-page="enquiries"] .enquiries-section,
body[data-admin-page="faq-review"] .faq-review-section,
body[data-admin-page="website-cms"] .website-cms-section,
body[data-admin-page="revenue"] .revenue-section,
body[data-admin-page="system"] .system-section {
    display: block;
}

body[data-admin-page="overview"] .cards {
    display: grid;
}

body[data-admin-page="website-cms"] .metric-strip {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.report-links {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

body[data-admin-page="overview"] .report-links {
    display: grid;
}

.report-links a {
    min-height: 104px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: 0.16s ease;
}

.report-links a i {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), var(--teal));
    font-size: 21px;
}

.report-links a:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
}

.report-links a:nth-child(2) i {
    background: linear-gradient(135deg, var(--teal), var(--green));
}

.report-links a:nth-child(3) i {
    background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.report-links a:nth-child(4) i {
    background: linear-gradient(135deg, var(--red), var(--amber));
}

.report-links a:nth-child(5) i {
    background: linear-gradient(135deg, var(--green), #16a34a);
}

.report-links a:nth-child(6) i {
    background: linear-gradient(135deg, var(--slate), var(--brand));
}

.report-links span {
    display: block;
    color: var(--brand);
    font-size: 16px;
    font-weight: 900;
}

.report-links strong {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.cards {
    display: none;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.card {
    position: relative;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.card::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: -42px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(18, 59, 102, 0.08);
}

.card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.card-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--card-tone, var(--brand));
    box-shadow: 0 12px 22px rgba(18, 59, 102, 0.14);
}

.card-icon i {
    font-size: 20px;
}

.card-blue { --card-tone: var(--blue); background: #eff6ff; border-color: #bfdbfe; }
.card-teal { --card-tone: var(--teal); background: #ecfeff; border-color: #a5f3fc; }
.card-green { --card-tone: var(--green); background: #ecfdf3; border-color: #abefc6; }
.card-amber { --card-tone: var(--amber); background: #fffbeb; border-color: #fedf89; }
.card-red { --card-tone: var(--red); background: #fef2f2; border-color: #fecaca; }
.card-violet { --card-tone: var(--violet); background: #f5f3ff; border-color: #ddd6fe; }
.card-cyan { --card-tone: var(--cyan); background: #ecfeff; border-color: #bae6fd; }
.card-slate { --card-tone: var(--slate); background: #f8fafc; border-color: #cbd5e1; }

.card-label {
    color: var(--muted);
    font-size: 13px;
}

.card-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--card-tone, var(--brand));
    line-height: 1.1;
}

.card-note,
.muted-text {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    gap: 18px;
    align-items: start;
}

body[data-admin-page="api-health"] .dashboard-grid,
body[data-admin-page="users"] .dashboard-grid,
body[data-admin-page="usage"] .dashboard-grid,
body[data-admin-page="error-logs"] .dashboard-grid,
body[data-admin-page="revenue"] .dashboard-grid,
body[data-admin-page="system"] .dashboard-grid {
    grid-template-columns: 1fr;
}

body[data-admin-page="users"] .dashboard-grid,
body[data-admin-page="revenue"] .dashboard-grid,
body[data-admin-page="system"] .dashboard-grid {
    max-width: 980px;
}

.panel-large {
    grid-row: auto;
}

.panel {
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-top: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.panel::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--brand), var(--accent), var(--green));
}

.panel-head {
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.panel-head.split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel-head h2 {
    margin: 0;
    font-size: 18px;
}

.panel-subhead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 18px 8px;
}

.panel-subhead h3 {
    margin: 0;
    color: var(--brand);
    font-size: 14px;
}

.panel-subhead span {
    color: var(--muted);
    font-size: 12px;
}

.cms-section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.cms-section-actions .button-link {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.button-link i {
    margin-right: 6px;
    font-size: 16px;
}

.cms-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.cms-mini-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
    border: 1px solid #99f6e4;
    border-radius: 999px;
    background: #f0fdfa;
    color: #0f766e;
    padding: 0 9px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.cms-mini-chip i {
    font-size: 14px;
}

.inline-subhead {
    border-top: 1px solid var(--line);
}

.health-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
}

.health-pill.is-good {
    color: var(--success);
    background: #dcfae6;
}

.health-pill.is-warn {
    color: var(--warning);
    background: #fef0c7;
}

.health-pill.is-bad {
    color: var(--danger);
    background: #fee4e2;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border-bottom: 1px solid var(--line);
}

.error-logs-section .metric-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-strip div {
    padding: 14px 16px;
    background: #fbfcfe;
}

.metric-strip span,
.resource-row span,
.bar-label span,
.legend-item em,
.mini-row em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.metric-strip strong {
    display: block;
    margin-top: 4px;
    color: var(--teal);
    font-size: 20px;
}

.chart-bars {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(190px, 1.2fr) minmax(160px, 2fr) 64px;
    gap: 12px;
    align-items: center;
}

.bar-label strong {
    display: block;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.bar-track,
.resource-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--soft);
}

.bar-track span,
.resource-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--teal));
}

.bar-value {
    color: var(--brand);
    font-size: 13px;
    font-weight: 900;
    text-align: right;
}

.donut-wrap {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 18px;
    align-items: center;
    padding: 18px;
}

.donut {
    position: relative;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.donut::after {
    content: "";
    position: absolute;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: var(--panel);
}

.donut span {
    position: relative;
    z-index: 1;
    color: var(--brand);
    font-size: 22px;
    font-weight: 900;
}

.legend-list,
.mini-list,
.resource-list {
    display: grid;
    gap: 10px;
    padding: 0 18px 18px;
}

.resource-list {
    gap: 14px;
    padding: 14px 18px 18px;
}

.compact-list {
    padding-top: 6px;
}

.error-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
}

.error-report-grid article + article {
    border-left: 1px solid var(--line);
}

.error-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.error-badge.critical {
    color: #991b1b;
    background: #fee2e2;
}

.error-badge.high {
    color: #9a3412;
    background: #ffedd5;
}

.error-badge.medium {
    color: #854d0e;
    background: #fef3c7;
}

.error-badge.low {
    color: #155e75;
    background: #cffafe;
}

.legend-list {
    padding: 0;
}

.legend-item,
.mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.legend-item span,
.mini-row span {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.legend-item strong,
.mini-row strong {
    color: var(--brand);
    font-size: 13px;
    white-space: nowrap;
}

.revenue-value {
    padding: 18px 18px 0;
    color: var(--brand);
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
}

#revenue-kpis .muted-text {
    padding: 0 18px 10px;
}

.resource-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
}

.resource-row strong {
    display: block;
    color: var(--text);
    font-size: 13px;
}

.resource-row em {
    color: var(--brand);
    font-size: 13px;
    font-style: normal;
    font-weight: 900;
}

.resource-track {
    grid-column: 1 / -1;
}

.disk-breakdown {
    display: grid;
    gap: 10px;
    padding-top: 6px;
}

.disk-breakdown-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.disk-breakdown-head strong {
    color: var(--brand);
    font-size: 13px;
}

.disk-breakdown-head span {
    color: var(--muted);
    font-size: 12px;
}

.disk-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.disk-row strong {
    display: block;
    color: var(--text);
    font-size: 13px;
}

.disk-row span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.disk-row em {
    color: var(--brand);
    font-size: 13px;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.backup-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    border-bottom: 1px solid var(--line);
}

.backup-detail-grid article + article {
    border-left: 1px solid var(--line);
}

.backup-list {
    display: grid;
    gap: 10px;
    padding: 8px 18px 18px;
}

.backup-row,
.backup-version {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.backup-row {
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: start;
}

.backup-row span,
.backup-version span {
    color: var(--muted);
    font-size: 12px;
}

.backup-row strong,
.backup-version strong {
    color: var(--brand);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.backup-row em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
}

.backup-version strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.backup-recommendation {
    display: grid;
    gap: 5px;
    margin: 18px;
    padding: 13px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fbfcfe;
}

.backup-recommendation strong {
    color: var(--brand);
    font-size: 13px;
}

.backup-recommendation span,
.backup-recommendation em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.backup-recommendation.is-good {
    border-color: #abefc6;
    background: #ecfdf3;
}

.backup-recommendation.is-warn {
    border-color: #fedf89;
    background: #fffbeb;
}

.empty-state {
    padding: 16px;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fbfcfe;
    font-size: 13px;
}

.main .platform-footer {
    margin-top: 28px;
    border-radius: 8px;
    overflow: hidden;
}

.main .platform-footer-inner {
    max-width: none;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    white-space: nowrap;
}

td span {
    color: var(--muted);
    font-size: 12px;
}

th {
    color: var(--muted);
    background: #f8fafc;
    font-weight: 700;
}

.status-bad {
    color: var(--danger);
    font-weight: 700;
}

@media (max-width: 980px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        overflow: visible;
        padding: 16px 18px 12px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .brand {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .sidebar nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .sidebar a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .panel-large {
        grid-row: auto;
    }

    .metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .error-logs-section .metric-strip,
    .error-report-grid,
    .backup-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main {
        padding: 18px;
    }
}

@media (max-width: 1180px) {
    .cms-pane[data-cms-pane="invites"] {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .cards {
        grid-template-columns: 1fr;
    }

    .bar-row {
        grid-template-columns: 1fr;
    }

    .bar-value {
        text-align: left;
    }

    .donut-wrap {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        gap: 14px;
        flex-direction: column;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .report-links {
        grid-template-columns: 1fr;
    }

    .error-logs-section .metric-strip,
    .error-report-grid,
    .backup-detail-grid {
        grid-template-columns: 1fr;
    }

    .error-report-grid article + article,
    .backup-detail-grid article + article {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

.backup-row {
    grid-template-columns: 1fr;
}
}

.faq-review-answer,
.faq-review-question,
.faq-review-keywords,
.faq-review-reference {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 96px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    font: 13px/1.5 inherit;
}

.faq-review-keywords,
.faq-review-reference {
    min-height: 36px;
    margin-top: 8px;
}

.faq-review-question {
    min-height: 72px;
}

.faq-create-form {
    display: grid;
    gap: 14px;
    margin: 18px 0 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.faq-review-section {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.faq-review-section .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.faq-review-section table {
    width: 100%;
    min-width: 960px;
    table-layout: fixed;
}

.faq-review-section th:nth-child(1) { width: 27%; }
.faq-review-section th:nth-child(2) { width: 110px; }
.faq-review-section th:nth-child(3) { width: auto; }
.faq-review-section th:nth-child(4) { width: 112px; }

.faq-review-section td {
    vertical-align: top;
    overflow-wrap: anywhere;
}

.enquiries-section {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.enquiries-section .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.enquiries-section table {
    width: 100%;
    min-width: 1180px;
    table-layout: fixed;
}

.enquiries-section th:nth-child(1) { width: 22%; }
.enquiries-section th:nth-child(2) { width: 24%; }
.enquiries-section th:nth-child(3) { width: 24%; }
.enquiries-section th:nth-child(4) { width: 22%; }
.enquiries-section th:nth-child(5) { width: 90px; }

.enquiries-section td {
    vertical-align: top;
    overflow-wrap: anywhere;
}

.enquiries-section label {
    display: grid;
    gap: 6px;
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.enquiries-section input,
.enquiries-section select,
.enquiries-section textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px 10px;
    color: var(--ink);
    font: 13px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.enquiries-section details {
    margin-top: 8px;
}

.enquiries-section summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 800;
}

.faq-create-form label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.faq-create-form input,
.faq-create-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
    font: 14px/1.5 inherit;
    resize: vertical;
}

.faq-create-form > button {
    justify-self: start;
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.faq-review-actions {
    display: grid;
    gap: 8px;
    width: 100%;
}

.faq-review-actions button {
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    color: #fff;
    background: var(--brand);
    font-weight: 900;
    cursor: pointer;
}

.faq-review-actions button[data-faq-action="ignore"] {
    color: var(--brand);
    background: #eef3f7;
}

.faq-review-actions button[data-faq-action="delete"] {
    background: #b42318;
}

.faq-review-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.website-cms-section {
    width: 100%;
    min-width: 0;
}

.cms-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.button-link,
button.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 8px;
    padding: 0 14px;
    color: var(--brand);
    background: #eef3f7;
    text-decoration: none;
    font-weight: 900;
}

.cms-command-bar {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(360px, 540px);
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 18px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(16, 42, 67, 0.06);
}

.cms-workflow-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.cms-workflow-steps span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    border-radius: 999px;
    background: #eef3f7;
    color: var(--brand);
    padding: 0 12px;
    font-size: 12px;
    font-weight: 900;
}

.cms-search-tools {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(130px, 0.45fr);
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.cms-search-tools label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
}

.cms-search-tools input,
.cms-search-tools select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 8px 10px;
}

.cms-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
    min-width: 0;
}

.cms-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--muted);
    padding: 0 14px;
    font-weight: 900;
    width: 100%;
}

.cms-tabs button.active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.cms-workspace {
    display: block;
    margin: 18px 0 22px;
}

.cms-pane {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    min-width: 0;
}

.cms-pane[data-cms-pane="invites"] {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    align-items: start;
}

.cms-form {
    display: grid;
    gap: 14px;
    align-content: start;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.cms-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    min-width: 0;
}

.cms-invite-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.cms-form label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.cms-form input,
.cms-form select,
.cms-form textarea {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
    font: 14px/1.5 inherit;
}

.cms-form textarea {
    resize: vertical;
}

.cms-check {
    display: flex !important;
    align-items: center;
    gap: 10px !important;
    min-height: 42px;
    padding-top: 22px;
}

.cms-check input {
    width: auto;
}

.cms-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cms-list-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.cms-list-grid article[hidden],
.cms-pane[hidden] {
    display: none;
}

.cms-list {
    display: grid;
    gap: 10px;
}

.cms-item {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 8px 22px rgba(16, 42, 67, 0.06);
}

.cms-item.is-hidden {
    display: none;
}

.cms-item-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.cms-item h4 {
    margin: 0;
    color: var(--brand);
    font-size: 15px;
}

.cms-item p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.cms-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cms-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    background: #eef3f7;
    color: var(--brand);
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.cms-chip.published {
    background: #ecfdf3;
    color: var(--success);
}

.cms-chip.archived {
    background: #fef3f2;
    color: var(--danger);
}

.cms-item button {
    justify-self: start;
    min-height: 32px;
    padding: 0 12px;
}

.cms-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cms-item-actions a,
.cms-item-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-radius: 8px;
    padding: 0 12px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
}

.cms-item-actions a {
    border: 1px solid var(--line);
    color: var(--brand);
    background: #fff;
}

.cms-thumb {
    width: 72px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    background: #eef3f7;
}

@media (max-width: 760px) {
    .faq-create-form {
        padding: 14px;
    }

    .faq-review-section table {
        min-width: 820px;
    }

    .cms-workspace,
    .cms-list-grid,
    .cms-command-bar,
    .cms-pane[data-cms-pane="invites"],
    .cms-form-grid {
        grid-template-columns: 1fr;
    }

    body[data-admin-page="website-cms"] .metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cms-command-bar {
        align-items: stretch;
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .cms-search-tools {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .cms-workflow-steps {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cms-workflow-steps span,
    .cms-mini-chip {
        justify-content: center;
        white-space: normal;
        text-align: center;
    }

    .cms-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cms-form {
        padding: 14px;
    }

    .cms-check {
        padding-top: 0;
    }
}

@media (max-width: 520px) {
    .main {
        padding: 12px;
    }

    .topbar {
        padding: 14px;
    }

    .panel-head,
    .panel-subhead {
        padding-left: 14px;
        padding-right: 14px;
    }

    body[data-admin-page="website-cms"] .metric-strip,
    .cms-tabs,
    .cms-workflow-steps {
        grid-template-columns: 1fr;
    }

    .cms-form input,
    .cms-form select,
    .cms-form textarea {
        font-size: 14px;
    }
}
