/* ── TOKENS ── */
:root {
  --orange:        #F5831F;
  --orange-light:  #FF9A3C;
  --orange-dim:    rgba(245, 131, 31, 0.1);
  --orange-glow:   rgba(245, 131, 31, 0.25);

  --bg:            #08090E;
  --bg-2:          #0C0D14;
  --surface:       #0F1118;
  --surface-2:     #13151F;
  --surface-3:     #181C28;
  --surface-4:     #1E2333;

  --border:        rgba(255, 255, 255, 0.055);
  --border-hover:  rgba(255, 255, 255, 0.11);
  --border-active: rgba(245, 131, 31, 0.4);

  --text-1: #F0F2FF;
  --text-2: #8B91AE;
  --text-3: #4E546E;

  --green:   #22D3A8;
  --blue:    #5B8DEF;
  --red:     #F05252;

  --sidebar-w: 220px;
  --topbar-h:  60px;
  --radius:    10px;
  --radius-sm: 7px;
  --radius-xs: 5px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow:    0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t: 0.18s;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
svg { display: block; flex-shrink: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-3); }

/* ════════════════════════════════════════════
   AUTH PAGES
════════════════════════════════════════════ */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* Multi-layer background */
.auth-bg { position: fixed; inset: 0; z-index: 0; }

.auth-bg-gradient {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% -10%, rgba(245,131,31,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(91,141,239,0.06) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 20% 70%, rgba(34,211,168,0.04) 0%, transparent 50%);
}

.auth-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.auth-container {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  padding: 20px 16px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(255,255,255,0.02) inset,
    0 1px 0 rgba(255,255,255,0.05) inset;
  position: relative;
  overflow: hidden;
}

/* Top glint line */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,131,31,0.5), transparent);
}

.auth-logo {
  display: flex; justify-content: center;
  margin-bottom: 24px;
}
.auth-logo img { height: 64px; width: auto; }

.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header h2 {
  font-size: 1.3rem; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
  margin-bottom: 5px;
}
.auth-header p { color: var(--text-2); font-size: 0.875rem; }

.auth-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 14px;
  border: 1px solid;
}
.auth-alert-error   { background: rgba(240,82,82,0.08); color: #FDA4A4; border-color: rgba(240,82,82,0.2); }
.auth-alert-success { background: rgba(34,211,168,0.08); color: #6EE7CC; border-color: rgba(34,211,168,0.2); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.07em;
  display: flex; align-items: center; gap: 7px;
}
.label-badge {
  background: rgba(245,131,31,0.1);
  color: var(--orange-light);
  font-size: 0.6rem; padding: 1px 6px;
  border-radius: 99px; letter-spacing: 0.04em;
  text-transform: none; font-weight: 600;
  border: 1px solid rgba(245,131,31,0.2);
}
.form-group input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text-1);
  font-size: 0.875rem;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  outline: none;
}
.form-group input::placeholder { color: var(--text-3); }
.form-group input:focus {
  background: var(--surface-3);
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--orange-dim);
}

/* PRIMARY BUTTON */
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--orange);
  color: #fff;
  font-weight: 600; font-size: 0.875rem;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  transition: all var(--t) var(--ease);
  white-space: nowrap;
  position: relative; overflow: hidden;
  letter-spacing: -0.01em;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
  pointer-events: none;
}
.btn-primary:hover {
  background: var(--orange-light);
  box-shadow: 0 0 0 3px var(--orange-glow), 0 4px 12px rgba(245,131,31,0.3);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-primary svg { width: 14px; height: 14px; }
.btn-full { width: 100%; justify-content: center; }

/* GHOST BUTTON */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 500; font-size: 0.8rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--t);
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text-1); border-color: var(--border-hover); }

.auth-footer {
  text-align: center; margin-top: 20px;
  font-size: 0.8rem; color: var(--text-3);
}
.auth-footer a { color: var(--orange-light); font-weight: 500; }
.auth-footer a:hover { color: var(--orange); }

/* ════════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform var(--t) var(--ease);
}

/* Subtle inner glow top */
.sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.sidebar-logo {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-img { height: 30px; width: auto; }

.sidebar-nav {
  flex: 1; padding: 10px 8px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 0.8rem; font-weight: 500;
  transition: all var(--t);
  position: relative;
  letter-spacing: -0.01em;
}
.nav-item:hover { background: var(--surface-2); color: var(--text-2); }

.nav-item.active {
  background: var(--surface-3);
  color: var(--text-1);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 2px;
  background: var(--orange);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--orange-glow);
}

.nav-icon { width: 16px; height: 16px; }
.nav-icon svg { width: 16px; height: 16px; }
.nav-label { flex: 1; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.sidebar-version { font-size: 0.68rem; color: var(--text-3); }

/* ════════════════════════════════════════════
   MAIN WRAPPER
════════════════════════════════════════════ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left var(--t) var(--ease);
  background: var(--bg);
}

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0;
  height: var(--topbar-h);
  background: rgba(8, 9, 14, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 90;
}

.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.sidebar-toggle {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-3);
  transition: all var(--t);
}
.sidebar-toggle:hover { background: var(--surface-2); color: var(--text-1); }
.sidebar-toggle svg { width: 16px; height: 16px; }

.page-title {
  font-size: 0.875rem; font-weight: 600;
  color: var(--text-1); letter-spacing: -0.01em;
}

/* ── DRIVE ── */
.drive-wrapper { position: relative; }
.drive-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.78rem; font-weight: 500;
  transition: all var(--t);
  letter-spacing: -0.01em;
}
.drive-btn:hover { border-color: var(--border-hover); color: var(--text-1); background: var(--surface-3); }
.drive-btn svg { width: 14px; height: 14px; }
.drive-badge {
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 1px 5px; border-radius: 99px;
  min-width: 18px; text-align: center;
  line-height: 1.4;
}

