/* ══════════════════════════════════════════════════════════════════════════
   SIMULATEUR STRUCTURES JURIDIQUES — CSS MODERNISÉ
   Style inspiré de : Linear, Shadcn, Supabase, Tremor
   ══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────
   VARIABLES CSS — Palette Shadcn/Linear
   ───────────────────────────────────────────────────────────────────────── */

:root {
    /* Couleurs de base */
    --ink: #09090b;
    --ink-secondary: #18181b;
    --muted: #71717a;
    --muted-light: #a1a1aa;
    
    /* Surfaces */
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --surface-hover: #f4f4f5;
    
    /* Bordures */
    --border: #e4e4e7;
    --border-light: #f4f4f5;
    --border-focus: #a1a1aa;
    
    /* Accent (bleu) */
    --accent: #2563eb;
    --accent-light: #3b82f6;
    --accent-soft: #eff6ff;
    --accent-glow: rgba(37, 99, 235, 0.15);
    
    /* Sémantique */
    --positive: #22c55e;
    --positive-soft: #dcfce7;
    --negative: #ef4444;
    --negative-soft: #fee2e2;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    
    /* Effets */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-glow: 0 0 20px var(--accent-glow);
    
    /* Rayons */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    
    /* Transitions */
    --transition-fast: 0.1s ease;
    --transition-base: 0.15s ease;
    --transition-slow: 0.25s ease;
}

/* ─────────────────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Motif de grille subtil — Style Linear/Vercel */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: -1;
}

/* ─────────────────────────────────────────────────────────────────────────
   TYPOGRAPHIE
   ───────────────────────────────────────────────────────────────────────── */

h1, h2, h3 {
    margin: 0;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

p {
    margin: 0;
}

ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

/* Chiffres monospace (financiers) */
.mono, 
.tabular-nums,
td:nth-child(2), td:nth-child(3), td:nth-child(4), td:nth-child(5),
.big,
#bestPerso, #bestCapi, #bestTotal,
.salary-row span:last-child,
.salary-highlight span:last-child {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ─────────────────────────────────────────────────────────────────────────
   LAYOUT
   ───────────────────────────────────────────────────────────────────────── */

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 40px 48px 24px;
}

.layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    padding: 0 48px 48px;
}

.sidebar {
    position: sticky;
    top: 24px;
    height: fit-content;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ─────────────────────────────────────────────────────────────────────────
   EYEBROW & META
   ───────────────────────────────────────────────────────────────────────── */

.eyebrow {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.lede {
    color: var(--muted);
    margin-top: 8px;
    font-size: 15px;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

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

.microcopy {
    color: var(--muted);
    font-size: 12px;
}

/* ─────────────────────────────────────────────────────────────────────────
   BADGES
   ───────────────────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.01em;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.badge-neutral {
    background: var(--surface-hover);
    color: var(--muted);
    border: 1px solid var(--border);
}

.badge-success {
    background: var(--positive-soft);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ─────────────────────────────────────────────────────────────────────────
   CARDS
   ───────────────────────────────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ══════════════════════════════════════════════════════════════════════════
   CARD HEADER — Titre à gauche, actions à droite
   ══════════════════════════════════════════════════════════════════════════ */

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

.card-header > div:first-child {
    flex: 1;
    min-width: 200px;
    line-height: 1.2;
}

.card-header h2 {
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    font-size: 1.15rem;
}

.card-actions {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-shrink: 0;
    margin-top: -2px;
}

.divider {
    margin: 16px 0;
    border: none;
    border-top: 1px dashed var(--border);
}

/* ─────────────────────────────────────────────────────────────────────────
   HIGHLIGHT CARD — Structure conseillée
   ───────────────────────────────────────────────────────────────────────── */

.highlight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 28px 32px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(239, 246, 255, 0.7) 100%
    );
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius-xl);
    box-shadow: 
        0 0 0 1px rgba(37, 99, 235, 0.05),
        0 4px 6px -1px rgba(37, 99, 235, 0.08),
        0 0 40px -10px rgba(37, 99, 235, 0.15);
    transition: 
        box-shadow var(--transition-slow),
        border-color var(--transition-slow);
}

.highlight:hover {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 
        0 0 0 1px rgba(37, 99, 235, 0.1),
        0 8px 12px -2px rgba(37, 99, 235, 0.12),
        0 0 60px -10px rgba(37, 99, 235, 0.25);
}

.highlight h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.highlight .lede {
    color: var(--positive);
    font-weight: 600;
    font-size: 14px;
    margin-top: 4px;
}

.best-figures {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.best-figures > div {
    text-align: right;
}

.best-figures .eyebrow {
    margin-bottom: 4px;
}

.big {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--ink);
}

