:root {
  --navy: #001b42;
  --navy-2: #062b63;
  --blue: #145cff;
  --blue-soft: #eaf1ff;
  --green: #0aa66a;
  --green-soft: #e8f8f0;
  --amber: #f59f00;
  --amber-soft: #fff4db;
  --red: #e03131;
  --red-soft: #fff0f0;
  --purple: #7048e8;
  --purple-soft: #f1edff;
  --ink: #07183f;
  --muted: #64718f;
  --line: #dbe4f2;
  --page: #f6f8fc;
  --card: #fff;
  --shadow: 0 12px 30px rgba(3, 26, 68, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); letter-spacing: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1.1fr);
  background: #fff;
}

.login-brand {
  background: linear-gradient(180deg, var(--navy), #021331);
  color: #fff;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-card {
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 18px 42px rgba(20, 92, 255, 0.18);
  overflow: hidden;
}
.logo-card img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hero-logo { width: 132px; height: 132px; border-radius: 22px; padding: 12px; }
.nav-logo { width: 46px; height: 46px; border-radius: 10px; padding: 5px; flex: 0 0 auto; }
.login-brand h1 { margin: 24px 0 8px; font-size: 52px; }
.login-brand p { margin: 0; color: #bad0f2; }
.brand-proof { margin-top: 90px; padding-top: 32px; border-top: 1px solid rgba(255,255,255,0.18); display: grid; gap: 12px; }
.brand-proof span { color: #8fb2ed; text-transform: uppercase; font-size: 12px; font-weight: 800; }
.brand-proof strong { max-width: 430px; font-size: 31px; line-height: 1.18; }
.investor-proof { margin-top: 30px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 520px; }
.investor-proof div { border: 1px solid rgba(255,255,255,0.16); border-radius: 8px; padding: 14px; background: rgba(255,255,255,0.05); }
.investor-proof strong { display: block; font-size: 26px; color: #fff; }
.investor-proof span { color: #bad0f2; font-size: 12px; font-weight: 800; text-transform: uppercase; }

.login-card {
  align-self: center;
  justify-self: center;
  width: min(430px, calc(100% - 40px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  display: grid;
  gap: 18px;
}

.login-card h2, .page-head h2 { margin: 0; font-size: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); text-transform: uppercase; font-size: 12px; font-weight: 900; }
.muted { color: var(--muted); font-size: 13px; }

label { color: var(--ink); font-size: 13px; font-weight: 800; display: grid; gap: 8px; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20, 92, 255, 0.12); }

.app { min-height: 100vh; display: grid; grid-template-columns: 254px 1fr; }
.sidebar {
  background: linear-gradient(180deg, var(--navy), #021331);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.logo-row strong { display: block; font-size: 22px; }
.logo-row span { color: #adc5ed; font-size: 11px; }
#nav { display: grid; gap: 5px; }
.nav-group { margin: 16px 8px 5px; color: #82a0cf; font-size: 11px; text-transform: uppercase; font-weight: 900; }
.nav-button {
  border: 0;
  background: transparent;
  color: #dce8fb;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  text-align: left;
  padding: 10px 9px;
  border-radius: 7px;
  min-height: 40px;
}
.nav-button .nav-icon { width: 24px; height: 24px; border: 1px solid rgba(255,255,255,0.18); border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 11px; }
.nav-button.active { background: var(--blue); color: #fff; }
.credits-card { margin-top: auto; border: 1px solid rgba(255,255,255,0.14); border-radius: var(--radius); padding: 16px; background: rgba(255,255,255,0.04); display: grid; gap: 8px; }
.credits-card span, .credits-card small { color: #b7c9e8; }
.credits-card strong { font-size: 28px; }
.meter { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.16); overflow: hidden; }
.meter i { display: block; height: 100%; width: 62%; background: linear-gradient(90deg, var(--green), var(--blue)); }

.workspace { min-width: 0; }
.topbar {
  height: 66px;
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) minmax(260px, 560px) auto auto auto;
  gap: 14px;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.crumbs { color: var(--blue); font-weight: 900; font-size: 14px; }
.search { position: relative; display: block; }
.search span { position: absolute; left: -999px; }
.search input { width: 100%; padding-left: 38px; background: linear-gradient(90deg, #fff, #f8fbff); }
.search:before { content: "/"; position: absolute; left: 16px; top: 10px; color: var(--blue); font-weight: 900; }
.profile { display: grid; grid-template-columns: 34px auto; column-gap: 8px; align-items: center; border: 0; background: transparent; color: var(--ink); text-align: left; }
.profile span { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.profile b { font-size: 13px; }
.profile small { color: var(--muted); }
.icon-button { border: 1px solid var(--line); background: #fff; color: var(--ink); width: 36px; height: 36px; border-radius: 7px; font-weight: 900; }
.icon-button.alert { color: #fff; background: var(--blue); border-color: var(--blue); }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 28px; }
.page-head p { color: var(--muted); margin: 8px 0 0; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.primary, .outline, .ghost, .danger { border-radius: 7px; padding: 10px 14px; border: 1px solid transparent; font-weight: 900; min-height: 40px; }
.primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(20, 92, 255, 0.18); }
.outline { background: #fff; color: var(--blue); border-color: var(--line); }
.ghost { background: var(--blue-soft); color: var(--blue); }
.danger { background: var(--red); color: #fff; }
.full { width: 100%; }

.context-strip {
  margin: 0 28px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) minmax(400px, 1fr);
  gap: 18px;
  align-items: center;
}
.demo-banner {
  margin: 0 28px 18px;
  border: 1px solid #b9cdf8;
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #eef5ff;
  color: var(--ink);
}
.demo-banner strong { color: var(--blue); font-size: 13px; text-transform: uppercase; }
.demo-banner span { color: var(--muted); font-size: 13px; }
.product-icon { width: 58px; height: 58px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #ff9f1c, #145cff); color: #fff; font-weight: 900; }
.context-strip h3 { margin: 0; }
.context-strip p { margin: 6px 0 0; color: var(--muted); }
dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(80px, 1fr)); gap: 10px; }
dt { color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 900; }
dd { margin: 3px 0 0; font-weight: 900; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 18px; padding: 0 28px 28px; align-items: start; }
.main-panel, .side-panel { display: grid; gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card h3 { margin: 0 0 12px; font-size: 17px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 14px; }
.metric { padding: 16px; display: grid; gap: 8px; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 900; }
.metric strong { font-size: 27px; }
.metric small { color: var(--muted); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.good { background: var(--green-soft); color: var(--green); }
.warning { background: var(--amber-soft); color: #a86400; }
.danger-soft { background: var(--red-soft); color: var(--red); }
.review { background: var(--purple-soft); color: var(--purple); }
.info { background: var(--blue-soft); color: var(--blue); }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 780px; background: #fff; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; background: #fbfdff; }
tr:last-child td { border-bottom: 0; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 12px; }
.export-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 12px; }
.export-item { border: 1px solid var(--line); border-radius: 7px; padding: 12px; display: grid; gap: 10px; background: #fbfdff; }
.export-item strong { font-size: 14px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.action-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.action-card p { margin: 0; color: var(--muted); }
.list { display: grid; gap: 10px; }
.list-item { border: 1px solid var(--line); border-radius: 7px; padding: 12px; display: grid; gap: 6px; background: #fff; }
.list-item strong { font-size: 14px; }
.list-item p { margin: 0; color: var(--muted); font-size: 13px; }
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 12px; }
.status-tile { border: 1px solid var(--line); border-radius: 7px; padding: 12px; display: grid; gap: 8px; align-content: start; min-height: 116px; background: #fbfdff; }
.status-tile span { color: var(--muted); font-size: 12px; font-weight: 900; }
.status-tile small { color: var(--muted); line-height: 1.35; }
.progress-cell { display: grid; grid-template-columns: 42px minmax(90px, 1fr); gap: 8px; align-items: center; min-width: 150px; }
.progress-cell span { color: var(--ink); font-weight: 900; font-size: 12px; }
.progress-bar { height: 8px; border-radius: 99px; background: #e8eef8; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--blue)); }
.empty-state { min-height: 190px; place-items: center; text-align: center; align-content: center; }
.empty-state p { max-width: 520px; margin: 0 0 12px; color: var(--muted); }
.check-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.check-item input { width: 18px; height: 18px; }
.check-item strong { display: block; }
.check-item span span { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 7px; padding: 8px 10px; font-weight: 900; }
.tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.health-ring { width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; background: conic-gradient(var(--green) var(--pct), #e8eef8 0); }
.health-ring span { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-weight: 900; font-size: 22px; }
.toast { position: fixed; right: 22px; bottom: 22px; background: var(--ink); color: #fff; padding: 13px 16px; border-radius: 7px; box-shadow: var(--shadow); z-index: 20; max-width: 380px; }
footer { padding: 20px 28px 34px; color: var(--muted); font-size: 12px; }

@media (max-width: 1180px) {
  .content-grid { grid-template-columns: 1fr; }
  .side-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .filter-grid, .export-grid, .status-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 860px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { padding: 36px; min-height: 320px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 10; width: 254px; transform: translateX(-102%); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .topbar { grid-template-columns: auto 1fr auto auto; padding: 0 16px; }
  .search { grid-column: 1 / -1; order: 2; }
  .profile, #logoutButton { display: none; }
  .page-head { display: grid; padding: 22px 16px; }
  .demo-banner { margin: 0 16px 16px; align-items: flex-start; flex-direction: column; }
  .context-strip { margin: 0 16px 16px; grid-template-columns: auto 1fr; }
  .context-strip dl { grid-column: 1 / -1; grid-template-columns: repeat(2, 1fr); }
  .content-grid { padding: 0 16px 16px; }
  .form-grid, .filter-grid, .export-grid, .status-grid, .split, .side-panel { grid-template-columns: 1fr; }
  .action-card { align-items: stretch; flex-direction: column; }
}
@media (max-width: 560px) {
  .metric-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px; }
  .investor-proof { grid-template-columns: 1fr; }
}
