/* ============================================================
   PARADISE OPTICS — DESIGN SYSTEM CSS (Labs v2)
   Versione 3.0 — Cockpit Redesign
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--surface-page);
  color: var(--slate-700);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }

:root {
  --indigo-50:  #EEF2FF;
  --indigo-100: #E0E7FF;
  --indigo-200: #C7D2FE;
  --indigo-300: #A5B4FC;
  --indigo-400: #818CF8;
  --indigo-500: #6366F1;
  --indigo-600: #4F46E5;
  --indigo-700: #4338CA;
  --indigo-800: #3730A3;
  --indigo-900: #312E81;
  --indigo-950: #1E1B4B;

  --surface-page:   #F8F9FB;
  --surface-subtle: #F1F3F7;
  --surface-card:   #FFFFFF;

  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  --text-on-dark:           #F5F5F4;
  --text-on-dark-secondary: #94A3B8;
  --text-on-brand:          #FFFFFF;

  --success: #22C55E;
  --warning: #F59E0B;
  --danger:  #EF4444;

  --shadow-color: rgba(30, 27, 75, 0.06);
  --shadow-sm:    0 1px 2px var(--shadow-color);
  --shadow-md:    0 4px 12px var(--shadow-color);

  --font-36: 36px;
  --font-28: 28px;
  --font-22: 22px;
  --font-20: 20px;
  --font-18: 18px;
  --font-16: 16px;
  --font-15: 15px;
  --font-14: 14px;
  --font-13: 13px;
  --font-12: 12px;
  --font-11: 11px;
  --font-10: 10px;

  --sidebar-width: 64px;
  --topbar-height: 56px;

  --space-1:  4px;
  --space-2:  6px;
  --space-3:  8px;
  --space-4:  10px;
  --space-5:  12px;
  --space-6:  14px;
  --space-7:  16px;
  --space-8:  20px;
  --space-9:  24px;
  --space-10: 32px;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --touch-target: 44px;
}

/* --- SHELL --- */

#sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: #2F2B8F;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand {
  width: 38px; height: 38px; border-radius: 8px;
  background: rgba(255,255,255,0.12); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

#topbar {
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
}

#content {
  margin-left: var(--sidebar-width);
  min-height: calc(100vh - var(--topbar-height));
}

.page-scroll { padding: 24px 28px 40px; }
.page-tabbed { padding: 16px 28px 40px; }
.page-fullheight { padding: 16px 28px 0; }

/* --- SIDEBAR COMPONENTS --- */

.sidebar-nav { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.sidebar-bottom { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-bottom: 8px; }

.sidebar-item {
  position: relative; width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.15s, color 0.15s; color: var(--text-on-dark-secondary);
}
.sidebar-item:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-on-dark); }
.sidebar-item.active { background: rgba(255, 255, 255, 0.14); color: #C7D2FE; }
.sidebar-item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: #A5B4FC; border-radius: 0 3px 3px 0;
}
.sidebar-item svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; }

.sidebar-item[data-tooltip]:hover::after {
  content: attr(data-tooltip); position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%); background: var(--slate-800); color: var(--text-on-dark);
  font-size: var(--font-12); font-weight: 500; padding: 6px 10px; border-radius: var(--radius-sm);
  white-space: nowrap; z-index: 200; pointer-events: none; box-shadow: var(--shadow-md);
}

/* --- TOPBAR COMPONENTS --- */

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.topbar-store { font-size: var(--font-14); font-weight: 700; color: var(--slate-800); white-space: nowrap; }
.topbar-date { font-size: var(--font-13); font-weight: 500; color: var(--slate-500); white-space: nowrap; }
.topbar-divider { width: 1px; height: 20px; background: var(--slate-200); flex-shrink: 0; }

.topbar-center { position: relative; flex: 1; max-width: 480px; margin: 0 auto; }
.topbar-center input {
  height: 38px; min-height: unset; padding-left: 38px; padding-right: 16px;
  background: var(--surface-subtle); border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: var(--font-13);
}
.topbar-center input:focus { background: var(--surface-card); border-color: var(--indigo-300); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.topbar-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--slate-400); stroke-width: 1.8; fill: none; pointer-events: none; }

.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 200px; justify-content: flex-end; }