/* ─────────────────────────────────────────────────────────────────────────
   INPUTS
   ───────────────────────────────────────────────────────────────────────── */

.field {
    margin-bottom: 18px;
}

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--ink);
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: var(--surface);
    transition: 
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

input[type="number"]:hover,
input[type="text"]:hover {
    border-color: var(--border-focus);
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder {
    color: var(--muted-light);
}

/* Input avec suffixe */
.input-with-suffix {
    position: relative;
    width: 100%;
}

.input-with-suffix input {
    padding-right: 100px;
}

.input-with-suffix > span {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 56px;
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
    pointer-events: none;
}

/* CA Display (grand input) */
.ca-display input {
    font-size: 22px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--ink);
    padding-left: 16px;
    padding-right: 110px;
}

.ca-display span {
    font-size: 20px;
    font-weight: 600;
}

/* Stepper buttons */
.input-stepper {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.stepper-btn {
    width: 20px;
    height: 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: all var(--transition-fast);
    padding: 0;
}

.stepper-btn:hover {
    background: var(--surface-hover);
    color: var(--ink);
}

.stepper-btn:active {
    background: var(--accent-soft);
    color: var(--accent);
}

.stepper-btn svg {
    width: 7px;
    height: 4px;
}

/* ─────────────────────────────────────────────────────────────────────────
   SLIDERS (RANGE)
   ───────────────────────────────────────────────────────────────────────── */

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: 50%;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: var(--shadow-md);
    transition: 
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-glow);
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(0.95);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

input[type="range"]::-moz-range-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
}

.range-wrapper {
    margin-bottom: 8px;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

/* ─────────────────────────────────────────────────────────────────────────
   TABLE
   ───────────────────────────────────────────────────────────────────────── */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    table-layout: fixed;
}

thead {
    background: var(--bg);
}

thead tr {
    border-bottom: 1px solid var(--border);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td {
    padding: 16px;
    font-size: 14px;
    color: var(--ink);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

/* Alignement colonnes */
th:nth-child(n+2), td:nth-child(n+2) {
    text-align: center;
}

th:nth-child(1), td:nth-child(1) {
    width: 26%;
    text-align: left;
}

th:nth-child(2), td:nth-child(2),
th:nth-child(3), td:nth-child(3),
th:nth-child(4), td:nth-child(4),
th:nth-child(5), td:nth-child(5) {
    width: 14%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

th:nth-child(6), td:nth-child(6) {
    width: 16%;
    text-align: center;
}

tbody tr {
    transition: background-color var(--transition-fast);
    background: transparent;
    cursor: pointer;
}

tbody tr:hover {
    background-color: var(--surface-hover);
}

tbody tr.selected {
    background-color: rgba(37, 99, 235, 0.08);
    border-left: 3px solid var(--accent);
}

.structure {
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.best-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.positive {
    color: var(--positive);
    font-weight: 600;
}

.negative {
    color: var(--negative);
    font-weight: 600;
}

.neutral {
    color: var(--muted);
    font-weight: 400;
}

.ecart-cell {
    position: relative;
    overflow: visible;
}

/* Animation changement de valeur */
@keyframes slideRight {
    0% {
        opacity: 0;
        transform: translateY(-50%) translateX(0);
    }
    10% {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
    90% {
        opacity: 1;
        transform: translateY(-50%) translateX(60px);
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) translateX(80px);
    }
}

.value-change {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    animation: slideRight 2s ease-in-out forwards;
    z-index: 9999;
    pointer-events: none;
}

.value-change.positive {
    color: #15803d;
    background: var(--positive-soft);
}

.value-change.negative {
    color: #dc2626;
    background: var(--negative-soft);
}

/* ─────────────────────────────────────────────────────────────────────────
   CHARTS
   ───────────────────────────────────────────────────────────────────────── */

.charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-container {
    min-height: 400px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
}

/* ─────────────────────────────────────────────────────────────────────────
   SALARY BREAKDOWN (Dark section)
   ───────────────────────────────────────────────────────────────────────── */

.salary-breakdown {
    margin-top: 16px;
    padding: 24px;
    background: linear-gradient(145deg, #1a1a1e 0%, #0f0f12 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 10px 30px -5px rgba(0, 0, 0, 0.5);
    position: relative;
}

.salary-structure-badge {
    position: static;
    margin: 0 auto 12px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #a78afa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    background: rgba(167, 138, 250, 0.15);
    border-radius: 4px;
    border: 1px solid rgba(167, 138, 250, 0.3);
    display: inline-block;
    width: fit-content;
}

.salary-input-section {
    margin-bottom: 20px;
}

.salary-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
    color: #f8fafc;
}

.salary-title-main {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.salary-title-sub {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.salary-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    transition: all var(--transition-base);
}

.salary-input:focus-within {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.salary-input input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    padding: 4px 100px 4px 0;
}

.salary-input input:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

.salary-input span {
    color: #94a3b8;
    font-size: 16px;
}

.salary-hint {
    color: #64748b;
    font-size: 11px;
    margin-top: 10px;
    line-height: 1.5;
}

.salary-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 20px 0;
}

.salary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #94a3b8;
}

.salary-row:last-child {
    border-bottom: none;
}

.salary-row span:first-child {
    color: #cbd5e1;
    font-weight: 500;
    font-size: 13px;
}

.salary-row span:last-child {
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
    white-space: nowrap;
}

.salary-highlight {
    margin-top: 16px;
    padding: 16px 24px;
    margin-left: -24px;
    margin-right: -24px;
    margin-bottom: -24px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.15) 0%, 
        rgba(99, 102, 241, 0.1) 100%
    );
    border-top: 1px solid rgba(139, 92, 246, 0.2);
}

.salary-highlight span:first-child {
    color: #e0e7ff;
    font-weight: 600;
}

.salary-highlight span:last-child {
    color: #a78bfa;
    font-weight: 700;
    font-size: 18px;
}

/* ─────────────────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────────────────── */

/* Bouton Réinitialiser */
.ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-hover);
    color: var(--muted);
    font-weight: 500;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    margin-top: 12px;
    margin-bottom: 10px;
}

