/* ================================================================
    Costrack — Clear professional dashboard theme
    ================================================================ */

:root {
    --c-bg:           #f3f6fc;
    --c-surface:      #ffffff;
    --c-surface-2:    #f7f9fe;
    --c-surface-3:    #eaf0fa;
    --c-border:       #e2e8f3;
    --c-border-dim:   #edf1f7;
    --c-border-hi:    #c9d6ef;

    --c-text:         #202b42;
    --c-muted:        #5f6b82;   /* 4.5:1 sur --c-bg (WCAG AA, Phase 8) */
    --c-muted-2:      #9aa7ba;

    --c-accent:       #3b5ddf;   /* 4.5:1 sur ses propres teintes */
    --c-accent-dark:  #2d4fd2;
    --c-accent-dim:   rgba(63, 99, 237, 0.10);
    --c-accent-glow:  rgba(63, 99, 237, 0.22);
    --c-accent-nav:   rgba(63, 99, 237, 0.12);

    --c-nav:          #ffffff;
    --c-nav-text:     #202b42;
    --c-nav-muted:    #5f6b82;
    --c-nav-hover:    #f1f4ff;
    --c-nav-active:   #e9edff;

    --c-danger:       #c0392b;
    --c-danger-bg:    #fff0f1;
    --c-warning:      #985a12;
    --c-warning-bg:   #fff6e9;
    --c-success:      #047857;   /* statuts : lisibles en texte sur blanc et sur leur fond */
    --c-success-bg:   #e9f9f3;
    --c-info:         #3b5ddf;
    --c-info-bg:      #edf1ff;
    --c-purple:       #7254d2;
    --c-purple-bg:    #f0edff;
    --c-muted-bg:     #f3f5f8;
    --c-orange:       #a45630;

    /* ── GA alias variables (keep for backward compat with Tailwind) */
    --ga-blue:        var(--c-accent);
    --ga-blue-dark:   var(--c-accent-dark);
    --ga-blue-light:  var(--c-accent-dim);
    --ga-bg:          var(--c-bg);
    --ga-surface:     var(--c-surface);
    --ga-border:      var(--c-border);
    --ga-text:        var(--c-text);
    --ga-muted:       var(--c-muted);
    --ga-hover:       var(--c-surface-2);
    --ga-nav:         var(--c-nav);
    --ga-green:       var(--c-success);
    --ga-green-bg:    var(--c-success-bg);
    --ga-red:         var(--c-danger);
    --ga-red-bg:      var(--c-danger-bg);
    --ga-yellow:      var(--c-warning);
    --ga-yellow-bg:   var(--c-warning-bg);
    --ga-purple:      var(--c-purple);
    --ga-orange:      var(--c-orange);

    /* ── Spacing ───────────────────────────────────────────────── */
    --sidebar-collapsed: 56px;
    --sidebar-expanded:  240px;
    --header-height:     60px;

    /* ── Typography ────────────────────────────────────────────── */
    --font-ui:   'Onest', 'DM Sans', sans-serif;
    --font-mono: 'Jost', sans-serif;
    --font-sans: var(--font-ui);

    /* ── Motion ────────────────────────────────────────────────── */
    --tr-fast:   150ms ease;
    --tr-normal: 250ms ease;
    --tr-slow:   350ms ease;
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
    min-height: 100%;
    font-family: var(--font-ui);
    background: var(--c-bg);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(63, 99, 237, 0.22); color: var(--c-text); }

:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 3px;
}

/* ── Typography ─────────────────────────────────────────────── */
.page-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--c-text);
    letter-spacing: -0.2px;
    font-family: var(--font-ui);
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    letter-spacing: 0.1px;
}

.label-sm {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-muted);
    font-family: var(--font-mono);
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

/* ── GA Cards ───────────────────────────────────────────────── */
.ga-card {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.07);
    transition: border-color var(--tr-normal), box-shadow var(--tr-normal);
}

.ga-card:hover {
    border-color: rgba(0,0,0,0.11);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.ga-card-elevated {
    background: var(--c-surface);
    border-radius: 10px;
    border: 1px solid var(--c-border);
    box-shadow: 0 4px 20px rgba(28,26,23,0.08), 0 1px 3px rgba(28,26,23,0.06);
}

/* ── Stat Cards (like GA metric cards) ─────────────────────── */
.stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border-dim);
    border-radius: 10px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color var(--tr-normal), box-shadow var(--tr-normal), transform var(--tr-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--c-accent), transparent);
    opacity: 0;
    transition: opacity var(--tr-normal);
}

