/* ============================================================
   SOLENCIA — Espace Client CSS
   Palette : Bleu nuit · Or · Blanc · Anthracite
   ============================================================ */

:root {
    --bleu-nuit:    #0a0e1a;
    --bleu-profond: #0d1526;
    --bleu-moyen:   #142040;
    --or:           #c9a84c;
    --or-clair:     #e8c96a;
    --blanc:        #f8f5ef;
    --gris-clair:   #c8c4bc;
    --gris:         #888480;
    --anthracite:   #2a2d35;
    --bg:           #f2f0eb;
    --bg-card:      #ffffff;
    --texte:        #1a1a2e;
    --vert:         #27ae60;
    --rouge:        #c0392b;
    --orange:       #e67e22;
    --bleu-info:    #2980b9;

    --sidebar-width: 260px;
    --topbar-height: 62px;
    --transition:    0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --radius:        4px;
    --shadow:        0 2px 16px rgba(0,0,0,0.08);
    --shadow-md:     0 4px 32px rgba(0,0,0,0.12);
    --font-titre:    'Cormorant Garamond', Georgia, serif;
    --font-corps:    'Montserrat', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-corps);
    background: var(--bg);
    color: var(--texte);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; }

/* ── Pages auth (connexion/inscription) ─────────────────── */
body.auth-body {
    background: linear-gradient(160deg, var(--bleu-profond) 0%, var(--bleu-nuit) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-wrap { width: 100%; max-width: 440px; padding: 1.5rem; }
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-brand__logo {
    font-family: var(--font-titre);
    font-size: 2rem;
    font-weight: 600;
    color: var(--blanc);
    letter-spacing: 0.08em;
}
.auth-brand__logo span { color: var(--or); }
.auth-brand__sub {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gris);
    margin-top: 0.3rem;
}
.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
}
.auth-card__title {
    font-family: var(--font-titre);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--bleu-nuit);
    margin-bottom: 0.3rem;
}
.auth-card__sub {
    font-size: 0.8rem;
    color: var(--gris);
    margin-bottom: 1.8rem;
}
.auth-card__footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.78rem;
    color: var(--gris);
}
.auth-card__footer a { color: var(--or); font-weight: 600; }
.auth-divider {
    text-align: center;
    font-size: 0.72rem;
    color: var(--gris);
    margin: 1rem 0;
    position: relative;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e0ddd8;
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }
.auth-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--gris-clair);
    transition: color var(--transition);
}
.auth-back:hover { color: var(--or); }
.auth-back svg { width: 14px; height: 14px; }