.drive-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.02) inset;
  z-index: 200;
  display: none; flex-direction: column;
  overflow: hidden;
}
.drive-panel.open { display: flex; }

.drive-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem; font-weight: 600; color: var(--text-1);
}
.drive-panel-close {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs); color: var(--text-3);
  transition: all var(--t);
}
.drive-panel-close:hover { background: var(--surface-2); color: var(--text-1); }
.drive-panel-close svg { width: 12px; height: 12px; }

.drive-panel-body { max-height: 320px; overflow-y: auto; padding: 6px; }
.drive-empty {
  text-align: center; padding: 28px 16px;
  color: var(--text-3); font-size: 0.78rem;
}
.drive-file-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: var(--radius-xs);
  cursor: pointer; transition: background var(--t);
}
.drive-file-row:hover { background: var(--surface-2); }
.drive-file-icon { color: var(--orange); }
.drive-file-icon svg { width: 13px; height: 13px; }
.drive-file-name { flex: 1; font-size: 0.78rem; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-file-date { font-size: 0.68rem; color: var(--text-3); white-space: nowrap; }
.drive-file-delete { color: var(--text-3); padding: 3px; border-radius: 4px; transition: all var(--t); }
.drive-file-delete:hover { color: var(--red); background: rgba(240,82,82,0.1); }
.drive-file-delete svg { width: 11px; height: 11px; }

/* ── PROFILE ── */
.profile-wrapper { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  transition: background var(--t);
}
.profile-btn:hover { background: var(--surface-2); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange) 0%, #FF6B6B 100%);
  color: #fff; font-weight: 700; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(245,131,31,0.3);
}
.profile-name { font-size: 0.8rem; font-weight: 500; color: var(--text-1); letter-spacing: -0.01em; }
.chevron { width: 12px; height: 12px; color: var(--text-3); }

.profile-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.02) inset;
  z-index: 200; display: none; overflow: hidden;
}
.profile-dropdown.open { display: block; }
.profile-dropdown-info { padding: 12px 14px; }
.profile-dropdown-name { font-size: 0.8rem; font-weight: 600; color: var(--text-1); }
.profile-dropdown-email { font-size: 0.7rem; color: var(--text-3); margin-top: 2px; }
.profile-dropdown-divider { height: 1px; background: var(--border); }
.profile-dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px;
  font-size: 0.8rem; color: var(--text-2);
  transition: all var(--t);
}
.profile-dropdown-item:hover { background: var(--surface-2); color: var(--text-1); }
.profile-dropdown-item.logout:hover { color: var(--red); }
.profile-dropdown-item svg { width: 13px; height: 13px; }

/* ── CONTENT ── */
.content { flex: 1; padding: 24px; }

/* FLASH */
.flash-container { margin-bottom: 18px; display: flex; flex-direction: column; gap: 7px; }
.flash {
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 0.8rem; border: 1px solid;
}
.flash-error   { background: rgba(240,82,82,0.08); color: #FDA4A4; border-color: rgba(240,82,82,0.2); }
.flash-success { background: rgba(34,211,168,0.08); color: #6EE7CC; border-color: rgba(34,211,168,0.2); }

/* ════════════════════════════════════════════
   CARDS
════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  transition: border-color var(--t);
}
.card:hover { border-color: var(--border-hover); }

.card-header { margin-bottom: 14px; }
.card-header h3 {
  font-size: 0.68rem; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── DASHBOARD GRID ── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.col-span-full { grid-column: 1 / -1; }
.col-span-2 { grid-column: span 2; }

/* WELCOME CARD */
.card-welcome {
  background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);
  border-color: rgba(245,131,31,0.15);
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 20px; padding: 24px 28px;
  overflow: hidden;
}
.card-welcome::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,131,31,0.4), transparent);
}
.card-welcome::after {
  content: '';
  position: absolute; top: -60px; right: -40px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(245,131,31,0.08), transparent 70%);
  pointer-events: none;
}
.card-welcome-text h2 {
  font-size: 1.25rem; font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 5px;
}
.card-welcome-text p { color: var(--text-2); font-size: 0.8rem; }
.card-welcome-graphic { width: 100px; opacity: 0.8; flex-shrink: 0; position: relative; z-index: 1; }

/* STAT CARDS */
.stat-card { display: flex; align-items: flex-start; gap: 14px; }
.stat-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon-orange { background: rgba(245,131,31,0.1); color: var(--orange); border: 1px solid rgba(245,131,31,0.15); }
.stat-icon-blue   { background: rgba(91,141,239,0.1); color: var(--blue); border: 1px solid rgba(91,141,239,0.15); }
.stat-icon-green  { background: rgba(34,211,168,0.1); color: var(--green); border: 1px solid rgba(34,211,168,0.15); }

.stat-label { font-size: 0.68rem; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text-1); letter-spacing: -0.03em; margin: 3px 0; }
.stat-sub { font-size: 0.68rem; color: var(--text-3); }

/* QUICK ACTIONS */
.quick-actions { display: flex; flex-direction: column; gap: 8px; }
.quick-action-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--t); cursor: pointer;
}
.quick-action-btn:hover { border-color: var(--border-hover); background: var(--surface-3); }
.qa-icon {
  width: 30px; height: 30px;
  background: var(--orange-dim); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--orange); flex-shrink: 0;
  border: 1px solid rgba(245,131,31,0.12);
}
.qa-icon svg { width: 13px; height: 13px; }
.qa-label { flex: 1; font-size: 0.8rem; font-weight: 500; color: var(--text-1); letter-spacing: -0.01em; }
.qa-arrow { width: 13px; height: 13px; color: var(--text-3); }