.stat-card:hover {
    border-color: var(--c-border-hi);
    box-shadow: 0 8px 24px rgba(28,26,23,0.10), 0 0 0 1px var(--c-border-dim);
    transform: translateY(-1px);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card__label {
    font-size: 10px;
    font-weight: 600;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

.stat-card__value {
    font-size: 30px;
    font-weight: 700;
    color: var(--c-text);
    letter-spacing: -1px;
    line-height: 1.1;
    font-family: var(--font-mono);
}

.stat-card__delta {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    font-family: var(--font-mono);
}

.stat-card__delta--up   { color: var(--c-success); }
.stat-card__delta--down { color: var(--c-danger); }

/* ── GA Tables ──────────────────────────────────────────────── */
.ga-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: var(--font-ui);
}

.ga-table thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--c-muted);
    border-bottom: 1px solid rgba(0,0,0,0.07);
    white-space: nowrap;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    position: sticky;
    top: 0;
    z-index: 1;
    font-family: var(--font-mono);
}

.ga-table tbody tr {
    border-bottom: 1px solid var(--c-border-dim);
    transition: background var(--tr-fast);
    cursor: pointer;
}

.ga-table tbody tr:last-child { border-bottom: none; }

.ga-table tbody tr:hover {
    background: var(--c-surface-2);
}

.ga-table tbody td {
    padding: 11px 16px;
    color: var(--c-text);
    vertical-align: middle;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 16px;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .1px;
    cursor: pointer;
    transition: background var(--tr-fast), box-shadow var(--tr-fast),
                opacity var(--tr-fast), transform var(--tr-fast);
    border: none;
    outline: none;
    white-space: nowrap;
    text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--c-accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--c-accent-dark);
    box-shadow: 0 2px 12px var(--c-accent-glow);
}

.btn-secondary {
    background: var(--c-surface);
    color: var(--c-text);
    border: 1px solid var(--c-border);
}
.btn-secondary:hover {
    background: var(--c-surface-2);
    border-color: var(--c-border-hi);
}

.btn-danger {
    background: transparent;
    color: var(--c-danger);
    border: 1px solid var(--c-border);
}
.btn-danger:hover {
    background: var(--c-danger-bg);
    border-color: var(--c-danger);
}

.btn-ghost {
    background: transparent;
    color: var(--c-accent);
    border: 1px solid var(--c-accent-dim);
}
.btn-ghost:hover {
    background: var(--c-accent-dim);
    box-shadow: 0 2px 8px var(--c-accent-glow);
}

.btn-icon {
    height: 34px;
    width: 34px;
    padding: 0;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--tr-fast), border-color var(--tr-fast);
    color: var(--c-muted);
}
.btn-icon:hover {
    background: var(--c-surface-2);
    border-color: var(--c-border);
    color: var(--c-text);
}

/* ── Form inputs ─────────────────────────────────────────────── */
.ga-input, .ga-select, .ga-textarea {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--c-text);
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast),
                background var(--tr-fast);
    outline: none;
}

.ga-textarea {
    height: auto;
    padding: 8px 12px;
    resize: vertical;
}

.ga-input:focus, .ga-select:focus, .ga-textarea:focus {
    border-color: var(--c-accent);
    background: var(--c-surface);
    box-shadow: 0 0 0 3px var(--c-accent-dim), 0 1px 4px rgba(154,140,103,0.08);
}

.ga-input::placeholder { color: var(--c-muted-2); }
.ga-input[readonly]    {
    background: var(--c-surface-2);
    cursor: not-allowed;
    color: var(--c-muted);
}

/* Select arrow */
.ga-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6460' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

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

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-family: var(--font-mono);
}

/* ── Modal ──────────────────────────────────────────────────── */
.ga-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px;
    overflow-y: auto;
}

.ga-modal__box {
    background: var(--c-surface);
    border-radius: 12px;
    width: 100%;
    max-width: 680px;
    border: 1px solid var(--c-border);
    box-shadow: 0 20px 60px rgba(28,26,23,0.18), 0 4px 16px rgba(28,26,23,0.08);
    animation: modal-in .2s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.ga-modal__box--wide { max-width: 900px; }
.ga-modal__box--narrow { max-width: 480px; }

@keyframes modal-in {
    from { opacity: 0; transform: translateY(-8px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ga-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--c-border-dim);
}

.ga-modal__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--c-text);
}

.ga-modal__body    { padding: 24px; }
.ga-modal__footer  {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--c-border-dim);
    background: var(--c-surface-2);
    border-radius: 0 0 12px 12px;
}

/* ── ga-modal hyphen aliases (settings tabs) ────────────────── */
.ga-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28,26,23,0.45);
}
.ga-modal-box     { background: var(--c-surface); border-radius: 12px; border: 1px solid var(--c-border); box-shadow: 0 20px 60px rgba(28,26,23,0.18), 0 4px 16px rgba(28,26,23,0.08); animation: modal-in .2s cubic-bezier(0.34,1.2,0.64,1); position: relative; z-index: 1; }
.ga-modal-header  { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--c-border-dim); }
.ga-modal-title   { font-size: 15px; font-weight: 600; color: var(--c-text); }
.ga-modal-close   { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: var(--c-muted); transition: background .15s, color .15s; }
.ga-modal-close:hover { background: var(--c-surface-2); color: var(--c-text); }
.ga-modal-body    { padding: 24px; }
.ga-modal-footer  { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--c-border-dim); background: var(--c-surface-2); border-radius: 0 0 12px 12px; }

