/* ─────────────────────────────────────────────────────────────────────────
   Kabiri staff console - shared stylesheet (index.html + login.html).

   Light theme mirrors the Kabiri app interface (white sidebar + top bar,
   rounded content panel, Inter, brand blue); the dark theme lifts its
   palette from the app's BaseStyles dark tokens so the console feels like
   the product. js/theme-boot.js stamps data-theme="light|dark" on <html>
   before first paint, so every rule can key off [data-theme] alone.
   ───────────────────────────────────────────────────────────────────────── */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    color-scheme: light;

    --bg: #fff;
    --content-bg: #f8f9fa;
    --surface: #fff;
    --surface-2: #f3f4f6;
    --hover: #f3f4f6;
    --active: #e5e7eb;
    --border: #e5e7eb;
    --content-border: rgb(0 0 0 / 8%);
    --text: #111827;
    --text-secondary: #6b7280;
    --muted: #9ca3af;
    --nav-text: #374151;
    --brand: #1433d2;
    --brand-light: #4a66e6;
    --brand-tint: rgb(20 51 210 / 8%);
    --brand-ring: rgb(20 51 210 / 12%);
    --brand-shadow: rgb(20 51 210 / 24%);
    --brand-shadow-hover: rgb(20 51 210 / 32%);
    --brand-gradient: linear-gradient(135deg, #1433d2 0%, #4a66e6 100%);
    --success: #059669;
    --success-bg: rgb(5 150 105 / 10%);
    --warning: #b45309;
    --warning-bg: rgb(245 158 11 / 12%);
    --warning-border: rgb(245 158 11 / 35%);
    --error: #dc2626;
    --error-bg: rgb(220 38 38 / 8%);
    --error-border: rgb(220 38 38 / 25%);
    --purple: #7c3aed;
    --amber: #b45309;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 5%);
    --shadow-md: 0 2px 12px rgb(0 0 0 / 6%);
    --shadow-lg: 0 4px 24px rgb(0 0 0 / 6%);
    --shadow-modal: 0 20px 50px rgb(0 0 0 / 25%);
}

[data-theme='dark'] {
    color-scheme: dark;

    --bg: #0f1117;
    --content-bg: #1a1b23;
    --surface: #222330;
    --surface-2: #2a2b38;
    --hover: #2a2b38;
    --active: #33343f;
    --border: #2a2b38;
    --content-border: rgb(255 255 255 / 6%);
    --text: #f5f6fa;
    --text-secondary: #c5c6d8;
    --muted: #8b8c9e;
    --nav-text: #c5c6d8;
    --brand: #4a66e6;
    --brand-light: #6d84ec;
    --brand-tint: rgb(74 102 230 / 16%);
    --brand-ring: rgb(74 102 230 / 32%);
    --brand-shadow: rgb(0 0 0 / 40%);
    --brand-shadow-hover: rgb(0 0 0 / 50%);
    --brand-gradient: linear-gradient(135deg, #4a66e6 0%, #1433d2 100%);
    --success: #34d399;
    --success-bg: rgb(52 211 153 / 14%);
    --warning: #e0a565;
    --warning-bg: rgb(245 158 11 / 16%);
    --warning-border: rgb(245 158 11 / 40%);
    --error: #f87171;
    --error-bg: rgb(248 113 113 / 12%);
    --error-border: rgb(248 113 113 / 30%);
    --purple: #a78bfa;
    --amber: #fbbf24;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-md: 0 2px 12px rgb(0 0 0 / 40%);
    --shadow-lg: 0 4px 24px rgb(0 0 0 / 50%);
    --shadow-modal: 0 20px 50px rgb(0 0 0 / 60%);
}

body {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ───── App layout ───── */

.app {
    display: grid;
    grid-template-columns: 216px 1fr;
    height: 100vh;
}

.sidebar {
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 18px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.sidebar .brand {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 6px 10px 16px;
}

.sidebar .brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.sidebar .brand-tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand);
}

#admin-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
}

.nav-group-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 12px 4px;
    user-select: none;
}

.nav-group-label:first-child {
    padding-top: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}

.nav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.nav-link:hover {
    background: var(--hover);
    color: var(--text);
}

.nav-link:hover svg {
    color: var(--text);
}

.nav-link.active {
    background: var(--brand-tint);
    color: var(--brand);
    font-weight: 600;
}

.nav-link.active svg {
    color: var(--brand);
}

.nav-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--error);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    padding: 10px 12px 2px;
    font-size: 11px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin-top: 10px;
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    height: 52px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.topbar .admin-identity {
    margin-right: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.topbar .admin-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.topbar .admin-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar .autorefresh-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.topbar .autorefresh-select {
    font: inherit;
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--nav-text);
    cursor: pointer;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--hover);
    color: var(--text);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