/* QUICKLINK CARDS (dashboard) */
.dash-grid-3col {
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
}
.card-quicklink {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 20px;
  text-decoration: none; color: inherit;
  cursor: pointer; border: none; text-align: left; width: 100%;
  background: var(--surface-1);
  transition: border-color var(--t), background var(--t), transform var(--t);
}
.card-quicklink:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.ql-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ql-icon svg { width: 20px; height: 20px; }
.ql-icon-orange { background: rgba(245,131,31,0.1); color: var(--orange); border: 1px solid rgba(245,131,31,0.15); }
.ql-icon-blue   { background: rgba(91,141,239,0.1); color: var(--blue); border: 1px solid rgba(91,141,239,0.15); }
.ql-icon-green  { background: rgba(34,211,168,0.1); color: var(--green); border: 1px solid rgba(34,211,168,0.15); }
.ql-body { flex: 1; }
.ql-title { font-size: 0.95rem; font-weight: 600; color: var(--text-1); letter-spacing: -0.02em; }
.ql-sub { font-size: 0.73rem; color: var(--text-3); margin-top: 2px; }
.ql-arrow { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }

/* FILE LIST */
.file-list { display: flex; flex-direction: column; gap: 1px; }
.file-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 5px; border-radius: var(--radius-xs);
  transition: background var(--t);
}
.file-item:hover { background: var(--surface-2); }
.file-type-badge {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 1px 6px; border-radius: 99px; flex-shrink: 0;
}
.file-type-analisi { background: rgba(245,131,31,0.1); color: var(--orange-light); border: 1px solid rgba(245,131,31,0.15); }
.file-type-conto   { background: rgba(91,141,239,0.1); color: var(--blue); border: 1px solid rgba(91,141,239,0.15); }
.file-type-report  { background: rgba(34,211,168,0.1); color: var(--green); border: 1px solid rgba(34,211,168,0.15); }
.file-name { flex: 1; font-size: 0.78rem; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-date { font-size: 0.68rem; color: var(--text-3); flex-shrink: 0; }

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 28px 16px; color: var(--text-3); text-align: center;
}
.empty-state svg { width: 28px; height: 28px; opacity: 0.3; }
.empty-state p { font-size: 0.78rem; }

/* ════════════════════════════════════════════
   INNER PAGES
════════════════════════════════════════════ */
.page-section { display: flex; flex-direction: column; gap: 20px; }

.section-intro {
  display: flex; align-items: flex-end;
  justify-content: space-between; gap: 16px;
}
.section-intro-text h2 {
  font-size: 1.15rem; font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 3px;
}
.section-intro-text p { color: var(--text-2); font-size: 0.8rem; }

/* KPI STRIP */
.kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color var(--t);
}
.kpi-card:hover { border-color: var(--border-hover); }
.kpi-label {
  font-size: 0.6rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.kpi-value { font-size: 1.35rem; font-weight: 700; color: var(--text-1); letter-spacing: -0.03em; }

/* COMING SOON */
.coming-soon-card {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 48px 40px;
  border-style: dashed;
  background: transparent;
}
.coming-soon-icon {
  width: 52px; height: 52px;
  background: var(--surface-3);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--orange);
  margin-bottom: 18px;
  border: 1px solid rgba(245,131,31,0.2);
  box-shadow: 0 0 20px rgba(245,131,31,0.08);
}
.coming-soon-icon svg { width: 24px; height: 24px; }
.coming-soon-card h3 { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.coming-soon-card p { color: var(--text-2); font-size: 0.8rem; max-width: 420px; line-height: 1.75; }

.coming-soon-features {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px; margin-top: 24px; text-align: left;
}
.cs-feature {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.78rem; color: var(--text-2);
}
.cs-feature svg { width: 13px; height: 13px; color: var(--green); flex-shrink: 0; }

/* ════════════════════════════════════════════
   SIDEBAR COLLAPSED
════════════════════════════════════════════ */
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main-wrapper { margin-left: 0; }

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .kpi-strip { grid-template-columns: repeat(3, 1fr); }
  .coming-soon-features { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid-3col { grid-template-columns: 1fr 1fr; }
  .col-span-2 { grid-column: span 2; }
}
@media (max-width: 680px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); width: 220px; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid-3col { grid-template-columns: 1fr; }
  .col-span-2, .col-span-full { grid-column: span 1; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .card-welcome { flex-direction: column; }
  .card-welcome-graphic { display: none; }
  .section-intro { flex-direction: column; align-items: flex-start; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .profile-name { display: none; }
}

/* ════════════════════════════════════════════
   CONTO ECONOMICO
════════════════════════════════════════════ */
.ce-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

/* ── Input card ── */
.ce-card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-2); text-transform: uppercase;
  letter-spacing: 0.07em; margin-bottom: 20px;
}
.ce-card-title svg { width: 14px; height: 14px; color: var(--orange); }

.ce-form { display: flex; flex-direction: column; gap: 16px; }

.ce-field { display: flex; flex-direction: column; gap: 6px; }
.ce-field label {
  font-size: 0.7rem; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.optional-tag {
  font-size: 0.6rem; font-weight: 500;
  color: var(--text-3); text-transform: none;
  background: var(--surface-3); padding: 1px 6px;
  border-radius: 99px; letter-spacing: 0; margin-left: 4px;
  border: 1px solid var(--border);
}

.input-wrapper {
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
}
.input-wrapper:focus-within {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--orange-dim);
}
.input-wrapper.hidden { display: none; }

