
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --border-strong: #cfd6e0;
  --text: #0f1b2d;
  --text-2: #4a5a70;
  --text-3: #7a889b;
  --brand: #1f4fd1;
  --brand-ink: #173c9e;
  --brand-soft: #e8eefc;
  --side: #0c1728;
  --side-2: #13223a;
  --side-text: #a9b6c9;
  --pos: #0f8a5f;
  --pos-soft: #e3f5ee;
  --neg: #c2362f;
  --neg-soft: #fbe9e8;
  --amber: #a86400;
  --amber-soft: #fdf2df;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.05), 0 1px 3px rgba(15, 27, 45, 0.06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }


.upload-progress {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.upload-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #6f8fb8, var(--brand));
  background-size: 200% 100%;
  animation: upload-progress-slide 1.1s ease-in-out infinite;
}
.upload-progress-label {
  margin: 8px 0 0;
  font-size: 12.5px;
}
@keyframes upload-progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
form.is-uploading { opacity: 0.72; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .upload-progress-bar { animation: none; width: 100%; opacity: 0.5; } }


.statement-job .upload-progress { margin-top: 10px; }
.statement-job-steps { margin: 6px 0 0; padding-left: 20px; font-size: 12px; }
.statement-job-steps li { margin: 2px 0; }
.statement-job-error { margin-top: 10px; margin-bottom: 0; white-space: pre-line; }


.session-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1000;
  max-width: min(720px, calc(100vw - 24px)); display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid #f0c36a; background: #fff8e6; color: #5c4200;
  box-shadow: var(--shadow); font-size: 13.5px;
}
.session-banner.ended { border-color: #f2c4c1; background: var(--neg-soft); color: #8f241f; }
.session-banner .actions { display: flex; gap: 8px; }


.fold-row { align-items: start; }
.fold-col { min-width: 0; }
.fold-col > .card + .card { margin-top: 16px; }   
details.fold > summary.card-head { cursor: pointer; list-style: none; user-select: none; }
details.fold > summary.card-head::-webkit-details-marker { display: none; }
details.fold:not([open]) > summary.card-head { border-bottom: 0; }
details.fold > summary .fold-meta { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; text-align: right; }
.fold-cue { font-size: 12px; font-weight: 600; color: var(--brand); white-space: nowrap; }
details:not([open]) > summary .fold-cue::after { content: "Show ▾"; }
details[open] > summary .fold-cue::after { content: "Hide ▴"; }
details.fold > summary.card-head:hover .fold-cue { text-decoration: underline; }
details.fold > summary:focus-visible, details.fold-inline > summary:focus-visible {
  outline: 2px solid var(--brand); outline-offset: -2px; border-radius: var(--radius-sm);
}
details.fold-inline > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; font-size: 13px; font-weight: 600; padding: 2px 0; }
details.fold-inline > summary::-webkit-details-marker { display: none; }


dialog.confirm-dialog { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 20px;
  max-width: 440px; box-shadow: var(--shadow); color: inherit; background: var(--surface, #fff); }
dialog.confirm-dialog::backdrop { background: rgba(15, 23, 42, 0.35); }
dialog.confirm-dialog p { margin: 0 0 14px; font-size: 14px; line-height: 1.45; }
dialog.confirm-dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }


.rates-card {
  border: 1px solid #f0c36a;
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.12);
}
.rates-card .card-head { align-items: center; gap: 10px; }
table.rates-edit td { vertical-align: middle; }
table.rates-edit .rate-input {
  width: 7.5rem;
  max-width: 100%;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 8px 10px;
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-sm);
  background: #fff;
}
table.rates-edit .rate-input:focus {
  outline: 2px solid var(--brand-soft);
  border-color: var(--brand-ink);
}
table.rates-edit tr.rate-extra td { background: var(--surface-2); }
table.rates-edit .w-full { width: 100%; }