.topbar-brand { font-size: var(--font-14); font-weight: 800; color: var(--slate-900); white-space: nowrap; }
.topbar-search { position: relative; flex: 1; max-width: 760px; min-width: 320px; }
.topbar-search input {
  height: 42px; min-height: unset; padding-left: 40px; padding-right: 16px;
  background: var(--surface-subtle); border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: var(--font-14);
}
.topbar-search input:focus { background: var(--surface-card); border-color: var(--indigo-300); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-store-select {
  height: 38px; min-width: 170px; max-width: 220px; padding: 0 34px 0 12px;
  border: 1px solid var(--slate-200); border-radius: var(--radius-md);
  background: var(--surface-card); color: var(--slate-800); font-size: var(--font-13); font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.topbar-store-select:focus {
  border-color: var(--indigo-300);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.topbar-icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--slate-500); border: 1px solid transparent;
}
.topbar-icon-btn:hover { background: var(--surface-subtle); color: var(--slate-800); border-color: var(--slate-200); }
.topbar-icon-btn svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.topbar-avatar-btn {
  background: var(--indigo-50);
  color: var(--indigo-600);
  font-weight: 800;
}
.topbar-alerts { position: relative; }
.topbar-alert-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
}
.topbar-alerts-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  display: none;
  background: var(--surface-card);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 320;
  overflow: hidden;
}
.topbar-alerts-panel.is-open { display: block; }
.topbar-alerts-panel button {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--slate-200);
  background: transparent;
  text-align: left;
}
.topbar-alerts-panel button:last-child { border-bottom: 0; }
.topbar-alerts-panel button:hover { background: var(--indigo-50); }
.topbar-alerts-panel strong { color: var(--slate-900); font-size: var(--font-13); }
.topbar-alerts-panel span { color: var(--slate-500); font-size: var(--font-12); }
.topbar-profile { position: relative; }
.topbar-avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 256px;
  display: none;
  padding: 10px;
  background: var(--surface-card);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 330;
}
.topbar-avatar-menu.is-open { display: grid; gap: 10px; }
.topbar-avatar-menu-head {
  display: grid;
  gap: 2px;
  padding: 2px 2px 8px;
  border-bottom: 1px solid var(--slate-200);
}
.topbar-avatar-menu-head strong {
  color: var(--slate-900);
  font-size: var(--font-14);
  font-weight: 800;
}
.topbar-avatar-menu-head span {
  color: var(--slate-500);
  font-size: var(--font-12);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-avatar-menu-section { display: grid; gap: 6px; }
.topbar-avatar-menu-label {
  color: var(--slate-500);
  font-size: var(--font-11);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.topbar-avatar-store-current {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--slate-800);
  font-size: var(--font-13);
  font-weight: 800;
}
.topbar-avatar-menu-link {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--slate-700);
  font-size: var(--font-13);
  font-weight: 800;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.topbar-avatar-menu-link:hover {
  border-color: var(--indigo-300);
  background: var(--indigo-50);
  color: var(--indigo-700);
}
.topbar-avatar-menu-link--danger:hover {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--slate-300));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface-card));
  color: var(--danger);
}
.topbar-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--indigo-50);
  color: var(--indigo-600); display: flex; align-items: center; justify-content: center;
  font-size: var(--font-14); font-weight: 800;
}

.topbar-search-empty { padding: 12px 16px; color: var(--slate-500); font-size: var(--font-13); }
.topbar-search-result { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 11px 14px; background: transparent; border: none; border-bottom: 1px solid var(--slate-200); cursor: pointer; transition: background 0.15s; font-family: inherit; text-align: left; }
.topbar-search-result:hover { background: var(--indigo-50); }
.topbar-search-result-icon { width: 34px; height: 34px; border-radius: var(--radius-md); background: var(--indigo-50); color: var(--indigo-600); display: inline-flex; align-items: center; justify-content: center; font-size: var(--font-12); font-weight: 800; }
.topbar-search-result-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.topbar-search-result-name { font-size: var(--font-14); font-weight: 700; color: var(--slate-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-search-result-meta { font-size: var(--font-12); color: var(--slate-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-search-result-type { font-size: var(--font-11); font-weight: 700; color: var(--slate-500); background: var(--surface-subtle); border-radius: var(--radius-sm); padding: 3px 8px; white-space: nowrap; }

#topbar-search-results { position: absolute; top: 100%; left: 0; right: 0; margin-top: 8px; background: var(--surface-card); border: 1px solid var(--slate-200); border-radius: var(--radius-md); box-shadow: var(--shadow-md); z-index: 300; display: none; overflow: hidden; max-height: 440px; overflow-y: auto; }
#topbar-search-results.is-open { display: block; }

/* --- CARDS & SURFACES --- */

.card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
}

.card-body { padding: 20px; }
.card-body-hero { padding: 24px 28px 20px; }

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--indigo-200);
  transition: box-shadow 0.15s, border-color 0.15s;
}

/* --- TYPOGRAPHY & DATA --- */

.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: var(--radius-sm); font-size: var(--font-11); font-weight: 600; white-space: nowrap;
}
.badge-lead, .badge-order-progress { background: var(--indigo-50); color: var(--indigo-600); }
.badge-success { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-neutral { background: var(--surface-subtle); color: var(--slate-600); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.text-kpi-1  { font-size: 36px; font-weight: 800; color: var(--slate-800); line-height: 1.1; letter-spacing: -1px; }
.text-kpi-2  { font-size: 28px; font-weight: 800; color: var(--slate-800); line-height: 1.1; letter-spacing: -0.5px; }
.text-kpi-3  { font-size: 18px; font-weight: 700; color: var(--slate-800); line-height: 1.2; }
.text-kpi-4  { font-size: 15px; font-weight: 700; color: var(--slate-800); line-height: 1.2; }
.text-page-title { font-size: 18px; font-weight: 700; color: var(--slate-800); }
.text-client-name { font-size: 20px; font-weight: 700; color: var(--slate-800); }
.text-data-primary { font-size: 14px; font-weight: 600; color: var(--slate-800); }
.text-data-standard { font-size: 14px; font-weight: 400; color: var(--slate-700); }
.text-meta { font-size: 13px; font-weight: 500; color: var(--slate-700); }
.text-link { font-size: 13px; font-weight: 500; color: var(--indigo-500); cursor: pointer; }
.text-micro { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--slate-500); }
.text-empty { color: var(--slate-400); }
.text-date-ter { font-size: 12px; font-weight: 400; color: var(--slate-400); }

.micro-label { display: block; font-size: var(--font-11); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--slate-500); margin-bottom: 4px; }
.widget-header { font-size: var(--font-12); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--slate-500); margin-bottom: 14px; }