.input-prefix {
  padding: 0 11px;
  font-size: 0.78rem; font-weight: 600; color: var(--text-3);
  background: var(--surface-3);
  border-right: 1px solid var(--border);
  height: 100%; display: flex; align-items: center;
  user-select: none;
  min-height: 38px;
}
.input-wrapper input {
  flex: 1; background: transparent; border: none;
  padding: 9px 12px; color: var(--text-1);
  font-size: 0.875rem; outline: none;
}
.input-wrapper input::placeholder { color: var(--text-3); }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }

.field-hint { font-size: 0.68rem; color: var(--text-3); padding-left: 2px; }

/* Payment toggle */
.toggle-label-row {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 0;
}
.payment-toggle {
  display: flex;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px; gap: 2px;
}
.ptoggle-btn {
  font-size: 0.68rem; font-weight: 600;
  padding: 4px 10px; border-radius: 4px;
  color: var(--text-3); transition: all var(--t);
  letter-spacing: 0.02em;
}
.ptoggle-btn.active { background: var(--surface); color: var(--text-1); box-shadow: var(--shadow-sm); }

.btn-calc { margin-top: 4px; }

/* ── Results ── */
.ce-results { display: flex; flex-direction: column; gap: 16px; }

/* Placeholder */
.ce-placeholder {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 60px 20px; text-align: center;
  color: var(--text-3);
}
.ce-placeholder-icon {
  width: 48px; height: 48px;
  background: var(--surface-2); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.ce-placeholder-icon svg { width: 22px; height: 22px; opacity: 0.4; }
.ce-placeholder p { font-size: 0.8rem; line-height: 1.7; }

/* KPI strip */
.ce-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.ce-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color var(--t);
}
.ce-kpi-card:hover { border-color: var(--border-hover); }
.ce-kpi-label {
  font-size: 0.6rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px;
}
.ce-kpi-value {
  font-size: 1.25rem; font-weight: 700;
  color: var(--text-1); letter-spacing: -0.03em;
}
.ce-kpi-positive { border-color: rgba(34,211,168,0.2); }
.ce-kpi-positive .ce-kpi-value { color: var(--green); }
.ce-kpi-negative { border-color: rgba(240,82,82,0.2); }
.ce-kpi-negative .ce-kpi-value { color: var(--red); }
.ce-kpi-highlight { border-color: rgba(245,131,31,0.2); }
.ce-kpi-highlight .ce-kpi-value { color: var(--orange-light); }

/* Cost breakdown */
.cost-breakdown { display: flex; flex-direction: column; gap: 14px; }

.breakdown-row { display: flex; flex-direction: column; gap: 6px; }
.breakdown-top {
  display: flex; align-items: center; gap: 8px;
}
.breakdown-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.breakdown-label { flex: 1; font-size: 0.8rem; color: var(--text-2); }
.breakdown-value { font-size: 0.8rem; font-weight: 600; color: var(--text-1); }
.breakdown-pct {
  font-size: 0.68rem; color: var(--text-3);
  background: var(--surface-3); padding: 1px 6px;
  border-radius: 99px; min-width: 40px; text-align: center;
}
.breakdown-bar-track {
  height: 4px; background: var(--surface-3);
  border-radius: 99px; overflow: hidden;
}
.breakdown-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width 0.5s var(--ease);
}

.breakdown-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0 0; border-top: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 600; color: var(--text-2);
}
.breakdown-margin { color: var(--green); padding-top: 8px; border-top: none; }
.breakdown-margin.negative { color: var(--red); }

/* ROAS interpretation */
.roas-banner {
  border: 1px solid; border-radius: var(--radius-sm);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 18px;
}
.roas-badge {
  display: inline-flex; align-items: center;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; padding: 3px 10px;
  border-radius: 99px; border: 1px solid; width: fit-content;
}
.roas-desc { font-size: 0.8rem; color: var(--text-2); line-height: 1.75; }
.roas-desc strong { color: var(--text-1); }

/* ROAS scale */
.roas-scale {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
.scale-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.scale-bar {
  width: 100%; height: 5px; border-radius: 99px;
  background: var(--surface-3);
  transition: all 0.4s var(--ease);
}
.scale-label {
  font-size: 0.65rem; font-weight: 600; color: var(--text-3);
  transition: color 0.3s;
}
.scale-sublabel { font-size: 0.6rem; color: var(--text-3); }
.scale-active .scale-label { font-weight: 700; }

.hidden { display: none !important; }

@media (max-width: 900px) {
  .ce-layout { grid-template-columns: 1fr; }
  .ce-kpis { grid-template-columns: repeat(2, 1fr); }
  .roas-scale { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 500px) {
  .ce-kpis { grid-template-columns: 1fr 1fr; }
}

/* ════════════════════════════════════════════
   META CAMPAIGNS
════════════════════════════════════════════ */
.mc-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}
.mc-sidebar { display: flex; flex-direction: column; gap: 16px; }
.mc-results { display: flex; flex-direction: column; gap: 16px; }

/* Upload zone */
.upload-card .ce-card-title { margin-bottom: 14px; }
.upload-zone {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 20px 16px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--t);
  text-align: center;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--orange);
  background: var(--orange-dim);
}
.upload-icon {
  width: 36px; height: 36px;
  background: var(--surface-3); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--orange);
}
.upload-icon svg { width: 18px; height: 18px; }
.upload-text { display: flex; flex-direction: column; gap: 2px; }
.upload-main { font-size: 0.8rem; font-weight: 600; color: var(--text-1); }
.upload-sub  { font-size: 0.7rem; color: var(--text-3); }

