/* ===== VARIABLES ===== */
:root {
    /* Palette validée — Review Nest */
    --color-primary:      #0F4C5C;
    --color-primary-rgb:  15, 76, 92;
    --color-accent:       #D97706;
    --color-bg:           #F8F9FA;

    /* Tokens fixes */
    --color-surface:      #FFFFFF;
    --color-text:         #111827;
    --color-text-body:    #374151;
    --color-text-muted:   #6B7280;
    --color-text-faint:   #9CA3AF;
    --color-border:       #E5E7EB;
    --color-divider:      #F3F4F6;

    /* Sémantique */
    --color-positive:     #16A34A;
    --color-negative:     #DC2626;
    --color-danger:       #EF4444;

    /* Composants */
    --radius:             6px;
    --radius-pill:        999px;
    --shadow-drawer:      -4px 0 24px rgba(0, 0, 0, 0.10);
    --transition:         150ms ease;

    /* Typographie — combo SaaS : Space Grotesk + Inter */
    --font-display:       'Space Grotesk', system-ui, sans-serif;
    --font-body:          'Inter', system-ui, sans-serif;

    /* Layout */
    --sidebar-collapsed:  64px;
    --sidebar-expanded:   240px;
    --bottom-nav-height:  60px;
}

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

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

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text-body);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img, video, svg {
    max-width: 100%;
}

h1, h2, h3, p, ul {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

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

/* ===== ICONES ===== */
.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon--sm {
    width: 16px;
    height: 16px;
}

/* ===== TYPOGRAPHIE ===== */
.h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-body);
}

.subtitle {
    margin-top: 6px;
    color: var(--color-text-muted);
}

.label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.micro {
    font-size: 11px;
    color: var(--color-text-faint);
}

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

.positive { color: var(--color-positive); }
.negative { color: var(--color-negative); }

/* ===== LAYOUT : SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    width: var(--sidebar-collapsed);
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    overflow: hidden;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    transition: width var(--transition);
}

/* Déplié au survol (souris) ou au clavier — jamais au tap tactile, où le hover reste collé */
@media (hover: hover) {
    .sidebar:hover {
        width: var(--sidebar-expanded);
    }
}

.sidebar:has(:focus-visible) {
    width: var(--sidebar-expanded);
}

/* Libellés masqués tant que la sidebar est repliée : plus aucun débordement */
.sidebar__name,
.nav-link span,
.sidebar__user {
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar:has(:focus-visible) .sidebar__name,
.sidebar:has(:focus-visible) .nav-link span,
.sidebar:has(:focus-visible) .sidebar__user {
    opacity: 1;
}

@media (hover: hover) {
    .sidebar:hover .sidebar__name,
    .sidebar:hover .nav-link span,
    .sidebar:hover .sidebar__user {
        opacity: 1;
    }
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    margin-bottom: 28px;
    padding-left: 2px;
    white-space: nowrap;
}

.sidebar__logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.sidebar__name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 40px;
    padding: 0 10px;
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    transition: background var(--transition), color var(--transition);
}

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

.nav-link[aria-current="page"] {
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
}

.sidebar__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--color-divider);
    white-space: nowrap;
}

.sidebar__user {
    min-width: 0;
    line-height: 1.3;
}

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

/* ===== LAYOUT : PAGE ===== */
.main {
    margin-left: var(--sidebar-collapsed);
}

.page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 40px 56px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 36px;
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}

.section {
    margin-bottom: 40px;
}

.topbar,
.bottom-nav {
    display: none;
}
