/* ============================================================================
   Crystal Ocean — dark grayscale design system
   ========================================================================== */

:root {
  --bg: #0D0D0E;
  --panel: #141415;
  --panel-2: #1B1B1C;
  --panel-3: #212123;
  --border: #2A2A2D;
  --border-soft: #202023;
  --text: #E8E8ED;
  --text-dim: #9A9A9E;
  --text-faint: #5A5A5E;
  --white: #FFFFFF;
  --red: #E85A5A;
  --red-dim: #3A1E1F;
  --green: #7FD98C;
  --blue: #6FA8E8;
  --gold: #F0C34D;
  --purple: #B47FE8;

  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 8px;
  --r-xs: 6px;

  --shadow: 0 18px 48px rgba(0, 0, 0, .55);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3A3A3E; }

/* ── Layout ───────────────────────────────────────────────────────────────── */

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: rgba(13, 13, 14, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 9px; margin-right: 4px; }
.brand-logo { height: 30px; width: auto; max-width: 130px; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.brand-sub { font-size: 9px; color: var(--text-faint); letter-spacing: .16em; text-transform: uppercase; }

/* ── Live time tracking, visible to the whole team ────────────────────────── */

.tracking-strip {
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; scrollbar-width: none; max-width: 40vw;
}
.tracking-strip::-webkit-scrollbar { display: none; }

.tracking-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 100px; white-space: nowrap;
  background: color-mix(in srgb, var(--who) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--who) 38%, transparent);
  color: var(--who); font-size: 11.5px; font-weight: 600;
}
.tracking-chip.mine {
  background: var(--red-dim);
  border-color: #5A2C2E;
  box-shadow: 0 0 0 1px rgba(232, 90, 90, .35);
  padding-right: 4px;
}
.tracking-chip .mono { color: var(--text); font-weight: 500; }
.tracking-who { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

.tracking-stop {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-left: 2px; flex-shrink: 0;
  background: var(--red); color: var(--bg);
  border: none; border-radius: 50%; cursor: pointer;
  font-size: 8px; line-height: 1; padding: 0;
}
.tracking-stop:hover { background: #F26E6E; }

.tracking-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--who);
  animation: pulse 1.6s ease-in-out infinite; flex-shrink: 0;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.tabs {
  display: flex; gap: 2px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 7px 13px; border-radius: var(--r-sm);
  color: var(--text-dim); font-size: 13px; font-weight: 500;
  white-space: nowrap; cursor: pointer; border: 1px solid transparent;
  background: none; transition: background .12s, color .12s;
}
.tab:hover { background: var(--panel); color: var(--text); }
.tab.active { background: var(--panel-2); color: var(--text); border-color: var(--border); }

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.content { flex: 1; padding: 20px; max-width: 1680px; width: 100%; margin: 0 auto; }

.page-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.page-title { font-size: 19px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.page-head .spacer { flex: 1; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r-sm);
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, opacity .12s;
}
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: #3A3A3E; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--white); border-color: var(--white); }

.btn-danger { background: var(--red-dim); border-color: #4E2628; color: #F2A3A3; }
.btn-danger:hover:not(:disabled) { background: #4A2426; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }

.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: var(--r-xs); }
.btn-icon { padding: 6px 8px; }

/* ── Form controls ────────────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.label {
  font-size: 10.5px; font-weight: 600; color: var(--text-faint);
  letter-spacing: .1em; text-transform: uppercase;
}

.input, .textarea, .select {
  width: 100%; padding: 9px 11px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--r-xs); color: var(--text);
  font-family: inherit; font-size: 13.5px; outline: none;
  transition: border-color .12s;
}
.input:focus, .textarea:focus, .select:focus { border-color: #4A4A4E; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.textarea { resize: vertical; min-height: 76px; line-height: 1.6; overflow: hidden; }

.select {
  appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239A9A9E' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}

.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.checkbox input { accent-color: var(--text); width: 15px; height: 15px; cursor: pointer; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ── Panels & cards ───────────────────────────────────────────────────────── */

.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px;
}
.panel-title {
  font-size: 12px; font-weight: 650; color: var(--text-dim);
  margin: 0 0 12px; letter-spacing: .02em;
  display: flex; align-items: center; gap: 8px;
}
.panel-title .spacer { flex: 1; }

.empty {
  color: var(--text-faint); font-size: 13px; text-align: center;
  padding: 26px 14px; font-style: italic;
}

/* ── Pills & chips ────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 100px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  white-space: nowrap;
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 100px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.chip:hover { border-color: #3A3A3E; color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.chip.static { cursor: default; }
.chip.static:hover { border-color: var(--border); color: var(--text-dim); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── Avatars ──────────────────────────────────────────────────────────────── */

.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--bg);
  border: 1px solid var(--border);
}
.avatar-sm { width: 20px; height: 20px; font-size: 8.5px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; }