/* ── Status Badges (reservations) ───────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .5px;
    white-space: nowrap;
    text-transform: uppercase;
    font-family: var(--font-mono);
}


/* ── Toggle Switch ──────────────────────────────────────────── */
.toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--c-border);
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--tr-fast), box-shadow var(--tr-fast);
}
.toggle input:checked + .toggle-track {
    background: var(--c-accent);
    box-shadow: 0 1px 6px var(--c-accent-glow);
}
.toggle-track::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
    transition: transform var(--tr-fast);
}
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }

/* ── Tab navigation (settings pages) ───────────────────────── */
.ga-tabs {
    display: flex;
    border-bottom: 1px solid var(--c-border-dim);
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.ga-tabs::-webkit-scrollbar { display: none; }

.ga-tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--c-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--tr-fast), border-color var(--tr-fast);
    text-decoration: none;
    font-family: var(--font-ui);
}
.ga-tab:hover { color: var(--c-text); }
.ga-tab.active {
    color: var(--c-accent);
    border-bottom-color: var(--c-accent);
}

/* ── Toast notifications ────────────────────────────────────── */
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    box-shadow: 0 8px 32px rgba(28,26,23,0.14), 0 2px 6px rgba(28,26,23,0.08);
    font-size: 13px;
    font-weight: 500;
    min-width: 240px;
    max-width: 400px;
    pointer-events: all;
    color: var(--c-text);
    animation: toast-in .2s ease, toast-out .2s ease 3.8s forwards;
}
.toast-success { border-left: 3px solid var(--c-accent); }
.toast-error   { border-left: 3px solid var(--c-danger); }
.toast-info    { border-left: 3px solid var(--c-info); }

@keyframes toast-in  { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; transform: translateY(8px); } }

/* ── Loading skeleton ───────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--c-surface-2) 25%, var(--c-border-dim) 50%, var(--c-surface-2) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s infinite;
    border-radius: 4px;
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Scrollbar (global slimmer) ─────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-border-hi); }

/* ── Utility: visually-hidden ───────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── Page load stagger animation ────────────────────────────── */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.stagger-children > * {
    animation: fade-up 0.35s ease both;
}
.stagger-children > *:nth-child(1)  { animation-delay: 0ms; }
.stagger-children > *:nth-child(2)  { animation-delay: 50ms; }
.stagger-children > *:nth-child(3)  { animation-delay: 100ms; }
.stagger-children > *:nth-child(4)  { animation-delay: 150ms; }
.stagger-children > *:nth-child(5)  { animation-delay: 200ms; }
.stagger-children > *:nth-child(6)  { animation-delay: 250ms; }
.stagger-children > *:nth-child(7)  { animation-delay: 300ms; }
.stagger-children > *:nth-child(n+8){ animation-delay: 350ms; }

.animate-fade-up {
    animation: fade-up 0.4s ease both;
}

/* ── Subtle accent shadow ───────────────────────────────────── */
.glow-accent {
    box-shadow: 0 2px 12px var(--c-accent-glow);
}

.text-accent   { color: var(--c-accent); }
.text-muted    { color: var(--c-muted); }
.text-danger   { color: var(--c-danger); }
.text-warning  { color: var(--c-warning); }

/* ── Terminal / code inline ─────────────────────────────────── */
.code-inline {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border-dim);
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--c-accent);
}
/* ── Glass utilities (shared across all pages) ────────────────── */

/* Metric / stat chip card */
.ga-glass-card {
    background: rgba(255,255,255,0.90);
    backdrop-filter: blur(22px) saturate(165%) brightness(1.01);
    -webkit-backdrop-filter: blur(22px) saturate(165%) brightness(1.01);
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: none;
    transition: transform 220ms var(--ease-spring), background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.ga-glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.9) 38%, rgba(255,255,255,0.9) 62%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}
.ga-glass-card > * { position: relative; z-index: 1; }
.ga-glass-card:hover {
    transform: translateY(-5px) scale(1.018);
    background: rgba(244,244,244,0.95);
    border-color: rgba(0,0,0,0.11);
    box-shadow:
        0 4px 16px rgba(28,26,23,0.06),
        0 1px 4px rgba(28,26,23,0.03);
}
/* Color tint overlay — add <span class="ga-glass-card-accent"> as first child */
.ga-glass-card-accent {
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, var(--stat-accent, transparent) 0%, transparent 52%);
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}

