/* base.css — i token del CRM di Malavasi (stessi nomi di wines-crm: --gold, --card, --border…)
   con il suo brand già applicato: bordeaux #9F102E, Josefin Sans nei titoli. */
:root {
  --gold: #9F102E;
  --gold-deep: #670A1E;
  --gold-mid: #820D26;
  --wine: #9F102E;
  --bg: #EFE7D3;
  --card: #F7F1E2;
  --white: #FFFDF8;
  --border: rgba(159,16,46,.22);
  --line: rgba(28,24,17,.12);
  --text: #1C1811;
  --muted: #6b6046;
  --muted-2: #9A8F77;
  --on-accent: rgba(255,255,255,.82);
  --on-accent-2: rgba(255,255,255,.62);
  --green: #2e7d32;
  --green-bg: rgba(46,125,50,.13);
  --orange: #b26a00;
  --orange-bg: rgba(178,106,0,.14);
  --red: #c62828;
  --red-bg: rgba(198,40,40,.12);
  --font-display: 'Josefin Sans', Georgia, serif;
  --font-body: 'Archivo', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  --r: 12px;
  --ombra: 0 6px 18px rgba(28,24,17,.07);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }

/* bottoni */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 999px;
  padding: 12px 22px; font-weight: 600; font-size: 16px; cursor: pointer; transition: background .15s, transform .05s; min-height: 48px; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primario { background: var(--gold); color: #fff; }
.btn-primario:hover { background: var(--gold-mid); }
.btn-sec { background: transparent; color: var(--gold); border: 1.5px solid var(--border); }
.btn-sec:hover { border-color: var(--gold); }
.btn-piccolo { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.btn-pieno { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link-btn { background: none; border: none; color: var(--gold); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* badge e chip */
.badge { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 999px; background: var(--green-bg); color: var(--green); white-space: nowrap; }
.badge.warn { background: var(--orange-bg); color: var(--orange); }
.badge.muted { background: rgba(28,24,17,.07); color: var(--muted); }
.badge.rosso { background: var(--red-bg); color: var(--red); }
.badge.brand { background: rgba(159,16,46,.1); color: var(--gold); }
.chip { padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--card); white-space: nowrap; }
.chip.attivo { background: var(--gold); color: #fff; border-color: var(--gold); }

.etichetta { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* punteggio */
.punteggio { font-family: var(--font-mono); font-weight: 700; }
.punteggio.alto { color: var(--green); }
.punteggio.medio { color: var(--orange); }
.punteggio.basso { color: var(--red); }
.barra { height: 10px; border-radius: 999px; background: rgba(28,24,17,.08); overflow: hidden; }
.barra > i { display: block; height: 100%; border-radius: 999px; background: var(--gold); }
.barra.alto > i { background: var(--green); }
.barra.medio > i { background: var(--orange); }
.barra.basso > i { background: var(--red); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1C1811; color: #fff;
  padding: 12px 20px; border-radius: 999px; font-size: 15px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 1000; max-width: 90vw; text-align: center; }
.toast.vis { opacity: 1; transform: translateX(-50%) translateY(0); }

/* finestra modale */
.velo { position: fixed; inset: 0; background: rgba(28,24,17,.55); z-index: 800; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modale { background: var(--card); border-radius: 18px; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modale h3 { font-family: var(--font-display); font-size: 24px; color: var(--gold); margin-bottom: 8px; font-weight: 600; }

/* lightbox foto */
.lightbox { position: fixed; inset: 0; background: rgba(10,8,6,.9); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-height: 92vh; max-width: 94vw; border-radius: 8px; object-fit: contain; }
.lightbox .chiudi { position: absolute; top: 14px; right: 18px; color: #fff; font-size: 34px; background: none; border: none; cursor: pointer; }

.vuoto { text-align: center; color: var(--muted); padding: 28px 12px; font-size: 16px; }
.nota-demo { font-size: 14px; color: var(--muted); }
