/* ── 1010Host ──────────────────────────────────────────────────
   Clean, flat, editorial aesthetic.
   Reference: Better Context / Stripe-like pricing layout.
   ──────────────────────────────────────────────────────────── */

:root {
    --black: #1a1a1a;
    --text: #37352f;
    --text-secondary: #6b6b6b;
    --text-muted: #9b9b9b;
    --border: #e8e8e8;
    --border-light: #f0f0f0;
    --bg: #ffffff;
    --bg-muted: #f7f7f5;
    --brand: #1a73e8;
    --brand-hover: #1557b0;
    --green: #2e7d32;
    --green-light: #e8f5e9;
    --red: #d32f2f;
    --red-light: #ffebee;
    --orange: #e65100;
    --orange-light: #fff3e0;
    --radius: 6px;
    --radius-lg: 10px;
    --radius-pill: 999px;
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 150ms, box-shadow 150ms, border-color 150ms;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}
.btn-primary:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--bg-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.btn-danger {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}
.btn-danger:hover {
    background: #b71c1c;
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 10px 22px; font-size: 14px; }
.btn-pill { border-radius: var(--radius-pill); }

/* ── Form ───────────────────────────────────────────────────── */
.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color 150ms, box-shadow 150ms;
}
.form-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.form-input::placeholder { color: var(--text-muted); }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}
.form-group { margin-bottom: 16px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }

textarea.form-input { min-height: 90px; resize: vertical; }
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b6b6b' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

/* ── Pricing Card ───────────────────────────────────────────── */
.pricing-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    position: relative;
}
.pricing-card.featured {
    border-color: var(--brand);
}

/* ── Badge ──────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
}
.badge-success { background: var(--green-light); color: var(--green); }
.badge-warning { background: var(--orange-light); color: var(--orange); }
.badge-danger  { background: var(--red-light); color: var(--red); }
.badge-info    { background: #e3f2fd; color: var(--brand); }
.badge-gray    { background: var(--bg-muted); color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Table ──────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}
.data-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-muted); }

.list-focus-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.list-focus-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 120ms ease;
}

.list-focus-chip:hover {
    background: #dbeafe;
}

.list-focus-chip.is-active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.list-focus-chip--warn {
    border-color: #fde68a;
    background: #fffbeb;
    color: #b45309;
}

.list-focus-chip--warn:hover {
    background: #fef3c7;
}

.list-focus-chip--warn.is-active {
    background: #b45309;
    border-color: #b45309;
    color: #fff;
}

.list-focus-chip--danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.list-focus-chip--danger:hover {
    background: #fee2e2;
}

.list-focus-chip--danger.is-active {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.list-focus-chip--muted {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text-secondary);
}

.data-table tbody tr.order-tone-active td {
    background: #f0fdf4;
}

.data-table tbody tr.order-tone-recent td,
.data-table tbody tr.ticket-tone-recent td {
    background: #f8fbff;
}

.data-table tbody tr.order-tone-risk td,
.data-table tbody tr.ticket-tone-priority td,
.data-table tbody tr.ticket-tone-reply td,
.data-table tbody tr.ticket-tone-update td {
    background: #fff8f5;
}

.data-table tbody tr.ticket-tone-update td {
    background: #fff9f1;
}

.data-table tbody tr.order-tone-active td:first-child {
    box-shadow: inset 3px 0 0 #16a34a;
}

.data-table tbody tr.order-tone-recent td:first-child,
.data-table tbody tr.ticket-tone-recent td:first-child {
    box-shadow: inset 3px 0 0 #2563eb;
}

.data-table tbody tr.order-tone-risk td:first-child,
.data-table tbody tr.ticket-tone-priority td:first-child,
.data-table tbody tr.ticket-tone-reply td:first-child,
.data-table tbody tr.ticket-tone-update td:first-child,
.data-table tbody tr.is-priority-row td:first-child,
.data-table tbody tr.is-attention-row td:first-child {
    box-shadow: inset 3px 0 0 #ea580c;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 120ms, color 120ms;
}
.sidebar-link:hover { background: var(--bg-muted); color: var(--text); }
.sidebar-link.active { background: #e3f2fd; color: var(--brand); }
.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Layout ─────────────────────────────────────────────────── */
.dashboard-layout { display: flex; min-height: 100vh; }
.dashboard-sidebar {
    width: 240px;
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.dashboard-main { flex: 1; background: var(--bg-muted); min-height: 100vh; }
.dashboard-content { padding: 28px; max-width: 1200px; width: 100%; margin: 0 auto; }

.dashboard-chart {
    width: 100%;
    min-height: 260px;
}

@media (max-width: 768px) {
    .dashboard-chart {
        min-height: 240px;
    }
}

/* ── Status ─────────────────────────────────────────────────── */
.status-open        { color: var(--brand); }
.status-in_progress { color: var(--orange); }
.status-resolved    { color: var(--green); }
.status-closed      { color: var(--text-muted); }
.status-pending     { color: var(--orange); }
.status-active      { color: var(--green); }
.status-cancelled   { color: var(--red); }
.status-expired     { color: var(--text-muted); }

/* ── Messages ───────────────────────────────────────────────── */
.message-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    line-height: 1.6;
}
.message-bubble.own {
    background: var(--brand);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 3px;
}
.message-bubble.other {
    background: var(--bg-muted);
    color: var(--text);
    border-bottom-left-radius: 3px;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    animation: slideIn 200ms ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 260px;
}
.toast-success { background: var(--green); color: #fff; }
.toast-error   { background: var(--red); color: #fff; }
.toast-warning { background: var(--orange); color: #fff; }
.toast-info    { background: var(--brand); color: #fff; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(2px);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
    padding: 28px;
    max-width: 440px;
    width: 90%;
    animation: fadeUp 200ms ease-out;
}

/* ── Stat Card ──────────────────────────────────────────────── */
.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state svg { width: 36px; height: 36px; margin: 0 auto 12px; opacity: 0.3; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.animate-fade-in-up { animation: fadeUp 0.4s ease-out both; }
.animate-fade-in    { animation: fadeIn 0.3s ease-out both; }
.animate-shake      { animation: shake 0.3s ease-in-out; }

.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 50ms; }
.stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 250ms; }

.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Prose (Markdown Content) ───────────────────────────────── */
.prose {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
}
.prose h1 {
    font-size: 2em;
    font-weight: 800;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.2;
    color: var(--black);
}
.prose h2 {
    font-size: 1.5em;
    font-weight: 700;
    margin-top: 1.75em;
    margin-bottom: 0.5em;
    line-height: 1.25;
    color: var(--black);
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-light);
}
.prose h3 {
    font-size: 1.25em;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.4em;
    line-height: 1.3;
    color: var(--black);
}
.prose h4 {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 1.25em;
    margin-bottom: 0.4em;
    color: var(--text);
}
.prose p {
    margin-bottom: 1em;
}
.prose a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.prose a:hover {
    color: var(--brand-hover);
}
.prose strong {
    font-weight: 700;
    color: var(--black);
}
.prose em {
    font-style: italic;
}
.prose ul, .prose ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li {
    margin-bottom: 0.35em;
}
.prose li::marker {
    color: var(--text-muted);
}
.prose blockquote {
    border-left: 3px solid var(--brand);
    padding: 0.75em 1em;
    margin: 1em 0;
    background: var(--bg-muted);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-secondary);
    font-style: italic;
}
.prose pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 1em 1.25em;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1em 0;
    font-size: 13px;
    line-height: 1.6;
}
.prose code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875em;
}
.prose p code, .prose li code {
    background: var(--bg-muted);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    border: 1px solid var(--border-light);
    font-size: 0.85em;
    color: var(--red);
}
.prose hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2em 0;
}
.prose table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.25em 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    font-size: 14px;
}
.prose thead th {
    text-align: left;
    padding: 12px 14px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border);
}
.prose tbody td {
    padding: 13px 14px;
    vertical-align: top;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.prose tbody tr:nth-child(even) td {
    background: #fcfcfd;
}
.prose tbody tr:last-child td {
    border-bottom: none;
}
.prose th + th,
.prose td + td {
    border-left: 1px solid var(--border-light);
}
.prose table code {
    font-size: 0.82em;
}
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }

