:root {
  --nav: #252b33;
  --bg: #f5f3ee;
  --surface: #fffdfa;
  --white: #fff;
  --ink: #20242a;
  --body: #525e68;
  --muted: #7d8790;
  --line: #ded9cf;
  --green: #24765a;
  --blue: #326fa8;
  --amber: #c57a28;
  --red: #b54752;
  --soft-red: #f2dadd;
  --shadow: 0 18px 48px rgba(30, 28, 22, .08);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--body); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login section { width: min(460px, 100%); padding: 30px; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.login form, .form, .form-grid { display: grid; gap: 10px; }
input, select, textarea { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; color: var(--ink); background: #fff; }
textarea { min-height: 90px; resize: vertical; }
button { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; color: var(--ink); background: #fff; font-weight: 900; }
button.primary, .login button { color: #fff; border-color: var(--green); background: var(--green); }
button.danger { color: #fff; border-color: var(--red); background: var(--red); }
.message { margin-top: 12px; color: var(--red); font-weight: 700; }
.app { min-height: 100vh; display: grid; grid-template-columns: 276px minmax(0, 1fr); }
.sidebar { min-height: 100vh; color: rgba(255,255,255,.82); background: var(--nav); display: flex; flex-direction: column; }
.brand { padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand h1 { margin: 0; color: #fff; font-size: 1.05rem; }
.brand p { margin: 5px 0 0; color: rgba(255,255,255,.58); font-size: .84rem; }
nav { display: grid; gap: 5px; padding: 12px 10px; }
nav button, .logout { border: 0; border-radius: 8px; padding: 10px; color: rgba(255,255,255,.78); background: transparent; text-align: left; }
nav button.active, nav button:hover, .logout:hover { color: #fff; background: rgba(255,255,255,.12); }
.logout { margin: auto 10px 12px; }
.main { min-width: 0; }
.topbar { padding: 18px 22px; border-bottom: 1px solid var(--line); background: rgba(245,243,238,.92); }
.topbar h2 { margin: 0; color: var(--ink); }
#appRoot { padding: 18px 22px 40px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.metric, .panel, .card, .task-card { border: 1px solid rgba(32,36,42,.1); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.metric { padding: 15px; }
.metric span { color: var(--muted); font-size: .78rem; font-weight: 900; }
.metric strong { display: block; color: var(--ink); font-size: 2rem; margin-top: 8px; }
.grid { display: grid; gap: 12px; }
.two-col { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); }
.panel-head { padding: 18px 18px 0; }
.panel-body { padding: 18px; }
.card, .task-card { padding: 13px; }
.task-card.critical { background: linear-gradient(90deg, var(--soft-red), #fff 40%); border-color: rgba(181,71,82,.34); }
.row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.row strong, .card strong, .task-card strong { color: var(--ink); }
.badge { display: inline-flex; border-radius: 999px; padding: 3px 8px; background: #dceaf6; color: var(--ink); font-size: .74rem; font-weight: 900; }
.badge.red { background: #f2dadd; }
.badge.green { background: #dcefe6; }
.badge.amber { background: #f4e4c7; }
.progress { height: 8px; overflow: hidden; border-radius: 999px; background: #ebe6dc; margin: 10px 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--blue)); }
.form-grid { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 14px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.comment { margin-top: 8px; border-left: 4px solid var(--blue); padding: 8px; background: #eef5fb; border-radius: 0 8px 8px 0; font-size: .86rem; }
.empty, .alert { border: 1px dashed var(--line); border-radius: 8px; padding: 16px; background: rgba(255,255,255,.65); color: var(--muted); }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metrics, .two-col, .form-grid { grid-template-columns: 1fr; }
  #appRoot { padding: 12px; }
}
