/* ==========================================================================
   I2DS intelligent cash management
   Brand tokens: change these few variables to match the Venicia palette.
   ========================================================================== */
:root {
  /* Navy background, white text everywhere (I2DS / Venicia identity) */
  --brand: #0b1a3f;         /* navy – page background, top bar */
  --brand-2: #1e3a8a;       /* lighter navy – gradients, primary buttons */
  --accent: #2dd4bf;        /* teal – feeds, highlights, positive */
  --accent-soft: rgba(45,212,191,.16);
  --warn: #fbbf24; --warn-soft: rgba(251,191,36,.18);
  --danger: #fb7185; --danger-soft: rgba(251,113,133,.18);
  --info: #38bdf8; --info-soft: rgba(56,189,248,.16);
  --ok: #34d399;
  --bg: #0b1a3f;            /* navy */
  --surface: #122452;       /* cards */
  --surface-2: #1a2f66;     /* table heads, hover */
  --field: #0e1f49;         /* inputs */
  --text: #ffffff;          /* all fonts white */
  --muted: rgba(255,255,255,.72);
  --line: rgba(255,255,255,.14);
  --link: #ffffff;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.25), 0 10px 28px rgba(0,0,0,.25);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--link); text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3 { margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ---------- top bar */
.topbar { background: linear-gradient(90deg, #08132f, var(--brand-2)); color: #fff; border-bottom: 1px solid var(--line); }
.topbar a, .hero a { text-decoration: none; }
.topbar .inner { max-width: 1320px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; }
.logo .mark { width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.15); display: grid; place-items: center; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { color: rgba(255,255,255,.85); padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user form { margin: 0; }
.user button { background: rgba(255,255,255,.15); color: #fff; border: 0; padding: 6px 10px; border-radius: 8px; cursor: pointer; }

main { max-width: 1320px; margin: 0 auto; padding: 24px 20px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- cards & grid */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-main { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-main, .g3, .g2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr; } }

.kpi { position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12px; }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--accent-soft); opacity: .8; }
.value.pos { color: var(--accent); } .value.neg { color: var(--danger); }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: rgba(255,255,255,.04); }
tfoot td { font-weight: 700; background: var(--surface-2); }
td.num, th.num { text-align: right; white-space: nowrap; }

/* ---------- badges & alerts */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.draft { background: var(--info-soft); color: #fff; }
.badge.submitted { background: var(--warn-soft); color: #fff; }
.badge.locked { background: var(--accent-soft); color: #fff; }
.badge.posted { background: rgba(167,139,250,.25); color: #fff; }
.badge.admin { background: rgba(167,139,250,.3); color: #fff; }
.flag { display: inline-block; margin: 2px 4px 0 0; padding: 1px 7px; border-radius: 6px; font-size: 11px; }
.flag.warning { background: var(--warn-soft); color: #fff; border-left: 3px solid var(--warn); }
.flag.danger { background: var(--danger-soft); color: #fff; border-left: 3px solid var(--danger); }
.flag.info { background: var(--info-soft); color: #fff; border-left: 3px solid var(--info); }
.alert { border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; border: 1px solid transparent; }
.alert.success { background: rgba(52,211,153,.16); border-color: var(--ok); color: #fff; }
.alert.danger { background: var(--danger-soft); border-color: var(--danger); color: #fff; }
.alert.warning { background: var(--warn-soft); border-color: var(--warn); color: #fff; }
.alert.info, .alert.message { background: var(--info-soft); border-color: var(--info); color: #fff; }
.insight { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.insight:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.danger { background: var(--danger); } .dot.warning { background: var(--warn); } .dot.info { background: var(--info); } .dot.ok { background: var(--ok); }

/* ---------- forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--text); }
input::placeholder, textarea::placeholder { color: rgba(255,255,255,.45); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(45,212,191,.45); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
.form-row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; }
.field { margin-bottom: 10px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06); color: #fff; padding: 8px 14px; border-radius: 9px; font-weight: 600; cursor: pointer; font-size: 13px; white-space: nowrap; }
.btn:hover { text-decoration: none; background: rgba(255,255,255,.14); }
.btn { text-decoration: none; }
.btn.primary { background: var(--brand-2); border-color: #3b5bdb; color: #fff; }
.btn.primary:hover { background: #2747b0; }
.btn.accent { background: #0d9488; border-color: var(--accent); color: #fff; }
.btn.danger { color: #fff; border-color: var(--danger); background: var(--danger-soft); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.suggest { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px dashed var(--accent); background: var(--accent-soft); color: #fff; padding: 2px 9px; border-radius: 999px; font-size: 12px; cursor: pointer; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 14px; border-radius: 9px 9px 0 0; color: var(--muted); font-weight: 600; }
.tabs a.active { color: #fff; border-bottom: 2px solid var(--accent); }
.tabs a { text-decoration: none; }
details summary { cursor: pointer; font-weight: 600; }

/* ---------- landing */
.hero { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.hero .left { background: radial-gradient(1200px 600px at 10% 10%, var(--brand-2), #08132f); color: #fff; padding: 64px; display: flex; flex-direction: column; justify-content: center; }
.hero .left h1 { font-size: 2.4rem; line-height: 1.15; max-width: 520px; }
.hero .left p { opacity: .85; max-width: 480px; font-size: 1.05rem; }
.hero .feat { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 28px; max-width: 560px; }
.hero .feat div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.hero .right { display: grid; place-items: center; padding: 32px; }
.login { width: 100%; max-width: 380px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .hero .left { padding: 40px 24px; } }

.timeline { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow: auto; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline .meta { font-size: 11px; color: var(--muted); }
.lockbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: #fff; border: 1px solid rgba(45,212,191,.4); margin-bottom: 16px; }
.chart-box { position: relative; height: 280px; }
.grid > .card + .card { margin-top: 0; }

select option { background: var(--surface); color: #fff; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=month]::-webkit-calendar-picker-indicator,
input[type=week]::-webkit-calendar-picker-indicator { filter: invert(1); }
input[type=file]::file-selector-button { background: rgba(255,255,255,.12); color: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; }
.mono { color: #fff; }
[hidden] { display: none !important; }
