/* ============================================================
   BO BrickSearch — feuille de style unique
   Fusion : style BO existant + charte graphique front chaude
   ============================================================ */

/* ── Variables ───────────────────────────────────────────── */
:root {
    /* Palette BO (conservée) */
    --bg:           #f4f6fb;
    --panel:        #ffffff;
    --text:         #172033;
    --muted:        #64748b;
    --primary:      #2563eb;
    --primary-dark: #1d4ed8;
    --border:       #e2e8f0;
    --danger:       #b91c1c;
    --danger-bg:    #fee2e2;

    /* Charte chaude front */
    --brand:        #E3241B;
    --brand-dark:   #be1d15;
    --cream:        #fdfcfa;
    --sand:         #f3ede6;
    --warm-border:  #e5e0d8;
    --warm-muted:   #74747a;
    --warm-label:   #1a1a1a;
}

/* ── Reset de base ───────────────────────────────────────── */
* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

a { color: inherit; }

code {
    background: #eef2ff;
    padding: .15rem .35rem;
    border-radius: .35rem;
}

/* ── Layout principal (sidebar + main) ───────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    background: #0f172a;
    color: white;
    padding: 1.25rem;
    flex-shrink: 0;
}

.main {
    flex: 1;
    min-width: 0;
}

.brand {
    display: block;
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
    font-weight: 800;
    text-decoration: none;
    color: #fff;
}

/* ─────────────────────────────────────────────
   Menu compact BO
───────────────────────────────────────────── */

.menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-section {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding-bottom: .8rem;
    border-bottom: 1px solid rgba(255,255,255,.05);
}

.menu-section:last-child {
    border-bottom: 0;
}

.menu-section-title {
    padding: .35rem .7rem;
    margin-bottom: .15rem;
    border-radius: .5rem;
    background: rgba(255,255,255,.05);
    color: #94a3b8;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.menu-section-links {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.menu-link {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: .6rem .75rem;
    border-radius: .6rem;
    color: #cbd5e1;
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
    transition: .15s;
}

.menu-link:hover {
    background: rgba(255,255,255,.05);
    color: white;
}

.menu-link.active {
    background: rgba(227,36,27,.16);
    color: white;
    border-left: 3px solid var(--brand);
}

.topbar {
    height: 72px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.userbox {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
}

.content { padding: 1.5rem; }

.page-header { margin-bottom: 1.5rem; }
.page-header h1 { margin: 0 0 .35rem; }

/* ── Grille contenu ──────────────────────────────────────── */
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

/* ── Card générique ──────────────────────────────────────── */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 12px 35px rgba(15,23,42,.06);
}

/* ── Composants form génériques ──────────────────────────── */
.muted, .hint { color: var(--muted); }

label {
    display: block;
    margin: 1rem 0 .35rem;
    font-weight: 700;
}

input {
    width: 100%;
    padding: .85rem 1rem;
    border: 1px solid var(--border);
    border-radius: .65rem;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(227,36,27,.09);
}

button, .button-link {
    display: inline-block;
    border: 0;
    border-radius: .65rem;
    padding: .85rem 1.1rem;
    margin-top: 1.25rem;
    background: var(--primary);
    color: white;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background .2s;
}

button:hover, .button-link:hover { background: var(--primary-dark); }

.alert {
    margin: 1rem 0;
    padding: .8rem 1rem;
    border-radius: .65rem;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-bg);
}

.bo-table {
    width: 100%;
    border-collapse: collapse;
}

.bo-table th {
    text-align: left;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    padding: 14px;
    background: #f8fafc;
}

.bo-table td {
    padding: 15px 14px;
    border-bottom: 1px solid var(--border);
}

.bo-table tr:hover td {
    background: #f8fafc;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 700;
}