:root {
  --bg: #0f1117;
  --card: #1a1d27;
  --border: #2a2d3a;
  --hover: #1e2130;
  --white: #ffffff;
  --muted: #9ca3af;
  --dim: #6b7280;
  --faint: #4b5563;
  --blue: #3b82f6;
  --blue-grad: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: #e5e7eb;
  font-family: Georgia, "Times New Roman", serif;
}

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

/* ── Top bar ── */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--blue-grad);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.brand-name { color: #fff; font-size: 16px; font-weight: 700; }
.badge {
  color: var(--blue); background: #1e3a5f;
  border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 600;
}
.spacer { margin-left: auto; }

/* ── Layout ── */
.container { max-width: 1000px; margin: 32px auto; padding: 0 20px; }
.container.narrow { max-width: 720px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.card-pad { padding: 24px; }
.card-head {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  color: #fff; font-size: 15px; font-weight: 700;
}

/* ── Buttons ── */
.btn {
  border: none; border-radius: 10px; padding: 10px 18px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--blue-grad); color: #fff; }
.btn-ghost { background: var(--border); color: var(--muted); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 14px; font-size: 14px; }

/* ── Stat cards ── */
.stat-grid { display: grid; gap: 16px; margin-bottom: 24px; }
.stat-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.stat-label { color: var(--faint); font-size: 12px; margin-bottom: 10px; }
.stat-value { font-size: 30px; font-weight: 700; }

/* ── Pills ── */
.pill { border-radius: 20px; padding: 4px 12px; font-size: 11px; font-weight: 700; display: inline-block; }

/* ── Filters ── */
.filters { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.chip {
  background: var(--card); color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.chip.active { background: var(--blue); color: #fff; border-color: transparent; }

/* ── Employee rows ── */
.row {
  padding: 16px 24px; border-bottom: 1px solid var(--hover);
  display: grid; grid-template-columns: 1fr 150px 150px 130px 24px;
  gap: 12px; align-items: center;
}
.row:last-child { border-bottom: none; }
.row.head { color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.row.clickable:hover { background: var(--hover); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.who { display: flex; align-items: center; gap: 12px; }
.who .name { color: #e5e7eb; font-size: 14px; font-weight: 600; }
.who .sub { color: var(--faint); font-size: 11px; }

/* ── Progress ── */
.progress { background: var(--bg); border-radius: 99px; height: 6px; overflow: hidden; }
.progress.lg { height: 10px; }
.progress > span { display: block; height: 100%; border-radius: 99px; }
.pts-line { display: flex; justify-content: space-between; margin-bottom: 4px; }
.pts-line .v { color: #fff; font-size: 13px; font-weight: 700; }
.pts-line .max { color: var(--faint); font-size: 11px; }

/* ── Incident list ── */
.inc {
  padding: 16px 24px; border-bottom: 1px solid var(--hover);
  display: flex; align-items: center; gap: 14px;
}
.inc:last-child { border-bottom: none; }
.inc.expired { opacity: 0.5; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.inc .body { flex: 1; }
.inc .body .t { color: #e5e7eb; font-size: 14px; font-weight: 600; }
.inc .body .n { color: var(--dim); font-size: 12px; }
.inc .amt { text-align: right; }
.inc .amt .p { font-weight: 700; }
.inc .amt .d { color: var(--faint); font-size: 11px; }
.tag-expired { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }

/* ── Forms ── */
.field { margin-bottom: 16px; }
.field label { color: var(--muted); font-size: 12px; display: block; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; color: #e5e7eb; font-size: 14px;
  outline: none; font-family: inherit;
}
.field textarea { resize: vertical; }

details.logbox { margin-bottom: 20px; }
details.logbox > summary {
  list-style: none; cursor: pointer; display: inline-flex;
}
details.logbox > summary::-webkit-details-marker { display: none; }
.logform { margin-top: 14px; max-width: 460px; }

/* ── Login ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 420px; }
.login-head { text-align: center; margin-bottom: 40px; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 32px; }
.role-grid { display: flex; gap: 12px; }
.role-grid .btn { flex: 1; }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.center { text-align: center; }