.upload-info {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem; color: var(--text-2);
}
.upload-info svg { width: 14px; height: 14px; color: var(--orange); flex-shrink: 0; }
.upload-info span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-info button { color: var(--text-3); padding: 2px; border-radius: 4px; transition: all var(--t); }
.upload-info button:hover { color: var(--red); background: rgba(240,82,82,0.1); }
.upload-info button svg { width: 12px; height: 12px; }

/* Section label */
.mc-section-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-3); margin-bottom: 10px;
}

/* KPI grid */
.mc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.mc-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color var(--t);
}
.mc-kpi-card:hover { border-color: var(--border-hover); }
.mc-kpi-sub { font-size: 0.65rem; color: var(--text-3); margin-top: 4px; }
.mc-kpi-green  { border-color: rgba(34,211,168,0.2); }
.mc-kpi-green  .ce-kpi-value { color: var(--green); }
.mc-kpi-red    { border-color: rgba(240,82,82,0.2); }
.mc-kpi-red    .ce-kpi-value { color: var(--red); }
.mc-kpi-orange { border-color: rgba(245,131,31,0.2); }
.mc-kpi-orange .ce-kpi-value { color: var(--orange-light); }

/* Table */
.mc-table-wrapper { overflow-x: auto; }
.mc-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.78rem;
}
.mc-table th {
  text-align: left; padding: 8px 12px;
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.mc-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
.mc-table tr:last-child td { border-bottom: none; }
.mc-table tr:hover td { background: var(--surface-2); }
.td-name { color: var(--text-1); font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Colors */
.color-green  { color: var(--green) !important; }
.color-red    { color: var(--red) !important; }
.color-orange { color: var(--orange-light) !important; }
.color-muted  { color: var(--text-3) !important; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 99px;
  border: 1px solid; white-space: nowrap;
}
.badge-green  { background: rgba(34,211,168,0.1); color: var(--green); border-color: rgba(34,211,168,0.2); }
.badge-red    { background: rgba(240,82,82,0.1);  color: var(--red);   border-color: rgba(240,82,82,0.2); }
.badge-blue   { background: rgba(91,141,239,0.1); color: var(--blue);  border-color: rgba(91,141,239,0.2); }
.badge-purple { background: rgba(167,139,250,0.1);color: #A78BFA;      border-color: rgba(167,139,250,0.2); }
.badge-gray   { background: var(--surface-3);     color: var(--text-3);border-color: var(--border); }
.badge-orange { background: var(--orange-dim);    color: var(--orange-light); border-color: rgba(245,131,31,0.2); }

/* Verdict */
.verdict {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 99px; border: 1px solid;
}
.verdict-good    { background: rgba(34,211,168,0.1); color: var(--green); border-color: rgba(34,211,168,0.2); }
.verdict-bad     { background: rgba(240,82,82,0.1);  color: var(--red);   border-color: rgba(240,82,82,0.2); }
.verdict-neutral { background: var(--surface-3);     color: var(--text-3);border-color: var(--border); }

/* Creative cards */
.mcCreativeGrid { display: flex; flex-direction: column; gap: 1px; }
#mcCreativeGrid { display: flex; flex-direction: column; gap: 12px; }

.creative-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color var(--t);
}
.creative-card:hover { border-color: var(--border-hover); }
.creative-winner {
  border-color: rgba(34,211,168,0.25);
  background: linear-gradient(135deg, rgba(34,211,168,0.04) 0%, var(--surface-2) 60%);
}

.creative-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.creative-tipo { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.creative-rank { font-size: 0.7rem; color: var(--text-3); }
.creative-name { font-size: 0.875rem; font-weight: 600; color: var(--text-1); letter-spacing: -0.01em; }
.creative-verdict {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 99px; border: 1px solid;
  white-space: nowrap; flex-shrink: 0;
}
.creative-verdict.verdict-good    { background: rgba(34,211,168,0.1); color: var(--green); border-color: rgba(34,211,168,0.25); }
.creative-verdict.verdict-bad     { background: rgba(240,82,82,0.1);  color: var(--red);   border-color: rgba(240,82,82,0.25); }
.creative-verdict.verdict-neutral { background: var(--surface-3);     color: var(--text-3);border-color: var(--border); }

.creative-desc {
  font-size: 0.78rem; color: var(--text-2);
  line-height: 1.7; margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--surface-3); border-radius: var(--radius-xs);
  border-left: 2px solid var(--border-hover);
}

.creative-metrics {
  display: grid; grid-template-columns: repeat(9, 1fr);
  gap: 8px; margin-bottom: 14px;
}
.creative-metric { text-align: center; }
.cm-label { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 4px; }
.cm-value { font-size: 0.8rem; font-weight: 600; color: var(--text-1); }

/* ROAS bar */
.creative-roas-bar { display: flex; flex-direction: column; gap: 6px; }
.crb-label { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-2); font-weight: 500; }
.crb-be { color: var(--text-3); }
.crb-track { position: relative; height: 5px; background: var(--surface-3); border-radius: 99px; overflow: visible; }
.crb-fill { height: 100%; border-radius: 99px; transition: width 0.5s var(--ease); }
.crb-marker {
  position: absolute; top: -3px; width: 2px; height: 11px;
  background: var(--orange); border-radius: 1px;
  transform: translateX(-50%);
}

/* Video retention */
#mcVideoGrid { display: flex; flex-direction: column; gap: 14px; }
.video-retention-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.vr-header {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px;
}
.vr-name { flex: 1; font-size: 0.8rem; font-weight: 600; color: var(--text-1); }
.vr-views { font-size: 0.7rem; color: var(--text-3); }
.vr-funnel { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.vr-step { display: grid; grid-template-columns: 36px 1fr 120px; align-items: center; gap: 12px; }
.vr-step-label { font-size: 0.68rem; font-weight: 700; color: var(--text-3); text-align: right; }
.vr-step-bar-track { height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.vr-step-bar { height: 100%; border-radius: 99px; transition: width 0.5s var(--ease); }
.vr-step-vals { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-2); }
.vr-pct { color: var(--text-3); font-weight: 600; }
.vr-insight {
  font-size: 0.75rem; color: var(--text-2); line-height: 1.65;
  padding: 9px 12px; background: var(--surface-3);
  border-radius: var(--radius-xs); border-left: 2px solid var(--border-hover);
}

@media (max-width: 1100px) {
  .mc-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .creative-metrics { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px) {
  .mc-layout { grid-template-columns: 1fr; }
  .mc-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── CPA Analysis ── */
.cpa-intro {
  font-size: 0.78rem; color: var(--text-2); line-height: 1.7;
  padding: 10px 14px; background: var(--surface-3);
  border-radius: var(--radius-xs); margin-bottom: 16px;
  border-left: 2px solid var(--orange);
}
.cpa-intro strong { color: var(--text-1); }
.cpa-rows { display: flex; flex-direction: column; gap: 14px; }
.cpa-row { display: flex; flex-direction: column; gap: 6px; }
.cpa-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cpa-name { font-size: 0.8rem; font-weight: 600; color: var(--text-1); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpa-values { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; flex-shrink: 0; }
.cpa-sep { color: var(--text-3); }
.cpa-delta { font-size: 0.68rem; padding: 2px 7px; border-radius: 99px; border: 1px solid; }
.delta-ok  { background: rgba(34,211,168,0.1); color: var(--green); border-color: rgba(34,211,168,0.2); }
.delta-bad { background: rgba(240,82,82,0.1);  color: var(--red);   border-color: rgba(240,82,82,0.2); }
.cpa-bar-track { position: relative; height: 5px; background: var(--surface-3); border-radius: 99px; overflow: visible; }
.cpa-bar-fill  { height: 100%; border-radius: 99px; transition: width 0.5s var(--ease); }
.cpa-bar-max   { position: absolute; top: -3px; width: 2px; height: 11px; background: var(--orange); border-radius: 1px; transform: translateX(-50%); }

/* ── Scalability ── */
.scala-intro {
  font-size: 0.78rem; color: var(--text-2); line-height: 1.7;
  padding: 10px 14px; background: var(--surface-3);
  border-radius: var(--radius-xs); margin-bottom: 16px;
  border-left: 2px solid var(--blue);
}
.scala-intro strong { color: var(--text-1); }
.scala-rows { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.scala-row { display: flex; flex-direction: column; gap: 7px; }
.scala-row-top { display: flex; align-items: center; gap: 8px; }
.scala-status { font-size: 0.85rem; flex-shrink: 0; }
.scala-name { flex: 1; font-size: 0.8rem; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scala-freq-val { font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.scala-bar-track { position: relative; height: 5px; background: var(--surface-3); border-radius: 99px; overflow: visible; }
.scala-bar-fill  { height: 100%; border-radius: 99px; transition: width 0.5s var(--ease); }
.scala-bar-marker { position: absolute; top: -3px; width: 2px; height: 11px; background: var(--text-3); border-radius: 1px; transform: translateX(-50%); }
.scala-bar-saturate { background: var(--red); }
.scala-hint { font-size: 0.72rem; color: var(--text-3); padding-left: 2px; }
.scala-hint em { color: var(--text-2); font-style: normal; }
.scala-legend { display: flex; gap: 16px; font-size: 0.7rem; color: var(--text-3); padding-top: 10px; border-top: 1px solid var(--border); }
.leg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* ── What-if Simulator ── */
.whatif-desc { font-size: 0.78rem; color: var(--text-2); margin-bottom: 18px; }
.whatif-body { display: flex; flex-direction: column; gap: 16px; }
.whatif-slider-row { display: flex; align-items: center; gap: 14px; }
.whatif-slider-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); white-space: nowrap; }
.whatif-slider-wrap { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.whatif-slider-wrap input[type=range] {
  width: 100%; -webkit-appearance: none;
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right, var(--orange) 0%, var(--orange) 10%, var(--surface-3) 10%);
  outline: none; cursor: pointer;
}
.whatif-slider-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--orange);
  border: 2px solid var(--bg); box-shadow: 0 0 0 3px var(--orange-dim);
  cursor: pointer;
}
.whatif-ticks { display: flex; justify-content: space-between; font-size: 0.6rem; color: var(--text-3); padding: 0 2px; }
.whatif-mult { font-size: 1.1rem; font-weight: 700; color: var(--orange-light); min-width: 42px; text-align: right; }
.whatif-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.whatif-kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.whatif-kpi-neg { border-color: rgba(240,82,82,0.2); }
.whatif-delta { font-size: 0.65rem; font-weight: 600; margin-top: 4px; }

/* ── Score pill & ring ── */
.score-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; padding: 2px 7px;
  border-radius: 99px; font-size: 0.72rem; font-weight: 700; border: 1px solid;
}
.score-excellent { background: rgba(34,211,168,0.12); color: var(--green);  border-color: rgba(34,211,168,0.25); }
.score-good      { background: rgba(91,141,239,0.12); color: var(--blue);   border-color: rgba(91,141,239,0.25); }
.score-medium    { background: rgba(245,158,11,0.12); color: #FBBF24;       border-color: rgba(245,158,11,0.25); }
.score-low       { background: rgba(240,82,82,0.12);  color: var(--red);    border-color: rgba(240,82,82,0.25); }

.score-ring {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid;
  min-width: 64px; flex-shrink: 0;
}
.score-ring-val   { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.score-ring-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.score-ring.score-excellent { background: rgba(34,211,168,0.08); border-color: rgba(34,211,168,0.25); color: var(--green); }
.score-ring.score-good      { background: rgba(91,141,239,0.08); border-color: rgba(91,141,239,0.25); color: var(--blue); }
.score-ring.score-medium    { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.25); color: #FBBF24; }
.score-ring.score-low       { background: rgba(240,82,82,0.08);  border-color: rgba(240,82,82,0.25);  color: var(--red); }

/* ── Creative card updates ── */
.creative-right { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex-shrink: 0; }
.creative-warning {
  font-size: 0.75rem; color: #FBBF24;
  padding: 7px 10px; background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2); border-radius: var(--radius-xs);
  margin-bottom: 6px;
}

/* ── Video retention updates ── */
.vr-metrics-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.vr-metric-box { background: var(--surface-3); border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid var(--border); }
.vr-metric-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin-bottom: 5px; }
.vr-metric-value { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-1); }
.vr-metric-sub   { font-size: 0.62rem; color: var(--text-3); margin-top: 2px; }
.vr-insights { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.vr-insight {
  font-size: 0.75rem; color: var(--text-2); line-height: 1.65;
  padding: 9px 12px; background: var(--surface-3);
  border-radius: var(--radius-xs); border-left: 2px solid var(--border-hover);
}

@media (max-width: 900px) {
  .whatif-kpis { grid-template-columns: repeat(3, 1fr); }
  .vr-metrics-row { grid-template-columns: 1fr 1fr; }
  .creative-metrics { grid-template-columns: repeat(5, 1fr); }
}

/* ════════════════════════════════════════════
   DRIVE DRAWER
════════════════════════════════════════════ */
.drive-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t) var(--ease);
}
.drive-overlay.open { opacity: 1; pointer-events: all; }

.drive-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1001;
  width: 520px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
  box-shadow: -8px 0 40px rgba(0,0,0,0.55);
}
.drive-drawer.open { transform: translateX(0); }

