:root {
  --bg: #f6f8f9;
  --surface: #fff;
  --soft: #eef3f5;
  --text: #172126;
  --muted: #66767d;
  --primary: #185c68;
  --primary-dark: #10434c;
  --accent: #dcecef;
  --border: #dce4e7;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --success: #027a48;
  --success-soft: #d1fadf;
  --warning: #b54708;
  --warning-soft: #fef0c7;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px rgba(16, 24, 40, 0.06);
  --sidebar: 250px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.app {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--primary-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.sidebar-head {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.logo {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}
.logo span {
  color: #cde6ea;
}
.sub {
  color: #9fc1c7;
  font-size: 0.78rem;
  margin-top: 5px;
}
.nav {
  padding: 18px 14px;
  flex: 1;
}
.nav-label {
  padding: 0 10px 10px;
  color: #82a9b0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #d3e3e6;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-weight: 600;
}
.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.side-foot {
  padding: 18px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #a9c4c9;
  font-size: 0.78rem;
  line-height: 1.5;
}
.main {
  margin-left: var(--sidebar);
  min-height: 100vh;
}
.topbar {
  height: 72px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
}
.top-title {
  font-weight: 800;
  letter-spacing: -0.025em;
}
.mobile {
  display: none;
  border: 0;
  background: transparent;
  font-size: 1.35rem;
}
.content {
  padding: 32px;
  max-width: 1500px;
  margin: 0 auto;
}
.eyebrow {
  display: inline-block;
  padding: 6px 11px;
  border-radius: 30px;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 26px;
}
.heading h1 {
  margin: 0 0 7px;
  font-size: 2rem;
  letter-spacing: -0.045em;
}
.heading p {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.6;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
}
.btn-secondary {
  background: #fff;
  color: var(--primary-dark);
  border-color: var(--border);
}
.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: #f0b8b4;
}
.btn-small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.82rem;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media(max-width:900px) {
  .grid4 {
    grid-template-columns: 1fr;
  }
}
.card,
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.card {
  padding: 22px;
}
.metric {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.metric-label {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.panel {
  overflow: hidden;
}
.toolbar {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.search {
  width: min(100%, 360px);
}
.form-control {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 92, 104, 0.11);
}
textarea.form-control {
  min-height: 110px;
  resize: vertical;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 7px;
}
.form-help {
  font-size: 0.79rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
th {
  background: #fafbfb;
  color: var(--muted);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td {
  font-size: 0.89rem;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.table-wrap {
  overflow: auto;
}
.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  border-radius: 20px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 750;
}
.badge-primary {
  background: var(--accent);
  color: var(--primary-dark);
}
.badge-alt {
  background: #f4ebff;
  color: #6941c6;
}
.badge-active {
  background: var(--success-soft);
  color: var(--success);
}
.detail {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid #eef1f2;
}
.detail:last-child {
  border-bottom: 0;
}
.detail-label {
  color: var(--muted);
  font-size: 0.84rem;
}
.scorebar {
  height: 9px;
  background: #edf1f2;
  border-radius: 20px;
  overflow: hidden;
}
.scorebar > span {
  display: block;
  height: 100%;
  background: var(--primary);
}
.score-text {
  font-weight: 800;
}
.notice {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}
.notice strong {
  color: var(--text);
}
.prob-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}
.belief-result {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.belief-result:last-child {
  border-bottom: 0;
}
.belief-title {
  font-weight: 800;
  font-size: 1.05rem;
}
.prob {
  font-size: 2rem;
  font-weight: 850;
  letter-spacing: -0.04em;
  color: var(--primary-dark);
}
.hypo-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f2;
}
.hypo-row:last-child {
  border-bottom: 0;
}
.muted {
  color: var(--muted);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal {
  width: min(100%, 680px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.22);
}
.modal-head,
.modal-foot {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.modal-foot {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-end;
}
.modal-body {
  padding: 24px;
}
.modal-head h2 {
  margin: 0;
  font-size: 1.25rem;
}
.close {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  color: var(--muted);
}
.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
}
.toast {
  background: #172126;
  color: #fff;
  padding: 13px 15px;
  border-radius: 9px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  margin-top: 8px;
}
.file-input {
  display: none;
}
.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.overlay {
  display: none;
}
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .mobile {
    display: inline-flex;
  }
  .topbar {
    padding: 0 18px;
  }
  .content {
    padding: 22px 18px;
  }
  .grid3,
  .prob-grid {
    grid-template-columns: 1fr;
  }
  .heading {
    flex-direction: column;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 35;
  }
  .detail {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media print {

  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .overlay,
  .toast-wrap,
  .modal-backdrop,
  .no-print {
    display: none !important;
  }

  .main {
    margin-left: 0 !important;
  }

  .content {
    max-width: none;
    padding: 0;
  }

  .print-report {
    display: block !important;
  }

  .print-page-break {
    break-before: page;
    page-break-before: always;
  }

  .panel,
  .card {
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  table {
    font-size: 10pt;
  }

  @page {
    size: A4;
    margin: 16mm;
  }

}