:root {
  --bg: #eef5fb;
  --panel: #ffffff;
  --panel-soft: #f7fbff;
  --text: #172033;
  --muted: #6b7890;
  --line: #dce7f3;
  --primary: #0f4c81;
  --primary-2: #1373b9;
  --accent: #11a6a6;
  --gold: #f3b434;
  --danger: #d94242;
  --success: #198754;
  --warning: #d98e04;
  --shadow: 0 20px 60px rgba(18, 40, 75, 0.14);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mobile-only { display: none; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(17,166,166,.25), transparent 28%),
    radial-gradient(circle at bottom right, rgba(15,76,129,.28), transparent 32%),
    linear-gradient(135deg, #f8fbff, #e6f0fa 45%, #e8f7f7);
  position: relative;
  overflow: hidden;
}
.login-bg-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(4px);
  opacity: .35;
  animation: floatOrb 8s ease-in-out infinite;
}
.orb-one { width: 280px; height: 280px; background: #11a6a6; left: 5%; top: 8%; }
.orb-two { width: 360px; height: 360px; background: #0f4c81; right: 3%; bottom: -8%; animation-delay: -3s; }
@keyframes floatOrb { 0%,100% { transform: translateY(0); } 50% { transform: translateY(22px); } }
.login-panel {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 26px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}
.login-brand, .login-copy, .login-card {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: var(--shadow);
}
.login-brand {
  grid-column: 1 / -1;
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 14px 30px rgba(15, 76, 129, .25);
}
.login-brand h1 { margin: 0; font-size: clamp(26px, 4vw, 42px); }
.login-brand p { margin: 4px 0 0; color: var(--muted); }
.login-copy {
  border-radius: var(--radius);
  padding: clamp(26px, 4vw, 46px);
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17,166,166,.12);
  color: #087070;
  font-size: 13px;
  font-weight: 800;
}
.login-copy h2 { font-size: clamp(30px, 5vw, 56px); line-height: 1.02; margin: 20px 0 16px; letter-spacing: -2px; }
.login-copy p { color: var(--muted); font-size: 17px; line-height: 1.6; }
.login-card {
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}
label { display: grid; gap: 8px; color: #344057; font-weight: 800; font-size: 13px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  outline: none;
  color: var(--text);
  transition: border .2s, box-shadow .2s, transform .2s;
}
textarea { min-height: 98px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(19,115,185,.6); box-shadow: 0 0 0 4px rgba(19,115,185,.11); }
.primary-btn, .ghost-btn, .danger-btn, .success-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}
.primary-btn { color: white; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 14px 25px rgba(15,76,129,.20); }
.success-btn { color: white; background: linear-gradient(135deg, #16804f, #25a56b); }
.danger-btn { color: white; background: linear-gradient(135deg, #b52f2f, #df4b4b); }
.ghost-btn { color: var(--primary); background: #eaf3fb; border: 1px solid #d6e6f5; }
.primary-btn:hover, .ghost-btn:hover, .danger-btn:hover, .success-btn:hover { transform: translateY(-1px); }
.full { width: 100%; }
.demo-accounts {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}
.demo-account {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
}
.demo-account small { color: var(--muted); display: block; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px 1fr;
}
.sidebar {
  background: #0c3154;
  color: #d8ecff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; }
.sidebar-brand .brand-mark { width: 46px; height: 46px; border-radius: 15px; }
.sidebar-brand strong { display: block; color: white; font-size: 18px; }
.sidebar-brand small { color: #a7c9e7; }
.main-nav { display: grid; gap: 8px; }
.nav-btn {
  width: 100%;
  text-align: left;
  border: 0;
  color: #cce4fa;
  background: transparent;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 850;
}
.nav-btn:hover, .nav-btn.active { background: rgba(255,255,255,.10); color: white; }
.nav-icon { width: 22px; text-align: center; }
.sidebar-card {
  margin-top: auto;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 18px;
  display: grid;
  gap: 6px;
}
.sidebar-card span, .sidebar-card small { color: #b9d6ed; }
.sidebar-card strong { color: white; font-size: 21px; }
.workspace { min-width: 0; }
.topbar {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 28px;
  background: rgba(238,245,251,.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(220,231,243,.85);
  position: sticky;
  top: 0;
  z-index: 8;
}
.page-kicker { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.topbar h2 { margin: 0; font-size: clamp(20px, 3vw, 30px); letter-spacing: -.6px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px 8px 8px;
  min-width: 180px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 900;
}
.user-chip strong { display: block; font-size: 13px; }
.user-chip small { display: block; color: var(--muted); font-size: 11px; }
.icon-btn {
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--line);
  font-weight: 900;
}
.content { padding: 28px; }
.grid { display: grid; gap: 18px; }
.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)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(30,54,88,.07);
  padding: 20px;
}
.card.soft { background: var(--panel-soft); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.card-header h3, .card h3 { margin: 0; font-size: 18px; }
.card-header p, .card > p { color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.kpi-card { position: relative; overflow: hidden; min-height: 146px; }
.kpi-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(17,166,166,.11);
  right: -36px;
  top: -36px;
}
.kpi-icon { font-size: 28px; margin-bottom: 18px; }
.kpi-value { font-size: 36px; font-weight: 950; letter-spacing: -1.2px; }
.kpi-label { color: var(--muted); font-weight: 800; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.status-draft { background: #edf2f7; color: #536275; }
.status-submitted { background: #fff1d8; color: #9a6500; }
.status-review { background: #e4f0ff; color: #0d5d9f; }
.status-revision { background: #ffe4e4; color: #b83232; }
.status-endorsed { background: #e2f8ee; color: #147144; }
.status-approved { background: #dff7ea; color: #0f6a3e; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f4f8fc; color: #3b4a61; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.small-btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--primary);
  border-radius: 11px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
}
.small-btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
.small-btn.danger { background: #fff0f0; color: #b83232; border-color: #ffcaca; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--primary);
  padding: 10px 14px;
  font-weight: 900;
}
.tab-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; border-color: transparent; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.score-input { max-width: 86px; }
.rating-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 34px;
  border-radius: 10px;
  background: #edf7ff;
  color: var(--primary);
  font-weight: 950;
}
.progress {
  height: 12px;
  border-radius: 999px;
  background: #e6edf5;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: inherit;
}
.split { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; align-items: start; }
.summary-tile {
  border: 1px solid var(--line);
  background: white;
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 8px;
}
.summary-tile span { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.summary-tile strong { font-size: 28px; letter-spacing: -1px; }
.timeline { display: grid; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 32px 1fr; gap: 12px; }
.timeline-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #e6f2fb; color: var(--primary); font-weight: 900; }
.timeline-body { background: #f8fbfe; border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.timeline-body strong { display: block; }
.timeline-body small { color: var(--muted); }
.report-card { display: grid; gap: 12px; }
.chart-row { display: grid; grid-template-columns: 130px 1fr 54px; gap: 10px; align-items: center; margin: 14px 0; }
.bar { height: 14px; background: #e8f0f8; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: inherit; }
.alert {
  border-radius: 18px;
  padding: 14px 16px;
  background: #f4f9ff;
  border: 1px solid #cfe4f8;
  color: #204464;
  line-height: 1.5;
}
.alert.warn { background: #fff7e9; border-color: #f6d49b; color: #734c00; }
.alert.success { background: #ecfbf3; border-color: #c3ecd6; color: #105c38; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filter-row label { min-width: 180px; flex: 1; }
.file-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  background: #eef7ff;
  border: 1px solid #cfe3f7;
  color: var(--primary);
  border-radius: 999px;
  padding: 7px 10px;
  margin: 4px;
  font-size: 12px;
  font-weight: 900;
}
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 24, 43, .55);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-card {
  width: min(820px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: white;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.modal-head h3 { margin: 0; }
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #102942;
  color: white;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .25s;
  z-index: 99;
  max-width: min(420px, calc(100vw - 44px));
}
.toast.show { opacity: 1; transform: translateY(0); }
.empty-state { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }
.print-only { display: none; }

@media (max-width: 1120px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .mobile-only { display: grid; }
  .hide-sm { display: none; }
  .login-panel { grid-template-columns: 1fr; }
  .login-copy { min-height: auto; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 292px;
    transform: translateX(-105%);
    transition: .25s;
    z-index: 30;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { height: auto; align-items: flex-start; padding: 14px 16px; }
  .topbar-actions { gap: 6px; }
  .user-chip { min-width: 0; padding-right: 8px; }
  .user-chip div:not(.user-avatar) { display: none; }
  .content { padding: 16px; }
  .grid-2, .grid-3, .grid-4, .form-row, .form-row.three { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: 18px; }
  .chart-row { grid-template-columns: 90px 1fr 44px; font-size: 13px; }
}
@media print {
  body { background: white; }
  .sidebar, .topbar, .tabs, .no-print, .toast, .modal-root { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #999; page-break-inside: avoid; }
  .print-only { display: block; }
  table { min-width: unset; font-size: 11px; }
  th, td { padding: 7px; }
}
