/* =========================================================
   Multi Project Report — Main Stylesheet
   ========================================================= */

:root {
  --navy-900: #0a2540;
  --navy-800: #0f3057;
  --navy-700: #16456f;
  --navy-600: #1d5b8f;
  --ink-900: #10233a;
  --ink-700: #33475b;
  --ink-500: #64748b;
  --ink-400: #8a99ab;
  --line: #e3e9f0;
  --line-strong: #cfd9e5;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;

  --teal-600: #0e8f6e;
  --teal-500: #12a97f;
  --teal-100: #e6f7f1;
  --blue-500: #2b7fff;
  --blue-100: #e8f1ff;
  --amber-600: #c2760a;
  --amber-100: #fdf3e0;
  --red-600: #cf2f2f;
  --red-100: #fdeaea;
  --violet-600: #6d47d9;
  --violet-100: #f0ecfe;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 35, 58, .06), 0 1px 3px rgba(16, 35, 58, .04);
  --shadow-md: 0 4px 14px rgba(16, 35, 58, .07), 0 2px 6px rgba(16, 35, 58, .04);
  --shadow-lg: 0 18px 40px rgba(10, 37, 64, .16);
  --sidebar-w: 252px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.015em; color: var(--ink-900); }
p { margin: 0; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
canvas { max-width: 100%; }

/* ============================ LAYOUT ============================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-900) 0%, #071b30 100%);
  color: #cfe0f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--teal-500), #0a7f9e);
  display: grid; place-items: center;
  flex: 0 0 38px;
  box-shadow: 0 4px 12px rgba(18, 169, 127, .35);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text strong {
  display: block;
  font-size: 14.5px;
  color: #fff;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.brand-text span {
  display: block;
  font-size: 11px;
  color: #7fa6c6;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
.nav-group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #5d82a3;
  padding: 12px 10px 6px;
  font-weight: 700;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9.5px 11px;
  border-radius: 9px;
  color: #b9d0e4;
  font-size: 13.8px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-item.active {
  background: rgba(18, 169, 127, .16);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--teal-500);
}
.nav-item.active svg { opacity: 1; color: #4ee0b0; }
.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 20px;
  color: #fff;
}

.sidebar-foot {
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 11.5px;
  color: #6f92b0;
}
.sidebar-foot a { color: #8fb6d4; }

/* ============================ MAIN ============================ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 0 26px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar h1 { font-size: 17px; font-weight: 700; }
.topbar .sub { font-size: 12.5px; color: var(--ink-500); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  width: 38px; height: 38px;
  place-items: center;
  cursor: pointer;
  color: var(--ink-700);
}

.content { padding: 24px 26px 60px; max-width: 1400px; width: 100%; }
.view { display: none; }
.view.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ============================ COMPONENTS ============================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14.5px; }
.card-head .hint { font-size: 12px; color: var(--ink-500); }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.section-title h2 { font-size: 15.5px; }
.section-title .spacer { margin-left: auto; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* KPI */
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kpi::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--blue-500);
}
.kpi.k-teal::after { background: var(--teal-500); }
.kpi.k-red::after { background: var(--red-600); }
.kpi.k-amber::after { background: var(--amber-600); }
.kpi.k-violet::after { background: var(--violet-600); }
.kpi-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-500);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-value {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-top: 7px;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
.kpi-meta { font-size: 12px; color: var(--ink-500); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.kpi-value.pos { color: var(--teal-600); }
.kpi-value.neg { color: var(--red-600); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-700);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:hover { background: var(--surface-2); border-color: #b9c7d6; }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(180deg, #12689b, var(--navy-700));
  border-color: var(--navy-700);
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 48, 87, .25);
}
.btn-primary:hover { background: linear-gradient(180deg, #1577b0, #17466f); border-color: #17466f; }
.btn-teal {
  background: linear-gradient(180deg, var(--teal-500), var(--teal-600));
  border-color: var(--teal-600);
  color: #fff;
  box-shadow: 0 2px 6px rgba(14, 143, 110, .28);
}
.btn-teal:hover { filter: brightness(1.06); }
.btn-danger { color: var(--red-600); border-color: #f3c9c9; background: #fff; }
.btn-danger:hover { background: var(--red-100); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-500); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink-700); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Forms */
.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: 5px;
}
.field .req { color: var(--red-600); }
input[type="text"], input[type="number"], input[type="date"], input[type="email"],
select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink-900);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(29, 91, 143, .12);
}
textarea { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help { font-size: 11.5px; color: var(--ink-500); margin-top: 4px; }

/* Table */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--ink-500);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  color: var(--ink-700);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fbfdff; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td { font-weight: 700; background: var(--surface-2); color: var(--ink-900); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-green { background: var(--teal-100); color: var(--teal-600); }
.badge-blue { background: var(--blue-100); color: #1a5fbf; }
.badge-amber { background: var(--amber-100); color: var(--amber-600); }
.badge-red { background: var(--red-100); color: var(--red-600); }
.badge-gray { background: #eef2f7; color: var(--ink-500); }
.badge-violet { background: var(--violet-100); color: var(--violet-600); }

/* Empty state */
.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--ink-500);
}
.empty .ico {
  width: 54px; height: 54px;
  border-radius: 15px;
  background: var(--surface-2);
  display: grid; place-items: center;
  margin: 0 auto 13px;
  color: var(--ink-400);
}
.empty h4 { font-size: 14.5px; margin-bottom: 5px; }
.empty p { font-size: 13px; max-width: 420px; margin: 0 auto 15px; }

/* Progress */
.bar-track { height: 7px; background: #e9eff6; border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; background: var(--teal-500); transition: width .5s ease; }
.bar-fill.warn { background: var(--amber-600); }
.bar-fill.over { background: var(--red-600); }

/* Chart */
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 320px; }
.chart-box.short { height: 220px; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 42, .5);
  backdrop-filter: blur(2px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  animation: pop .2s ease;
  margin: auto 0;
}
.modal.wide { max-width: 780px; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-head {
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}
.modal-head h3 { font-size: 15.5px; }
.modal-head .close {
  margin-left: auto;
  border: 0; background: transparent;
  font-size: 22px; line-height: 1;
  color: var(--ink-400);
  cursor: pointer;
  padding: 0 4px;
}
.modal-head .close:hover { color: var(--ink-700); }
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  background: var(--surface-2);
  border-radius: 0 0 16px 16px;
}

/* Toast */
#toast-host {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 200;
}
.toast {
  background: #10233a;
  color: #fff;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 380px;
  animation: slideIn .22s ease;
}
.toast.ok { background: #0b6b53; }
.toast.err { background: #a32525; }
.toast.warn { background: #9a5c05; }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: all .18s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--teal-500);
  background: var(--teal-100);
}
.dropzone .ico { color: var(--navy-600); margin-bottom: 10px; }
.dropzone h4 { font-size: 14px; margin-bottom: 4px; }
.dropzone p { font-size: 12.5px; color: var(--ink-500); }

/* Nota preview */
.nota-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.nota-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0f1c2b;
  display: grid;
  place-items: center;
  min-height: 220px;
}
.nota-preview img { max-width: 100%; max-height: 380px; display: block; }
.ocr-text {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
  color: var(--ink-700);
}
.spinner {
  width: 17px; height: 17px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.spinner.dark { border-color: rgba(16,35,58,.15); border-top-color: var(--navy-700); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  border: 0;
  background: transparent;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink-700); }
.tab.active { color: var(--navy-700); border-bottom-color: var(--navy-700); }

/* Verdict panel */
.verdict {
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.verdict.good { background: linear-gradient(135deg, #0e8f6e, #0b6b53); }
.verdict.warn { background: linear-gradient(135deg, #d18a12, #a35f06); }
.verdict.bad { background: linear-gradient(135deg, #d13b3b, #9d2323); }
.verdict.neutral { background: linear-gradient(135deg, #3a5a7a, #22384f); }
.verdict .v-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: grid; place-items: center;
  flex: 0 0 56px;
}
.verdict .v-icon svg { width: 28px; height: 28px; }
.verdict h3 { color: #fff; font-size: 19px; margin-bottom: 3px; }
.verdict p { font-size: 13px; color: rgba(255,255,255,.88); }
.verdict .v-score {
  margin-left: auto;
  text-align: right;
  flex: 0 0 auto;
}
.verdict .v-score b { font-size: 30px; letter-spacing: -.03em; display: block; line-height: 1; }
.verdict .v-score span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }

/* Analysis list */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-700);
}
.check-list li:last-child { border-bottom: 0; }
.check-list .dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 7px; flex: 0 0 8px;
  background: var(--ink-400);
}
.check-list .dot.ok { background: var(--teal-500); }
.check-list .dot.warn { background: var(--amber-600); }
.check-list .dot.bad { background: var(--red-600); }

/* Report sheet (print/PDF) */
#reportSheet {
  background: #fff;
  width: 794px;
  padding: 40px 42px;
  color: #10233a;
  font-size: 12px;
  position: absolute;
  left: -10000px;
  top: 0;
}
#reportSheet .r-head { display: flex; align-items: flex-start; border-bottom: 3px solid #0f3057; padding-bottom: 14px; margin-bottom: 18px; }
#reportSheet .r-logo {
  width: 44px; height: 44px; border-radius: 11px;
  background: linear-gradient(135deg, #12a97f, #0a7f9e);
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 17px; margin-right: 13px;
}
#reportSheet .r-title h1 { font-size: 19px; margin-bottom: 2px; }
#reportSheet .r-title p { font-size: 11px; color: #64748b; }
#reportSheet .r-meta { margin-left: auto; text-align: right; font-size: 10.5px; color: #64748b; line-height: 1.7; }
#reportSheet h2 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #0f3057;
  border-left: 3px solid #12a97f;
  padding-left: 8px;
  margin: 20px 0 10px;
}
#reportSheet table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
#reportSheet th {
  background: #eef3f9;
  text-align: left;
  padding: 6px 7px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #33475b;
  border-bottom: 1px solid #cfd9e5;
}
#reportSheet td { padding: 5.5px 7px; border-bottom: 1px solid #eef2f7; }
#reportSheet td.num, #reportSheet th.num { text-align: right; }
#reportSheet tfoot td { font-weight: 700; background: #f8fafc; border-top: 1px solid #cfd9e5; }
#reportSheet .r-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 6px; }
#reportSheet .r-kpi {
  border: 1px solid #e3e9f0;
  border-radius: 8px;
  padding: 8px 10px;
}
#reportSheet .r-kpi span { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
#reportSheet .r-kpi b { font-size: 13px; }
#reportSheet .r-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#reportSheet .r-chart { border: 1px solid #e3e9f0; border-radius: 8px; padding: 8px; }
#reportSheet .r-chart h4 { font-size: 10px; margin-bottom: 6px; color: #33475b; }
#reportSheet .r-verdict {
  border-radius: 8px; padding: 11px 14px; color: #fff;
  display: flex; align-items: center; gap: 12px;
}
#reportSheet .r-verdict b { font-size: 14px; }
#reportSheet .r-foot {
  margin-top: 22px; padding-top: 10px; border-top: 1px solid #e3e9f0;
  font-size: 9px; color: #8a99ab; display: flex; justify-content: space-between;
}

