/* No Name Digital — Project Hub */
:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --ink: #0b0b0b;
  --ink-2: #3a3a38;
  --muted: #76766f;
  --line: #e7e6e1;
  --line-2: #d9d8d2;
  --side: #0b0b0b;
  --side-ink: #f3f3f1;
  --side-muted: #8c8c86;
  --focus: #0b0b0b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 15, 10, .04), 0 2px 8px rgba(15, 15, 10, .04);
  --shadow-lg: 0 10px 40px rgba(15, 15, 10, .16);

  /* status colours (used sparingly) */
  --s-pending-bg: #efefec; --s-pending: #55554f;
  --s-progress-bg: #e5eefc; --s-progress: #1d4fb8;
  --s-awaiting-bg: #fdf1dc; --s-awaiting: #9a5b00;
  --s-revision-bg: #fde8e4; --s-revision: #b3261e;
  --s-done-bg: #e3f4e8; --s-done: #1c7a3d;
  --s-cancel-bg: #f1f1ef; --s-cancel: #8b8b85;
  --danger: #b3261e;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 620; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.pre { white-space: pre-wrap; word-break: break-word; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: none; background: var(--side); color: var(--side-ink);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 26px; }
.brand img { height: 24px; width: auto; max-width: 100%; }
.brand .brand-sub { font-size: 11px; color: var(--side-muted); letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--side-muted); font-weight: 500; font-size: 14.5px;
}
.nav a:hover { color: var(--side-ink); background: rgba(255,255,255,.06); }
.nav a.active { color: var(--side-ink); background: rgba(255,255,255,.1); }
.nav .count { margin-left: auto; background: #fff; color: #000; border-radius: 99px; font-size: 11.5px; font-weight: 700; padding: 1px 7px; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 14px 10px 0; }
.side-user { display: flex; align-items: center; gap: 10px; }
.side-user .who { min-width: 0; }
.side-user .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { font-size: 12px; color: var(--side-muted); }
.side-user a { color: var(--side-muted); margin-left: auto; padding: 6px; border-radius: 8px; }
.side-user a:hover { color: #fff; background: rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(245,245,243,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 12px; padding: 14px 32px; border-bottom: 1px solid transparent;
}
.topbar .mobile-brand { display: none; }
.search { flex: 1; max-width: 460px; position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 10px 12px 10px 38px; outline: none;
}
.search input:focus { border-color: var(--ink); }
.topbar .spacer { flex: 1; }
.clock { display: inline-flex; align-items: baseline; gap: 6px; height: 42px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); line-height: 42px; white-space: nowrap; }
.clock span { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.clock small { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-2); }
.badge-dot {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--bg);
}
.content { padding: 8px 32px 60px; max-width: 1240px; width: 100%; }

