:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --soft: #f9fafb;
  --brand: #0b3b5f;
  --brand-2: #0e7490;
  --accent: #d89b2b;
  --good: #027a48;
  --warn: #b54708;
  --bad: #b42318;
  --shadow: 0 20px 60px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(14, 116, 144, .12), transparent 32rem),
    linear-gradient(135deg, #f6f8fb 0%, #eef2f6 100%);
}
button, input, select, textarea { font: inherit; }
.app-shell { display: grid; grid-template-columns: 292px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 24px 18px; background: #071f33; color: white;
  box-shadow: 10px 0 40px rgba(7, 31, 51, .18);
}
.brand { display: flex; gap: 14px; align-items: center; padding: 4px 6px 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-mark {
  width: 48px; height: 48px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(135deg, #d89b2b, #ffe0a3); color: #071f33; font-weight: 900;
}
.brand h1 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.brand p { margin: 2px 0 0; color: rgba(255,255,255,.64); font-size: 13px; }
.module-nav { margin: 22px 0; display: grid; gap: 6px; }
.nav-btn {
  width: 100%; border: 0; border-radius: 14px; padding: 12px 13px; color: rgba(255,255,255,.76);
  background: transparent; text-align: left; display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.nav-btn:hover { background: rgba(255,255,255,.08); color: white; }
.nav-btn.active { background: white; color: #071f33; box-shadow: 0 10px 30px rgba(0,0,0,.16); }
.nav-dot { width: 9px; height: 9px; border-radius: 999px; background: currentColor; opacity: .5; }
.sidebar-card {
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.08); border-radius: 22px; padding: 16px; margin-top: 18px;
}
.sidebar-card strong { display: block; line-height: 1.35; margin: 7px 0; }
.sidebar-card p { margin: 0; color: rgba(255,255,255,.66); font-size: 13px; line-height: 1.5; }
.main { padding: 26px; min-width: 0; }
.topbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  background: rgba(255,255,255,.74); border: 1px solid rgba(255,255,255,.9); border-radius: 28px; padding: 26px;
  box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.eyebrow { margin: 0 0 7px; color: var(--brand-2); text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; }
.topbar h2 { margin: 0; font-size: clamp(27px, 3vw, 42px); letter-spacing: -.055em; }
.topbar p:last-child { margin: 9px 0 0; color: var(--muted); max-width: 840px; line-height: 1.55; }
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.primary-btn, .ghost-btn, .icon-btn {
  border: 0; border-radius: 14px; padding: 11px 15px; cursor: pointer; font-weight: 800;
}
.primary-btn { background: var(--brand); color: white; box-shadow: 0 10px 24px rgba(11, 59, 95, .2); }
.ghost-btn { background: white; color: var(--brand); border: 1px solid var(--line); }
.icon-btn { background: var(--soft); width: 42px; height: 42px; display: grid; place-items: center; font-size: 24px; }
.filter-panel {
  display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)) auto; gap: 12px; align-items: end;
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 16px; margin: 18px 0;
}
.filter-field { display: grid; gap: 7px; }
.filter-field.wide { grid-column: span 2; }
.filter-field label, .expense-form label { font-size: 12px; color: var(--muted); font-weight: 800; }
select, input, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; background: white; color: var(--ink); outline: none;
}
textarea { min-height: 82px; resize: vertical; }
.content { display: grid; gap: 18px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.kpi-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi-card:after { content: ""; position: absolute; right: -30px; top: -30px; width: 96px; height: 96px; border-radius: 50%; background: rgba(14,116,144,.08); }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 800; }
.kpi-value { margin-top: 8px; font-size: 28px; letter-spacing: -.04em; font-weight: 900; }
.kpi-note { margin-top: 8px; color: var(--muted); font-size: 12px; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.panel, .table-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden;
}
.panel-header, .table-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.panel-title, .table-title { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.panel-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.panel-body { padding: 18px 20px; }
.bars { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: 11px; align-items: center; }
.bar-label { font-size: 13px; color: var(--ink); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 11px; background: #edf2f7; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: inherit; }
.bar-value { color: var(--muted); font-size: 12px; font-weight: 800; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; min-width: 920px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
th { color: var(--muted); background: #fbfcfe; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; position: sticky; top: 0; z-index: 1; }
tbody tr:hover { background: #f9fbfc; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 900; background: #f2f4f7; color: #344054; white-space: nowrap; }
.badge.good { background: #ecfdf3; color: var(--good); }
.badge.warn { background: #fffaeb; color: var(--warn); }
.badge.bad { background: #fef3f2; color: var(--bad); }
.badge.info { background: #ecfeff; color: var(--brand-2); }
.health { display: grid; gap: 7px; min-width: 130px; }
.health-track { height: 8px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.health-fill { height: 100%; border-radius: 999px; background: var(--good); }
.health-fill.watch { background: var(--warn); }
.health-fill.critical { background: var(--bad); }
.module-intro {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; align-items: stretch;
}
.intro-card {
  background: linear-gradient(135deg, #073756, #0e7490); color: white; border-radius: 26px; padding: 26px; box-shadow: var(--shadow); min-height: 210px;
}
.intro-card h3 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.intro-card p { color: rgba(255,255,255,.76); line-height: 1.6; max-width: 740px; }
.intro-list { display: grid; gap: 10px; margin-top: 18px; }
.intro-list span { background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.16); border-radius: 13px; padding: 10px 12px; }
.timeline-card { background: var(--panel); border: 1px solid var(--line); border-radius: 26px; padding: 22px; box-shadow: var(--shadow); }
.timeline { display: grid; gap: 11px; margin-top: 14px; }
.timeline-item { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.timeline-dot { width: 13px; height: 13px; border-radius: 50%; background: var(--accent); margin-top: 3px; box-shadow: 0 0 0 5px rgba(216,155,43,.14); }
.timeline-item strong { display: block; font-size: 13px; }
.timeline-item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.modal { position: fixed; inset: 0; background: rgba(16,24,40,.44); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 20; }
.modal.open { display: flex; }
.modal-panel { background: white; border-radius: 28px; width: min(920px, 96vw); max-height: 92vh; overflow: auto; box-shadow: 0 30px 90px rgba(16,24,40,.25); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; font-size: 24px; }
.expense-form { padding: 22px 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.expense-form label { display: grid; gap: 8px; }
.span-2 { grid-column: span 2; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.notice { border: 1px dashed #d0d5dd; background: #fcfcfd; border-radius: 20px; padding: 18px; color: var(--muted); line-height: 1.55; }
.search-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.search-row input { max-width: 360px; }
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .module-nav { grid-template-columns: repeat(3, 1fr); }
  .filter-panel { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid, .panel-grid.three, .module-intro { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .main { padding: 14px; }
  .topbar, .filter-panel { border-radius: 20px; }
  .topbar { flex-direction: column; }
  .filter-panel, .kpi-grid, .form-grid { grid-template-columns: 1fr; }
  .filter-field.wide, .span-2 { grid-column: auto; }
  .module-nav { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 23px; }
}