/* Misc */
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--ink-500); }
.text-sm { font-size: 12.5px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.pill-select { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
}
.pill:hover { border-color: var(--navy-600); }
.pill.active { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 1100px) {
  .grid-4, .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .content { padding: 18px 15px 60px; }
  .topbar { padding: 0 15px; height: 58px; }
  .topbar .sub { display: none; }
  .grid-2, .grid-3, .grid-4, .grid-kpi { grid-template-columns: 1fr; }
  .nota-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 14px; align-items: flex-start; }
  .verdict { flex-wrap: wrap; }
  .verdict .v-score { margin-left: 0; text-align: left; }
  .kpi-value { font-size: 19px; }
}
@media (max-width: 520px) {
  .btn { padding: 8px 12px; font-size: 13px; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { padding: 8px 10px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9d5e2; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #adbecf; }

/* Print */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}

/* ============================ REPORT PREVIEW ============================ */
.report-preview-wrap {
  background: #e9eef5;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  overflow: hidden;
  position: relative;
}
.report-preview-wrap #reportSheet {
  box-shadow: 0 6px 24px rgba(16, 35, 58, .12);
  border-radius: 2px;
  margin: 0 auto;
}
@media (max-width: 860px) {
  .report-preview-wrap { padding: 8px; }
}

/* ============================ PRINT MODE ============================ */
@media print {
  body.print-mode .app-shell { display: none !important; }
  body.print-mode #reportSheet {
    position: static !important;
    left: auto !important;
    transform: none !important;
    width: 100% !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  body.print-mode { background: #fff; }
  @page { size: A4; margin: 12mm; }
}
