:root {
  --bg: #f5f7f2;
  --surface: #ffffff;
  --surface-2: #eef4e6;
  --ink: #17352b;
  --muted: #62746b;
  --line: #d7e1d5;
  --accent: #2e6b4f;
  --accent-2: #8bbf3f;
  --danger: #a23b3b;
  --shadow: 0 12px 30px rgba(23, 53, 43, 0.08);
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
}
button, input, select { font: inherit; }
button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: 0.15s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(23, 53, 43, 0.08); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger-light { border-color: #e7c5c5; color: var(--danger); background: #fff8f8; }
button.small { padding: 7px 10px; font-size: 13px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin: 0; }
code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.11em; font-size: 12px; color: var(--accent); font-weight: 700; }
.error { color: var(--danger); margin-top: 12px; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top left, #dfeecb, transparent 36%), var(--bg);
}
.login-card {
  width: min(460px, 100%);
  background: var(--surface);
  padding: 34px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.app-shell { max-width: 1500px; margin: 0 auto; padding: 24px; }
.topbar, .panel-header, .card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.topbar {
  background: linear-gradient(135deg, #17352b, #2e6b4f);
  color: #fff;
  padding: 28px;
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.topbar .muted, .topbar .eyebrow { color: #dbead2; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 0 12px;
}
.tab { white-space: nowrap; background: #fff; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.panel { display: none; }
.panel.active { display: grid; gap: 16px; }
.panel-header {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.filters, .form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  min-width: min(620px, 100%);
}
.form-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); min-width: auto; }
.form-grid.single { grid-template-columns: 1fr; margin-top: 18px; }
.kpi-grid, .grid-two {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}
.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi-card, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.kpi-card { display: grid; gap: 7px; }
.kpi-card span { color: var(--muted); font-size: 13px; }
.kpi-card strong { font-size: 28px; }
.kpi-card small { color: var(--muted); }
.card { display: grid; gap: 14px; }
.table-scroll { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-2); position: sticky; top: 0; z-index: 1; color: var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar-list { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(140px, 230px) 1fr 86px; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar-track { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.month-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 12px; }
.month-card { background: var(--surface-2); border-radius: 14px; padding: 12px; display: grid; gap: 6px; }
.month-card strong { font-size: 20px; }
.status-box { border: 1px dashed var(--line); background: var(--surface-2); padding: 12px; border-radius: 12px; color: var(--muted); }
.stopwatch-card { align-content: start; }
.stopwatch { font-family: var(--mono); font-size: clamp(42px, 8vw, 70px); background: #0f251e; color: #e8f4df; padding: 22px; border-radius: 18px; text-align: center; letter-spacing: 0.04em; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink); font-size: 12px; }
.badge.green { background: #e6f3dc; color: #2e6b4f; }
.badge.red { background: #fae9e9; color: var(--danger); }
.badge.yellow { background: #fff5cf; color: #765a00; }

@media (max-width: 980px) {
  .topbar, .panel-header, .card-header { flex-direction: column; }
  .kpi-grid, .grid-two, .filters, .form-grid { grid-template-columns: 1fr; }
  .top-actions { justify-content: flex-start; }
}

@media print {
  body { background: #fff; }
  .tabs, .top-actions, button, input, select, #loginView { display: none !important; }
  .app-shell { padding: 0; max-width: none; }
  .panel { display: block !important; page-break-after: always; }
  .card, .kpi-card, .panel-header, .topbar { box-shadow: none; border-color: #bbb; }
}