.scope-card { border-color: #c5d4f5; }
.scope-card .scope-section {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-ink);
}
.scope-card .scope-section:first-of-type { margin-top: 8px; }
.scope-table td { vertical-align: top; font-size: 13px; line-height: 1.45; }
.scope-table tr.scope-flag { background: #fffaf0; }
.scope-table tr.scope-ok { background: #f4fbf7; }
.scope-detail { margin-top: 4px; font-size: 12px; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
small, .muted { color: var(--text-3); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }


.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: var(--side);
  color: var(--side-text);
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-weight: 650; font-size: 15px; }
.brand > div { display: flex; flex-direction: column; gap: 2px; line-height: 1.15; }
.brand-sub { font-size: 10.5px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: #8fa0b8; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #3b6cf6, #1f4fd1 55%, #0f8a5f);
  display: grid; place-items: center; font-size: 14px; font-weight: 750; color: #fff;
  flex-shrink: 0;
}
.nav-group { margin: 6px 0 4px; padding: 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #62728a; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--side-text); font-size: 13.5px;
}
.nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav a.active { background: #1c3256; color: #fff; }
.nav a .ico { width: 16px; text-align: center; opacity: 0.85; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid #1d2c45; font-size: 12px; }
.side-foot .who { color: #d6deea; font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar .spacer { flex: 1; }
.scope { display: flex; align-items: center; gap: 8px; }
.scope label { font-size: 12px; color: var(--text-3); }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }


.grid { display: grid; gap: 16px; align-items: stretch; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.grid.g-3 > .card.kpi,
.grid.g-4 > .card.kpi,
.grid.g-5 > .card.kpi { min-width: 0; }
.span-2 { grid-column: span 2; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head .sub { font-size: 12px; color: var(--text-3); }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.narrow { max-width: 560px; }
.medium { max-width: 820px; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.mb-sm { margin: 0 0 10px; }
.w-auto { width: auto !important; }
.right { text-align: right; }
.actions.center { justify-content: center; }
.stack > * + * { margin-top: 10px; }
.mt-lg { margin-top: 24px; }

.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.kpi .value { font-size: 24px; font-weight: 680; margin-top: 4px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .meta { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.kpi.hero { background: linear-gradient(135deg, #0f1f3a, #1b3a73); color: #fff; border: 0; }
.kpi.hero .label { color: #9fb3d6; }
.kpi.hero .meta { color: #c8d4ea; }
.kpi.hero .pos { color: #6be3b1; }
.kpi.hero .neg { color: #ff9c95; }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }
.chart-box.short { height: 200px; }


.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-3); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0;
}
table.data th.num { text-align: right; }
table.data th.sortable,
table.v2t th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable::after,
table.v2t th.sortable::after { content: " ↕"; color: #b8c2d0; font-size: 10px; }
table.data th.sorted-asc::after,
table.v2t th.sorted-asc::after { content: " ↑"; color: var(--brand); }
table.data th.sorted-desc::after,
table.v2t th.sorted-desc::after { content: " ↓"; color: var(--brand); }

.table-filters {
  display: flex; align-items: flex-end; gap: 10px 14px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 10px 12px;
  background: var(--surface-2, #f5f7fa); border: 1px solid var(--border, #e4e8ef);
  border-radius: 10px;
}
.table-filters.is-active {
  border-color: color-mix(in srgb, var(--brand, #1f4fd1) 35%, var(--border, #e4e8ef));
  background: color-mix(in srgb, var(--brand-soft, #e8eefc) 55%, #fff);
}
.table-filters-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3, #7a8494); align-self: center; margin-right: 2px;
}
.table-filters-controls {
  display: flex; flex-wrap: wrap; gap: 8px 12px; flex: 1; min-width: 0;
}
.table-filter-field {
  display: flex; flex-direction: column; gap: 3px; min-width: 120px; max-width: 240px; flex: 1 1 140px;
  margin: 0; font: inherit;
}
.table-filter-lab {
  font-size: 10.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-3, #7a8494); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.table-filter-field select {
  appearance: none; -webkit-appearance: none;
  padding: 7px 28px 7px 10px; border: 1px solid var(--border, #d5dae3); border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center;
  font: inherit; font-size: 13px; color: var(--text, #1a1f2c); cursor: pointer;
  max-width: 100%;
}
.table-filter-field select:focus {
  outline: 2px solid color-mix(in srgb, var(--brand, #1f4fd1) 35%, transparent);
  border-color: var(--brand, #1f4fd1);
}
.table-filters-clear { margin-left: auto; }
.table-filters-count {
  font-size: 12px; font-weight: 650; color: var(--text-2, #4b5565); white-space: nowrap;
  align-self: center;
}
.table-filters-slot { width: 100%; margin-top: 8px; }
.table-filters-slot .table-filters { margin: 0; }
table.data td { padding: 9px 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
table.data tr:hover td { background: #fafbfd; }
table.data tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border-strong); }
table.data td .sub { display: block; font-size: 11.5px; color: var(--text-3); }
table.compact td, table.compact th { padding: 6px 10px; }

.bar { height: 6px; border-radius: 3px; background: #edf1f7; overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 3px; width: 0; }
.bar.green > span { background: var(--pos); }
.bar.amber > span { background: #d98a00; }


.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: #eef1f6; color: var(--text-2);
}
.badge.pos, .badge.green { background: var(--pos-soft); color: var(--pos); }
.badge.neg, .badge.red { background: var(--neg-soft); color: var(--neg); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--brand-soft); color: var(--brand-ink); }

.flash { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; font-size: 13.5px; }
.flash.success { background: var(--pos-soft); border-color: #b9e5d3; color: #0b5e41; }
.flash.error { background: var(--neg-soft); border-color: #f2c4c1; color: #8f241f; }
.flash.info { background: var(--brand-soft); border-color: #c9d6f6; color: #1a3a8c; }

.finding { display: flex; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #eef1f5; align-items: flex-start; }
.finding:last-child { border-bottom: 0; }
.finding .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.finding .dot.red { background: var(--neg); }
.finding .dot.amber { background: #e09400; }
.finding .dot.green { background: var(--pos); }
.finding .area { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); }

.empty { padding: 36px 18px; text-align: center; color: var(--text-2); }
.empty h3 { margin-bottom: 6px; color: var(--text); }


.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-3); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input[type=file], select, textarea {
  font: inherit; font-size: 13.5px; color: var(--text);
  padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #b9cbf7; outline-offset: 0; border-color: var(--brand); }
textarea { min-height: 70px; resize: vertical; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); color: #fff; }
.btn.danger { color: var(--neg); border-color: #efc2bf; }
.btn.danger:hover { background: var(--neg-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.link { border: 0; background: none; color: var(--brand); padding: 0; font-weight: 500; }
.btn.block { width: 100%; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.lt-plan { margin: -6px 0 16px; font-size: 13px; }
ul.lessons { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
tr.link-row td { background: var(--surface-2, #f7f8f6); }

.dl { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; font-size: 13px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; }

details.box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface-2); }
details.box summary { cursor: pointer; font-weight: 600; }

.search-results { border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 260px; overflow-y: auto; background: #fff; display: none; }
.search-results.open { display: block; }
.search-results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; font: inherit; font-size: 12.5px; cursor: pointer; border-bottom: 1px solid #f0f2f6; }
.search-results button:hover { background: var(--brand-soft); }
.search-results .search-empty { padding: 8px 10px; }


.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-art {
  background: radial-gradient(circle at 20% 20%, #234a9a 0, transparent 45%),
              radial-gradient(circle at 80% 70%, #0f8a5f 0, transparent 40%),
              linear-gradient(160deg, #0b1526, #10203b);
  color: #dfe7f5; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-art h2 { font-size: 30px; line-height: 1.2; color: #fff; max-width: 460px; letter-spacing: -0.02em; }
.auth-art p { color: #aebbd2; max-width: 440px; font-size: 15px; margin-top: 14px; }
.auth-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-art li { display: flex; gap: 10px; color: #cfd9ea; }
.auth-art li::before { content: "✓"; color: #6be3b1; font-weight: 700; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .lead { color: var(--text-2); margin-bottom: 24px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn.primary { padding: 10px 14px; }
.auth-foot { margin-top: 24px; font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; }
.code-input { font-family: var(--mono); font-size: 22px !important; letter-spacing: 0.35em; text-align: center; }
.qr svg { width: 200px; height: 200px; display: block; }
.recovery-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: var(--mono); font-size: 15px; padding: 14px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }


@media (max-width: 1200px) {
  .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .g-2, .g-3, .g-4, .g-5 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .content { padding: 18px 14px 40px; }
  .topbar { padding: 10px 14px; }
}
.print-only { display: none; }
table.data select { font-size: 12px; padding: 3px 6px; max-width: 190px; }
table.data td .inline-form input[type="number"], table.data td .inline-form input[type="date"] { font-size: 12px; padding: 3px 6px; }
@media print {
  .side, .topbar, .actions, form.no-print, .no-print { display: none !important; }
  .print-only { display: inline; }
  .shell { grid-template-columns: 1fr; }
  .card { box-shadow: none; break-inside: avoid; }
}


.nav-count { margin-left: auto; background: #e09400; color: #1a1300; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.nav-count.red { background: var(--neg); color: #fff; }
.review-item { display: grid; gap: 8px; padding: 14px 18px; border-bottom: 1px solid #eef1f5; }
.review-item:last-child { border-bottom: 0; }
.review-item:target { background: #fffaf0; }
.review-forms { display: flex; flex-direction: column; gap: 8px; }
.review-forms details.box { padding: 6px 12px; }
.review-forms table.data input { font-size: 12px; padding: 3px 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.decision + .decision { border-top: 1px solid var(--border); padding-top: 14px; }
.inline-form .grow { flex: 1 1 260px; width: auto; }
.attention { border-left: 3px solid #e09400; }
.attention.red { border-left-color: var(--neg); }

.review-table td { vertical-align: top; }
.review-table td.what { max-width: 340px; color: var(--text-2); }
.review-table td.fix { min-width: 300px; }
.review-table .fix-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.review-table .fix-row details.mini[open] { flex-basis: 100%; }
.review-table input[type=number] { width: 120px; font-size: 12px; padding: 4px 6px; }
.review-table input[type=date] { width: 140px; font-size: 12px; padding: 4px 6px; }
.review-table input[type=text] { width: 150px; font-size: 12px; padding: 4px 6px; }
.dot-inline { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: #e09400; vertical-align: 1px; }
.dot-inline.red { background: var(--neg); }
.dot-inline.green { background: var(--pos); }


.price-strip { font-size: 12px; color: var(--text-2); text-decoration: none; padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.price-strip:hover { border-color: var(--brand); color: var(--text); }
.price-strip.is-late { border-color: var(--neg); color: var(--neg); background: var(--neg-soft); }
.prices-card { margin-bottom: 16px; }
.prices-card.is-late { border-left: 3px solid var(--neg); }
.prices-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.3fr 1fr; gap: 14px 22px; padding: 14px 18px; }
.prices-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prices-grid .k { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.prices-grid b { font-size: 15px; font-weight: 650; }
.prices-grid .s { font-size: 12px; color: var(--text-2); line-height: 1.45; }
.prices-note { margin: 0 18px 12px; }
.prices-foot { margin: 0 18px 12px; font-size: 12px; }
@media (max-width: 900px) { .prices-grid { grid-template-columns: 1fr 1fr; } .price-strip { display: none; } }
details.mini summary { cursor: pointer; font-size: 12px; color: var(--brand); }
details.mini[open] { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.bulk-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border); }


table.data tr.expandable { cursor: pointer; }
table.data tr.expandable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
table.data tr.expandable .caret::before { content: "▸"; display: inline-block; width: 14px; color: var(--text-3); transition: transform 0.15s; }
table.data tr.expandable[aria-expanded="true"] .caret::before { transform: rotate(90deg); color: var(--brand); }
table.data tr.expandable[aria-expanded="true"] td { background: var(--brand-soft); }
table.data tr.expand-row > td { background: var(--surface-2); padding: 0; }
table.data tr.expand-row:hover > td { background: var(--surface-2); }
.expand-body { padding: 14px 18px 18px 32px; border-left: 3px solid var(--brand); }
.expand-body h3 { font-size: 14px; margin: 0 0 8px; }
.expand-body h4 { font-size: 12.5px; margin: 14px 0 6px; }
.expand-body ol.working { margin: 0 0 12px; padding-left: 20px; font-size: 12.5px; line-height: 1.6; max-width: 980px; }
.expand-body ul.left-out { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6; }
table.data.inner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.data.inner tr.group td { background: #f1f4f9; border-top: 1px solid var(--border-strong); }
table.data.inner tr.member td:first-child { padding-left: 26px; }
table.data.inner td.src { max-width: 420px; font-size: 12px; color: var(--text-2); }
table.data.inner td.src .sub { margin-top: 2px; }
table.data.inner tr.group[aria-expanded="true"] td { background: var(--brand-soft); }
table.data tr.expandable .link-like { color: var(--brand); font-weight: 600; }
table.data tr.expandable td .sub { max-width: 340px; white-space: normal; }
td.dotted { text-decoration: underline dotted var(--text-3); text-underline-offset: 3px; cursor: help; }


.preview-table input[type=text], .preview-table input[type=date], .preview-table select { font-size: 12px; padding: 4px 6px; }
.preview-table select { max-width: 280px; }
.preview-table input[type=text] { width: 100px; }
.preview-table input[name$="_reason"] { width: 140px; }
.preview-table tr.row-bad td { background: #fff6f5; }
.preview-table tr.row-dup td { background: #fffaf0; }
.preview-table td.pv-check { min-width: 230px; white-space: normal; }
.preview-table td.pv-check .badge { white-space: normal; margin: 2px 0; display: inline-block; }


.plan-check { border: 1px solid #ecd6a6; background: var(--amber-soft); color: #5b4300; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }
.plan-check.ok { border-color: #b9e5d3; background: var(--pos-soft); color: #0b5e41; }
.plan-check .actions { margin-top: 8px; }


.btn.new-view { background: #4b6639; border-color: #4b6639; color: #fff; }
.btn.new-view:hover { background: #3a5129; color: #fff; }

a.card.kpi { display: block; color: inherit; transition: border-color 0.15s, box-shadow 0.15s; }
a.card.kpi:hover { text-decoration: none; color: inherit; border-color: #b9c8e6; box-shadow: 0 2px 8px rgba(15, 27, 45, 0.08); }
a.card.kpi.hero, a.card.kpi.hero:hover { color: #fff; text-decoration: none; }
.kpi.hero .value { color: #fff; }
.security-banner { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.banner-actions { display: inline-flex; align-items: center; gap: 6px; }


.content > .flash { position: sticky; top: 8px; z-index: 30; box-shadow: var(--shadow); }
.flash.closable { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.flash[hidden] { display: none !important; }   
.note-close { display: inline; margin: 0; }
.note-close .x, .flash .x {
  border: 0; background: transparent; color: inherit; opacity: 0.6; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 4px;
}
.note-close .x:hover, .flash .x:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }


body:not(.detail) :is(main.content, main.v2-record) table.data td .sub:not(.keep),
body:not(.detail) :is(main.content, main.v2-record) table.data .x,
body:not(.detail) :is(main.content, main.v2-record) .page-head > div > p,
body:not(.detail) .prices-foot,
body:not(.detail) .prices-card:not(.is-late):not(:has(.prices-note)) { display: none; }
:is(main.content, main.v2-record) table.data td { padding-top: 11px; padding-bottom: 11px; }
:is(main.content, main.v2-record) table.compact td { padding-top: 7px; padding-bottom: 7px; }
:is(main.content, main.v2-record) table.data tbody tr:nth-child(even) td { background: #fbfcfe; }
:is(main.content, main.v2-record) table.data tbody tr:hover td { background: #f3f6fb; }
:is(main.content, main.v2-record) table.data td.num { white-space: nowrap; }
.chart-dl { position: absolute; top: 4px; right: 4px; z-index: 2; border: 1px solid #d9dee7; background: #fff; color: #555; border-radius: 8px; width: 26px; height: 26px; line-height: 1; cursor: pointer; opacity: .55; }
.chart-dl:hover, .chart-dl:focus-visible { opacity: 1; }
@media print { .chart-dl { display: none !important; } }


.ai-setup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ai-setup-head h2 { margin: 0 0 4px; font-size: 1.25rem; }
.ai-howto { margin-bottom: 16px; }
.ai-steps { margin: 0; padding-left: 1.25em; line-height: 1.55; color: var(--text-2, #4a5a70); }
.ai-steps li { margin-bottom: 6px; }
.connect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.connect-grid > .card { margin-bottom: 0; }
.card.conn { padding: 14px 16px 16px; }
.conn-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 8px; }
.conn-h h3 { margin: 0; font-size: 15px; }
.conn-form .field { margin-top: 10px; }
.conn-form .form-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.det { margin-top: 8px; }
.det > summary { cursor: pointer; color: var(--text-2, #4a5a70); font-size: 13px; }
.ai-setup-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 4px; }
.cascade-strip { margin-bottom: 14px; }
.cascade-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; }
.cascade-step { display: flex; flex-direction: column; gap: 4px; min-width: 140px; max-width: 260px; }
.cascade-detail { font-size: 12.5px; line-height: 1.35; }
.cascade-arrow { color: #8a94a6; font-size: 1.1rem; align-self: center; }
.claude-link, .cursor-link { margin: 10px 0; padding: 10px 12px; background: #f6f8fb; border: 1px solid #dde2ea; border-radius: 8px; }
.claude-link .mono, .cursor-link .mono { word-break: break-all; font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill.ok { background: #e6f6ec; color: #0f7a3f; border-color: #b7e0c4; }
.pill.bad { background: #fdecea; color: #a1281f; border-color: #f0c2bc; }
.pill.warn { background: #fff6e0; color: #9a6b00; border-color: #f0d48a; }
.pill.info { background: #eef2ff; color: #3b4cca; border-color: #c9d2f8; }
.pill.mut { background: #f1f3f6; color: #5a6678; border-color: #dde2ea; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }


.assist-desk .assist-log, .assist-fab-panel .assist-log { max-height: min(52vh, 480px); overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; background: #f7f9fc; border-bottom: 1px solid var(--line, #e4e8ef); }
.assist-msg { max-width: 92%; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.assist-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line, #e4e8ef); color: var(--text, #1a2332); }
.assist-msg.user { align-self: flex-end; background: #1f4fd1; color: #fff; border: 0; }
.assist-msg.err { align-self: flex-start; background: #fff5f4; border: 1px solid #f0c2bc; color: #8a2f28; }
.assist-compose { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.assist-compose textarea { width: 100%; resize: vertical; min-height: 64px; font: inherit; padding: 10px 12px; border: 1px solid var(--line, #d9dee7); border-radius: 8px; }
.assist-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.assist-providers {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0;
  border-bottom: 0;
}
.assist-prov {
  border: 1px solid #d5dbe6; background: #fff; color: #3a4658;
  border-radius: 999px; padding: 5px 12px; font: 600 12px/1.2 inherit;
  cursor: pointer; min-height: 32px;
}
.assist-prov:hover { border-color: #5b3cc4; color: #5b3cc4; }
.assist-prov.on { background: #5b3cc4; border-color: #5b3cc4; color: #fff; }
.assist-prov:disabled { opacity: 0.55; cursor: wait; }
.bullets { margin: 0; padding-left: 1.2em; line-height: 1.55; color: var(--text-2, #4a5a70); }
.badge.green { background: #e6f6ec; color: #0f7a3f; }
.badge.amber { background: #fff6e0; color: #9a6b00; }

.assist-fab { position: fixed; right: 22px; bottom: 22px; z-index: 80; font-family: inherit; }
.assist-fab-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; padding: 12px 16px 12px 14px; border-radius: 999px; background: #5b3cc4; color: #fff; font: 600 14px/1 inherit; box-shadow: 0 8px 24px rgba(40, 20, 90, 0.28); position: relative; }
.assist-fab-btn:hover, .assist-fab-btn:focus-visible { background: #4a2fad; outline: none; }
.assist-fab-ico { font-size: 16px; line-height: 1; }
.assist-fab-dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #3dd68c; box-shadow: 0 0 0 2px #5b3cc4; }
.assist-fab-panel { position: absolute; right: 0; bottom: 58px; width: min(380px, calc(100vw - 28px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: #fff; border: 1px solid #dde2ea; border-radius: 14px; box-shadow: 0 16px 48px rgba(20, 30, 50, 0.18); overflow: hidden; }
.assist-fab-panel[hidden] { display: none !important; }
.assist-fab-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #e8ecf2; background: #fafbfe; }
.assist-fab-head strong { display: block; font-size: 15px; }
.assist-fab-head .sub { font-size: 12px; color: #5a6678; }
.assist-fab-x { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: #5a6678; padding: 0 4px; }
.assist-fab-setup { padding: 16px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.45; color: #3a4658; }
.assist-fab-panel .assist-log { flex: 1; max-height: none; min-height: 180px; }
.assist-fab-panel .assist-compose { border-top: 0; padding-top: 10px; }
@media (max-width: 640px) {
  .assist-fab { right: 14px; bottom: 14px; }
  .assist-fab-label { display: none; }
  .assist-fab-btn { padding: 14px; border-radius: 50%; }
  .assist-fab-panel { width: calc(100vw - 24px); }
}
@media print { .assist-fab { display: none !important; } }


.pt-tour-popover.driver-popover { max-width: 340px; border-radius: 12px; box-shadow: 0 12px 40px rgba(20,30,50,.18); }
.pt-tour-popover .driver-popover-title { font-size: 15px; font-weight: 700; color: #1a2332; }
.pt-tour-popover .driver-popover-description { font-size: 13.5px; line-height: 1.45; color: #4a5a70; }
.pt-tour-popover .driver-popover-next-btn { background: #5b3cc4; color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; }
.pt-tour-popover .driver-popover-prev-btn, .pt-tour-popover .driver-popover-close-btn { border-radius: 8px; }
.ai-howto .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tour-header-btn { white-space: nowrap; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid #d5dbe6; background: #fff; color: #3a4658; cursor: pointer; }
.tour-header-btn:hover, .tour-header-btn:focus-visible { border-color: #5b3cc4; color: #5b3cc4; outline: none; }
@media (max-width: 1100px) {
  .tour-header-btn { max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 720px) {
  .tour-header-btn { font-size: 0; padding: 7px 10px; width: 34px; height: 34px; border-radius: 50%; position: relative; }
  .tour-header-btn::before { content: "?"; font-size: 14px; font-weight: 700; position: absolute; inset: 0; display: grid; place-items: center; }
}


.nps-desk { display: flex; flex-direction: column; gap: 0; }
.nps-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.9fr);
  gap: 18px;
  margin-top: 8px;
  padding: 22px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f1f3a 0%, #1b3a73 55%, #2450a0 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(15, 31, 58, 0.18);
}
.nps-hero-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fb3d6;
}
.nps-hero-value {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 720;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.nps-hero-meta {
  margin-top: 8px;
  font-size: 13.5px;
  color: #c8d4ea;
  line-height: 1.4;
}
.nps-hero-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.nps-status-chip {
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 1px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.nps-status-chip .nps-status-k {
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9fb3d6;
}
.nps-status-chip .nps-status-v {
  font-size: 15px;
  font-weight: 650;
  color: #fff;
}
.nps-status-chip .nps-status-m {
  font-size: 12px;
  color: #b7c6df;
}
.nps-status-chip.ok { box-shadow: inset 3px 0 0 #6be3b1; }
.nps-status-chip.warn { box-shadow: inset 3px 0 0 #ffb454; }
.nps-status-chip.muted { box-shadow: inset 3px 0 0 rgba(255,255,255,0.25); }
.nps-sync-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.45;
}
.nps-people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.nps-person {
  padding: 0;
  overflow: hidden;
}
.nps-person-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 10px;
}
.nps-person-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.nps-person-sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-3);
}
.nps-person-total {
  font-size: 28px;
  font-weight: 720;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--brand-ink);
  line-height: 1;
}
.nps-bar {
  display: flex;
  height: 12px;
  margin: 0 18px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}
.nps-bar-seg { display: block; height: 100%; }
.nps-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 18px 4px;
  font-size: 12px;
  color: var(--text-3);
}
.nps-bar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.nps-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.nps-tone-e, .nps-bar-seg.nps-tone-e, .nps-dot.nps-tone-e { background: #1f4fd1; }
.nps-tone-c, .nps-bar-seg.nps-tone-c, .nps-dot.nps-tone-c { background: #0f8a5f; }
.nps-tone-g, .nps-bar-seg.nps-tone-g, .nps-dot.nps-tone-g { background: #a86400; }
.nps-slices {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 10px 12px;
}
.nps-slice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
}
.nps-slice + .nps-slice { border-top: 1px solid var(--border); }
.nps-slice.is-missing { opacity: 0.55; }
.nps-slice-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nps-slice-badge {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 750; color: #fff;
  flex: 0 0 auto;
}
.nps-slice-label { font-size: 14px; font-weight: 650; color: var(--text); }
.nps-slice-meta { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.nps-slice-right { text-align: right; }
.nps-slice-value {
  font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
}
.nps-slice-pct { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.nps-ops {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-strong);
}
.nps-ops-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
}
.nps-ops-lead { margin: 4px 0 0; font-size: 13px; }
@media (max-width: 900px) {
  .nps-hero { grid-template-columns: 1fr; }
  .nps-people { grid-template-columns: 1fr; }
  .nps-person-total { font-size: 24px; }
}


.tip { cursor: help; }
.tip:not(.badge) { text-decoration: underline dotted; text-underline-offset: 3px; }
.tip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.tip-bubble { position: fixed; z-index: 1000; max-width: min(340px, calc(100vw - 16px)); padding: 8px 11px; border-radius: 8px;
  background: var(--side); color: #f4f7fb; font-size: 12.5px; font-weight: 400; line-height: 1.45; text-transform: none;
  letter-spacing: normal; box-shadow: 0 8px 24px rgba(15, 27, 45, 0.22); pointer-events: none; }
.tip-bubble[hidden] { display: none; }
@media print { .tip-bubble { display: none; } }