/* --- BUTTONS --- */

.btn-primary {
  height: 38px; min-height: var(--touch-target); padding: 0 16px;
  background: var(--indigo-500); color: var(--text-on-brand); border: none;
  border-radius: var(--radius-md); font-size: var(--font-13); font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2);
  transition: background 0.15s; white-space: nowrap;
}
.btn-primary:hover { background: var(--indigo-600); }
.btn-primary:active { background: var(--indigo-700); }
.btn-primary.compact { height: 34px; min-height: 34px; padding: 0 12px; font-size: var(--font-12); }

.btn-secondary {
  height: 38px; min-height: var(--touch-target); padding: 0 14px;
  background: transparent; color: var(--slate-700); border: 1px solid var(--slate-300);
  border-radius: var(--radius-md); font-size: var(--font-13); font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2);
  transition: background 0.15s, border-color 0.15s; white-space: nowrap;
}
.btn-secondary:hover { background: var(--surface-subtle); border-color: var(--slate-400); }
.btn-secondary.compact { height: 30px; min-height: 30px; padding: 0 10px; font-size: var(--font-12); }

.btn-ghost {
  height: 38px; padding: 0 10px; background: transparent; color: var(--slate-600);
  border: none; border-radius: var(--radius-md); font-size: var(--font-13); font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2);
}
.btn-ghost:hover { background: var(--surface-subtle); color: var(--slate-800); }

.filter-preset {
  height: 34px; padding: 0 12px; border-radius: var(--radius-md);
  border: 1px solid var(--slate-300); background: var(--surface-card);
  color: var(--slate-600); font-size: var(--font-12); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-preset:hover { background: var(--surface-subtle); color: var(--slate-800); }
.filter-preset.active { background: var(--indigo-50); border-color: var(--indigo-300); color: var(--indigo-600); }

.filter-check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--font-13); color: var(--slate-700); }
.filter-check input { width: 16px; height: 16px; accent-color: var(--indigo-500); }
.filter-check-label { font-weight: 500; }

/* --- INPUTS --- */

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="tel"], input[type="date"], input[type="datetime-local"], textarea, select {
  height: 44px; padding: 0 12px; border: 1px solid var(--slate-300);
  border-radius: var(--radius-md); font-size: var(--font-13); font-family: 'Inter', sans-serif;
  color: var(--slate-700); background: var(--surface-page); width: 100%;
  transition: border-color 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--slate-400); }
input:focus, textarea:focus, select:focus {
  border-color: var(--indigo-500); outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
input.error { border-color: var(--danger); }

/* --- TABLES --- */

table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 12px 14px; font-size: var(--font-12); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--slate-500);
  background: var(--surface-subtle); border-bottom: 1px solid var(--slate-200);
  text-align: left; white-space: nowrap;
}
tbody td {
  padding: 0 14px; height: 48px; border-bottom: 1px solid var(--slate-200);
  font-size: var(--font-14); color: var(--slate-700);
}
tbody tr:hover { background: var(--indigo-50); }
tbody tr:last-child td { border-bottom: none; }

/* --- TABS --- */

.tab-bar {
  height: 44px; display: flex; align-items: stretch; gap: 32px;
  border-bottom: 1px solid var(--slate-200);
}
.tab {
  display: flex; align-items: center; gap: 6px; font-size: var(--font-14);
  font-weight: 500; color: var(--slate-500); border-bottom: 2px solid transparent;
  cursor: pointer; transition: color 0.15s, border-color 0.15s; white-space: nowrap;
  background: none; border-left: none; border-right: none; border-top: none; padding: 0;
}
.tab.active { font-weight: 600; color: var(--indigo-500); border-bottom-color: var(--indigo-500); }
.tab:hover:not(.active) { color: var(--slate-700); }