.bottom-nav { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 11px; padding: 10px 16px;
  border: 1px solid var(--line-2); background: var(--surface); font-weight: 560; font-size: 14.5px; cursor: pointer; white-space: nowrap;
  min-height: 42px; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #262624; }
.btn.approve { background: var(--s-done); color: #fff; border-color: var(--s-done); }
.btn.approve:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: #efc7c2; }
.btn.danger:hover { border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 18px 0 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-top: 14px; }
.back:hover { color: var(--ink); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
h2 .n, h3 .n, .section-head h2 .n { color: var(--muted); font-weight: 500; margin-left: 6px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stats.admin { grid-template-columns: repeat(3, 1fr); margin-top: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: border-color .12s, transform .12s;
}
.stat:hover { border-color: var(--ink-2); }
.stat .lbl { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat .val { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; }
.stat.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat.dark .lbl { color: #b9b9b3; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.pending { background: #9a9a93; } .dot.in_progress { background: var(--s-progress); } .dot.awaiting_approval { background: #e09400; }
.dot.revision_required { background: var(--s-revision); } .dot.completed { background: var(--s-done); } .dot.cancelled { background: #c3c3bd; }

.grid-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pcard { padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: border-color .12s; }
.pcard:hover { border-color: var(--ink-2); }
.pcard .client { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pcard .name { font-size: 16px; font-weight: 620; }
.pcard .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.progress { height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ink); border-radius: 99px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap;
  background: var(--s-pending-bg); color: var(--s-pending);
}
.badge.pending { background: var(--s-pending-bg); color: var(--s-pending); }
.badge.in_progress { background: var(--s-progress-bg); color: var(--s-progress); }
.badge.awaiting_approval { background: var(--s-awaiting-bg); color: var(--s-awaiting); }
.badge.revision_required, .badge.further_work { background: var(--s-revision-bg); color: var(--s-revision); }
.badge.completed { background: var(--s-done-bg); color: var(--s-done); }
.badge.cancelled, .badge.archived { background: var(--s-cancel-bg); color: var(--s-cancel); }
.badge.active { background: #ededea; color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 7px; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.chip.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.prio::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: #c3c3bd; }
.prio.high::before { background: #e07a00; } .prio.urgent::before { background: var(--danger); } .prio.medium::before { background: #8a8a84; }
.prio.urgent { color: var(--danger); font-weight: 600; }
.overdue { color: var(--danger); font-weight: 600; }

/* ---------- Tabs & filters ---------- */
.tabs { display: flex; gap: 4px; background: #ebebe7; padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs a { padding: 8px 14px; border-radius: 9px; font-weight: 560; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tabs a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; align-items: center; }
.filters select, .filters input { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; min-height: 38px; font-size: 14px; max-width: 220px; }
.filters .clear { font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; background: none; border: none; }
.filter-toggle { display: none; }

/* ---------- Task table ---------- */
.ttable { width: 100%; border-collapse: collapse; }
.ttable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ttable td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ttable tr:last-child td { border-bottom: none; }
.ttable tbody tr { cursor: pointer; }
.ttable tbody tr:hover td { background: var(--surface-2); }
.ttable .tname { font-weight: 600; }
.ttable .tsub { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ttable .tnotes { color: var(--ink-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 420px; }
.ttable .col-task { width: 34%; } .ttable .col-assignee { width: 15%; } .ttable .col-status { width: 16%; }
.task-cards { display: none; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; font-weight: 600; }

.tcard { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.tcard .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tcard .tname { font-weight: 620; font-size: 15.5px; }
.tcard .kv { font-size: 13.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tcard .kv span { color: var(--muted); }
.list-cards { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Detail pages ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.kv-list { display: flex; flex-direction: column; }
.kv-list .kv { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv-list .kv:last-child { border-bottom: none; }
.kv-list .kv > span:first-child { color: var(--muted); }
.kv-list .kv > span:last-child { text-align: right; font-weight: 520; }
.notes-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; white-space: pre-wrap; word-break: break-word; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.callout { border-radius: var(--radius); padding: 16px 18px; border: 1px solid; }
.callout.revision { background: #fff6f4; border-color: #f3cbc5; }
.callout.awaiting { background: #fffaf0; border-color: #f1ddb3; }
.callout.done { background: #f3faf5; border-color: #c5e6cf; }
.callout.info { background: var(--surface-2); border-color: var(--line); }
.callout h3 { margin-bottom: 6px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 22px 1fr; gap: 12px; position: relative; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 1.5px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface); display: flex; align-items: center; justify-content: center; }
.tl-dot .dot { width: 8px; height: 8px; }
.tl-body .when { font-size: 12.5px; color: var(--muted); }
.tl-body .what { font-weight: 600; font-size: 14px; }
.tl-body .note { margin-top: 6px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; }
.tl-body .note.rev { background: #fff6f4; border-color: #f3cbc5; }

.activity { display: flex; flex-direction: column; }
.activity .a { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.activity .a:last-child { border-bottom: none; }
.activity .a .t { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.members { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #e4e4df; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.sidebar .avatar { background: #2a2a28; color: #fff; }
.person { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.member-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); padding: 3px 10px 3px 3px; border-radius: 99px; font-size: 13px; }
.member-pill .avatar { width: 24px; height: 24px; font-size: 10.5px; }

details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .chev { transition: transform .15s; }
details.fold[open] > summary .chev { transform: rotate(90deg); }

.month { margin-bottom: 10px; }
.month > summary { padding: 16px 18px; }
.month > summary h3 { font-size: 16px; }
.month > summary .n { color: var(--muted); font-size: 14px; }
.month .ttable { border-top: 1px solid var(--line); }
.month .ttable tbody tr { cursor: pointer; }

/* approval cards */
.acard { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.acard .top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acard .waiting { font-size: 13px; font-weight: 600; color: var(--s-awaiting); background: var(--s-awaiting-bg); padding: 4px 10px; border-radius: 99px; white-space: nowrap; height: fit-content; }
.acard .waiting.old { color: var(--s-revision); background: var(--s-revision-bg); }
.acard .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.acard .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--ink-2); }
.acard .facts span { color: var(--muted); }
.acard .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.acard .actions .btn { min-width: 150px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=date], .field input:not([type]),
.field select, .field textarea, .field input[type=tel] {
  width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 11px; padding: 11px 13px; outline: none; font-size: 15px; min-height: 46px;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: #000; flex: none; }
.checklist { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; border: 1px solid var(--line-2); border-radius: 11px; padding: 6px; }
.checklist .check { padding: 8px 8px; border-radius: 8px; }
.checklist .check:hover { background: var(--surface-2); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { border: 1px solid var(--line-2); border-radius: 11px; padding: 12px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.seg label:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.seg input { accent-color: #000; margin-top: 3px; }
.seg b { display: block; font-size: 14px; }
.seg span { font-size: 12.5px; color: var(--muted); }
.form-error { color: var(--danger); font-size: 14px; margin-bottom: 12px; display: none; background: #fff6f4; border: 1px solid #f3cbc5; padding: 10px 12px; border-radius: 10px; }
.form-error.show { display: block; }
.warn { font-size: 13px; background: #fffaf0; border: 1px solid #f1ddb3; color: #7a4a00; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10,10,8,.42); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .12s ease; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .16s ease; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } }

/* notifications panel */
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100%; background: var(--surface); z-index: 110; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); gap: 8px; }
.panel-body { overflow: auto; flex: 1; }
.notif { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: #fbfbf7; }
.notif .ndot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: transparent; }
.notif.unread .ndot { background: var(--danger); }
.notif .ntitle { font-weight: 620; font-size: 14px; }
.notif .nbody { font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; }
.notif .nwhen { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* toast */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 11px; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .16s ease; max-width: 90vw; }
.toast.err { background: var(--danger); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side img { height: 40px; width: auto; align-self: flex-start; }
.auth-side .tag { font-size: 34px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; max-width: 420px; }
.auth-side .tag span { color: #8c8c86; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box .logo-mobile { display: none; height: 28px; width: auto; margin-bottom: 28px; }
.auth-box h1 { font-size: 26px; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 26px; }
.pin-input { letter-spacing: .5em; font-size: 20px !important; font-variant-numeric: tabular-nums; }

/* ---------- Search results ---------- */
.results-group { margin-bottom: 24px; }
.result { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.result:last-child { border-bottom: none; }
.result:hover { background: var(--surface-2); }

.table-wrap { overflow-x: auto; }
.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
.simple th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.simple td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.simple tr:last-child td { border-bottom: none; }
.simple tr.link { cursor: pointer; }
.simple tr.link:hover td { background: var(--surface-2); }

.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.sheet-menu a, .sheet-menu button { display: flex; align-items: center; gap: 12px; padding: 15px 6px; border: none; background: none; width: 100%; font-size: 16px; font-weight: 520; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; }
.sheet-menu a:last-child, .sheet-menu button:last-child { border-bottom: none; }

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 900px) {
  body { font-size: 15.5px; }
  .sidebar { display: none; }
  .topbar { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); gap: 8px; }
  .topbar .mobile-brand { display: flex; align-items: center; }
  .topbar .mobile-brand img { height: 20px; width: auto; }
  .topbar .search { display: none; }
  .topbar .new-task-top { display: none; }
  .clock { padding: 0 10px; }
  .clock small { display: none; }
  .topbar .spacer { display: block; }
  .content { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 23px; }
  .page-head { margin: 12px 0 16px; }
  .page-head .btn { flex: 1; }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted);
    padding: 6px 0; border: none; background: none; position: relative; cursor: pointer;
  }
  .bottom-nav a.active { color: var(--ink); }
  .bottom-nav .bn-badge { position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
  .fab {
    position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 45; width: 56px; height: 56px; border-radius: 18px;
    background: var(--ink); color: #fff; border: none; box-shadow: 0 8px 24px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; cursor: pointer;
  }
  .fab svg { width: 26px; height: 26px; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stats .stat:first-child { grid-column: span 2; }
  .stats.admin { grid-template-columns: 1fr; }
  .stats.admin .stat:first-child { grid-column: auto; }
  .stat { padding: 14px 16px; }
  .stat .val { font-size: 26px; }

  .ttable-wrap { display: none; }
  .task-cards { display: flex; flex-direction: column; gap: 10px; }
  .detail { grid-template-columns: 1fr; }
  .acard .grid2 { grid-template-columns: 1fr; }
  .acard .actions { flex-direction: column; }
  .acard .actions .btn { width: 100%; min-width: 0; min-height: 50px; font-size: 15.5px; }
  .action-bar .btn { flex: 1 1 auto; min-height: 50px; font-size: 15.5px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .seg { grid-template-columns: 1fr; }

  .filter-toggle { display: inline-flex; }
  .filters { display: none; }
  .filters.open { display: grid; grid-template-columns: 1fr 1fr; }
  .filters.open select, .filters.open input { max-width: none; width: 100%; }

  .overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; animation: up .2s ease; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; min-height: 50px; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } }
  .panel { width: 100%; }

  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-box .logo-mobile { display: block; }
  .simple th, .simple td { padding: 10px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 901px) { .show-mobile { display: none !important; } .fab { display: none; } }
@media (max-width: 1100px) and (min-width: 901px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .detail { grid-template-columns: 1fr; }
}