/* Section / group container card */
.ga-glass-section {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.92);
    border-bottom: 1px solid rgba(221,217,210,0.55);
    border-radius: 14px;
    box-shadow: none;
    overflow: hidden;
    transition: box-shadow 250ms ease, transform 250ms ease;
    margin-bottom: 16px;
}
.ga-glass-section:hover {
    box-shadow:
        0 4px 16px rgba(28,26,23,0.06),
        0 1px 4px rgba(28,26,23,0.03);
    transform: translateY(-1px);
}

/* Floating dropdown (context menus, status pickers) */
.ga-glass-dropdown {
    background: rgba(255,255,255,0.92) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow:
        0 12px 44px rgba(0,0,0,0.10),
        0 3px 12px rgba(0,0,0,0.06),
        inset 0 1px 0 rgba(255,255,255,0.95) !important;
}

/* Tag pill with color-keyed border (use with inline style for color) */
.ga-tag-pill {
    border-width: 1px;
    border-style: solid;
}

/* Table / list row with status left-edge accent */
.ga-accent-row {
    transition: background 120ms ease, box-shadow 140ms ease;
    border-left-style: solid;
    border-left-width: 3px;
}
.ga-accent-row:hover {
    background: color-mix(in srgb, var(--row-accent, #9a8c67) 4%, transparent) !important;
    box-shadow: inset 4px 0 20px var(--row-color, rgba(154,140,103,0.10));
}

/* Mobile card list item with status left-edge accent */
.ga-accent-card {
    transition: background 120ms ease, box-shadow 140ms ease;
    border-left-style: solid;
    border-left-width: 3px;
    border-radius: 0;
}
.ga-accent-card:hover {
    background: color-mix(in srgb, var(--row-accent, #9a8c67) 4%, transparent) !important;
    box-shadow: inset 4px 0 20px var(--row-color, rgba(154,140,103,0.10));

}

/* Animated time / status pill badge */
.ga-time-badge {
    transition: transform 150ms var(--ease-spring), box-shadow 150ms ease;
}
.ga-accent-row:hover .ga-time-badge,
.ga-accent-card:hover .ga-time-badge {
    transform: scale(1.1) translateY(-1px);
}
/* ── Sidebar — frosted glass ───────────────────────────────── */
#sidebar {
    border-right: 1px solid rgba(0,0,0,0.07) !important;
}

/* ── Page content area ──────────────────────────────────────── */


/* ── Header — frosted glass ─────────────────────────────────── */
header {
    backdrop-filter: blur(20px) saturate(180%) brightness(1.02) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(1.02) !important;
}

/* ── Dropdown menus — frosted glass ─────────────────────────── */
#restaurant-menu,
#user-menu {
    background: rgba(255,255,255,0.88) !important;
    backdrop-filter: blur(20px) saturate(180%) brightness(1.02) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(1.02) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.09), 0 2px 8px rgba(0,0,0,0.05) !important;
}

/* ── Modal backdrop ─────────────────────────────────────────── */
#modal-backdrop {
    background: rgba(28,26,23,0.5);
    backdrop-filter: blur(4px);
}

/* ── Quill editor light override ────────────────────────────── */
.ql-toolbar {
    background: var(--c-surface-2) !important;
    border-color: var(--c-border) !important;
    border-radius: 6px 6px 0 0;
}
.ql-container {
    background: var(--c-surface) !important;
    border-color: var(--c-border) !important;
    color: var(--c-text) !important;
    border-radius: 0 0 6px 6px;
    font-family: var(--font-ui) !important;
}
.ql-editor { color: var(--c-text) !important; }
.ql-toolbar .ql-stroke { stroke: var(--c-muted) !important; }
.ql-toolbar .ql-fill   { fill:   var(--c-muted) !important; }
.ql-toolbar button:hover .ql-stroke { stroke: var(--c-accent) !important; }


/* ── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 768px) {
    .ga-modal { padding: 16px; }
    .ga-modal__box { max-width: 100%; }
}


/* -- Analytics   Themed Report Sections ----------------------- */
.ana-section-wrap {
    border: 1px solid var(--c-border-dim);
    border-radius: 10px;
    overflow: hidden;
    background: var(--c-surface);
}

.ana-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    cursor: pointer;
    background: var(--c-surface-2);
    border-bottom: 1px solid var(--c-border-dim);
    transition: background var(--tr-fast);
    user-select: none;
    list-style: none;
    border: none;
    width: 100%;
    text-align: left;
}

.ana-section-header:hover {
    background: var(--c-surface-3);
}

.ana-section-icon {
    font-size: 18px;
    color: var(--c-accent);
    flex-shrink: 0;
}

.ana-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text);
    font-family: var(--font-ui);
    flex: 1;
}

.ana-section-sub {
    color: var(--c-muted-2);
    font-size: 10px;
}

.ana-section-chevron {
    font-size: 18px;
    color: var(--c-muted-2);
    transition: transform var(--tr-normal);
    flex-shrink: 0;
}

