:root {
  --bg: #0a0a0a;
  --bg-2: #141414;
  --bg-3: #1c1c1c;
  --line: #3d3d3d;
  --text: #ececec;
  --muted: #8f8f8f;
  --gold: #f5c400;
  --gold-2: #ffd84a;
  --ink: #0a0a0a;
  --green: #2ecc71;
  --orange: #f39c12;
  --red: #e74c3c;
  --radius: 8px;
  --serif: "Figtree", sans-serif;
  --sans: "Figtree", sans-serif;
}

* { box-sizing: border-box; font-family: var(--sans); }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  color-scheme: dark;
}

button, input, select, textarea { font: inherit; color: inherit; }

#app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 28px 72px;
}

#app.board-mode { max-width: none; padding-left: 24px; padding-right: 24px; }
#app.login-mode { max-width: none; padding: 0; }

.boot, .muted, .empty { color: var(--muted); }
.empty { padding: 18px 4px; font-size: 14px; }

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(920px 420px at 18% -8%, rgba(245, 196, 0, 0.16), transparent 58%),
    linear-gradient(180deg, #0c0c0c 0%, var(--bg) 100%);
}

.login-shell {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--bg-2);
  border: 1px solid var(--line);
  min-height: 520px;
}

.login-brand {
  padding: 56px 48px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(245, 196, 0, 0.1), transparent 55%),
    #0d0d0d;
}

.login-brand .mark,
.login-card .mark {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 18px;
}

.login-brand h1 {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 500;
  margin: 0 0 14px;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.login-brand .lede,
.login-card .lede {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.login-card {
  padding: 56px 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

.login-card .lede { margin-bottom: 28px; }

.login-card .cairo {
  margin: 24px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.login-card .banner { margin: 0; }
.login-card .btn.primary { width: 100%; padding: 12px 16px; }

/* Chrome */
.top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.brand p {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

h1, h2, h3 { margin: 0; font-weight: 600; }
h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
}
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 12px; font-weight: 600; }

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.top-actions select { width: auto; min-width: 150px; }

.who-chip {
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 7px 10px;
  background: var(--bg-2);
}

.cairo-chip {
  font-size: 12px;
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--line);
}

nav button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 10px 14px;
  margin-bottom: -1px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

nav button:hover { color: var(--text); }
nav button.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}

.btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn:hover { border-color: var(--gold); }
.btn.primary {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.btn.primary:hover { background: var(--gold-2); }
.btn.ghost { color: var(--muted); }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: rgba(231, 76, 60, 0.12); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

input, textarea, select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px 12px;
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
}

textarea { min-height: 88px; resize: vertical; }

.form { display: grid; gap: 14px; }
label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.place-picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.place-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
}

.place-pick input {
  width: auto;
  margin: 0;
}

.banner {
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 12px 14px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}
.banner.warn { border-color: var(--gold); color: var(--text); }
.banner.ok { border-color: var(--gold); }
.banner.err { border-color: #d7d7d7; color: var(--text); }
.connect-box { display: grid; gap: 10px; }
.connect-box p { margin: 0; }
.connect-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.connect-form input {
  flex: 1;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 10px;
}

.board-wrap { display: grid; gap: 10px; }
.board-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.board-filter-note { margin: 0; }
.kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  align-items: stretch;
  min-height: calc(100vh - 180px);
  padding-bottom: 8px;
}

.kanban-col {
  flex: 0 0 280px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 540px;
}

.kanban-col.drop { border-color: var(--gold); }