/* ── App Marquee ────────────────────────────────────────────── */
.app-marquee-wrapper {
    position: relative;
}

.app-marquee {
    position: relative;
    overflow: hidden;
}

.app-marquee-track {
    display: flex;
    align-items: center;
    gap: 0;
    width: max-content;
}

.app-marquee-track .app-pill {
    margin-right: 12px;
}

.app-marquee-ltr {
    animation: marquee-ltr 45s linear infinite;
}

.app-marquee-rtl {
    animation: marquee-rtl 45s linear infinite;
}

.app-marquee:hover .app-marquee-track {
    animation-play-state: paused;
}

@keyframes marquee-ltr {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes marquee-rtl {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.app-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px 7px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
    cursor: default;
}

.app-pill:hover {
    border-color: #c0c0c0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.app-pill-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.app-pill:hover .app-pill-icon {
    color: var(--data-color, var(--text));
}

.app-pill-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    transition: color 0.25s ease;
}

.app-pill:hover .app-pill-name {
    color: var(--text);
}

@media (max-width: 768px) {
    .app-marquee-ltr { animation-duration: 30s; }
    .app-marquee-rtl { animation-duration: 30s; }
    .app-pill {
        padding: 5px 11px 5px 8px;
        gap: 5px;
    }
    .app-pill-icon { width: 15px; height: 15px; }
    .app-pill-name { font-size: 11px; }
}

/* ── Infrastructure Cards ───────────────────────────────────── */
.infra-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.infra-card:hover {
    border-color: #d0d0d0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    transform: translateY(-2px);
}

