:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --brand: #2563eb;
  --success: #16a34a;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.92rem; }
.app-shell { min-height: 100vh; }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}
.sidebar {
  background: #0f172a;
  color: #fff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.brand h2 { margin: 0 0 0.35rem; }
.brand .muted { color: #cbd5e1; }
.nav-list { display: grid; gap: 0.5rem; }
.nav-list button {
  border: 1px solid transparent;
  background: rgba(255,255,255,0.08);
  color: #fff;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}
.nav-list button.active {
  background: #1d4ed8;
  border-color: #3b82f6;
}
.danger { background: #991b1b; color: #fff; border: 0; border-radius: 10px; padding: 0.7rem; cursor: pointer; }
.content { padding: 1.2rem; }
.topbar { margin-bottom: 1rem; }
.topbar h1 { margin: 0; font-size: 1.35rem; }
.page { display: none; }
.page.active { display: block; }
.grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}
.auth-card { width: min(460px, 100%); }
.form-grid { display: grid; gap: 0.65rem; }
.form-grid label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}
input, select, textarea, button { font: inherit; }
input, select, textarea {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: #fff;
}
button {
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 0.85rem;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}
.toolbar input { width: min(280px, 100%); }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th, td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.45rem;
  vertical-align: top;
}
th { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}
.mini-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: #fff;
}
.mini-card h4 { margin: 0 0 0.35rem; }
.mini-card p { margin: 0.2rem 0; color: var(--muted); font-size: 0.9rem; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.78rem;
  border: 1px solid transparent;
}
.pill.low { background: #ecfeff; color: #0369a1; border-color: #bae6fd; }
.pill.medium { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pill.high { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.pill.critical { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.overdue { color: #b91c1c; font-weight: 600; }
.due-soon { color: #92400e; font-weight: 600; }
.mini {
  background: #e5e7eb;
  color: #111827;
  margin-right: 0.3rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #d1d5db;
}
.empty {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 0.7rem;
  color: var(--muted);
  background: #f8fafc;
}
.toast-container {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 40;
  display: grid;
  gap: 0.45rem;
}
.toast {
  border-radius: 10px;
  padding: 0.62rem 0.8rem;
  color: #fff;
  background: #334155;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; }
  .grid.two { grid-template-columns: 1fr; }
}