/* BP Nexus light theme — token da analisi/cruscotto.html */

:root {
  --bg: #f0f4f8;
  --bg2: #ffffff;
  --bg3: #e8edf3;
  --line: #d0d9e4;
  --txt: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --accent2: #1d4ed8;
  --accent-soft: #eff6ff;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --yellow: #b45309;
  --yellow-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.05);
}

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

body {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-size: 15px;
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-size: 0.9em;
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
}

#app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg2);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.brand .logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 17px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.brand b {
  font-size: 15px;
  display: block;
  color: var(--txt);
}

.brand span {
  font-size: 11px;
  color: var(--muted);
}

.nav {
  padding: 12px 10px;
  flex: 1;
}

.nav-group {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  padding: 14px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--muted);
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 2px;
  transition: 0.15s;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: var(--bg3);
  color: var(--txt);
  text-decoration: none;
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  border-color: #bfdbfe;
}

.nav-link.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.nav .ico {
  width: 22px;
  text-align: center;
  font-size: 16px;
}

.sidebar .note {
  font-size: 11px;
  color: var(--muted);
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg3);
  line-height: 1.5;
}

/* Main */
.main {
  flex: 1;
  padding: 28px 36px 48px;
  max-width: 1200px;
  width: 100%;
}

.page-hd {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--line);
}

.page-hd h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--txt);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.page-hd .sub {
  color: var(--muted);
  font-size: 14px;
  max-width: 680px;
  line-height: 1.55;
}

.page-hd .tagrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.section {
  margin-bottom: 32px;
}

.section-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.section-hd h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--txt);
}

.grid {
  display: grid;
  gap: 16px;
}

.g3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  #app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .g3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.kpi {
  border-left: 4px solid var(--line);
}

.kpi .lab {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.kpi .val {
  font-size: 32px;
  font-weight: 800;
  margin: 8px 0 4px;
  letter-spacing: -0.5px;
}

.kpi .desc {
  font-size: 12px;
  color: var(--muted);
}

.kpi.red {
  border-color: var(--red);
}

.kpi.red .val {
  color: var(--red);
}

.kpi.green {
  border-color: var(--green);
}

.kpi.green .val {
  color: var(--green);
}

.kpi.blue {
  border-color: var(--accent);
}

.kpi.blue .val {
  color: var(--accent);
}

.kpi.yellow {
  border-color: var(--yellow);
}

.kpi.yellow .val {
  color: var(--yellow);
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid transparent;
}

.b-red {
  background: var(--red-soft);
  color: var(--red);
  border-color: #fecaca;
}

.b-green {
  background: var(--green-soft);
  color: var(--green);
  border-color: #bbf7d0;
}

.b-yellow {
  background: var(--yellow-soft);
  color: var(--yellow);
  border-color: #fde68a;
}

.b-blue {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #bfdbfe;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.code-block {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  overflow-x: auto;
  margin: 12px 0;
}

.g2 { grid-template-columns: repeat(2, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .g2, .g4 { grid-template-columns: 1fr; }
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: 0.15s;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
  display: inline-block;
  text-decoration: none;
}

.btn:hover { background: var(--accent2); text-decoration: none; color: #fff; }
.btn.ghost { background: var(--bg2); color: var(--txt); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.danger { background: var(--red-soft); color: var(--red); border: 1px solid #fecaca; box-shadow: none; }
.btn.danger:hover { background: #fee2e2; }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.btn.primary { background: var(--accent); color: #fff; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions { margin-top: 16px; }

.field { display: block; margin-bottom: 14px; }
.field span, label.fl { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], input[type="file"], select, textarea {
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--txt);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.toggle { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; cursor: pointer; font-size: 13.5px; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); }

.form-card { max-width: 900px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 18px; align-items: center; }
.filter-bar input, .filter-bar select { width: auto; min-width: 160px; flex: 1; }

.flash-stack { margin-bottom: 20px; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; border: 1px solid var(--line); }
.flash-success, .flash.success { background: var(--green-soft); border-color: #bbf7d0; color: var(--green); }
.flash-error, .flash.error { background: var(--red-soft); border-color: #fecaca; color: var(--red); }
.flash-warning, .flash.warning { background: var(--yellow-soft); border-color: #fde68a; color: var(--yellow); }

.tbl-wrap { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; background: var(--bg3); }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }
.row-suppressed { background: var(--red-soft); }

.empty-state { text-align: center; padding: 40px 24px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-inline { padding: 20px; color: var(--muted); text-align: center; }

.pagination { display: flex; gap: 12px; align-items: center; margin: 16px 0; }
.pagination-info { font-size: 13px; color: var(--muted); }

.wizard-steps { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.wizard-step { padding: 8px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--bg3); color: var(--muted); border: 1px solid var(--line); }
.wizard-step.active { background: var(--accent-soft); color: var(--accent); border-color: #bfdbfe; }
.wizard-step.done { background: var(--green-soft); color: var(--green); border-color: #bbf7d0; }

.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-item { display: flex; gap: 12px; align-items: center; padding: 10px 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; }
.timeline-time { font-size: 12px; color: var(--muted); min-width: 80px; }

.simple-list { list-style: none; padding: 0; }
.simple-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.inline-form { display: inline; }
.nav-btn { background: none; border: none; font: inherit; cursor: pointer; }
.nav-logout { padding: 0; margin: 0; }

.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-wrap { width: 100%; max-width: 420px; }
.login-card { padding: 8px; }

.sidebar-toggle { display: none; position: absolute; top: 16px; right: 12px; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }

.hint { font-size: 11px; color: var(--muted); margin-top: 4px; display: block; text-transform: none; letter-spacing: 0; font-weight: 400; }

.step-block { margin-bottom: 16px; }
.mapping-list { margin: 8px 0 0 18px; font-size: 14px; }
.preview-html { border: 1px dashed var(--line); padding: 12px; margin-top: 8px; background: #fff; }

.kv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; }
.kv-grid dt { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.kv-grid dd { font-size: 14px; margin-top: 2px; }

@media (max-width: 900px) {
  .sidebar { position: relative; }
  .sidebar.collapsed .nav { display: none; }
  .sidebar-toggle { display: block; }
  .brand { padding-right: 48px; position: relative; }
}