.ana-section-chevron.collapsed {
    transform: rotate(-90deg);
}

.ana-section-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ana-section-body.hidden {
    display: none;
}

.ana-topic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ana-chart-wrap {
    position: relative;
    height: 230px;
}

.ana-chart-wrap--tall {
    height: 280px;
}

.ana-chart-wrap--short {
    height: 180px;
}

.ana-toggle {
    font-size: 10px;
    font-weight: 600;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: transparent;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    padding: 3px 9px;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: background var(--tr-fast), color var(--tr-fast), border-color var(--tr-fast);
    flex-shrink: 0;
}

.ana-toggle:hover {
    background: var(--c-surface-2);
    color: var(--c-text);
    border-color: var(--c-border-hi);
}

.ana-table-wrap {
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid var(--c-border-dim);
    margin-top: 8px;
}

.ana-table-wrap.hidden {
    display: none;
}

/* Retention stat large number */
.ana-retention-pct {
    font-size: 44px;
    font-weight: 800;
    color: var(--c-accent);
    font-family: var(--font-mono);
    letter-spacing: -2px;
    line-height: 1;
}

/* No-show rate colour coding in tables */
.rate-high   { color: var(--c-danger);  font-weight: 600; }
.rate-medium { color: var(--c-warning); font-weight: 600; }
.rate-low    { color: var(--c-success); }

/* Loading state */
.ana-loading-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--c-accent), var(--c-info), transparent);
    background-size: 200% 100%;
    animation: ana-bar-slide 1.2s linear infinite;
    border-radius: 0 0 10px 10px;
    width: 100%;
    opacity: 0;
    transition: opacity var(--tr-fast);
    pointer-events: none;
}
.ana--loading .ana-loading-bar {
    opacity: 1;
}
@keyframes ana-bar-slide {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ana--loading .stat-card__value,
.ana--loading .stat-card__delta,
.ana--loading .ana-section-sub {
    color: transparent !important;
    background: linear-gradient(90deg, var(--c-surface-2) 25%, var(--c-border-dim) 50%, var(--c-surface-2) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: 4px;
    pointer-events: none;
    user-select: none;
}

.ana--loading .ana-section-sub {
    min-width: 80px;
    display: inline-block;
}

.ana--loading canvas {
    opacity: 0.25;
    transition: opacity var(--tr-normal);
}

.ana--loading .btn-primary[data-ana-apply] {
    opacity: 0.6;
    pointer-events: none;
    cursor: wait;
}

/* ── Top Findings Banner ────────────────────────────────────── */
.ana-findings-banner {
    background: var(--c-surface);
    border: 1px solid var(--c-border-dim);
    border-left: 3px solid var(--c-accent);
    border-radius: 10px;
    overflow: hidden;
}

.ana-findings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    background: var(--c-surface-2);
    border-bottom: 1px solid var(--c-border-dim);
}

.ana-findings-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: var(--font-mono);
    flex: 1;
}

.ana-findings-period {
    font-size: 10px;
    color: var(--c-muted-2);
    font-family: var(--font-mono);
}

.ana-findings-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 4px 0;
}

.ana-finding-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 16px;
    font-size: 13px;
    color: var(--c-text);
    border-bottom: 1px solid var(--c-border-dim);
    width: 100%;
    line-height: 1.4;
    transition: background var(--tr-fast);
}

.ana-finding-item:last-child { border-bottom: none; }

.ana-finding-item:hover { background: var(--c-surface-2); }

.ana-finding-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.ana-finding-icon--up      { color: var(--c-success); }
.ana-finding-icon--down    { color: var(--c-danger); }
.ana-finding-icon--warning { color: var(--c-warning); }
.ana-finding-icon--neutral { color: var(--c-muted-2); }
.ana-finding-icon--info    { color: var(--c-info); }

.ana-finding-text strong { font-weight: 600; }
.ana-finding-text em { font-style: normal; color: var(--c-muted); font-size: 12px; }

/* ── Health badges on stat cards ────────────────────────────── */
.ana-health-badge {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    line-height: 1.6;
    display: none;
}

.ana-health-badge.on-track  { display: inline-block; background: var(--c-success-bg); color: var(--c-success); }
.ana-health-badge.watch     { display: inline-block; background: var(--c-warning-bg); color: var(--c-warning); }
.ana-health-badge.action    { display: inline-block; background: var(--c-danger-bg);  color: var(--c-danger); }

/* ── Insight callout cards ──────────────────────────────────── */
.ana-insight-callout {
    background: linear-gradient(135deg, rgba(194,128,52,0.06) 0%, transparent 60%);
    border: 1px solid var(--c-border-dim);
    border-left: 3px solid var(--c-accent);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ana-insight-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--c-muted);
    line-height: 1.45;
}

