/* ============================================================
   Roster design system
   Apple-style light UI. Blue accents. No dark mode by design.
   ============================================================ */

:root {
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: #eaf3fe;
  --blue-border: #c7dffa;
  --ink: #1d1d1f;
  --ink-soft: #515154;
  --ink-faint: #86868b;
  --canvas: #f5f5f7;
  --card: #ffffff;
  --line: #e8e8ed;
  --green: #1d9d55;
  --green-soft: #e6f6ec;
  --red: #d92d20;
  --red-soft: #fdecea;
  --amber: #b25e09;
  --amber-soft: #fdf3e7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 6px 24px rgba(0,0,0,.05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Top bar ---------- */

.topbar {
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.02em;
}

.nav { display: flex; gap: 20px; flex: 1; overflow-x: auto; }

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: color .15s;
}

.nav a:hover { color: var(--ink); }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.lang-switch {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  border: 1px solid var(--blue-border);
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--blue-soft);
}

.logout { font-size: 14px; color: var(--ink-faint); text-decoration: none; }
.logout:hover { color: var(--ink); }

/* ---------- Page ---------- */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.025em;
  margin-bottom: 6px;
}

h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.02em;
  margin: 32px 0 14px;
}

.subtitle { color: var(--ink-faint); margin-bottom: 28px; }

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.kpi .label {
  font-size: 13px;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: 6px;
}

.kpi .value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.kpi .value small { font-size: 15px; font-weight: 500; color: var(--ink-faint); }

.kpi.accent { background: linear-gradient(160deg, var(--blue) 0%, #2b8ceb 100%); }
.kpi.accent .label { color: rgba(255,255,255,.75); }
.kpi.accent .value { color: #fff; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  color: var(--ink-faint);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Pills / status ---------- */

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
}

.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red   { background: var(--red-soft);   color: var(--red); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.blue  { background: var(--blue-soft);  color: var(--blue); }
.pill.gray  { background: #f0f0f2;           color: var(--ink-faint); }

.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 7px;
  box-shadow: 0 0 0 3px var(--green-soft);
}

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="file"], select, textarea {
  width: 100%;
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.form-row { margin-bottom: 16px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.98); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }

.btn-secondary { background: var(--blue-soft); color: var(--blue); }
.btn-secondary:hover { background: #ddecfd; }

.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fbdcd8; }

.btn-ghost { background: transparent; color: var(--ink-faint); }
.btn-ghost:hover { color: var(--ink); }

.btn-sm { font-size: 13px; padding: 6px 14px; }

.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Alerts ---------- */

.alert {
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 14px;
  margin-bottom: 18px;
}

.alert.error   { background: var(--red-soft);   color: var(--red); }
.alert.success { background: var(--green-soft); color: var(--green); }
.alert.info    { background: var(--blue-soft);  color: var(--blue); }

/* ---------- Credentials reveal box ---------- */

.cred-box {
  background: var(--blue-soft);
  border: 1px dashed var(--blue-border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  margin-bottom: 20px;
}

.cred-box .cred {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink);
  margin: 6px 0 14px;
}

.cred-box .note { font-size: 13px; color: var(--ink-soft); }

/* ---------- Login screen ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-card .brand-big {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 4px;
}

.login-card .tagline {
  color: var(--ink-faint);
  font-size: 14px;
  margin-bottom: 30px;
}

.login-card form { text-align: left; }

.pin-input {
  letter-spacing: .35em;
  text-align: center;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.login-lang { margin-top: 22px; }

/* ---------- Tasks (user view) ---------- */

.task-list { list-style: none; }

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line);
}

.task-item:last-child { border-bottom: none; }

.task-check {
  appearance: none;
  -webkit-appearance: none;
  width: 24px; height: 24px;
  flex: 0 0 24px;
  margin-top: 1px;
  border: 1.5px solid #c9c9ce;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
}

.task-check:checked {
  background: var(--blue);
  border-color: var(--blue);
}

.task-check:checked::after {
  content: "";
  position: absolute;
  left: 8px; top: 4px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-body { flex: 1; }

.task-title { font-weight: 600; }

.task-item.done .task-title {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.task-meta { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }

/* ---------- Filter bar ---------- */

.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 22px;
}

.filterbar .seg {
  display: inline-flex;
  background: #e9e9ee;
  border-radius: 999px;
  padding: 3px;
}

.filterbar .seg a {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 999px;
}

.filterbar .seg a.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.filterbar .dates { display: flex; gap: 8px; align-items: flex-end; }
.filterbar .dates input { width: 150px; }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .page { padding: 24px 16px 60px; }
  h1 { font-size: 24px; }
  .kpi .value { font-size: 24px; }
  .topbar-inner { padding: 0 16px; gap: 16px; }
  .nav { gap: 14px; }
}