/* ── Formulaires ────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form__group { display: flex; flex-direction: column; gap: 0.4rem; }
.form__label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--anthracite);
}
.form__input, .form__select, .form__textarea {
    background: #faf8f4;
    border: 1px solid #ddd9d0;
    color: var(--texte);
    padding: 0.8rem 1rem;
    font-family: var(--font-corps);
    font-size: 0.85rem;
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    width: 100%;
}
.form__input:focus, .form__select:focus, .form__textarea:focus {
    border-color: var(--or);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
    background: #fff;
}
.form__input::placeholder { color: var(--gris); }
.form__textarea { resize: vertical; min-height: 100px; }
.form__hint { font-size: 0.7rem; color: var(--gris); }
.form__msg { font-size: 0.8rem; padding: 0.7rem 1rem; border-radius: var(--radius); margin-top: 0.5rem; }
.form__msg--success { background: #eafaf1; border-left: 3px solid var(--vert); color: #1e8449; }
.form__msg--error   { background: #fdecea; border-left: 3px solid var(--rouge); color: var(--rouge); }
.form__msg--info    { background: #eaf4fb; border-left: 3px solid var(--bleu-info); color: var(--bleu-info); }

/* ── Boutons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.8rem;
    font-family: var(--font-corps);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn--or { background: linear-gradient(135deg, var(--or), var(--or-clair)); color: var(--bleu-nuit); }
.btn--or:hover { box-shadow: 0 4px 20px rgba(201,168,76,0.4); transform: translateY(-1px); }
.btn--outline { background: transparent; border: 1.5px solid var(--or); color: var(--or); }
.btn--outline:hover { background: var(--or); color: var(--bleu-nuit); }
.btn--ghost { background: transparent; border: 1.5px solid #ddd9d0; color: var(--anthracite); }
.btn--ghost:hover { border-color: var(--or); color: var(--or); }
.btn--danger { background: var(--rouge); color: #fff; }
.btn--danger:hover { background: #a93226; }
.btn--sm { padding: 0.45rem 1rem; font-size: 0.68rem; }
.btn--full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bleu-nuit);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--transition);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(201,168,76,0.2) transparent;
}
.sidebar__brand {
    padding: 1.6rem 1.4rem 1rem;
    border-bottom: 1px solid rgba(201,168,76,0.1);
    flex-shrink: 0;
}
.sidebar__logo {
    font-family: var(--font-titre);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--blanc);
    letter-spacing: 0.06em;
}
.sidebar__logo-s { color: var(--or); }
.sidebar__sub {
    display: block;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gris);
    margin-top: 0.2rem;
}
.sidebar__nav { padding: 1.2rem 0.8rem; flex: 1; }
.sidebar__section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gris);
    padding: 0 0.6rem;
    margin-bottom: 0.4rem;
}
.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gris-clair);
    transition: background var(--transition), color var(--transition);
    margin-bottom: 2px;
    position: relative;
}
.sidebar__link svg { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar__link:hover { background: rgba(255,255,255,0.06); color: var(--blanc); }
.sidebar__link--active { background: rgba(201,168,76,0.12); color: var(--or); }
.sidebar__link--active svg { color: var(--or); }
.sidebar__link--logout { color: #e57373; margin-top: 0.5rem; }
.sidebar__link--logout:hover { background: rgba(192,57,43,0.1); color: var(--rouge); }
.sidebar__badge {
    margin-left: auto;
    background: var(--or);
    color: var(--bleu-nuit);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.sidebar__badge--red { background: var(--rouge); color: #fff; }
.sidebar__user {
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
}
.sidebar__user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--or), var(--bleu-moyen));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--bleu-nuit);
    flex-shrink: 0;
}
.sidebar__user-name { font-size: 0.78rem; font-weight: 600; color: var(--blanc); }
.sidebar__user-email { font-size: 0.65rem; color: var(--gris); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 199; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid #e8e4dc;
    display: flex;
    align-items: center;
    padding: 0 1.8rem;
    z-index: 100;
    gap: 1rem;
}
.topbar__burger { display: none; background: none; border: none; cursor: pointer; color: var(--anthracite); padding: 4px; }
.topbar__burger svg { width: 22px; height: 22px; }
.topbar__title { font-size: 0.88rem; font-weight: 600; color: var(--texte); flex: 1; }
.topbar__right { display: flex; align-items: center; gap: 1rem; }
.topbar__site-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--gris);
    transition: color var(--transition);
}
.topbar__site-link:hover { color: var(--or); }
.topbar__avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--or), var(--bleu-moyen));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--bleu-nuit);
}

/* ── Layout principal ───────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}
.page-content {
    padding: calc(var(--topbar-height) + 2rem) 2rem 2rem;
    max-width: 1200px;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid #e8e4dc;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card__header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #f0ede6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.card__title {
    font-family: var(--font-titre);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bleu-nuit);
}
.card__body { padding: 1.5rem; }

/* ── Dashboard widgets ──────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid #e8e4dc;
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card__icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-card__icon svg { width: 20px; height: 20px; }
.stat-card__icon--or    { background: rgba(201,168,76,0.12); color: var(--or); }
.stat-card__icon--vert  { background: rgba(39,174,96,0.1);  color: var(--vert); }
.stat-card__icon--rouge { background: rgba(192,57,43,0.1);  color: var(--rouge); }
.stat-card__icon--bleu  { background: rgba(41,128,185,0.1); color: var(--bleu-info); }
.stat-card__value { font-size: 1.8rem; font-weight: 700; color: var(--texte); line-height: 1; }
.stat-card__label { font-size: 0.72rem; font-weight: 500; color: var(--gris); margin-top: 0.3rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Tableaux ───────────────────────────────────────────── */
.data-grid { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-grid th {
    background: #f7f4ee;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gris);
    border-bottom: 2px solid #e8e4dc;
}
.data-grid td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #f0ede6;
    color: var(--texte);
    vertical-align: middle;
}
.data-grid tr:last-child td { border-bottom: none; }
.data-grid tr:hover td { background: #faf8f4; }
.data-grid__empty { text-align: center; padding: 2.5rem; color: var(--gris); }

/* ── Badges statut ──────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
}
.badge::before { content: '●'; font-size: 0.5rem; }
.badge--vert    { background: #eafaf1; color: #1e8449; }
.badge--rouge   { background: #fdecea; color: var(--rouge); }
.badge--orange  { background: #fef9e7; color: var(--orange); }
.badge--bleu    { background: #eaf4fb; color: var(--bleu-info); }
.badge--gris    { background: #f4f3f0; color: var(--gris); }
.badge--or      { background: rgba(201,168,76,0.12); color: #8b6914; }

/* ── Page hero interne ──────────────────────────────────── */
.page-hero {
    margin-bottom: 2rem;
}
.page-hero__title {
    font-family: var(--font-titre);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--bleu-nuit);
}
.page-hero__sub { font-size: 0.82rem; color: var(--gris); margin-top: 0.3rem; }

/* ── Utilitaires ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-or { color: var(--or); } .text-gris { color: var(--gris); } .text-vert { color: var(--vert); } .text-rouge { color: var(--rouge); }
.text-sm { font-size: 0.78rem; } .text-xs { font-size: 0.7rem; }
.bold { font-weight: 600; }
.or-line { height: 3px; background: linear-gradient(90deg, var(--or), transparent); border: none; margin: 1.5rem 0; }
.empty-state { text-align: center; padding: 3rem 2rem; }
.empty-state__icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state__title { font-size: 1rem; font-weight: 600; color: var(--texte); margin-bottom: 0.5rem; }
.empty-state__sub { font-size: 0.82rem; color: var(--gris); }

/* ── Pagination ─────────────────────────────────────────── */
.pagination { display: flex; gap: 0.4rem; align-items: center; justify-content: center; margin-top: 1.5rem; }
.pagination a, .pagination span {
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid #e8e4dc;
    border-radius: var(--radius);
    color: var(--texte);
    transition: var(--transition);
}
.pagination a:hover { border-color: var(--or); color: var(--or); }
.pagination .active { background: var(--or); border-color: var(--or); color: var(--bleu-nuit); font-weight: 700; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; }
    .topbar { left: 0; }
    .topbar__burger { display: flex; }
    .page-content { padding: calc(var(--topbar-height) + 1rem) 1rem 1rem; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .grid-2, .form__row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .auth-card { padding: 1.8rem 1.2rem; }
}