.ana-insight-item .material-icons {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.ana-insight-item strong { color: var(--c-text); font-weight: 600; }

/* ── Trend narrative micro-label ────────────────────────────── */
.ana-trend-narrative {
    font-size: 11px;
    color: var(--c-muted-2);
    font-family: var(--font-mono);
    padding: 6px 2px 2px;
    display: none;
    gap: 4px;
    align-items: center;
}

.ana-trend-narrative.visible { display: flex; }
.ana-trend-narrative .material-icons { font-size: 13px; }

/* ── KPI tooltip icon ───────────────────────────────────────── */
.ana-tip-icon {
    font-size: 11px;
    color: var(--c-muted-2);
    cursor: help;
    line-height: 1;
    flex-shrink: 0;
    transition: color var(--tr-fast);
}

.ana-tip-icon:hover { color: var(--c-accent); }

/* ── Best/worst row highlight in tables ─────────────────────── */
.ana-row-best td:first-child::before {
    content: '\1F525';
    margin-right: 5px;
    font-size: 11px;
}

.ana-row-worst td:first-child::before {
    content: '\26A0\FE0F';
    margin-right: 4px;
    font-size: 11px;
}

.ana-row-best  { background: var(--c-success-bg) !important; }
.ana-row-worst { background: var(--c-warning-bg) !important; }

/* ── Clear dashboard shell ─────────────────────────────────── */
#app-shell { position: relative; }

#sidebar {
    background: var(--c-nav) !important;
    border-right-color: var(--c-border) !important;
}

#sidebar [style*="#575350"] { color: var(--c-muted) !important; }
#sidebar [style*="#393939"], #sidebar [style*="#1C1A17"] { color: var(--c-text) !important; }

header, .aurora-topbar {
    background: rgba(255, 255, 255, .96) !important;
    border-color: var(--c-border) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}

.aurora-panel,
.ga-card,
.ga-card-elevated,
.ga-glass-card,
.ga-glass-section {
    background: var(--c-surface) !important;
    border-color: var(--c-border) !important;
    box-shadow: 0 3px 14px rgba(41, 63, 105, .05);
}

.aurora-panel:hover,
.ga-card:hover,
.ga-glass-card:hover,
.ga-glass-section:hover {
    border-color: var(--c-border-hi) !important;
    box-shadow: 0 7px 20px rgba(41, 63, 105, .09);
}

.aurora-stat {
    position: relative;
    overflow: hidden;
    background: var(--c-surface) !important;
    border-color: var(--c-border) !important;
    box-shadow: 0 3px 14px rgba(41, 63, 105, .05);
}
.aurora-stat::after {
    content: '';
    position: absolute;
    width: 110px;
    height: 110px;
    right: -56px;
    bottom: -64px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(63, 99, 237, .10), transparent 70%);
    pointer-events: none;
}

.aurora-action {
    background: var(--c-accent) !important;
    color: #fff !important;
    box-shadow: 0 5px 14px rgba(63, 99, 237, .22);
}
.aurora-action:hover { background: var(--c-accent-dark) !important; box-shadow: 0 7px 18px rgba(63, 99, 237, .28); }

input, select, textarea { color-scheme: light; }