.kanban-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.kanban-head h3 {
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kanban-head span {
  color: var(--ink);
  background: var(--gold);
  min-width: 22px;
  text-align: center;
  font-size: 11px;
  padding: 2px 7px;
}

.kanban-cards { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.done-history-btn {
  width: 100%;
  margin: 0 0 12px;
}
.done-history { display: grid; gap: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.done-day { display: grid; gap: 8px; }
.done-day h4 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.kcard {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 14px;
  cursor: grab;
}

.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: 0.4; }
.kcard .title { font-weight: 600; margin: 0 0 8px; line-height: 1.4; font-size: 14px; }

.task-facts {
  display: grid;
  gap: 4px;
  margin: 0;
}
.task-facts > div {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.task-facts dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}
.task-facts dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}
.kcard-done {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 8px;
  margin-top: 4px;
  align-items: center;
}
.kcard-done .btn {
  grid-column: 2;
  justify-self: start;
}
.btn.compact,
.kcard .btn.compact {
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  width: max-content;
  line-height: 1.3;
  letter-spacing: 0.02em;
}
.load-table tr[onclick] { cursor: pointer; }

.time-page { gap: 20px; }
.time-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.time-chip {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.time-chip.on {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.time-person-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.time-person-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
}
.time-person-head p { margin: 4px 0 0; }
.time-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.time-fact span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.time-fact strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.time-tasks { margin-top: 16px; }
.time-task {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) 92px repeat(3, minmax(86px, 0.7fr));
  gap: 8px 14px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 14px 0 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  color: inherit;
  cursor: pointer;
}
.time-task-main strong { display: block; }
.time-task-main .muted { display: block; margin-top: 3px; font-size: 12px; }
.time-task .pill { justify-self: start; }
.time-bar {
  grid-column: 1 / -1;
  display: flex;
  height: 4px;
  background: #2a2a2a;
  overflow: hidden;
}
.time-bar .wait { display: block; height: 100%; background: #4a4a4a; }
.time-bar .work { display: block; height: 100%; background: var(--gold); }
.time-task.is-done .time-task-main strong { color: var(--green); }
.time-days {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.time-days-label {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.time-day {
  display: grid;
  grid-template-columns: 110px 88px 1fr;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
}
.time-day strong { color: var(--gold); }

.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.pill {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 3px 7px;
  color: var(--muted);
}

.pill.warn { color: var(--gold); border-color: var(--gold); }

.cards { display: grid; gap: 12px; }

.card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 18px;
}

.card p { margin: 0; line-height: 1.55; }
.card .title { font-weight: 600; margin-bottom: 8px; }

.qa { display: grid; gap: 14px; margin-top: 4px; }
.qa dt {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
.qa dd {
  margin: 4px 0 0;
  color: var(--text);
  line-height: 1.55;
}

.report-card { display: grid; gap: 18px; }
.qa-pair {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.qa-k {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.qa-q {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}
.qa-a {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  white-space: pre-wrap;
}

.date-input {
  margin-bottom: 12px;
  min-height: 44px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 16px;
}

.stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  color: var(--gold);
}

.stat span { display: block; margin-top: 4px; font-size: 12px; }

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

a { color: var(--gold); }

.sop-list { max-width: 720px; display: grid; gap: 16px; }
.sop-list article { padding: 20px 22px; }
.sop-list h3 { color: var(--gold); margin-bottom: 8px; letter-spacing: 0.06em; text-transform: uppercase; font-size: 11px; }
.sop-list p { color: var(--muted); line-height: 1.6; margin: 0; }

.dash { display: grid; gap: 28px; }
.cal-wrap { max-width: 760px; }
.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cal-nav select {
  width: auto;
  min-width: 160px;
  padding: 8px 10px;
}
.cal-week, .cal-grid, .due-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-week span, .due-week span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}
.cal-day, .due-day {
  min-height: 52px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px;
  cursor: pointer;
}
.cal-day.pad, .due-day.pad { visibility: hidden; cursor: default; }
.cal-day.has, .due-day.has { border-color: var(--gold); }
.cal-day.on, .due-day.on { background: var(--gold); color: var(--ink); }
.cal-day span {
  font-size: 11px;
  background: var(--gold);
  color: var(--ink);
  padding: 1px 6px;
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 30;
}

.modal, .drawer {
  position: fixed;
  z-index: 31;
  background: #0e0e0e;
  border: 1px solid var(--line);
}

.modal {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
}

.drawer {
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  padding: 28px;
  overflow: auto;
  border-left: 1px solid var(--line);
  border-top: 0;
  border-bottom: 0;
  border-right: 0;
}

.drawer h2, .modal h2 { margin-bottom: 6px; font-family: var(--serif); font-weight: 500; }
.modal .form, .drawer .form { margin-top: 16px; }

.due-box { border: 1px solid var(--line); padding: 12px; background: var(--bg); }
.due-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}
.due-week { margin-bottom: 6px; }
.due-day { min-height: 36px; align-items: center; justify-content: center; padding: 6px; font-size: 13px; }

.statuses { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.statuses button {
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.statuses button.on { color: var(--ink); background: var(--gold); border-color: var(--gold); }

.time-line {
  margin: 8px 0 0;
  color: var(--gold);
  font-size: 13px;
}

.done-section { margin-top: 28px; }
.done-card { border-color: var(--green); }

.done-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  letter-spacing: 0;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.done-check input { width: auto; }

.review-card { display: grid; gap: 10px; }

.load-table-wrap { overflow-x: auto; margin-top: 16px; }
.load-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.load-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.load-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.load-table strong { display: block; }
.load-bar {
  margin-top: 8px;
  height: 4px;
  background: #2a2a2a;
  max-width: 180px;
}
.load-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
}
.warn-cell { color: var(--gold); }

.tone-green, .tone-green strong { color: var(--green); }
.tone-orange, .tone-orange strong { color: var(--orange); }
.tone-red, .tone-red strong { color: var(--red); }
.stat.tone-green strong, .stat.tone-orange strong, .stat.tone-red strong { color: inherit; }
.pill.tone-green { border-color: var(--green); color: var(--green); }
.pill.tone-orange { border-color: var(--orange); color: var(--orange); }
.pill.tone-red { border-color: var(--red); color: var(--red); }
.report-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.name-chip {
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 13px;
}
.name-chip.tone-green { border-color: var(--green); color: var(--green); }
.name-chip.tone-orange { border-color: var(--orange); color: var(--orange); }

.kcard.tone-orange { border-color: var(--orange); }
.kcard.tone-green { border-color: var(--green); }
.tr.tone-green .load-bar span, .tone-green .load-bar span { background: var(--green); }
.tone-orange .load-bar span { background: var(--orange); }
.tone-red .load-bar span { background: var(--red); }
.load-table tr.tone-green td:first-child strong { color: var(--green); }
.load-table tr.tone-orange td:first-child strong { color: var(--orange); }
.load-table tr.tone-red td:first-child strong { color: var(--red); }

.stat-row.dense {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-bar {
  display: grid;
  grid-template-columns: 130px 1fr 40px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  margin: 8px 0;
}

.profile-bar .load-bar { margin: 0; max-width: none; }

span.attend-chip {
  display: inline-block;
  text-align: center;
  cursor: default;
}
.hr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hr-tabs button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.hr-tabs button.on {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.modal.wide { width: min(720px, calc(100% - 32px)); }
.track-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin: 12px 0 4px;
  font-size: 12px;
  color: var(--muted);
}
.load-table input, .load-table select {
  width: 100%;
  min-width: 88px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 6px 8px;
}

.attend-week-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.attend-nav { align-items: flex-start; }
.attend-table th, .attend-table td { text-align: center; }
.attend-table th:first-child, .attend-table td:first-child { text-align: left; }
.attend-table th.attend-today { color: var(--gold); }
.attend-mine td:first-child strong { color: var(--gold); }
.attend-chip {
  min-width: 72px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 6px;
  cursor: pointer;
  font-size: 12px;
}
.attend-chip:disabled { cursor: default; opacity: 0.95; }
.attend-chip.office { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.attend-chip.home { background: var(--bg-3); color: var(--text); border-color: var(--line); }
.attend-chip.off { background: #241111; color: var(--red); border-color: #5a2a2a; }
.attend-chip.today { box-shadow: inset 0 0 0 1px var(--gold); }
.attend-change { max-width: 520px; }
.attend-table .pill { display: inline-block; margin-top: 6px; }

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .time-task { grid-template-columns: 1fr 1fr; }
  .time-task .pill { grid-column: 2; justify-self: end; }
  .time-day { grid-template-columns: 100px 72px 1fr; }
  h1 { font-size: 24px; }
  .kanban-col { flex-basis: 230px; }
  .report-summary { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; min-height: 0; }
  .login-brand {
    padding: 36px 28px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .login-brand h1 { font-size: 32px; }
  .login-card { padding: 32px 24px 28px; }
}
