/* base.css — reset, palette, tipografia, regole globali.
   Stile portato dal modulo fatturazione/public/app.css e applicato
   all'intero gestionale come parte della FASE 4 (redesign UI). */

/* ─── Design tokens ───────────────────────────────────────────────────── */
:root {
  /* Palette */
  --bg-app:        #f5f6f8;
  --bg-surface:    #ffffff;
  --bg-muted:      #f9fafb;
  --bg-header:     #1f2937;

  --text-primary:   #1f2937;
  --text-body:      #374151;
  --text-muted:     #6b7280;
  --text-faint:     #9ca3af;
  --text-on-dark:   #ffffff;

  --border:        #e5e7eb;
  --border-strong: #d1d5db;

  --accent:        #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft:   rgba(37, 99, 235, 0.10);

  --danger:        #dc2626;
  --danger-strong: #b91c1c;
  --success:       #059669;
  --warning:       #d97706;

  /* Status palette (badge) */
  --status-attesa-bg:     #fef3c7; --status-attesa-fg:     #92400e;
  --status-confermato-bg: #d1fae5; --status-confermato-fg: #065f46;
  --status-gray-bg:       #f3f4f6; --status-gray-fg:       #6b7280;
  --status-blue-bg:       #dbeafe; --status-blue-fg:       #1e40af;
  --status-amber-bg:      #fef3c7; --status-amber-fg:      #92400e;
  --status-purple-bg:     #ede9fe; --status-purple-fg:     #6d28d9;
  --status-teal-bg:       #ccfbf1; --status-teal-fg:       #115e59;

  /* Shape & shadow */
  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.05);
  --shadow:     0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.15);

  /* Sizing layout */
  --topbar-h:        48px;
  --tablet-sidebar-w: 64px;
  --tablet-sidebar-w-open: 220px;
  --bottom-nav-h:    60px;
  --mobile-header-h: 52px;

  /* Typography */
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs:  11px;
  --fs-sm:  12px;
  --fs:     13px;
  --fs-md:  14px;
  --fs-lg:  16px;
  --fs-xl:  18px;
  --fs-2xl: 22px;
}

/* ─── Reset & globali ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-base);
  font-size: var(--fs-md);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 8px; color: var(--text-primary); font-weight: 600; line-height: 1.25; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
h5 { font-size: var(--fs); }

p { margin: 0 0 8px; }
small { font-size: var(--fs-sm); color: var(--text-muted); }

hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* Scrollbar — coerente con stile chiaro dell'app */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5c8ce; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #a5a8ae; }

/* Selezione testo */
::selection { background: var(--accent-soft); color: var(--text-primary); }

/* Focus visibile (accessibilità) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
button:focus, input:focus, select:focus, textarea:focus { outline: none; }

/* Helpers tipografici e di layout */
.no-print {}                  /* visibile in screen, nascosto in stampa via responsive */
.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  font-size: var(--fs);
}

/* Stato sync (topbar) */
#sync-status {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
}

/* Print: nascondi navigazioni e azioni */
@media print {
  .topbar, .tablet-sidebar, .mobile-header, .bottom-nav,
  .mobile-menu-overlay, .modal-bg, .toolbar, .no-print { display: none !important; }
  body { background: #fff; }
  .page { display: block !important; padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd; }
}
