:root {
  --green-950: #063d28;
  --green-800: #07583a;
  --green-700: #0b6b43;
  --green-100: #e8f5ee;
  --orange: #f28c28;
  --ink: #17211c;
  --muted: #66756d;
  --border: #dfe7e2;
  --surface: #ffffff;
  --canvas: #f5f7f6;
  --danger: #b42318;
  --danger-bg: #fff0ee;
  --shadow: 0 20px 50px rgba(14, 39, 27, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 6px; color: var(--green-700); font-size: .74rem; letter-spacing: .14em; font-weight: 800; }

.setup-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding: 12px 18px; background: #fff5d6; border-bottom: 1px solid #ead58a; text-align: center; font-size: .9rem; }
.setup-banner code { background: rgba(255,255,255,.7); padding: 2px 5px; border-radius: 5px; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #edf8f2 0, transparent 35%), linear-gradient(145deg, #f9fbfa 0%, #edf3ef 100%); }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: 38px; box-shadow: var(--shadow); }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--green-700); color: #fff; font-size: 1.45rem; font-weight: 900; margin-bottom: 24px; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; margin: 0; font-size: 1rem; }
h1 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.auth-card .muted { line-height: 1.55; }
.login-form { display: grid; gap: 16px; margin-top: 28px; }
.login-form label { display: grid; gap: 7px; font-size: .88rem; font-weight: 700; }
.login-form input { width: 100%; border: 1px solid var(--border); border-radius: 13px; padding: 13px 14px; outline: none; background: #fbfcfb; transition: .2s; }
.login-form input:focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(11,107,67,.09); background: #fff; }
.login-form button { border: 0; border-radius: 13px; padding: 13px 16px; background: var(--green-700); color: #fff; font-weight: 800; }
.login-form button:hover { background: var(--green-800); }
.login-form button:disabled { opacity: .55; cursor: not-allowed; }
.form-message { min-height: 1.3em; margin: -4px 0 0; color: var(--danger); font-size: .85rem; }
.footer-note { margin: 24px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 255px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--border); padding: 22px 16px; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 4px 7px 26px; }
.sidebar-brand div:last-child { display: grid; }
.sidebar-brand strong { font-size: .96rem; }
.sidebar-brand span { color: var(--muted); font-size: .76rem; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; background: transparent; padding: 11px 12px; border-radius: 11px; text-align: left; color: #48554e; font-weight: 650; }
.nav-item:hover { background: #f3f7f5; color: var(--green-800); }
.nav-item.active { background: var(--green-100); color: var(--green-800); }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); }
.user-mini { display: grid; padding: 0 7px 12px; }
.user-mini strong { font-size: .86rem; }
.user-mini span { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .06em; }
.ghost-button { width: 100%; padding: 9px 11px; border: 1px solid var(--border); background: #fff; border-radius: 10px; }

.content-shell { min-width: 0; }
.topbar { min-height: 83px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 34px; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.topbar h2 { margin: 0; font-size: 1.35rem; }
.profile-chip { display: grid; justify-items: end; }
.profile-chip span { font-weight: 800; font-size: .88rem; }
.profile-chip small { color: var(--muted); }
.page-content { padding: 32px 34px 50px; max-width: 1500px; margin: 0 auto; }
.welcome-block { margin-bottom: 24px; }
.welcome-block h3 { margin: 0 0 4px; font-size: 1.55rem; letter-spacing: -.03em; }
.welcome-block p { margin: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(140px,1fr)); gap: 14px; margin-bottom: 24px; }
.kpi-card { min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 7px 22px rgba(14,39,27,.04); }
.kpi-card span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.kpi-card strong { font-size: 2rem; letter-spacing: -.05em; }

.panel { background: #fff; border: 1px solid var(--border); border-radius: 19px; padding: 20px; box-shadow: 0 8px 28px rgba(14,39,27,.04); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-heading h3 { margin: 0; font-size: 1rem; }
.panel-heading p { margin: 4px 0 0; font-size: .8rem; }
.secondary-button { border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 8px 11px; font-size: .8rem; font-weight: 700; }
.task-list { display: grid; gap: 9px; }
.task-card { display: grid; grid-template-columns: minmax(0,1fr) 125px; align-items: center; gap: 18px; padding: 15px 16px; border: 1px solid var(--border); border-radius: 14px; }
.task-card.is-overdue { border-color: #f1c4bd; background: #fffafa; }
.task-title-row { display: flex; align-items: center; gap: 9px; }
.task-card h4 { margin: 0; font-size: .92rem; }
.task-card p { margin: 5px 0 9px; color: var(--muted); font-size: .78rem; }
.task-meta { display: flex; gap: 8px 13px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .72rem; }
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; background: var(--green-100); color: var(--green-800); font-size: .67rem; font-weight: 800; }
.badge.neutral { background: #f0f2f1; color: #536058; }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.progress-block { display: grid; justify-items: end; gap: 7px; }
.progress-block strong { font-size: .82rem; }
.progress-track { width: 100%; height: 7px; border-radius: 999px; background: #e9eeeb; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green-700); }
.empty-state { display: grid; gap: 5px; padding: 28px; border: 1px dashed var(--border); border-radius: 13px; color: var(--muted); text-align: center; }
.empty-state strong, .empty-state h3 { color: var(--ink); margin: 0; }

@media (max-width: 1050px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-brand { padding-bottom: 12px; }
  .nav-list { display: flex; overflow-x: auto; }
  .nav-item { width: auto; white-space: nowrap; }
  .sidebar-footer { display: none; }
  .topbar { padding: 15px 18px; }
  .profile-chip { display: none; }
  .page-content { padding: 22px 16px 40px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .task-card { grid-template-columns: 1fr; }
  .progress-block { justify-items: start; }
  .progress-track { max-width: 220px; }
}

@media (max-width: 430px) {
  .auth-card { padding: 28px 22px; border-radius: 22px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi-card { min-height: 94px; padding: 14px; }
}