.drive-drawer-header {
  display: flex; align-items: center; gap: 11px;
  padding: 0 18px; height: 60px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drive-drawer-header > svg { width: 17px; height: 17px; color: var(--orange); flex-shrink: 0; }
.drive-drawer-title { font-size: 0.88rem; font-weight: 700; color: var(--text-1); flex: 1; }
.drive-drawer-close {
  width: 30px; height: 30px; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); transition: color var(--t), background var(--t);
}
.drive-drawer-close:hover { color: var(--text-1); background: var(--surface-3); }
.drive-drawer-close svg { width: 15px; height: 15px; }

.drive-drawer-body { display: flex; flex: 1; overflow: hidden; }

/* Folder sidebar */
.drive-folders-panel {
  width: 175px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.drive-folders-title {
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--text-3);
  padding: 13px 13px 8px;
}
.drive-folders-list { flex: 1; overflow-y: auto; padding: 0 7px 8px; }
.drive-folder-item {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 9px; border-radius: var(--radius-xs);
  cursor: pointer; user-select: none;
  color: var(--text-2); font-size: 0.76rem; font-weight: 500;
  transition: background var(--t), color var(--t);
  position: relative;
}
.drive-folder-item:hover { background: var(--surface-3); color: var(--text-1); }
.drive-folder-item.active { background: var(--orange-dim); color: var(--orange); }
.drive-folder-icon { width: 13px; height: 13px; flex-shrink: 0; }
.drive-folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.drive-folder-count {
  font-size: 0.58rem; font-weight: 700;
  background: var(--surface-3); color: var(--text-3);
  padding: 1px 5px; border-radius: 99px; min-width: 16px; text-align: center;
}
.drive-folder-item.active .drive-folder-count { background: rgba(245,131,31,0.15); color: var(--orange); }
.drive-folder-lock { width: 9px; height: 9px; flex-shrink: 0; color: var(--text-3); }
.drive-folder-actions { display: none; gap: 1px; }
.drive-folder-item:hover .drive-folder-actions,
.drive-folder-item.active .drive-folder-actions { display: flex; }
.drive-folder-action-btn {
  width: 19px; height: 19px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); transition: color var(--t), background var(--t);
}
.drive-folder-action-btn:hover { color: var(--text-1); background: var(--surface-4); }
.drive-folder-action-btn.del-btn:hover { color: var(--red); background: rgba(240,82,82,0.1); }
.drive-folder-action-btn svg { width: 10px; height: 10px; }