.avatar-stack { display: flex; }
.avatar-stack .avatar:not(:first-child) { margin-left: -7px; }

/* ── Board ────────────────────────────────────────────────────────────────── */

.board {
  display: grid; grid-template-columns: repeat(5, minmax(255px, 1fr));
  gap: 12px; align-items: start;
  overflow-x: auto; padding-bottom: 10px;
}

.board-col {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 11px; min-height: 130px;
  transition: border-color .14s, background .14s, box-shadow .14s;
}

/* While a card is in flight the target column opens up so it is easy to hit. */
.board-col.drag-over {
  border-color: #55555C; background: #17171C;
  box-shadow: inset 0 0 0 1px #33333A;
}
.board-col.drag-over .board-col-body { padding-bottom: 78px; }
.board-col.drag-over .drop-hint { display: flex; }

.board-col-body { transition: padding-bottom .14s ease; }

.drop-hint {
  display: none; align-items: center; justify-content: center;
  height: 66px; margin-top: 6px;
  border: 1px dashed #4A4A52; border-radius: var(--r-md);
  color: var(--text-faint); font-size: 12px;
  background: rgba(255, 255, 255, .015);
}

.board-col-head {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 11px; padding: 0 3px;
}
.board-col-name { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.board-col-count {
  background: var(--panel-2); color: var(--text-faint);
  padding: 1px 7px; border-radius: 100px; font-size: 10.5px; font-weight: 600;
}
.board-col-add {
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: 16px; line-height: 1;
  padding: 2px 6px; border-radius: var(--r-xs);
  transition: background .12s, color .12s;
}
.board-col-add:hover { background: var(--panel-2); color: var(--text); }

.task {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--r-md); margin-bottom: 9px;
  cursor: grab; overflow: hidden;
  transition: border-color .12s, transform .08s;
}
.task:hover { border-color: #3A3A3E; }
.task:active { cursor: grabbing; }
.task.dragging { opacity: .35; }

.task-drop-line { height: 2px; background: var(--text-dim); border-radius: 2px; margin: 6px 2px; }

.task-image { width: 100%; height: 92px; object-fit: cover; display: block; }
.task-image-placeholder { width: 100%; height: 62px; display: block; }

.task-body { padding: 10px 11px 11px; }
.task-title { font-size: 13px; font-weight: 550; line-height: 1.35; margin-bottom: 8px; }

.task-meta {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-faint);
}
.task-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border-soft);
}