@media (max-width: 768px) {
    .aurora-panel { border-radius: 12px !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── Bandeaux défilants (onglets de module sur téléphone) ─────── */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ── Accessibilité (Phase 8) ─────────────────────────────────────
   `.btn` et les champs suppriment l'outline par défaut : le contour de focus
   clavier est rétabli explicitement — sinon la navigation au clavier ne
   montre plus où l'on se trouve. */
.btn:focus-visible,
.btn-icon:focus-visible,
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

/* Lien d'évitement : invisible jusqu'au premier Tab. */
.skip-link {
    position: fixed; top: 8px; left: 8px; z-index: 100;
    padding: 8px 14px; border-radius: 8px;
    background: var(--c-accent); color: #fff; font-size: 13px; font-weight: 500;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform var(--tr-fast);
}
.skip-link:focus { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ================================================================
   Desktop layer
   ----------------------------------------------------------------
   Applies with a mouse on a screen of at least 1024 px; touch devices
   keep the layout above, whatever their width. In markup use the
   Tailwind `desk:` variant, which carries the same condition.

   The Tailwind CDN injects its stylesheet after this file, so rules
   here must beat a single utility class on specificity: the
   `[data-density]` and `#page-main` prefixes are there for that reason.

   A page chooses its width with $pageWidth (data, work, form) and can
   keep touch-sized controls with $pageDensity = 'touch' (receiving and
   stock counts, which are used standing up).
   ================================================================ */
@media (min-width: 1024px) and (pointer: fine) {

    /* ── Page widths ──────────────────────────────────────────── */
    .page-frame { margin-inline: auto; max-width: 1600px; }
    .page-frame[data-width="work"] { max-width: 1320px; }
    .page-frame[data-width="form"] { max-width: 960px; }
    #page-main { padding: 16px 20px; }

    /* ── Scrollbars: big enough to grab with a mouse ──────────── */
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-thumb,
    ::-webkit-scrollbar-thumb:hover {
        border: 2px solid transparent;
        border-radius: 5px;
        background-clip: padding-box;
    }
    ::-webkit-scrollbar-thumb { background-color: var(--c-border-hi); }
    ::-webkit-scrollbar-thumb:hover { background-color: var(--c-muted-2); }

    /* ── Sidebar: pinned, and hovering never moves the page ───── */
    #sidebar, #sidebar:hover { width: 220px; transition: none; }
    #sidebar .nav-fade { opacity: 1 !important; transition: none; }
    #sidebar .nav-group { margin-top: 12px; margin-bottom: 2px; padding-inline: 20px; }
    #sidebar .nav-group .nav-fade { font-size: 11px; letter-spacing: .06em; }
    #sidebar .nav-link { height: 32px; margin-block: 0; }
    #sidebar .sidebar-brand { height: 48px; }
    #sidebar .sidebar-user { display: none; }

    html[data-sidebar="collapsed"] #sidebar,
    html[data-sidebar="collapsed"] #sidebar:hover { width: 56px; }
    html[data-sidebar="collapsed"] #sidebar .nav-fade { display: none; }
    html[data-sidebar="collapsed"] #sidebar .nav-group { height: 1px; margin: 8px 12px; padding: 0; background: var(--c-border); }
    html[data-sidebar="collapsed"] .sidebar-collapse-icon { transform: rotate(180deg); }

    /* ── Top bar: the page header already carries the title ───── */
    body:has(#page-main .page-header) .topbar-title {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
    }

    /* ── Base type: nothing under 11 px ───────────────────────── */
    .text-\[9px\], .text-\[10px\] { font-size: 11px !important; }

    /* ── Compact density ──────────────────────────────────────── */
    [data-density="compact"] input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"], [type="range"], [type="color"]),
    [data-density="compact"] select {
        height: 32px;
        font-size: 13px;
    }
    [data-density="compact"] textarea { font-size: 13px; }
    [data-density="compact"] :is(a, button, label, span, summary):is(.h-9, .h-10, .h-11, .h-12) {
        height: 32px;
        font-size: 13px;
    }
    [data-density="compact"] :is(a, button):is(.w-9, .w-10, .w-11) { width: 32px; }
    [data-density="compact"] table :is(a, button):is(.h-8, .h-9, .h-10, .h-11) { height: 28px; }
    [data-density="compact"] table :is(a, button):is(.w-8, .w-9, .w-10, .w-11) { width: 28px; }
    [data-density="compact"] table :is(input:not([type="checkbox"], [type="radio"]), select) { height: 28px; }

    [data-density="compact"] #page-main :is(h2, h3):is(.text-\[15px\], .text-\[16px\], .text-\[17px\]) { font-size: 14px; }

    [data-density="compact"] #page-main :is(.p-5, .p-6, .sm\:p-5, .md\:p-6) { padding: 16px; }
    [data-density="compact"] #page-main :is(.px-5, .sm\:px-5) { padding-inline: 16px; }
    [data-density="compact"] #page-main .p-4 { padding: 12px; }

    /* ── Tables: 32 px rows, 40 px on request ─────────────────── */
    [data-density="compact"] #page-main table td { padding-block: 5.5px; }
    [data-density="compact"] #page-main table th { padding-block: 6px; }
    html[data-rows="comfortable"] [data-density="compact"] #page-main table td { padding-block: 9px; }

    /* Header stays visible: the scroll box, not the page, scrolls the rows. */
    #page-main .overflow-x-auto:has(> table) { max-height: calc(100vh - 88px); overflow-y: auto; }
    #page-main .overflow-x-auto > table { border-collapse: separate; border-spacing: 0; }
    #page-main .overflow-x-auto > table > thead th {
        position: sticky; top: 0; z-index: 3;
        background: var(--c-surface);
        box-shadow: inset 0 -1px 0 var(--c-border);
    }
    #page-main .overflow-x-auto > table > tbody > tr > td { border-bottom: 1px solid var(--c-border-dim); }
    #page-main .overflow-x-auto > table > tbody > tr:last-child > td { border-bottom: 0; }

    /* First column stays beside the numbers it labels (wide comparison tables). */
    #page-main table.table-pin > thead th:first-child,
    #page-main table.table-pin > tbody td:first-child {
        position: sticky; left: 0; z-index: 2;
        background: var(--c-surface);
        box-shadow: inset -1px 0 0 var(--c-border);
    }
    #page-main table.table-pin > thead th:first-child { z-index: 4; box-shadow: inset -1px -1px 0 var(--c-border); }

    /* Filters on one line: label beside the field, not above it. */
    :is([data-filter-bar], [data-report-filters]) label.flex-col { flex-direction: row; align-items: center; gap: 6px; }
    :is([data-filter-bar], [data-report-filters]) label.flex-col > span { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 400; }
    :is([data-filter-bar], [data-report-filters]) > .flex { align-items: center; }

    /* ── Two-column work screens ──────────────────────────────── */
    .work-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
    .work-side { position: sticky; top: 0; align-self: start; max-height: calc(100vh - 80px); overflow-y: auto; }
}

/* Keyboard hint, used by the search button and the search dialog. */
.kbd {
    display: inline-block; padding: 0 5px; border: 1px solid var(--c-border); border-radius: 4px;
    background: var(--c-surface); font: 500 11px/16px var(--font-ui); color: var(--c-muted); white-space: nowrap;
}

/* Row name link: looks like the text it wraps. */
.row-link { color: inherit; text-decoration: none; }
.row-link:hover { color: var(--c-accent); }

/* ── Global search dialog ───────────────────────────────────── */
#global-search {
    position: fixed; inset: 0; z-index: 90;
    display: flex; justify-content: center; align-items: flex-start;
    padding-top: 12vh;
    background: rgba(32, 43, 66, .28);
}
#global-search[hidden] { display: none; }
.gs-panel {
    width: 600px; max-width: calc(100vw - 32px); max-height: 66vh;
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 12px;
    box-shadow: 0 16px 40px rgba(28, 26, 23, .16);
}
.gs-field { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--c-border); flex-shrink: 0; }
.gs-field .material-icons-round { font-size: 18px; color: var(--c-muted); }
.gs-field input {
    flex: 1; min-width: 0; height: 44px !important; border: 0; outline: 0; background: transparent;
    font-size: 14px !important; color: var(--c-text);
}
.gs-list { overflow-y: auto; padding: 4px 6px; }
.gs-list:empty { display: none; }
.gs-group {
    margin: 8px 8px 2px; font-size: 11px; font-weight: 600; letter-spacing: .05em;
    text-transform: uppercase; color: var(--c-muted);
}
.gs-item {
    display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px;
    border-radius: 6px; font-size: 13px; color: var(--c-text); text-decoration: none;
}
.gs-item .material-icons-round { font-size: 16px; color: var(--c-muted); flex-shrink: 0; }
.gs-item.is-active { background: var(--c-nav-active); }
.gs-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-detail { margin-left: auto; padding-left: 12px; font-size: 12px; color: var(--c-muted); white-space: nowrap; }
.gs-status { margin: 0; padding: 0 14px 10px; font-size: 12px; color: var(--c-muted); }
.gs-status:empty { display: none; }
.gs-list:empty + .gs-status { padding-top: 10px; }