.drive-new-folder-btn {
  display: flex; align-items: center; gap: 6px;
  margin: 7px 7px 8px;
  padding: 7px 9px; border-radius: var(--radius-xs);
  border: 1px dashed var(--border-hover);
  color: var(--text-3); font-size: 0.72rem; font-weight: 500;
  transition: all var(--t); cursor: pointer;
}
.drive-new-folder-btn:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-dim); }
.drive-new-folder-btn svg { width: 12px; height: 12px; }

/* Files panel */
.drive-files-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.drive-files-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px 9px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.drive-files-folder-name { font-size: 0.78rem; font-weight: 600; color: var(--text-1); }
.drive-files-count { font-size: 0.68rem; color: var(--text-3); }
.drive-files-list { flex: 1; overflow-y: auto; padding: 6px 8px; }

.drive-file-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: var(--radius-xs);
  cursor: pointer; transition: background var(--t);
  border: 1px solid transparent;
}
.drive-file-row:hover { background: var(--surface-2); border-color: var(--border); }
.drive-file-icon {
  width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.drive-file-icon-meta  { background: rgba(91,141,239,0.12); color: var(--blue); }
.drive-file-icon-conto { background: rgba(34,211,168,0.12); color: var(--green); }
.drive-file-icon svg { width: 13px; height: 13px; }
.drive-file-info { flex: 1; min-width: 0; }
.drive-file-name { font-size: 0.76rem; font-weight: 500; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-file-meta { font-size: 0.63rem; color: var(--text-3); margin-top: 1px; }
.drive-file-type-badge {
  font-size: 0.56rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 2px 5px; border-radius: 4px; flex-shrink: 0;
}
.drive-file-type-meta  { background: rgba(91,141,239,0.12); color: var(--blue); }
.drive-file-type-conto { background: rgba(34,211,168,0.12); color: var(--green); }
.drive-file-btn {
  width: 25px; height: 25px; border-radius: 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); opacity: 0;
  transition: opacity var(--t), color var(--t), background var(--t);
}
.drive-file-row:hover .drive-file-btn { opacity: 1; }
.drive-file-btn:hover { color: var(--text-1); background: var(--surface-4); }
.drive-file-btn.drive-file-delete:hover { color: var(--red); background: rgba(240,82,82,0.1); }
.drive-file-btn svg { width: 12px; height: 12px; }

.drive-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  padding: 50px 20px; text-align: center;
  color: var(--text-3); font-size: 0.76rem;
}
.drive-empty svg { width: 30px; height: 30px; opacity: 0.25; }