#admin-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#admin-refresh .refresh-icon {
    display: inline-flex;
}

#admin-refresh.is-refreshing .refresh-icon {
    animation: admin-spin 0.7s linear infinite;
}

@keyframes admin-spin {
    to {
        transform: rotate(360deg);
    }
}

/* The content region is the app's rounded, inset panel. */
.content {
    flex: 1 1 auto;
    overflow-y: auto;
    margin: 12px;
    padding: 24px 28px;
    background: var(--content-bg);
    border: 1px solid var(--content-border);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
}

/* ───── Typography helpers ───── */

.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.muted {
    color: var(--text-secondary);
    font-size: 14px;
}

.small {
    font-size: 12px;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
}

.footnote {
    margin-top: 20px;
}

.error-text {
    color: var(--error);
}

.success-text {
    color: var(--success);
}

/* ───── Cards + panels ───── */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.stat-card.attention {
    border-color: var(--warning-border);
    background: linear-gradient(0deg, var(--warning-bg), var(--warning-bg)), var(--surface);
}

.stat-card.stat-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.stat-card.stat-link:hover {
    border-color: var(--brand-light);
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.stat-sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 18px 0;
    box-shadow: var(--shadow-sm);
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
}

/* ───── Buttons ───── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    background: var(--hover);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--nav-text);
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        filter 0.15s ease;
}

.btn:hover {
    background: var(--active);
}

.btn.small {
    padding: 6px 10px;
    font-size: 13px;
}

.btn.primary {
    background: var(--brand-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px var(--brand-shadow);
}

.btn.primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 4px 12px var(--brand-shadow-hover);
}

.btn.danger {
    color: var(--error);
    border-color: var(--error-border);
    background: transparent;
}

.btn.danger:hover {
    background: var(--error-bg);
}

.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    filter: none;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

/* ───── Horizontal bars ───── */

.bar-row {
    display: grid;
    grid-template-columns: 160px 1fr 48px;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 13px;
}

.bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    height: 10px;
    background: var(--hover);
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--brand);
}

.bar-fill.tier-free {
    background: var(--muted);
}

.bar-fill.tier-premium {
    background: var(--brand);
}

.bar-fill.tier-business {
    background: var(--purple);
}

.bar-fill.tier-enterprise {
    background: #f59e0b;
}

.bar-pct {
    text-align: right;
    color: var(--text-secondary);
}

/* ───── Forms ───── */

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 13px;
    font-weight: 600;
}

.field input,
.field textarea,
.field select,
.status-select,
.search-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
}

.status-select {
    width: auto;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.status-select:focus,
.search-input:focus {
    outline: none;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 16px;
}

.form-feedback {
    font-size: 13px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
}

.search-input {
    width: 260px;
    max-width: 100%;
}

/* ───── Tables ───── */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.data-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ───── Pills ───── */

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--hover);
    border: 1px solid var(--border);
    color: var(--nav-text);
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

.pill.sev-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning);
}

.pill.sev-info {
    background: var(--brand-tint);
    border-color: var(--brand-ring);
    color: var(--brand);
}

.pill.pill-danger {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error);
}

.pill.pill-admin {
    background: var(--brand-tint);
    border-color: var(--brand-ring);
    color: var(--brand);
}

.pill.plan-premium {
    color: var(--brand);
}

.pill.plan-business {
    color: var(--purple);
}

.pill.plan-enterprise {
    color: var(--amber);
}

.pill.status-new {
    background: var(--brand-tint);
    border-color: var(--brand-ring);
    color: var(--brand);
}

.pill.status-in_progress {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning);
}

.pill.status-escalated {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error);
}

.pill.status-resolved {
    background: var(--success-bg);
    border-color: transparent;
    color: var(--success);
}

/* ───── List cards (tickets, users, partners) ───── */

.feedback-card,
.user-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.feedback-head,
.user-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

/* The customer's own one-line summary, captured by the in-app ticket form.
   Leads the queue card and the thread so the list scans by what the ticket is
   about rather than by five repeating category names. */
.ticket-subject {
    margin: 8px 0 2px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

/* As the thread's own heading it carries the page title's weight. */
h1.ticket-subject {
    margin: 14px 0 0;
    font-size: 20px;
}

.feedback-body {
    margin: 10px 0;
    white-space: pre-wrap;
    font-size: 14px;
}

.feedback-actions,
.user-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.user-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

/* ───── Ticket thread ───── */

.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0;
}

.ticket-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
}

.ticket-bubble-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.ticket-bubble-meta {
    margin-top: 6px;
}