.timer-bar { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.timer-row { display: flex; align-items: center; gap: 6px; }
.timer-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 100px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
}
.timer-chip .tracking-who { font-family: var(--font); max-width: 74px; }
.timer-mine { background: var(--red-dim); color: #F2A3A3; border: 1px solid #4E2628; }

.due-flag { font-size: 10.5px; padding: 1px 6px; border-radius: var(--r-xs); }
.due-over { background: var(--red-dim); color: #F2A3A3; }
.due-soon { background: #3A2E12; color: var(--gold); }

/* ── Tables ───────────────────────────────────────────────────────────────── */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 8px 10px;
  font-size: 10px; font-weight: 700; color: var(--text-faint);
  letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.table-wrap { overflow-x: auto; }

.row-muted td { opacity: .5; }
.row-muted .strike { text-decoration: line-through; }

.link-cell { cursor: pointer; font-weight: 500; }
.link-cell:hover { color: var(--white); text-decoration: underline; }

/* ── Modals ───────────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5, 5, 6, .78);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
  animation: fade .14s ease;
}

.modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  width: 100%; max-width: 560px;
  animation: rise .16s cubic-bezier(.2, .8, .3, 1);
}
.modal-wide { max-width: 1080px; }
.modal-narrow { max-width: 420px; }

.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 620; margin: 0; flex: 1; }
.modal-body { padding: 18px; }
.modal-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px; border-top: 1px solid var(--border);
}
.modal-foot .spacer { flex: 1; }

.split { display: grid; grid-template-columns: 1fr 380px; gap: 0; }
.split-main { padding: 18px; border-right: 1px solid var(--border); min-width: 0; }
.split-side {
  padding: 18px; background: var(--panel-2);
  border-radius: 0 0 var(--r-lg) 0;
  display: flex; flex-direction: column; min-width: 0;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ── Activity feed ────────────────────────────────────────────────────────── */

.activity { flex: 1; overflow-y: auto; max-height: 460px; margin: -4px -4px 12px; padding: 4px; }

.activity-item {
  display: flex; gap: 9px; padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}
.activity-item:last-child { border-bottom: none; }
.activity-main { flex: 1; min-width: 0; }
.activity-head {
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  font-size: 12px; margin-bottom: 3px;
}
.activity-who { font-weight: 600; }
.activity-when { color: var(--text-faint); font-size: 11px; }
.activity-note { font-size: 12.5px; color: var(--text-dim); white-space: pre-wrap; word-break: break-word; }
.activity-img {
  margin-top: 7px; max-width: 100%; border-radius: var(--r-xs);
  border: 1px solid var(--border); cursor: zoom-in; display: block;
}

.composer { border-top: 1px solid var(--border); padding-top: 11px; }
.composer.drag-over { outline: 1px dashed #4A4A4E; outline-offset: 4px; border-radius: var(--r-sm); }
.composer-row { display: flex; gap: 7px; align-items: flex-end; margin-top: 7px; }

/* ── Calendar ─────────────────────────────────────────────────────────────── */

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.cal-dayname {
  background: var(--panel); padding: 7px 9px;
  font-size: 10px; font-weight: 700; color: var(--text-faint);
  letter-spacing: .09em; text-transform: uppercase;
}
.cal-cell {
  background: var(--panel); min-height: 104px; padding: 6px 7px;
  cursor: pointer; transition: background .12s;
}
.cal-cell:hover { background: var(--panel-2); }
.cal-cell.other-month { background: #101011; }
.cal-cell.other-month .cal-daynum { color: var(--text-faint); opacity: .5; }
.cal-cell.today { background: #17171C; box-shadow: inset 0 0 0 1px #3A3A45; }
.cal-daynum { font-size: 11.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; }
.cal-cell.today .cal-daynum { color: var(--text); }

.cal-item {
  font-size: 10.5px; padding: 2px 5px; border-radius: 4px;
  margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}

.week-grid {
  display: grid; grid-template-columns: 52px repeat(7, minmax(96px, 1fr));
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
}
.week-scroll { overflow-x: auto; }
.week-head {
  background: var(--panel); padding: 8px 6px; text-align: center;
  border-bottom: 1px solid var(--border); border-left: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 2;
}
.week-head-day { font-size: 10px; color: var(--text-faint); letter-spacing: .09em; text-transform: uppercase; }
.week-head-num { font-size: 15px; font-weight: 600; }
.week-head.today .week-head-num { color: var(--blue); }

.week-hours { background: var(--panel); border-right: 1px solid var(--border); }
.week-hour-label {
  height: 44px; font-size: 10px; color: var(--text-faint);
  text-align: right; padding: 2px 7px 0 0; border-bottom: 1px solid var(--border-soft);
}

.week-day { position: relative; background: var(--panel); border-left: 1px solid var(--border-soft); }
.week-slot { height: 44px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.week-slot:hover { background: var(--panel-2); }
.week-slot.sel-start { background: #23232C; box-shadow: inset 0 0 0 1px #45455A; }

.week-event {
  position: absolute; left: 3px; right: 3px;
  border-radius: 5px; padding: 3px 6px; overflow: hidden;
  font-size: 10.5px; line-height: 1.3; cursor: pointer; z-index: 3;
  border-left: 3px solid;
}
.week-event-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-event-time { opacity: .8; font-size: 9.5px; }

.week-allday { padding: 3px; border-left: 1px solid var(--border-soft); background: var(--panel); border-bottom: 1px solid var(--border); min-height: 26px; }

/* ── Notifications ────────────────────────────────────────────────────────── */

.toast-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 300;
  display: flex; flex-direction: column-reverse; gap: 11px;
  max-width: 390px; width: calc(100% - 40px);
}

.toast {
  background: var(--panel-2); border: 1px solid #3A3A42;
  border-left: 4px solid var(--accent, var(--blue));
  border-radius: var(--r-md); padding: 15px 16px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, .7);
  animation: toast-in .28s cubic-bezier(.2, .9, .3, 1);
  display: flex; gap: 12px; align-items: flex-start;
}
.toast-icon {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: color-mix(in srgb, var(--accent, var(--blue)) 18%, transparent);
}
.toast-main { flex: 1; min-width: 0; }
.toast-title { font-size: 14px; font-weight: 650; margin-bottom: 4px; line-height: 1.35; }
.toast-detail { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }
.toast-when { font-size: 11px; color: var(--text-faint); margin-top: 6px; }
.toast-close {
  background: none; border: none; color: var(--text-faint);
  cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px;
  border-radius: var(--r-xs);
}
.toast-close:hover { color: var(--text); background: var(--panel-3); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(32px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.bell { position: relative; }
.badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--red); color: var(--white);
  font-size: 9px; font-weight: 700; min-width: 15px; height: 15px;
  border-radius: 100px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.drawer-backdrop { position: fixed; inset: 0; z-index: 190; background: rgba(5, 5, 6, .5); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 195;
  width: 340px; max-width: 92vw;
  background: var(--panel); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  animation: slide-in .18s cubic-bezier(.2, .8, .3, 1);
}
.drawer-head {
  padding: 15px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 9px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.drawer-section {
  font-size: 10px; font-weight: 700; color: var(--text-faint);
  letter-spacing: .11em; text-transform: uppercase; margin: 16px 0 8px;
}
.drawer-section:first-child { margin-top: 0; }

.notif-row {
  display: flex; gap: 8px; padding: 9px 0;
  border-bottom: 1px solid var(--border-soft); font-size: 12.5px;
}
.notif-row:last-child { border-bottom: none; }

/* ── Charts ───────────────────────────────────────────────────────────────── */

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-label { width: 108px; font-size: 12.5px; flex-shrink: 0; display: flex; align-items: center; gap: 7px; }
.bar-track { flex: 1; height: 21px; background: var(--panel-2); border-radius: var(--r-xs); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-xs); transition: width .3s ease; }
.bar-value { width: 78px; text-align: right; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; }
.stat {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 15px 16px;
}
.stat-value { font-size: 27px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

.progress-track { height: 6px; background: var(--panel-2); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--text-dim); border-radius: 100px; }

/* ── Login gate ───────────────────────────────────────────────────────────── */

.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background:
    radial-gradient(1000px 620px at 50% -12%, #17171C 0%, var(--bg) 62%);
}
.gate-card {
  width: 100%; max-width: 400px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 28px 26px;
  animation: rise .22s cubic-bezier(.2, .8, .3, 1);
}
.gate-brand { text-align: center; margin-bottom: 22px; }
.gate-brand-name { font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.gate-brand-sub {
  font-size: 9.5px; color: var(--text-faint);
  letter-spacing: .2em; text-transform: uppercase; margin-top: 3px;
}
.gate-switch {
  display: flex; gap: 3px; margin-bottom: 20px;
  background: var(--panel-2); padding: 3px; border-radius: var(--r-sm);
}
.gate-switch button {
  flex: 1; padding: 7px; border: none; background: none;
  color: var(--text-dim); font-size: 12.5px; font-weight: 550;
  border-radius: var(--r-xs); cursor: pointer;
}
.gate-switch button.on { background: var(--panel-3); color: var(--text); }

.alert {
  padding: 9px 11px; border-radius: var(--r-xs);
  font-size: 12.5px; margin-bottom: 14px; line-height: 1.5;
}
.alert-error { background: var(--red-dim); color: #F2A3A3; border: 1px solid #4E2628; }
.alert-ok { background: #16301C; color: #A7E5B1; border: 1px solid #274B2E; }
.alert-info { background: var(--panel-2); color: var(--text-dim); border: 1px solid var(--border); }

.avatar-picker { display: flex; align-items: center; gap: 12px; }
.avatar-drop {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--panel-2); border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 19px; color: var(--text-faint); overflow: hidden;
}
.avatar-drop img { width: 100%; height: 100%; object-fit: cover; }

/* ── Misc ─────────────────────────────────────────────────────────────────── */

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.bold { font-weight: 650; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-col { display: flex; flex-direction: column; gap: 8px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hidden { display: none !important; }

.popover {
  position: absolute; z-index: 120; min-width: 176px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 5px;
}
.popover button {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; background: none; border: none;
  color: var(--text); font-size: 12.5px; border-radius: var(--r-xs); cursor: pointer;
}
.popover button:hover { background: var(--panel-3); }
.popover-anchor { position: relative; display: inline-block; }

.lightbox {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(5, 5, 6, .93);
  display: flex; align-items: center; justify-content: center;
  padding: 30px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-sm); }

.role-block {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px 12px; margin-bottom: 9px;
}
.role-question { font-size: 12px; color: var(--text-dim); margin-bottom: 7px; }

.list-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: var(--r-xs); margin-bottom: 6px;
}

.spin {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--text-dim);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .split-main { border-right: none; border-bottom: 1px solid var(--border); }
  .split-side { border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .activity { max-height: 300px; }
}

@media (max-width: 1180px) {
  .tracking-strip { max-width: 30vw; }
  .tracking-who { max-width: 62px; }
}

@media (max-width: 820px) {
  .content { padding: 14px; }
  .board { grid-template-columns: repeat(5, 268px); }

  /* Brand and controls on the first row; tabs and the tracking strip get their own. */
  .topbar-right { order: 1; }
  .tabs { order: 2; flex: 0 0 100%; }
  .tracking-strip { order: 3; flex: 0 0 100%; max-width: none; }
  .tracking-strip:empty { display: none; }
  .form-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; }
  .modal { max-width: 100%; min-height: 100vh; border-radius: 0; border: none; }
  .split-side { border-radius: 0; }
  .topbar { padding: 9px 12px; gap: 10px; }
  .brand-sub { display: none; }
  .cal-cell { min-height: 74px; }
  .toast-stack { right: 10px; bottom: 10px; left: 10px; max-width: none; width: auto; }
  .bar-label { width: 88px; }
}

@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .table th, .table td { padding: 7px 6px; font-size: 12px; }
}