/* ════════════════════════════════════════════
   SAVE MODAL
════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--surface-2);
  border: 1px solid var(--border-hover);
  border-radius: 14px; padding: 26px;
  width: 380px; max-width: 95vw;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(8px);
  transition: transform 0.22s var(--ease);
}
.modal-overlay.open .modal-box { transform: scale(1) translateY(0); }
.modal-title {
  font-size: 0.92rem; font-weight: 700; color: var(--text-1);
  margin-bottom: 20px; display: flex; align-items: center; gap: 9px;
}
.modal-title svg { width: 16px; height: 16px; color: var(--orange); flex-shrink: 0; }
.modal-field { margin-bottom: 13px; }
.modal-field label {
  font-size: 0.63rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.07em;
  display: block; margin-bottom: 6px;
}
.modal-field input, .modal-field select {
  width: 100%; padding: 10px 12px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-1);
  font-size: 0.82rem; font-family: inherit;
  transition: border-color var(--t); outline: none;
}
.modal-field input:focus, .modal-field select:focus { border-color: var(--border-active); }
.modal-field select { cursor: pointer; }
.modal-field select option { background: var(--surface-3); }
.modal-actions { display: flex; gap: 9px; margin-top: 20px; }
.modal-actions .btn-cancel {
  flex: 1; padding: 10px; border-radius: var(--radius-xs);
  background: var(--surface-3); color: var(--text-2);
  font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--border); transition: all var(--t);
}
.modal-actions .btn-cancel:hover { background: var(--surface-4); color: var(--text-1); }
.modal-actions .btn-save {
  flex: 2; padding: 10px; border-radius: var(--radius-xs);
  background: var(--orange); color: #fff;
  font-size: 0.82rem; font-weight: 700;
  transition: background var(--t), box-shadow var(--t);
}
.modal-actions .btn-save:hover { background: var(--orange-light); box-shadow: 0 0 16px var(--orange-glow); }

/* ── Upload zone nel drive ── */
.drive-upload-zone {
  margin: 10px 8px;
  padding: 18px 14px;
  border: 1.5px dashed var(--border-hover);
  border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; transition: all var(--t); text-align: center;
}
.drive-upload-zone:hover {
  border-color: var(--orange);
  background: var(--orange-dim);
}
.drive-upload-zone svg { width: 22px; height: 22px; color: var(--text-3); transition: color var(--t); }
.drive-upload-zone:hover svg { color: var(--orange); }
.drive-upload-zone-title { font-size: 0.78rem; font-weight: 600; color: var(--text-2); }
.drive-upload-zone-sub { font-size: 0.65rem; color: var(--text-3); }
.drive-upload-zone:hover .drive-upload-zone-title { color: var(--orange); }

.drive-drop-active { background: var(--orange-dim) !important; border-color: var(--orange) !important; }

/* ── File icon per tipo ── */
.drive-file-icon-upload-pdf   { background: rgba(240,82,82,0.12);   color: var(--red); }
.drive-file-icon-upload-img   { background: rgba(34,211,168,0.12);  color: var(--green); }
.drive-file-icon-upload-sheet { background: rgba(34,211,168,0.12);  color: #16A34A; }
.drive-file-icon-upload-doc   { background: rgba(91,141,239,0.12);  color: var(--blue); }
.drive-file-icon-upload-other { background: var(--surface-3);       color: var(--text-3); }

/* Salva Ricerca floating button */
.results-actions {
  display: flex; justify-content: flex-end; margin-bottom: 14px;
}
.btn-salva-ricerca {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--radius-xs);
  background: var(--surface-3); color: var(--text-2);
  font-size: 0.76rem; font-weight: 600;
  border: 1px solid var(--border); transition: all var(--t); cursor: pointer;
}
.btn-salva-ricerca:hover {
  background: var(--orange-dim); color: var(--orange);
  border-color: var(--border-active);
}
.btn-salva-ricerca svg { width: 13px; height: 13px; }
