:root {
  /* ---- Sci-fi Workspace — light theme, brand-derived palette ---- */
  --paper: #F5F8FC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --border-strong: #CBD8E6;
  --ink: #1B3A5C;
  --text: #1B3A5C;
  --text-muted: #5B7089;
  --text-faint: #93A6BA;

  --brand-blue: #1E9FD1;
  --brand-blue-dim: rgba(30,159,209,0.12);
  --brand-green: #2E9E58;
  --brand-green-dim: rgba(46,158,88,0.12);
  --brand-gold: #C98A12;
  --brand-gold-dim: rgba(201,138,18,0.13);
  --brand-magenta: #D6316E;
  --brand-magenta-dim: rgba(214,49,110,0.12);
  --brand-purple: #8B5FC7;
  --brand-purple-dim: rgba(139,95,199,0.12);
  --brand-orange: #C2600F;
  --brand-orange-dim: rgba(194,96,15,0.13);
  --brand-teal: #0E8F8A;
  --brand-teal-dim: rgba(14,143,138,0.13);

  --status-not-started: #8695A7;
  --status-in-progress: var(--brand-blue);
  --status-in-review: var(--brand-gold);
  --status-blocked: var(--brand-magenta);
  --status-needs-improvement: var(--brand-orange);
  --status-pending-approval: var(--brand-teal);
  --status-done: var(--brand-green);

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(27,58,92,0.06);
  --shadow-md: 0 10px 28px rgba(27,58,92,0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 480px at 8% -10%, rgba(30,159,209,0.07), transparent),
    radial-gradient(900px 420px at 100% 0%, rgba(214,49,110,0.05), transparent),
    var(--paper);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.hidden { display: none !important; }

h1, h2 { font-family: 'Orbitron', 'Space Grotesk', sans-serif; margin: 0; letter-spacing: 0.01em; color: var(--ink); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* ---------- Auth screens ---------- */

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

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px 32px;
}

.auth-logo {
  display: block;
  height: 56px;
  width: auto;
  margin: 0 auto 20px;
}

.auth-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin: 0 0 8px;
  text-align: center;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.auth-sub {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 24px;
  text-align: center;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

input, select, textarea {
  font-family: 'Inter', sans-serif;
  font-size: 16px; /* keeps iOS Safari from auto-zooming on focus */
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.auth-form button, .modal-actions .solid-btn {
  margin-top: 4px;
  background: var(--ink);
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14.5px;
}

.auth-error {
  color: var(--brand-magenta);
  font-size: 13px;
  min-height: 16px;
  margin: 0;
}

/* ---------- App shell ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 40px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.brand-tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.who { display: flex; align-items: center; gap: 12px; }
.who-name { font-weight: 600; font-size: 14px; }
.who-role {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--brand-blue);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 2px 6px;
  text-transform: uppercase;
  background: var(--brand-blue-dim);
}

.ghost-btn {
  background: var(--surface);
  border: 1px solid var(--border-strong) !important;
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  min-height: 38px;
}
.ghost-btn:hover { background: var(--paper); }
.ghost-btn.danger { border-color: var(--brand-magenta) !important; color: var(--brand-magenta); }

.solid-btn {
  background: var(--ink);
  color: #FFFFFF;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  min-height: 38px;
}
.solid-btn:hover { filter: brightness(1.15); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.toolbar-spacer { flex: 1; }

.scope-toggle {
  display: flex;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.scope-btn {
  background: transparent;
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
}
.scope-btn.active { background: var(--ink); color: #fff; }

/* ---------- Mobile status tabs (hidden on desktop) ---------- */

.mobile-status-tabs { display: none; }

/* ---------- Kanban board ---------- */

.board {
  display: flex;
  gap: 16px;
  padding: 20px 28px 40px;
  overflow-x: auto;
  align-items: flex-start;
}

.column {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 8px;
  border-bottom: 2px solid var(--col-color, var(--border-strong));
}
.column-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--col-color, var(--text-faint));
}
.column-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}
.column-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
  margin-left: auto;
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 40px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--col-color, var(--border-strong));
  border-radius: var(--radius);
  padding: 13px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.task-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.task-card-title { font-weight: 600; font-size: 13.5px; margin: 0 0 8px; line-height: 1.35; color: var(--ink); }

.task-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: var(--text-faint);
}
.task-card-meta .overdue { color: var(--brand-magenta); font-weight: 700; }
.task-card-assignee { color: var(--text-muted); }

.priority-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.priority-low { background: var(--paper); color: var(--text-muted); }
.priority-medium { background: var(--brand-blue-dim); color: var(--brand-blue); }
.priority-high { background: var(--brand-gold-dim); color: var(--brand-gold); }
.priority-urgent { background: var(--brand-purple-dim); color: var(--brand-purple); }