.tab-badge {
  padding: 1px 7px; border-radius: 10px; font-size: var(--font-11);
  font-weight: 600; min-width: 22px; text-align: center;
}
.tab.active .tab-badge { background: var(--indigo-50); color: var(--indigo-600); }
.tab:not(.active) .tab-badge { background: var(--surface-subtle); color: var(--slate-500); }

/* --- LAYOUT UTILS --- */

.page-header {
  height: 44px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.page-title { font-size: var(--font-18); font-weight: 700; color: var(--slate-800); }

.avatar {
  border-radius: 50%; background: var(--indigo-100); display: flex;
  align-items: center; justify-content: center; font-weight: 600;
  color: var(--indigo-700); flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: var(--font-13); }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); } .gap-5 { gap: var(--space-5); } .gap-6 { gap: var(--space-6); }
.gap-7 { gap: var(--space-7); } .gap-8 { gap: var(--space-8); } .gap-9 { gap: var(--space-9); }
.gap-10 { gap: var(--space-10); }

.divider { height: 1px; background: var(--slate-200); border: none; }

/* Kanban specific */
.kanban-board {
  display: flex; gap: 12px; height: calc(100vh - var(--topbar-height) - 80px);
  overflow-x: auto; padding-bottom: 16px;
}
.kanban-col {
  background: var(--surface-subtle); border-radius: var(--radius-md);
  min-width: 260px; max-width: 300px; flex: 1;
  display: flex; flex-direction: column; overflow: hidden;
}
.kanban-col-header {
  padding: 12px 14px; font-size: var(--font-13); font-weight: 600;
  color: var(--slate-700); display: flex; justify-content: space-between; align-items: center;
  border-top: 3px solid var(--indigo-400);
}
.kanban-col-body {
  overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; flex: 1;
}
.kanban-card {
  background: var(--surface-card); border-radius: var(--radius-md);
  border: 1px solid var(--slate-200); box-shadow: var(--shadow-sm);
  padding: 12px 14px; cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s;
}
.kanban-card:hover { box-shadow: var(--shadow-md); border-color: var(--indigo-200); }

/* Customer Detail Layout */
.cd-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cd-full { grid-column: 1 / -1; }

/* Vendita Workspace */
.vendita-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; }
.vendita-lines { display: flex; flex-direction: column; gap: 16px; }
.vendita-summary { background: var(--surface-subtle); border-radius: var(--radius-lg); padding: 20px; height: fit-content; position: sticky; top: 80px; }

/* Progress bar */
.progress-bar { height: 6px; background: var(--slate-200); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.indigo { background: var(--indigo-500); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger { background: var(--danger); }

/* Grid utils */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Drawer */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 190; display: none; }
.drawer-overlay.is-open { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; background: var(--surface-card); z-index: 200; box-shadow: -4px 0 16px rgba(0,0,0,0.1); transform: translateX(100%); transition: transform 0.3s ease; }
.drawer.is-open { transform: translateX(0); }
.drawer-header { padding: 20px 24px; border-bottom: 1px solid var(--slate-200); display: flex; justify-content: space-between; align-items: center; }
.drawer-body { padding: 24px; overflow-y: auto; height: calc(100% - 70px); }

.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 80;
  display: none; background: var(--surface-card); border: 1px solid var(--slate-200);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md); overflow: hidden;
}

.baseline-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-12 { grid-column: span 12; }

.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 760px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--slate-300); }
.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.danger { background: var(--danger); }
.status-dot.indigo { background: var(--indigo-500); }
.soft-panel { background: var(--surface-subtle); border: 1px solid var(--slate-200); border-radius: var(--radius-md); padding: 14px; }
.settings-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border-radius: var(--radius-md); background: var(--slate-800); color: white; font-size: var(--font-13); box-shadow: var(--shadow-md); animation: slideIn 0.3s ease; }
.toast.success { background: var(--success); }
.toast.danger { background: var(--danger); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 980px) {
  #topbar { padding: 0 12px; gap: 10px; }
  .topbar-store, .topbar-divider, .topbar-actions { display: none; }
  .topbar-search { min-width: 0; max-width: none; }
  .page-scroll, .page-tabbed, .page-fullheight { padding-left: 16px; padding-right: 16px; }
  .grid-2, .grid-3, .grid-4, .metric-strip, .baseline-grid, .cd-layout, .vendita-layout {
    grid-template-columns: 1fr;
  }
  .settings-layout { grid-template-columns: 1fr; }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-12 { grid-column: 1 / -1; }
  .tab-bar { overflow-x: auto; gap: 20px; }
}
