﻿:root {
  --ink: #17211b;
  --muted: #68746d;
  --paper: #f6f1e7;
  --panel: rgba(255, 252, 244, .86);
  --line: rgba(40, 54, 45, .12);
  --forest: #183f2d;
  --moss: #6b8b3d;
  --gold: #d6a73d;
  --clay: #b95f36;
  --danger: #9d2f27;
  --good: #1f7a4a;
  --warning: #b7791f;
  --shadow: 0 24px 80px rgba(30, 43, 34, .16);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(214, 167, 61, .34), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(31, 122, 74, .20), transparent 32rem),
    linear-gradient(135deg, #fbf7ec, var(--paper));
}

button, input { font: inherit; }
.shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 48px; }
.hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 28px;
  align-items: center;
}
.eyebrow { margin: 0 0 10px; color: var(--moss); font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; max-width: 820px; font-size: clamp(3.6rem, 9vw, 8.4rem); line-height: .85; letter-spacing: -.075em; }
h2 { margin: 0; font-size: clamp(2rem, 4vw, 4.5rem); letter-spacing: -.055em; }
h3 { margin: 0; font-size: 1.15rem; }
.hero-copy { max-width: 700px; margin: 28px 0 0; color: var(--muted); font-size: 1.25rem; line-height: 1.6; }
.login-card, .panel, .cashflow-card, .insight-band, .sources {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.login-card { padding: 24px; border-radius: 30px; display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: .92rem; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--ink);
  background: rgba(255,255,255,.6);
  outline: none;
}
input:focus { border-color: rgba(31, 122, 74, .55); box-shadow: 0 0 0 4px rgba(31, 122, 74, .12); }
button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  color: #fff;
  background: var(--forest);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(24,63,45,.20); }
button:disabled { cursor: wait; opacity: .65; }
.ghost { color: var(--forest); background: rgba(24, 63, 45, .08); }
.ghost.danger { color: var(--danger); background: rgba(157,47,39,.08); }
.status { min-height: 22px; margin: 0; color: var(--danger); font-size: .92rem; }
.hidden { display: none !important; }
.dashboard { animation: rise .55s ease both; }
.dashboard-topline { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 24px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi-card {
  min-height: 165px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,.58);
  position: relative;
  overflow: hidden;
}
.kpi-card:before { content: ""; position: absolute; inset: auto -20px -35px auto; width: 110px; height: 110px; border-radius: 999px; background: rgba(214,167,61,.18); }
.kpi-title { margin: 0 0 18px; color: var(--muted); font-size: .88rem; }
.kpi-value { margin: 0; font-size: clamp(1.55rem, 2vw, 2.45rem); letter-spacing: -.045em; }
.kpi-meta { margin: 12px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 6px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.good { color: var(--good); background: rgba(31,122,74,.12); }
.warning { color: var(--warning); background: rgba(183,121,31,.13); }
.danger { color: var(--danger); background: rgba(157,47,39,.12); }
.neutral { color: var(--muted); background: rgba(104,116,109,.12); }
.insight-band { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: center; padding: 24px; border-radius: 34px; margin-bottom: 18px; }
.cashflow-card { padding: 22px; border-radius: 26px; box-shadow: none; background: linear-gradient(145deg, var(--forest), #285b42); color: white; display: grid; gap: 8px; }
.cashflow-card span, .cashflow-card small { opacity: .78; }
.cashflow-card strong { font-size: 2rem; letter-spacing: -.05em; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { min-height: 320px; border-radius: 30px; padding: 20px; box-shadow: 0 18px 60px rgba(30, 43, 34, .10); }
.panel.wide { grid-column: 1 / -1; }
.panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 18px; }
.panel-heading span { color: var(--muted); font-size: .86rem; }
.trend-chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 12px; min-height: 250px; padding-top: 16px; }
.bar-wrap { display: grid; gap: 8px; align-items: end; min-width: 0; }
.bar { border-radius: 18px 18px 6px 6px; background: linear-gradient(180deg, var(--gold), var(--clay)); min-height: 10px; position: relative; }
.bar small { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); color: var(--muted); font-size: .72rem; white-space: nowrap; }
.bar-label { color: var(--muted); font-size: .76rem; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.ranking, .alert-list { display: grid; gap: 10px; }
.rank-row, .alert-row { border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: rgba(255,255,255,.46); }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.rank-name { margin: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-code, .rank-sub, .alert-message { color: var(--muted); font-size: .82rem; }
.rank-value { font-weight: 900; text-align: right; }
.alert-row strong { display: block; margin-bottom: 6px; }
.sources { margin-top: 18px; padding: 16px 20px; border-radius: 22px; color: var(--muted); box-shadow: none; }
.sources strong { color: var(--forest); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (max-width: 980px) {
  .hero, .insight-band, .content-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 40px 0; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-topline { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 22px, 1440px); padding-top: 16px; }
  .kpi-grid { grid-template-columns: 1fr; }
  h1 { font-size: 4rem; }
  .panel { padding: 16px; }
}

.period-filter {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: .82rem;
  min-width: 180px;
}

.period-filter input {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,.72);
}