.empty-state {
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  padding: 20px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.can-assign.hidden, .senior-only.hidden { display: none !important; }

/* ---------- Modals ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27,58,92,0.28);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.checkbox-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
}
.checkbox-row input { width: auto; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.hint { font-size: 12px; color: var(--text-faint); margin: -6px 0 0; }

/* ---------- Task detail modal ---------- */

.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tick-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--col-color, var(--text-faint));
  flex-shrink: 0;
}
.detail-header h2 { flex: 1; font-size: 17px; font-family: 'Space Grotesk', sans-serif; }
.icon-btn {
  background: transparent;
  color: var(--text-faint);
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}
.icon-btn:hover { color: var(--ink); background: var(--paper); }

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.meta-item span:last-child, .detail-meta span { font-size: 12.5px; color: var(--ink); }

.detail-notes p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 6px 0 0;
}

.detail-status-label { margin-top: 4px; }

/* ---------- Team management list ---------- */

.team-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.team-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
}
.team-row-name { font-weight: 600; font-size: 13.5px; flex: 1; }
.team-row-username {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
}
.team-row-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
}
.team-row-btn.is-admin { border-color: var(--brand-blue); color: var(--brand-blue); background: var(--brand-blue-dim); }

/* ---------- Notifications ---------- */

.notif-wrap { position: relative; }

.icon-btn-bell {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn-bell:hover { background: var(--paper); }

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--brand-magenta);
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 20;
}
.notif-panel-header {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
}
.notif-list { display: flex; flex-direction: column; }
.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.4;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--brand-blue-dim); }
.notif-item-time {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 3px;
}
.notif-empty { padding: 20px 14px; text-align: center; color: var(--text-faint); font-size: 12.5px; }

/* ---------- Review / approval box ---------- */

.review-box {
  background: var(--brand-orange-dim);
  border: 1px solid rgba(194,96,15,0.3);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.review-box p { margin: 4px 0 0; font-size: 13px; color: var(--ink); line-height: 1.5; }

/* ---------- Team management role select ---------- */

.team-row-role-select {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
}

/* ---------- Points badge ---------- */

.points-wrap { position: relative; }

.points-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-gold-dim);
  border: 1px solid rgba(201,138,18,0.35);
  color: var(--brand-gold);
  padding: 7px 12px;
  border-radius: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 13px;
}
.points-badge:hover { filter: brightness(0.96); }
.points-icon { flex-shrink: 0; }

.leaderboard-total {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  color: var(--brand-gold);
  font-size: 13px;
  white-space: nowrap;
}

/* ---------- Main nav (Tasks / Attendance) ---------- */

.main-nav {
  display: flex;
  gap: 4px;
  padding: 10px 28px 0;
}
.main-nav-btn {
  background: transparent;
  color: var(--text-muted);
  padding: 9px 16px;
  border-radius: 8px 8px 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
}
.main-nav-btn.active { color: var(--ink); border-bottom-color: var(--ink); }
.main-nav-btn:hover:not(.active) { color: var(--ink); }

/* ---------- Attendance ---------- */

.attendance-panel {
  max-width: 900px;
  margin: 0 auto 28px;
  padding: 0 28px;
}
.attendance-heading { font-size: 15px; margin-bottom: 10px; }
.attendance-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.attendance-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.attendance-mark-list, .attendance-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attendance-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.attendance-row-name { font-weight: 600; font-size: 13px; min-width: 140px; }

.status-btn-group { display: flex; gap: 4px; }
.status-toggle-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
}
.status-toggle-btn.active.status-present { background: var(--brand-green-dim); color: var(--brand-green); border-color: var(--brand-green); }
.status-toggle-btn.active.status-absent { background: var(--brand-magenta-dim); color: var(--brand-magenta); border-color: var(--brand-magenta); }
.status-toggle-btn.active.status-on-leave { background: var(--brand-blue-dim); color: var(--brand-blue); border-color: var(--brand-blue); }

.minute-input-group { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-faint); }
.minute-input {
  width: 56px;
  padding: 6px 7px;
  font-size: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
}

.attendance-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 12.5px;
}
.attendance-summary-row .att-date { font-family: 'IBM Plex Mono', monospace; color: var(--text-faint); }
.attendance-summary-row .att-status.status-present { color: var(--brand-green); font-weight: 600; }
.attendance-summary-row .att-status.status-absent { color: var(--brand-magenta); font-weight: 600; }
.attendance-summary-row .att-status.status-on-leave { color: var(--brand-blue); font-weight: 600; }
.attendance-empty { color: var(--text-faint); font-size: 13px; padding: 10px 2px; }

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .brand-tagline { display: none; }
  .toolbar { padding: 12px 16px; }
  .who { gap: 8px; }

  .mobile-status-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 16px 2px;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-tab {
    flex: 0 0 auto;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11.5px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-muted);
    white-space: nowrap;
  }
  .mobile-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

  .board { padding: 12px 16px 32px; overflow-x: hidden; }
  .column { display: none; flex: 1 1 100%; }
  .column.mobile-active { display: flex; }

  .row-2 { grid-template-columns: 1fr; }
  .detail-meta { grid-template-columns: 1fr; }
  .modal-card { padding: 22px; }
  .notif-panel { width: calc(100vw - 32px); right: -8px; }
  .attendance-panel { padding: 0 16px; }
  .main-nav { padding: 10px 16px 0; }
  .attendance-row { flex-direction: column; align-items: flex-start; }
  .attendance-row-name { min-width: 0; }
}