/* ── Desktop layer, continued ───────────────────────────────── */
@media (min-width: 1024px) and (pointer: fine) {
    /* Recipe editor: the form's two blocks and the tabs share one grid. */
    .rf-wrap { grid-template-rows: auto 1fr; }
    .rf-main  { grid-area: 1 / 1; }
    .rf-side  { grid-area: 1 / 2 / 3 / 3; margin: 0 !important; position: sticky; top: 0; align-self: start; max-height: calc(100vh - 80px); overflow-y: auto; }
    .rf-below { grid-area: 2 / 1; }
    .rf-wrap .rf-row { grid-template-columns: minmax(0, 1fr) 172px 88px 48px 68px; column-gap: 8px; }
    .rf-wrap :is(.text-\[14px\], .text-\[15px\]) { font-size: 13px; }
    .rf-wrap .min-h-\[52px\] { min-height: 36px; }
    #rf-head:has(+ #ingredient-rows:empty) { display: none; }

    .rf-panel[data-off] { display: none; }
    .rf-panel > details > summary { display: none; }

    .rf-tabs { gap: 2px; border-bottom: 1px solid var(--c-border); }
    .rf-tabs button {
        height: 32px; padding: 0 12px; margin-bottom: -1px; font-size: 13px;
        color: var(--c-muted); border-bottom: 2px solid transparent;
    }
    .rf-tabs button:hover { color: var(--c-text); }
    .rf-tabs button[aria-selected="true"] { color: var(--c-text); font-weight: 600; border-bottom-color: var(--c-accent); }

    /* Forms whose Save bar sits at the end of the page. */
    #page-main .form-bar { margin-inline: 0; border: 1px solid var(--c-border); border-radius: 12px; padding: 8px 12px; }
}

/* A small window has no room for labels and two columns: rail only. */
@media (min-width: 1024px) and (max-width: 1179px) and (pointer: fine) {
    #sidebar, #sidebar:hover { width: 56px; }
    #sidebar .nav-fade { display: none; }
    #sidebar .nav-group { height: 1px; margin: 8px 12px; padding: 0; background: var(--c-border); }
    #sidebar-collapse { display: none; }
}