.ticket-bubble.user {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.ticket-bubble.admin {
    align-self: flex-end;
    background: var(--brand);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ticket-bubble.admin .ticket-bubble-meta {
    color: rgb(255 255 255 / 75%);
}

.reply-composer {
    margin-top: 8px;
}

.reply-box {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font: inherit;
    font-size: 14px;
}

.reply-box:focus {
    outline: none;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

/* ───── Support console (toolbar, bulk bar, macros, notes) ───── */

.cs-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.cs-toolbar-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cs-bulk-bar {
    align-items: center;
    gap: 8px;
    background: var(--brand-tint);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.cs-select {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    flex-shrink: 0;
    cursor: pointer;
}

.cs-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cs-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cs-tag-input {
    width: 140px;
}

.cs-tag-x {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 13px;
    padding: 0 0 0 2px;
}

.cs-sla {
    margin: 8px 0 0;
}

.cs-macros,
.cs-internal {
    margin-bottom: 14px;
}

.cs-macro-form,
.cs-macro-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.cs-macro-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cs-macro-row .cs-macro-body {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs-note {
    background: var(--hover);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.cs-note-body {
    white-space: pre-wrap;
    font-size: 13px;
    margin-bottom: 4px;
}

.cs-attach-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: flex-start;
    max-width: 80%;
    margin: -4px 0 4px;
}

.cs-attach {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--brand);
    text-decoration: underline;
    word-break: break-all;
}

.cs-attach-img {
    max-width: 200px;
    max-height: 160px;
    border-radius: 8px;
    display: block;
}

.ticket-row {
    cursor: pointer;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ticket-row-main {
    flex: 1;
    min-width: 0;
}

/* ───── Moderation queue ───── */

.mod-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.mod-row-head {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 6px;
}

.mod-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 10px;
}

.badge-image {
    background: var(--error-bg);
    color: var(--error);
}

.badge-report {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-text {
    background: var(--brand-tint);
    color: var(--brand);
}

.badge-csam {
    background: #7f1d1d;
    color: #fff;
}

.mod-when {
    font-size: 12px;
    color: var(--text-secondary);
}

.mod-status {
    font-size: 12px;
    margin-left: auto;
}

.mod-status-open {
    color: var(--error);
    font-weight: 600;
}

.mod-status-resolved,
.mod-status-dismissed {
    color: var(--text-secondary);
}

.mod-line {
    font-size: 13px;
}

.mod-preview {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 4px;
}

.mod-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
    flex-wrap: wrap;
}

.mod-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* ───── Charts ───── */

.chart-wrap {
    margin: 6px 0 2px;
}

.chart-svg {
    display: block;
    width: 100%;
    height: auto;
}

.chart-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.chart-legend .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

/* ───── Announcement preview ───── */

.announce-preview {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--brand-ring);
    background: var(--brand-tint);
    font-size: 14px;
}

.announce-preview.sev-warning {
    border-color: var(--warning-border);
    background: var(--warning-bg);
}

.announce-preview .announce-title {
    font-weight: 600;
}

.announce-preview .announce-close {
    margin-left: auto;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
}

/* ───── Modal (confirm dialogs) ───── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgb(15 17 23 / 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: var(--shadow-modal);
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-body {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.modal-body strong {
    color: var(--text);
}

.modal .field {
    margin-top: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

/* ───── Toasts ───── */

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1100;
    max-width: min(360px, calc(100vw - 36px));
}

.toast {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.18s ease;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ───── Login page ───── */

body.login-page {
    background: var(--content-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: var(--shadow-lg);
}

.login-card .brand {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-bottom: 4px;
}

.login-card .brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.login-card .brand-tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand);
}

.login-card h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 24px;
}

.login-card .btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--hover);
}

.login-card .divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    margin: 20px 0;
}

.login-card .divider::before,
.login-card .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 14px 0 6px;
}

.login-card input {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
}

.login-card input:focus {
    outline: none;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

.login-card .submit {
    margin-top: 20px;
    background: var(--brand-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 2px 8px var(--brand-shadow);
}

.login-card .submit:hover {
    filter: brightness(1.05);
    box-shadow: 0 4px 12px var(--brand-shadow-hover);
}

.login-card .restricted-note {
    margin-top: 18px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

.error-message {
    display: none;
    margin-top: 16px;
    padding: 10px 14px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 10px;
    color: var(--error);
    font-size: 13px;
}

.error-message.active {
    display: block;
}

/* ───── Responsive ───── */

@media (width <= 720px) {
    .app {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        flex-flow: row wrap;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-y: visible;
    }

    .sidebar .brand {
        padding: 6px 10px;
    }

    #admin-nav {
        flex-flow: row wrap;
    }

    .nav-group-label {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }

    .main {
        overflow: visible;
    }

    .content {
        overflow-y: visible;
    }

    .topbar {
        height: auto;
        flex-wrap: wrap;
        padding: 8px 16px;
        gap: 8px;
    }

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