.ghost:hover {
    color: var(--ink);
    border-color: var(--border-focus);
    background: var(--border-light);
}

.ghost:active {
    transform: scale(0.98);
}

.ghost-icon {
    font-size: 13px;
    display: inline-block;
}

.ghost-label {
    font-size: 12px;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════════════════
   BOUTON GRAPHIQUE COMPLET
   ══════════════════════════════════════════════════════════════════════════ */

.full-chart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--ink);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.full-chart-btn:hover {
    background: #27272a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.full-chart-btn:active {
    transform: scale(0.98);
}

.full-chart-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.icon-button {
    border: none;
    background: transparent;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: 
        color var(--transition-fast), 
        background var(--transition-fast);
}

.icon-button:hover {
    background: var(--surface-hover);
    color: var(--accent);
}

.icon-button .icon {
    font-size: 18px;
    line-height: 1;
}

/* ─────────────────────────────────────────────────────────────────────────
   NOTE CARD (Dark)
   ───────────────────────────────────────────────────────────────────────── */

.note {
    background: var(--ink);
    color: #f8fafc;
    border-color: var(--ink-secondary);
}

.note h3 {
    color: #ffffff;
    margin-bottom: 12px;
}

.note ul {
    color: #cbd5e1;
}

.note li {
    margin-bottom: 8px;
}

/* ─────────────────────────────────────────────────────────────────────────
   MODAL
   ───────────────────────────────────────────────────────────────────────── */

.chart-modal {
    position: fixed;
    inset: 0;
    background: rgba(9, 9, 11, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.chart-modal.visible {
    display: flex;
}

.chart-dialog {
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    width: min(1200px, 95vw);
    max-width: 1200px;
    height: 82vh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.chart-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.chart-dialog-header h3 {
    margin: 0;
    color: var(--ink);
}

.chart-dialog-body {
    flex: 1;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border-light);
}

.chart-dialog-body canvas {
    width: 100% !important;
    height: 100% !important;
}

body.modal-open {
    overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────
   SIDEBAR TOGGLE (Mobile)
   ───────────────────────────────────────────────────────────────────────── */

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 20px;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.sidebar-toggle:hover {
    border-color: var(--ink);
    box-shadow: var(--shadow-lg);
}

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────────── */

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

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
        padding: 0 20px 24px;
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 360px;
        height: 100vh;
        z-index: 999;
        background: var(--bg);
        border-right: 1px solid var(--border);
        padding: 20px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        max-height: 100vh;
        overflow-y: auto;
    }

    .sidebar.visible {
        transform: translateX(0);
    }

    .hero {
        flex-direction: column;
        padding: 24px 20px 10px;
    }
}

@media (max-width: 768px) {
    .best-figures {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .best-figures > div {
        text-align: left;
    }

    .highlight {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
    }

    .card {
        padding: 16px;
    }

    .big {
        font-size: 24px;
    }

    table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .sidebar {
        width: 100%;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   TOP BAR — בס"ד
   ══════════════════════════════════════════════════════════════════════════ */

.top-bar {
    position: fixed;
    top: 16px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1000;
}

.hebrew-blessing {
    font-family: 'Times New Roman', 'David', serif;
    font-size: 16px;
    color: var(--muted);
    user-select: none;
    direction: rtl;
}
