/* ============================================================
   CAVE IA — Design system
   Ancrage : la cave physique. Pierre, lie de vin, verre teinté.
   ============================================================ */
:root {
  /* Palette — issue du monde de la cave */
  --stone:      #1a1714;   /* pierre humide, fond profond */
  --stone-2:    #221d19;   /* panneaux */
  --stone-3:    #2e2722;   /* cartes */
  --lie:        #6e1023;   /* lie de vin, accent principal */
  --lie-bright: #9c1b32;   /* hover */
  --gold:       #c9a45c;   /* reflet doré sur le verre */
  --cream:      #efe7d8;   /* texte principal */
  --cream-dim:  #b3a795;   /* texte secondaire */
  --line:       #3a322b;   /* filets */
  --ok:         #5b8c5a;
  --warn:       #c98a3c;

  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 18px 50px rgba(0,0,0,.45);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--stone);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.04; }
h2 { font-size: 1.5rem; margin: 0 0 .6rem; }

a { color: var(--gold); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.3rem; border-radius: var(--r-sm);
  border: 1px solid transparent; font-weight: 600; font-size: .95rem;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--lie); color: var(--cream); }
.btn-primary:hover { background: var(--lie-bright); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--cream); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* Champs */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label { font-size: .82rem; color: var(--cream-dim); }
.field input, .field select, .field textarea {
  background: var(--stone-2); border: 1px solid var(--line);
  color: var(--cream); padding: .75rem .85rem; border-radius: var(--r-sm);
  font-family: inherit; font-size: 1rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
}

/* Cartes */
.card {
  background: var(--stone-3); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.3rem; box-shadow: var(--shadow);
}

/* App shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--stone-2); border-right: 1px solid var(--line);
  padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: .3rem;
}
.brand { font-family: var(--font-display); font-size: 1.4rem; padding: .3rem .6rem 1.2rem; }
.brand .dot { color: var(--lie-bright); }
.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem;
  border-radius: var(--r-sm); color: var(--cream-dim); font-weight: 500;
}
.nav-item:hover, .nav-item.active { background: var(--stone-3); color: var(--cream); }
.main { flex: 1; padding: 2rem clamp(1rem, 4vw, 3rem); }

/* Bandeau hors-ligne */
.offline-banner {
  display: none; background: var(--warn); color: #2a1c08;
  padding: .5rem 1rem; font-size: .85rem; text-align: center; font-weight: 600;
}
body.is-offline .offline-banner { display: block; }

/* Pastille de garde */
.tag { font-size: .72rem; padding: .2rem .55rem; border-radius: 99px; font-weight: 600; }
.tag-boire { background: rgba(201,138,60,.18); color: var(--warn); }
.tag-garder { background: rgba(91,140,90,.18); color: var(--ok); }

@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: auto; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .brand { display: none; }
}