.infra-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #eef4ff;
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Infrastructure Chips (homepage strip) ─────────────────── */
.infra-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    border: 1px solid #d8e1ec;
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    font-size: 11px;
    font-weight: 600;
    color: #3b4656;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 1px 2px rgba(15,23,42,0.06);
    transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.infra-chip i,
.infra-chip svg {
    color: var(--brand);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    padding: 2px;
    border-radius: 999px;
    background: rgba(26,115,232,0.11);
}

.infra-chip:hover {
    border-color: #b9cbe5;
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 4px 14px rgba(26,115,232,0.14);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .infra-chip {
        padding: 5px 10px 5px 7px;
        font-size: 10px;
        gap: 6px;
    }
    .infra-chip i,
    .infra-chip svg {
        width: 14px;
        height: 14px;
        padding: 2px;
    }
}

/* ── Glow Card (Interactive Gradient) ──────────────────────── */
.glow-card {
    position: relative;
    overflow: hidden;
}
.glow-card .glow-blob {
    opacity: 0.7;
    z-index: 0;
    pointer-events: none;
}

/* ── Frontend Mobile Menu Overlay ───────────────────────────── */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
    visibility: hidden;
}

.mobile-menu-overlay.active {
    pointer-events: auto;
    visibility: visible;
}

.mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active .mobile-menu-backdrop {
    opacity: 1;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    padding: 80px 28px 28px;
    transform: translateY(-100%);
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    max-height: 100vh;
    overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu-panel {
    transform: translateY(0);
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    /* Staggered animation */
    opacity: 0;
    transform: translateY(-8px);
}

.mobile-menu-overlay.active .mobile-menu-link {
    opacity: 1;
    transform: translateY(0);
    transition: background 0.15s ease, color 0.15s ease,
                opacity 0.3s ease calc(var(--delay, 0) * 50ms + 100ms),
                transform 0.3s ease calc(var(--delay, 0) * 50ms + 100ms);
}

/* Reverse animation when closing */
.mobile-menu-overlay.closing .mobile-menu-panel {
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.55, 0, 1, 0.45);
}

.mobile-menu-overlay.closing .mobile-menu-backdrop {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-menu-overlay.closing .mobile-menu-link {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.mobile-menu-overlay.closing .mobile-menu-footer {
    opacity: 0;
    transition: opacity 0.1s ease;
}

.mobile-menu-link i,
.mobile-menu-link svg {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.mobile-menu-link:hover,
.mobile-menu-link:active {
    background: var(--bg-muted);
}

.mobile-menu-link:hover i,
.mobile-menu-link:hover svg {
    color: var(--brand);
}

.mobile-menu-link-danger {
    color: var(--red);
}

.mobile-menu-link-danger i,
.mobile-menu-link-danger svg {
    color: var(--red) !important;
}

.mobile-menu-link-cta {
    background: var(--brand);
    color: #fff;
    margin-top: 6px;
    justify-content: center;
}

.mobile-menu-link-cta i,
.mobile-menu-link-cta svg {
    color: #fff !important;
}

.mobile-menu-link-cta:hover,
.mobile-menu-link-cta:active {
    background: var(--brand-hover);
}

.mobile-menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 14px;
    opacity: 0;
}

.mobile-menu-overlay.active .mobile-menu-divider {
    opacity: 1;
    transition: opacity 0.3s ease calc(var(--delay, 0) * 50ms + 100ms);
}

.mobile-menu-footer {
    text-align: center;
    padding-top: 20px;
    margin-top: 16px;
    border-top: 1px solid var(--border-light);
    opacity: 0;
    transition: opacity 0.3s ease 0.35s;
}

.mobile-menu-overlay.active .mobile-menu-footer {
    opacity: 1;
}

/* Hamburger icon flip animation */
.mobile-icon-open,
.mobile-icon-close {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-icon-close {
    opacity: 0;
    transform: scale(0.75) rotate(-90deg);
    position: absolute;
}

.mobile-toggle-active .mobile-icon-open {
    opacity: 0;
    transform: scale(0.75) rotate(90deg);
}

.mobile-toggle-active .mobile-icon-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* ── Sidebar Backdrop (Dashboard & Admin mobile) ───────────── */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9989;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* Sidebar icon flip */
.sidebar-icon-open,
.sidebar-icon-close {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sidebar-icon-close {
    opacity: 0;
    transform: scale(0.75) rotate(-90deg);
}

.sidebar-toggle-active .sidebar-icon-open {
    opacity: 0;
    transform: scale(0.75) rotate(90deg);
}

.sidebar-toggle-active .sidebar-icon-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .dashboard-sidebar {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 9990;
        width: 270px;
        max-width: 85vw;
        box-shadow: 8px 0 24px rgba(0,0,0,0.08);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    }
    .dashboard-sidebar.mobile-open {
        transform: translateX(0);
    }
    .dashboard-content { padding: 16px; }
}

@media (min-width: 769px) {
    .mobile-menu-overlay { display: none !important; }
    .sidebar-backdrop { display: none !important; }
}
