:root {
  --bg: #0e1513;
  --nav-bg: #121b19;
  --card-bg: #1b2724;
  --field-bg: #16201d;
  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --text-secondary: #a8b3ae;
  --text-muted: #6e7a75;
  --green: #32b04a;
  --green-light: #6fd487;
  --gold: #fec744;
  --teal: #3b5152;
  --teal-light: #a7b4b2;
  --red: #e2574c;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 7px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 40px;
  background: var(--nav-bg);
}
.nav-left { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: url('/static/logo.svg') center/cover no-repeat;
}
.wordmark { font-weight: 700; font-size: 16px; }
.role-pill {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(50, 176, 74, 0.18); color: var(--green-light);
}
.nav-center { display: flex; align-items: center; gap: 4px; }
.nav-item {
  padding: 8px 14px; border-radius: 8px; color: var(--text-secondary);
  font-size: 14px;
}
.nav-item.active { background: rgba(255,255,255,0.08); color: var(--text); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.avatar {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 600; color: #fff; flex-shrink: 0;
}
.avatar.gold { color: #14201d; }
.avatar-green { background: var(--green); }
.avatar-gold { background: var(--gold); }
.avatar-teal { background: var(--teal); }

.page { padding: 40px 48px; max-width: 1440px; margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-size: 28px; margin: 0 0 6px; }
.page-header .sub { color: var(--text-secondary); font-size: 14px; margin: 0; }

.month-switcher {
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.month-switcher a, .month-switcher span {
  display: flex; align-items: center; justify-content: center;
}
.month-switcher .arrow { width: 30px; height: 30px; border-radius: var(--radius-sm); color: var(--text-secondary); font-weight: 700; }
.month-switcher .arrow:hover { background: rgba(255,255,255,0.06); }
.month-switcher .label { padding: 0 14px; font-weight: 600; }

.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px;
}
.card-flush { padding: 0; }

.kpi-row, .cards-row, .stats-row { display: grid; gap: 16px; margin-bottom: 32px; }
.kpi-row { grid-template-columns: repeat(4, 1fr); }
.cards-row { grid-template-columns: repeat(4, 1fr); }
.stats-row { grid-template-columns: repeat(3, 1fr); }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 32px; }
.kpi-label { color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.kpi-sub { font-size: 12px; font-weight: 600; }

h2.section-title { font-size: 18px; margin: 0 0 16px; }
.section-block { margin-bottom: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }

.table-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-top: 1px solid var(--border-soft);
}
.table-row:first-child { border-top: none; }
.table-row.current { background: rgba(254, 199, 68, 0.08); }
.table-head { display: flex; justify-content: space-between; padding: 16px 20px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; }

.progress-track { position: relative; height: 8px; border-radius: 4px; background: #232f2b; overflow: hidden; }
.progress-track.thin { height: 6px; }
.progress-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 4px; background: var(--green); }
.progress-fill.gold { background: var(--gold); }
.progress-fill.red { background: var(--red); }

.pill { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-green { background: rgba(50,176,74,.18); color: var(--green-light); }
.pill-gold { background: rgba(254,199,68,.18); color: var(--gold); }
.pill-red { background: rgba(226,87,76,.18); color: #f19188; }
.pill-gray { background: rgba(255,255,255,.08); color: var(--text-secondary); }

.checkbox-form { display: inline-flex; }
.checkbox {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid rgba(255,255,255,.15);
  background: #29332f; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700; padding: 0;
}
.checkbox.done { background: linear-gradient(90deg, var(--green), var(--gold)); border: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-md); font-weight: 600; font-size: 13px;
  border: none; cursor: pointer;
}
.btn-primary { background: var(--green); color: #0a1410; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-block { width: 100%; padding: 13px 16px; font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.field input, .field select {
  height: 46px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--field-bg); color: var(--text); padding: 0 14px; font-size: 14px;
  font-family: inherit;
}
.field input:focus, .field select:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.field input[type="date"] { color-scheme: dark; }

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 90px; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-green { color: var(--green-light); }
.text-gold { color: var(--gold); }
.text-red { color: #f19188; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.glow { position: absolute; border-radius: 50%; filter: blur(140px); z-index: 0; }
.glow-green { width: 500px; height: 500px; background: rgba(50,176,74,.22); top: -150px; left: -120px; }
.glow-gold { width: 450px; height: 450px; background: rgba(254,199,68,.14); bottom: -150px; right: -100px; }
.login-card {
  position: relative; z-index: 1; width: 440px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px; text-align: center;
}
.login-logo-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 20px; }
.login-logo-row .logo { width: 40px; height: 40px; }
.login-card h1 { font-size: 22px; margin: 4px 0; }
.login-error { background: rgba(226,87,76,.15); color: #f19188; border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.login-foot { font-size: 11px; color: var(--text-muted); margin-top: 16px; }

table.simple { width: 100%; border-collapse: collapse; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

@media (max-width: 1100px) {
  .kpi-row, .cards-row { grid-template-columns: repeat(2, 1fr); }
  .stats-row, .two-col { grid-template-columns: 1fr; }
}

.site-footer { padding: 32px 40px 44px; text-align: center; }
.site-footer a {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  color: var(--text-secondary); font-size: 15px; font-weight: 600; transition: color .15s;
}
.site-footer a:hover { color: var(--text); }
.footer-logo { width: 32px; height: 32px; border-radius: 50%; }
