/* Papan Tugas Kantor — tema terang & bersih: sidebar kiri, aksen ungu, tombol utama hitam. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --sidebar: #fafafa;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --hover: #f2f2f4;
  --list-bg: transparent;
  --border: #ebebee;
  --border-strong: #dcdce1;
  --text: #121216;
  --text-2: #6b6b76;
  --text-3: #a3a3ad;
  --ink: #121216;
  --ink-hover: #2c2c33;
  --primary: #7c5cfc;
  --primary-hover: #6744f0;
  --primary-soft: #f1edff;
  --primary-grad: linear-gradient(90deg, #b8a4ff 0%, #8f6dfd 55%, #7c5cfc 100%);
  --danger: #e5484d;
  --danger-soft: #fdeced;
  --success: #2f9e66;
  --success-soft: #e7f6ed;
  --warning: #e8890c;
  --warning-soft: #fff3e0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(18, 18, 22, .05);
  --shadow: 0 6px 20px rgba(18, 18, 22, .07), 0 1px 3px rgba(18, 18, 22, .05);
  --shadow-lg: 0 24px 60px rgba(18, 18, 22, .18);
  --board-color: #7c5cfc;
  --sidebar-w: 248px;
  --mobile-bar-h: 54px;
  --on-ink: #ffffff;
  --line: #f1f1f3;
  --track: #efeff2;
  --active: #ececef;
  --side-text: #3f3f48;
  --row-hover: #fcfcfd;
  --warn-text: #b45309;
  --toast: #121216;
  --auth-bg: #fbfbfd;
  --auth-card: rgba(255, 255, 255, .92);
  --chart-2: #f59e0b;
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
svg { stroke-width: 1.8; }
.boot { padding: 40px; text-align: center; color: var(--text-2); }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  box-shadow: 0 1px 1px rgba(18, 18, 22, .04);
  cursor: pointer; font-weight: 500; font-size: 13px; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); border-color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.94); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.on { background: var(--primary-soft); border-color: transparent; color: var(--primary-hover); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; justify-content: flex-start; }
.btn.icon { padding: 0; width: 32px; height: 32px; }
.btn.sm.icon { width: 28px; height: 28px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary svg { stroke-width: 2.2; }

.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 9px;
  padding: 0 11px; height: 36px; background: var(--surface); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 72px; }
.select { padding-right: 8px; cursor: pointer; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-weight: 500; font-size: 12.5px; color: var(--text-2); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.active { border-color: var(--text); box-shadow: inset 0 0 0 2px #fff; }

/* ---------- App layout: sidebar + main ---------- */
.layout { display: flex; min-height: 100vh; }
body.on-board .layout { height: 100vh; overflow: hidden; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#main { flex: 1; min-width: 0; }

.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; z-index: 40;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; color: var(--text); }
.side-brand:hover { text-decoration: none; }
.brand-logo { width: 32px; height: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; flex: none; }
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: var(--text-3); }
.side-scroll { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.side-group-title, .side-group-head {
  font-size: 11.5px; font-weight: 500; color: var(--text-3); padding: 16px 8px 6px; display: flex; align-items: center; gap: 4px;
}
.side-group-head { width: 100%; background: transparent; border: 0; cursor: pointer; text-align: left; }
.side-group-head:hover { color: var(--text-2); }
.side-group-head svg { width: 13px; height: 13px; transition: transform .15s; }
.side-group-head.collapsed svg { transform: rotate(-90deg); }
.side-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 8px;
  color: var(--side-text); font-weight: 500; font-size: 13.5px; background: transparent; border: 0; cursor: pointer; text-align: left;
}
.side-link svg { width: 17px; height: 17px; color: var(--text-3); flex: none; }
.side-link:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.side-link.active { background: var(--active); color: var(--text); }
.side-link.active svg { color: var(--text); }
.side-link.sub { font-size: 13px; padding: 6px 8px 6px 10px; }
.side-link.muted-link { color: var(--text-3); }
.side-link.muted-link svg { width: 15px; height: 15px; }
.side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.side-link.active .side-count { color: var(--text-2); }
.board-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; display: inline-block; }
.side-boards { display: flex; flex-direction: column; gap: 1px; }
.side-foot { padding: 8px 10px 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.side-user {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 10px;
  background: transparent; border: 0; cursor: pointer; text-align: left;
}
.side-user:hover { background: var(--hover); }
.side-user .who { flex: 1; min-width: 0; }
.side-user .name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .sub { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user > svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }

.mobile-bar { display: none; }
.nav-backdrop { display: none; }

/* ---------- Avatars ---------- */
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10.5px; font-weight: 600; flex: none; text-transform: uppercase; letter-spacing: .02em;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -7px; box-sizing: content-box; }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------- Page structure ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 16px 32px 64px; }
.page-header { margin-bottom: 24px; }
.page-top { display: flex; align-items: center; gap: 10px; min-height: 40px; flex-wrap: wrap; margin-bottom: 14px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.crumb:hover { color: var(--text); text-decoration: none; }
.crumb svg { width: 15px; height: 15px; }
.crumb.current { color: var(--text); font-weight: 500; }
.crumb-sep { display: inline-flex; color: var(--text-3); }
.crumb-sep svg { width: 14px; height: 14px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-title h1 { font-size: 20px; letter-spacing: -.015em; }
.page-title p { color: var(--text-2); margin: 5px 0 0; max-width: 620px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; }
.section-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow-sm); }
.empty { text-align: center; color: var(--text-2); padding: 40px 20px; }

/* ---------- Home: dashboard widgets ---------- */
.widgets { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.widget {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text); transition: border-color .12s, box-shadow .12s;
}
.widget:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; }
.widget-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.widget-head svg { width: 16px; height: 16px; color: var(--text-3); }
.widget-head svg:last-child { width: 14px; height: 14px; }
.widget-nums { display: flex; gap: 28px; flex-wrap: wrap; }
.widget-nums .n, .widget-big { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.widget-nums .n.red { color: var(--danger); }
.widget .l { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.key { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.k-done, .seg.done { background: linear-gradient(180deg, #6a48f0, #5b3ae0); }
.k-open, .seg.open { background: var(--primary-grad); }
.k-late, .seg.late { background: linear-gradient(90deg, #f9a8d4, #e5484d); }
.status-bar { display: flex; gap: 3px; height: 34px; margin-top: auto; }
.seg { border-radius: 6px; min-width: 6px;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, rgba(0, 0, 0, .55) 5px 7px); mask: repeating-linear-gradient(90deg, #000 0 5px, rgba(0, 0, 0, .55) 5px 7px); }
.seg.empty { background: var(--hover); }

/* ---------- Home: board tiles ---------- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.board-tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  min-height: 128px; border-radius: 14px; padding: 16px; cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.board-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.tile-top { display: flex; gap: 12px; align-items: flex-start; }
.tile-icon {
  width: 36px; height: 36px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--tile-color, var(--primary)); color: #fff; font-weight: 600; font-size: 15px;
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, .08);
}
.tile-text { min-width: 0; }
.board-tile h3 { font-size: 14.5px; overflow-wrap: anywhere; }
.board-tile .desc { font-size: 12.5px; color: var(--text-2); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-tile .stats { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-2);
  border-top: 1px solid var(--border); padding-top: 11px; }
.board-tile .stats strong { color: var(--text); font-weight: 600; }
.board-tile .stats .mine strong { color: var(--primary); }
.board-tile .stats .muted { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); }
.board-tile .stats svg { width: 14px; height: 14px; }
.board-tile.new {
  background: transparent; color: var(--text-2); border: 1.5px dashed var(--border-strong); box-shadow: none;
  align-items: center; justify-content: center; flex-direction: row; gap: 8px; font-weight: 500;
}
.board-tile.new svg { width: 16px; height: 16px; }
.board-tile.new:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Board page ---------- */
body.on-board { overflow: hidden; }
.board-page { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.board-header { padding: 16px 28px 0; border-bottom: 1px solid var(--border); }
.board-header .page-top { margin-bottom: 4px; }
.board-name { gap: 6px; min-width: 0; }
.board-title {
  font-size: 15px; font-weight: 600; padding: 3px 6px; border-radius: 7px; background: transparent;
  border: 0; color: var(--text); cursor: pointer; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.board-title:hover { background: var(--hover); }
.board-title-input { font-size: 15px; font-weight: 600; max-width: 320px; height: 32px; }
.role-chip { font-size: 11px; font-weight: 500; color: var(--text-2); background: var(--hover); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.board-desc { color: var(--text-2); margin: 0 0 4px; max-width: 720px; }
.board-actions { display: flex; gap: 2px; }
.board-actions .btn { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.board-actions .btn:hover { background: var(--hover); color: var(--text); }
.board-actions .btn.on { background: var(--primary-soft); color: var(--primary-hover); }
.member-stack {
  display: inline-flex; align-items: center; gap: 4px; background: transparent; border: 0; padding: 3px 4px; border-radius: 99px; cursor: pointer;
}
.member-stack:hover, .member-stack.on { background: var(--hover); }
.member-stack .more { font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.member-stack .add {
  width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--border-strong); display: inline-flex; align-items: center; justify-content: center; color: var(--text-3);
}
.member-stack .add svg { width: 12px; height: 12px; }
.board-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 0 12px; flex-wrap: wrap; }
.filterbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.filterbar .select { width: auto; height: 30px; font-size: 12.5px; border-radius: 8px; color: var(--text-2); }
.filterbar .select.active { border-color: var(--primary); color: var(--text); background-color: var(--primary-soft); }
.filterbar .color-filter.active[style*="--cc"] { border-color: var(--cc); background-color: color-mix(in srgb, var(--cc) 12%, var(--surface)); box-shadow: inset 4px 0 0 var(--cc); }
.filterbar .color-filter option { background: var(--surface); }
.search-box { position: relative; display: inline-flex; align-items: center; }
.search-box svg { position: absolute; left: 9px; width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.search-box .input { width: 210px; height: 30px; padding-left: 30px; font-size: 12.5px; border-radius: 8px; background: var(--surface-2); }
.search-box .input:focus { background: var(--surface); }

.board-body { flex: 1; display: flex; min-height: 0; }
.canvas { flex: 1; display: flex; align-items: flex-start; gap: 18px; padding: 16px 28px 20px; overflow-x: auto; overflow-y: hidden; }
.list { width: 288px; flex: none; background: var(--list-bg); border-radius: 14px; display: flex; flex-direction: column; max-height: 100%; }
.list.dragging { opacity: .4; }
.list-head { display: flex; align-items: center; gap: 8px; padding: 4px 2px 10px; cursor: grab; }
.list-head:active { cursor: grabbing; }
.list-icon { display: inline-flex; color: var(--text-3); }
.list-icon svg { width: 16px; height: 16px; }
.list-icon.todo { color: var(--text-2); }
.list-icon.doing { color: var(--warning); }
.list-icon.review { color: var(--primary); }
.list-icon.done { color: var(--success); }
.list-title { font-weight: 600; font-size: 13.5px; cursor: pointer; overflow-wrap: anywhere; padding: 2px 0; }
.list-title-input { font-weight: 600; height: 30px; padding: 0 8px; }
.count { font-size: 12.5px; font-weight: 600; color: var(--text-3); flex: 1; }
.cards { display: flex; flex-direction: column; gap: 10px; padding: 2px 2px 6px; overflow-y: auto; min-height: 12px; flex: 1; }
.list-foot { padding: 4px 2px 8px; }
.add-card-btn { width: 100%; justify-content: flex-start; color: var(--text-3); }
.add-card-btn:hover { color: var(--text); }
.composer { display: flex; flex-direction: column; gap: 6px; }
.composer .textarea { min-height: 64px; box-shadow: var(--shadow-sm); }
.add-list { width: 288px; flex: none; padding: 0; }
.add-list .btn.ghost { width: 100%; justify-content: flex-start; color: var(--text-3); border: 1.5px dashed var(--border-strong); height: 40px; }
.add-list .btn.ghost:hover { color: var(--text); border-color: var(--text-3); background: transparent; }
.list-placeholder { width: 288px; flex: none; align-self: stretch; border-radius: 14px; background: var(--hover); border: 1.5px dashed var(--border-strong); }

.card {
  background: var(--surface); border-radius: 12px; padding: 12px 12px 10px; border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(18, 18, 22, .04); cursor: pointer; display: flex; flex-direction: column; gap: 8px;
  transition: border-color .12s, box-shadow .12s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
/* Coloured card: accent edge on the left and a light tint (works in light and dark themes). */
.card.colored { background: color-mix(in srgb, var(--cc) 9%, var(--surface)); border-color: color-mix(in srgb, var(--cc) 28%, var(--border)); box-shadow: inset 4px 0 0 var(--cc), 0 1px 2px rgba(18, 18, 22, .04); padding-left: 15px; }
.card.colored:hover { border-color: color-mix(in srgb, var(--cc) 50%, var(--border)); box-shadow: inset 4px 0 0 var(--cc), var(--shadow); }
.card.colored .card-foot { border-top-color: color-mix(in srgb, var(--cc) 18%, var(--line)); }
.card.colored .avatars .avatar { border-color: color-mix(in srgb, var(--cc) 9%, var(--surface)); }
.card:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.card.dragging { display: none; }
.card.done .card-title { color: var(--text-2); text-decoration: line-through; }
.card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); min-height: 16px; }
.card-id { font-variant-numeric: tabular-nums; }
.label-flag {
  display: inline-flex; align-items: center; gap: 4px; color: var(--c); font-size: 11.5px; font-weight: 500;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.label-flag svg { width: 12px; height: 12px; fill: var(--c); flex: none; }
.label-flag.lg { font-size: 12.5px; padding: 3px 9px; border-radius: 7px; background: color-mix(in srgb, var(--c) 13%, var(--surface)); }
.card-title { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; line-height: 1.35; }
.card-due { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.card-due svg { width: 13px; height: 13px; color: var(--text-3); }
.card-due strong { font-weight: 600; color: var(--text); }
.card-due.overdue, .card-due.overdue strong, .card-due.overdue svg { color: var(--danger); }
.card-due.today, .card-due.today strong, .card-due.today svg { color: var(--warning); }
.card-due.done strong { color: var(--text-2); }
.card-foot { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.card-foot .meta { display: inline-flex; align-items: center; gap: 3px; }
.card-foot .meta.ok { color: var(--success); }
.card-foot svg { width: 13px; height: 13px; }
.done-chip { display: inline-flex; align-items: center; gap: 3px; color: var(--success); font-weight: 600; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.card-placeholder { border-radius: 12px; background: var(--hover); border: 1.5px dashed var(--border-strong); flex: none; }

.due { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 7px; font-weight: 500; font-size: 12px; white-space: nowrap; }
.due svg { width: 13px; height: 13px; flex: none; }
.due.overdue { background: var(--danger-soft); color: var(--danger); }
.due.today { background: var(--warning-soft); color: var(--warn-text); }
.due.soon { background: var(--warning-soft); color: var(--warn-text); }
.due.normal { background: var(--surface-2); color: var(--text-2); }
.due.done { background: var(--success-soft); color: var(--success); }

/* ---------- Drawer ---------- */
.drawer { width: 340px; flex: none; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.drawer-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); gap: 8px; }
.drawer-head h3 { font-size: 14.5px; flex: 1; }
.drawer-body { padding: 16px; overflow-y: auto; flex: 1; }
.drawer-body .section-title:first-child { margin-top: 0; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-row .who { flex: 1; min-width: 0; }
.member-row .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row .select { width: auto; height: 30px; font-size: 12.5px; }

.feed { display: flex; flex-direction: column; gap: 14px; }
.feed-item { display: flex; gap: 10px; }
.feed-item .body { flex: 1; min-width: 0; }
.feed-item .time { font-size: 12px; color: var(--text-3); }
.feed-item.activity { font-size: 13px; color: var(--text-2); }
.comment-text {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; margin-top: 5px;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text);
}

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(18, 18, 22, .38); backdrop-filter: blur(3px); z-index: 50; display: flex; justify-content: center;
  align-items: flex-start; padding: 48px 16px; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 800px; box-shadow: var(--shadow-lg); position: relative;
  padding: 22px 24px 26px; border: 1px solid var(--border);
}
.modal.narrow { max-width: 440px; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal h2 { font-size: 17px; margin-bottom: 16px; padding-right: 36px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.card-modal-title {
  font-size: 19px; font-weight: 600; letter-spacing: -.01em; border: 1px solid transparent; border-radius: 9px; padding: 4px 6px;
  width: calc(100% - 40px); resize: none; background: transparent; min-height: 0; overflow: hidden; line-height: 1.3;
}
.card-modal-title:hover { background: var(--surface-2); }
.card-modal-title:focus { background: var(--surface); border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.card-sub { display: flex; align-items: center; gap: 6px; color: var(--text-2); margin: 4px 0 18px 6px; flex-wrap: wrap; }
.card-sub .select { width: auto; height: 30px; font-size: 12.5px; }
.card-grid { display: grid; grid-template-columns: 1fr 190px; gap: 26px; }
.card-section { margin-bottom: 24px; }
.card-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-section-head h4 { font-size: 13.5px; flex: 1; display: flex; align-items: center; gap: 8px; }
.card-section-head svg { width: 16px; height: 16px; color: var(--text-3); }
.props { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 22px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.prop-label { font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.prop-value { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 30px; }
.add-round {
  width: 28px; height: 28px; border-radius: 50%; border: 1px dashed var(--border-strong); background: var(--surface); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-3);
}
.add-round:hover { border-color: var(--primary); color: var(--primary); }
.prop-wide { flex-basis: 100%; }
.color-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.color-dot {
  width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
  transition: transform .1s;
}
.color-dot:hover { transform: scale(1.12); }
.color-dot svg { width: 14px; height: 14px; stroke-width: 3; }
.color-dot.on { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--text); }
.color-dot.none { background: var(--surface); color: var(--text-3); box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.color-dot.none svg { stroke-width: 2; }
.color-dot.none.on { box-shadow: inset 0 0 0 1.5px var(--border-strong), 0 0 0 2px var(--surface-2), 0 0 0 4px var(--text); }
.card-color-bar { width: 4px; height: 18px; border-radius: 2px; flex: none; }
.cal-chip.colored { box-shadow: inset 3px 0 0 var(--cc); }
.cal-chip.colored:not(.overdue):not(.today) { background: color-mix(in srgb, var(--cc) 10%, var(--surface)); }
.tl-bar.colored { background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 65%, #fff), var(--cc)); }
.add-round svg { width: 14px; height: 14px; }
.date-input { width: auto; height: 32px; padding: 0 9px; }
.desc-view {
  white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 10px; padding: 10px 12px;
  cursor: pointer; min-height: 48px; border: 1px solid transparent;
}
.desc-view:hover { border-color: var(--border); }
.desc-view.empty-desc { color: var(--text-3); }
.archived-banner {
  background: var(--warning-soft); color: var(--warn-text); border-radius: 10px; padding: 9px 12px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px; font-weight: 500;
}
.archived-banner svg { width: 16px; height: 16px; }
.side-title { font-size: 12px; font-weight: 500; color: var(--text-3); margin: 0 0 6px; }
.side-actions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.side-actions .btn { justify-content: flex-start; }

.progress { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.progress-bar { flex: 1; height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--primary-grad); border-radius: inherit; transition: width .25s; }
.progress-bar.complete > div { background: var(--success); }
.check-item { display: flex; align-items: flex-start; gap: 9px; padding: 6px 6px; border-radius: 8px; }
.check-item:hover { background: var(--surface-2); }
.check-item input[type=checkbox] { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--primary); flex: none; cursor: pointer; }
.check-item .txt { flex: 1; overflow-wrap: anywhere; cursor: text; }
.check-item.done .txt { text-decoration: line-through; color: var(--text-2); }
.check-item .del { opacity: 0; }
.check-item:hover .del, .check-item .del:focus { opacity: 1; }

/* ---------- Popover ---------- */
.popover {
  position: fixed; z-index: 70; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); width: 290px; max-height: 70vh; overflow-y: auto; padding: 10px;
}
.popover h4 { font-size: 12.5px; text-align: center; color: var(--text-2); font-weight: 500; margin: 2px 0 10px; }
.pick-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; width: 100%;
  background: transparent; border: 0; text-align: left;
}
.pick-row:hover { background: var(--hover); }
.pick-row .tick { margin-left: auto; color: var(--primary); width: 16px; height: 16px; }
.pick-row .label-flag { flex: 1; }
.label-chip {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; color: #fff; padding: 1px 7px;
  border-radius: 6px; line-height: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.label-chip.lg { font-size: 12.5px; padding: 3px 10px; }
.menu { display: flex; flex-direction: column; min-width: 190px; }
.menu button { text-align: left; background: transparent; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---------- Tables / lists ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--row-hover); }
.table th { font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--surface-2); border-bottom-color: var(--border); }
.table-wrap { border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; box-shadow: var(--shadow-sm); }
.backup-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.backup-box > div { flex: 1 1 320px; }
.backup-box p { margin: 0 0 4px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 500; padding: 2px 9px; border-radius: 99px; background: var(--success-soft); color: var(--success); }
.badge.admin { background: var(--primary-soft); color: var(--primary-hover); }
.badge.off { background: var(--hover); color: var(--text-2); }
.task-group { margin-bottom: 8px; }
.task-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 8px; cursor: pointer; color: var(--text); box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s;
}
.task-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; }
.task-row .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.task-row .t { flex: 1; min-width: 0; }
.task-row .t .title { font-weight: 600; overflow-wrap: anywhere; }
.task-row.done .title { text-decoration: line-through; color: var(--text-2); }
.task-row .due { flex: none; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary-grad); opacity: .85; }
.stat .n { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.stat.red .n { color: var(--danger); }
.stat.red::after { background: linear-gradient(90deg, #ffb3b5, var(--danger)); }
.stat.orange .n { color: var(--warning); }
.stat.orange::after { background: linear-gradient(90deg, #ffd59a, var(--warning)); }
.stat.green .n { color: var(--success); }
.stat.green::after { background: linear-gradient(90deg, #a6e3c1, var(--success)); }

/* ---------- Auth (sign-in / first setup) ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; background: var(--bg); }
.auth-side {
  position: relative; display: flex; flex-direction: column; padding: 28px clamp(24px, 5vw, 64px); min-height: 100vh;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1px);
  background-size: 18px 18px; background-position: -9px -9px;
}
.auth-side::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 45% at 0% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%),
    radial-gradient(70% 60% at 50% 55%, var(--bg) 35%, transparent 80%);
}
.auth-side > * { position: relative; }
.auth-top { display: flex; align-items: center; }
.brand-full { display: inline-flex; }
.brand-full img { height: 100%; width: auto; display: block; }
.brand-full .logo-for-dark { display: none; }
:root[data-theme="dark"] .brand-full .logo-for-light { display: none; }
:root[data-theme="dark"] .brand-full .logo-for-dark { display: block; }
.auth-logo { height: 54px; }
.auth-card { width: 100%; max-width: 420px; margin: auto 0; padding: 40px 0; align-self: center; }
.auth-card h1 { font-size: 26px; letter-spacing: -.025em; }
.auth-sub { color: var(--text-2); margin: 8px 0 26px; font-size: 14px; }
.auth-form .field { margin-bottom: 16px; }
.auth-form .field > label { color: var(--text); font-size: 13px; }
.auth-pair { gap: 12px; align-items: flex-start; }
.auth-pair .field { flex: 1; min-width: 0; }
.icon-input { position: relative; display: flex; align-items: center; }
.icon-input > svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.icon-input .input { height: 44px; padding-left: 40px; border-radius: 11px; font-size: 14px; background: var(--surface); }
.icon-input.has-reveal .input { padding-right: 44px; }
.icon-input:focus-within > svg { color: var(--primary); }
.reveal {
  position: absolute; right: 6px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.reveal:hover { background: var(--hover); color: var(--text); }
.reveal svg { width: 17px; height: 17px; }
.auth-submit { width: 100%; height: 46px; margin-top: 8px; border-radius: 11px; font-size: 14px; gap: 4px; }
.auth-submit svg { transition: transform .15s; }
.auth-submit:hover svg { transform: translateX(3px); }
.auth-help { font-size: 12.5px; color: var(--text-3); text-align: center; margin: 16px 0 0; }
.auth-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.auth-theme .theme-switch { margin: 0; background: var(--surface); border: 1px solid var(--border); }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; display: flex; gap: 8px; align-items: center; }

/* Showcase panel */
.auth-showcase {
  position: relative; overflow: hidden; margin: 12px; border-radius: 26px; min-height: calc(100vh - 24px);
  background:
    radial-gradient(55% 45% at 85% 12%, rgba(255, 170, 120, .55), transparent 70%),
    radial-gradient(60% 55% at 10% 85%, rgba(124, 92, 252, .55), transparent 70%),
    radial-gradient(45% 40% at 60% 60%, rgba(255, 122, 168, .35), transparent 70%),
    linear-gradient(160deg, #f3efff 0%, #fbf3f6 50%, #fff4ec 100%);
  isolation: isolate;
}
:root[data-theme="dark"] .auth-showcase {
  background:
    radial-gradient(55% 45% at 85% 12%, rgba(255, 140, 90, .28), transparent 70%),
    radial-gradient(60% 55% at 10% 85%, rgba(124, 92, 252, .45), transparent 70%),
    radial-gradient(45% 40% at 60% 60%, rgba(255, 92, 150, .2), transparent 70%),
    linear-gradient(160deg, #191527 0%, #1b1520 50%, #21171a 100%);
}
.auth-grid {
  position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 45%, #000 30%, transparent 85%); mask-image: radial-gradient(80% 70% at 50% 45%, #000 30%, transparent 85%);
}
.auth-ribbon { position: absolute; left: -4%; right: -4%; bottom: -6%; width: 108%; height: auto; z-index: -1; }
.auth-pitch { position: absolute; top: clamp(32px, 7vh, 72px); left: clamp(28px, 5%, 56px); right: 28px; max-width: 470px; }
.pitch-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 99px;
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  backdrop-filter: blur(8px); color: var(--text-2);
}
.pitch-chip svg { width: 14px; height: 14px; color: var(--primary); }
.auth-pitch h2 { font-size: clamp(26px, 3vw, 40px); line-height: 1.12; letter-spacing: -.03em; margin: 16px 0 12px; }
.auth-pitch h2 span { background: linear-gradient(90deg, #7c5cfc, #e2589a 60%, #f08a4b); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .auth-pitch h2 span { background: linear-gradient(90deg, #b39dff, #ff86b6 60%, #ffb07a); -webkit-background-clip: text; background-clip: text; }
.auth-pitch p { color: var(--text-2); font-size: 15px; margin: 0; max-width: 420px; }

.float-card, .float-toast {
  position: absolute; background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 16px; box-shadow: 0 18px 50px rgba(30, 20, 60, .16), 0 2px 6px rgba(30, 20, 60, .06);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding: 14px; display: flex; flex-direction: column; gap: 9px;
  animation: floaty 7s ease-in-out infinite;
}
:root[data-theme="dark"] .float-card, :root[data-theme="dark"] .float-toast { box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.fc-task { width: 270px; top: 40%; left: 9%; transform: rotate(-3deg); }
.fc-status { width: 270px; top: 31%; right: 7%; animation-delay: -2s; }
.fc-burn { width: 220px; bottom: 15%; right: 12%; animation-delay: -4s; }
.fc-commits { width: 240px; bottom: 9%; left: 13%; animation-delay: -5.5s; }
.float-card .card-foot { border-top-color: color-mix(in srgb, var(--border) 70%, transparent); }
.float-card .status-bar { height: 30px; margin: 2px 0 0; }
.float-card .w-num .n { font-size: 18px; }
.mini-burn { width: 100%; height: auto; }
.float-toast {
  flex-direction: row; align-items: center; gap: 9px; padding: 10px 14px 10px 10px; border-radius: 12px; font-size: 13px;
  top: 60%; right: 30%; animation-delay: -3s;
}
.float-toast .ok { width: 24px; height: 24px; border-radius: 50%; background: var(--success); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.float-toast .ok svg { width: 14px; height: 14px; stroke-width: 3; }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@media (prefers-reduced-motion: reduce) { .float-card, .float-toast { animation: none; } }

@media (max-width: 1180px) {
  .fc-burn, .float-toast { display: none; }
  .fc-task { left: 6%; top: 44%; }
  .fc-status { right: 5%; top: 36%; }
}
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-showcase { display: none; }
  .auth-side {
    background-image:
      radial-gradient(70% 38% at 85% 0%, rgba(255, 170, 120, .45), transparent 70%),
      radial-gradient(70% 40% at 5% 4%, rgba(124, 92, 252, .45), transparent 70%),
      radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1px);
    background-size: auto, auto, 18px 18px;
    background-position: 0 0, 0 0, -9px -9px;
    background-repeat: no-repeat, no-repeat, repeat;
  }
  .auth-side::before { background: radial-gradient(90% 60% at 50% 60%, var(--bg) 40%, transparent 85%); }
  .auth-card { margin: auto; padding: 32px 0; max-width: 460px; }
  .auth-top { justify-content: center; }
}
@media (max-width: 480px) {
  .auth-pair { flex-direction: column; gap: 0; }
  .auth-pair .field { width: 100%; }
  .auth-foot { justify-content: center; }
  .auth-card h1 { font-size: 23px; }
}

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--toast); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; max-width: 90vw; animation: pop .18s ease; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--toast); }
.toast.success::before { content: "✓  "; color: #6ee7a8; font-weight: 700; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #34c77b; display: inline-block; box-shadow: 0 0 0 3px rgba(52, 199, 123, .2); margin-right: 4px; }
.live-dot.off { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .2); }

/* ---------- Attachments ---------- */
.attach-section { border-radius: 12px; transition: background .15s, box-shadow .15s; }
.attach-section.drop-hover { background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary); }
.attach-list { display: flex; flex-direction: column; gap: 8px; }
.attach-list:not(:empty) { margin-bottom: 8px; }
.attach-item { display: flex; align-items: center; gap: 12px; padding: 7px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.attach-thumb { flex: none; width: 64px; height: 48px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 11px; font-weight: 600; color: var(--text-2); }
.attach-thumb:hover { text-decoration: none; border-color: var(--primary); }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-info { flex: 1; min-width: 0; }
.attach-name { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.attach-item .progress { margin: 4px 0 0; }
.attach-actions { display: flex; gap: 2px; flex: none; }
.attach-drop { padding: 9px 10px; border: 1.5px dashed var(--border-strong); border-radius: 10px; text-align: center; color: var(--text-3); }

/* ---------- Reports ---------- */
.report-filters { flex-wrap: wrap; margin-bottom: 8px; }
.report-filters .select { width: auto; min-width: 180px; }
.report-filters .date-input { width: auto; height: 36px; }
.report-caption { margin: 0 0 18px; font-size: 12.5px; color: var(--text-3); }
.report-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.report-table th.sortable:hover { color: var(--text); }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table td.bad { color: var(--danger); font-weight: 600; }
.report-table .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.report-table a.row { color: var(--text); font-weight: 500; }
.load { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.load-bar { width: 72px; height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
.load-bar > div { height: 100%; background: var(--primary-grad); border-radius: inherit; }
.report-progress { justify-content: flex-end; margin: 0; min-width: 130px; }
.report-progress .progress-bar { max-width: 90px; }

/* ---------- Dark theme ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141416;
  --sidebar: #19191c;
  --surface: #1f1f23;
  --surface-2: #19191c;
  --hover: #28282d;
  --border: #2b2b31;
  --border-strong: #3a3a41;
  --text: #ececf1;
  --text-2: #a1a1ac;
  --text-3: #6c6c77;
  --ink: #f4f4f6;
  --ink-hover: #ffffff;
  --on-ink: #121216;
  --primary: #9a7fff;
  --primary-hover: #b4a0ff;
  --primary-soft: rgba(154, 127, 255, .16);
  --primary-grad: linear-gradient(90deg, #5b45c9 0%, #7d63f5 55%, #b39dff 100%);
  --danger: #ff6b70;
  --danger-soft: rgba(255, 107, 112, .14);
  --success: #4cc38a;
  --success-soft: rgba(76, 195, 138, .14);
  --warning: #ffa94d;
  --warning-soft: rgba(255, 169, 77, .14);
  --line: #27272c;
  --track: #2d2d33;
  --active: #2a2a30;
  --side-text: #c6c6cf;
  --row-hover: #232327;
  --warn-text: #ffb366;
  --toast: #2c2c33;
  --auth-bg: #111113;
  --auth-card: rgba(31, 31, 35, .9);
  --chart-2: #f5a524;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 8px 24px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
}
:root[data-theme="dark"] .board-tile .tile-icon,
:root[data-theme="dark"] .avatar { box-shadow: none; }

/* ---------- Theme switch ---------- */
.theme-switch { display: flex; gap: 2px; padding: 3px; background: var(--hover); border-radius: 10px; margin: 2px 0 6px; }
.theme-opt {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); font-size: 12px; font-weight: 500; cursor: pointer; padding: 0 4px;
}
.theme-opt svg { width: 14px; height: 14px; flex: none; }
.theme-opt:hover { color: var(--text); }
.theme-opt.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- View tabs + board widgets ---------- */
.view-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--hover); border-radius: 10px; }
.view-tab {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.view-tab svg { width: 14px; height: 14px; }
.view-tab:hover { color: var(--text); }
.view-tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }

.board-widgets { display: grid; grid-template-columns: minmax(250px, 1.1fr) minmax(220px, .9fr) minmax(320px, 1.6fr); gap: 12px; margin: 10px 0 4px; }
.report-widgets { grid-template-columns: minmax(240px, 1fr) minmax(320px, 2fr); margin: 14px 0 0; }
.w {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.w-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.w-stack .w { flex: 1; }
.w-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.w-head svg { width: 15px; height: 15px; color: var(--text-3); }
.w-sub { color: var(--text-3); font-weight: 400; }
.w-nums { display: flex; gap: 22px; flex-wrap: wrap; }
.w-num .n { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.w-num .l { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-2); }
.w-num .list-icon svg { width: 12px; height: 12px; }
.w-num-name { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-bar.tall { height: 46px; margin-top: 0; }
.w-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: -4px; }
.w-split { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.w-big { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.delta svg { width: 11px; height: 11px; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.w-spark { width: 150px; height: 44px; flex: none; }
.w-spark .dot { fill: var(--primary); }
.w-spark .dot-hot { fill: var(--chart-2); }
.w-spark .dot-zero, .w-spark .bar-zero { fill: var(--track); }
.w-spark .bar { fill: var(--chart-2); opacity: .45; }
.w-spark .bar-hot { fill: var(--chart-2); }
.burndown { width: 100%; height: auto; display: block; color: var(--text-3); font-size: 10.5px; }
.burndown text { fill: currentColor; font-family: inherit; }
.burndown .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.burndown .actual { fill: none; stroke: var(--primary); stroke-width: 2; }
.burndown .ideal { fill: none; stroke: var(--chart-2); stroke-width: 1.6; stroke-dasharray: 5 4; }
.burndown .today { stroke: var(--text-3); stroke-dasharray: 2 3; }
.burndown .area-top { stop-color: var(--primary); stop-opacity: .28; }
.burndown .area-bottom { stop-color: var(--primary); stop-opacity: 0; }
.w-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-2); }
.w-legend span { display: inline-flex; align-items: center; gap: 6px; }
.k-actual { background: var(--primary); }
.k-ideal { background: var(--chart-2); }
.w-loading { color: var(--text-3); font-size: 12px; padding: 10px 0; }

/* ---------- Views ---------- */
.view-scroll { flex: 1; overflow: auto; padding: 16px 28px 28px; min-width: 0; }

.sheet-table th, .sheet-table td { white-space: nowrap; padding: 8px 12px; }
.sheet-table tbody tr { cursor: pointer; }
.sheet-table .cell-title { white-space: normal; min-width: 220px; max-width: 380px; }
.sheet-table .cell-title a { color: var(--text); font-weight: 500; }
.sheet-table tr.done .cell-title a { text-decoration: line-through; color: var(--text-2); }
.sheet-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet-table th.sortable { cursor: pointer; user-select: none; }
.sheet-table th.sortable:hover { color: var(--text); }
.cell-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.cell-select { width: auto; height: 28px; font-size: 12.5px; border-color: transparent; background: transparent; padding: 0 6px; }
.cell-select:hover { border-color: var(--border); background: var(--surface); }
.cell-labels { display: flex; gap: 8px; }
.cell-names { color: var(--text-2); font-size: 12.5px; }
.cell-progress { margin: 0; min-width: 110px; }
.sheet-foot { margin-top: 10px; }

.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-head h3 { font-size: 16px; min-width: 150px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.cal-wd { background: var(--surface-2); padding: 8px 10px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.cal-cell { background: var(--surface); min-height: 116px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.other .cal-num { color: var(--text-3); }
.cal-cell.drop { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-soft); }
.cal-day { display: flex; align-items: center; justify-content: space-between; }
.cal-num { font-size: 12px; font-weight: 600; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-cell.today .cal-num { background: var(--ink); color: var(--on-ink); }
.cal-add { opacity: 0; width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cal-add svg { width: 14px; height: 14px; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { background: var(--hover); color: var(--text); }
.cal-items { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; max-height: 126px; }
.cal-chip {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface);
  border-radius: 7px; padding: 3px 6px; font-size: 12px; cursor: pointer; color: var(--text); min-width: 0;
}
.cal-chip:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.cal-chip.overdue { background: var(--danger-soft); border-color: transparent; }
.cal-chip.today { background: var(--warning-soft); border-color: transparent; }
.cal-chip.done .chip-text { text-decoration: line-through; color: var(--text-3); }
.chip-dot { width: 7px; height: 7px; border-radius: 2px; flex: none; display: inline-block; }
.chip-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-agenda { display: none; }

/* No left padding: the sticky labels must sit flush against the scroll edge, or scrolled bars show beside them. */
.view-timeline { padding-left: 0; }
.view-timeline .timeline { border-left: 0; border-radius: 0 14px 14px 0; }
.view-timeline .tl-label { padding-left: 28px; }
.view-timeline .tl-header .tl-label { border-top-left-radius: 0; }
.timeline { --tl-label-w: 270px; position: relative; width: calc(var(--tl-label-w) + var(--tl-width)); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.tl-row { display: flex; min-height: 38px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tl-row:last-of-type { border-bottom: 0; }
.tl-row:hover .tl-label, .tl-row:hover .tl-track { background-color: var(--row-hover); }
.tl-label {
  position: sticky; left: 0; z-index: 2; width: var(--tl-label-w); flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--surface); border-right: 1px solid var(--border); min-width: 0;
}
.tl-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tl-title.done { text-decoration: line-through; color: var(--text-2); }
.tl-track { position: relative; flex: none; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: var(--day) 100%; }
.tl-group { cursor: default; }
.tl-group .tl-label, .tl-group .tl-track, .tl-group:hover .tl-label, .tl-group:hover .tl-track { background-color: var(--surface-2); }
.tl-group .tl-label { font-size: 12.5px; }
.tl-group .count { flex: none; }
.tl-header { position: sticky; top: 0; z-index: 3; cursor: default; min-height: 52px; border-radius: 14px 14px 0 0; }
.tl-header .tl-label, .tl-header .tl-track, .tl-header:hover .tl-label, .tl-header:hover .tl-track { background-color: var(--surface-2); }
.tl-header .tl-label { z-index: 4; border-top-left-radius: 14px; }
.tl-months { display: flex; height: 24px; border-bottom: 1px solid var(--line); }
.tl-month { flex: none; font-size: 12px; font-weight: 600; padding: 4px 8px; white-space: nowrap; overflow: hidden; border-left: 1px solid var(--line); }
.tl-days { display: flex; height: 28px; }
.tl-day { flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-2); }
.tl-day.weekend { color: var(--text-3); }
.tl-day.is-today { color: var(--on-ink); background: var(--ink); border-radius: 6px; font-weight: 600; margin: 3px 0; }
.tl-bar {
  position: absolute; top: 7px; bottom: 7px; border-radius: 7px; background: var(--primary-grad); color: #fff; font-size: 11.5px; font-weight: 500;
  padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; box-shadow: var(--shadow-sm); min-width: 18px;
}
.tl-bar span { overflow: hidden; text-overflow: ellipsis; }
.tl-bar.overdue { background: linear-gradient(90deg, #f7a1ad, var(--danger)); }
.tl-bar.today, .tl-bar.soon { background: linear-gradient(90deg, #ffcf8a, var(--warning)); color: #3b2300; }
.tl-bar.done { background: var(--success); opacity: .85; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--danger); z-index: 1; pointer-events: none; opacity: .7; }

@media (max-width: 1100px) {
  .board-widgets { grid-template-columns: 1fr 1fr; }
  .board-widgets > .w:last-child { grid-column: 1 / -1; }
  .report-widgets { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .board-widgets { grid-template-columns: 1fr; }
  .view-scroll { padding: 12px 16px 24px; }
  .cal-grid { display: none; }
  .cal-agenda { display: flex; flex-direction: column; gap: 14px; }
  .agenda-day { display: flex; flex-direction: column; gap: 6px; }
  .agenda-date { font-weight: 600; font-size: 13px; }
  .agenda-date.today { color: var(--primary); }
  .cal-agenda .cal-chip { padding: 9px 10px; font-size: 13px; }
  .timeline { --tl-label-w: 150px; }
  .view-timeline { padding-left: 0; }
  .view-timeline .tl-label { padding-left: 16px; }
  .toolbar-sep { display: none; }
}

/* ---------- Notifications ---------- */
svg.tiny { width: 14px; height: 14px; flex: none; }
.section-title svg.tiny { color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-pair { gap: 12px; align-items: flex-start; }
.form-pair .field { flex: 1; min-width: 0; }
.field .hint { font-size: 12px; color: var(--text-3); }
.panel-head { margin-bottom: 14px; }
.test-row { display: flex; gap: 8px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.test-row .input { flex: 1 1 220px; width: auto; }
.time-input { width: 110px; }
.advanced { margin: 4px 0 6px; }
.advanced summary { cursor: pointer; color: var(--text-2); font-size: 13px; padding: 6px 0 12px; }
.advanced summary:hover { color: var(--text); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--primary-soft); }
.stat .n.small-n { font-size: 18px; }
.badge.fail { background: var(--danger-soft); color: var(--danger); }
.log-error { font-size: 12px; color: var(--danger); margin-top: 3px; max-width: 360px; white-space: normal; }
.log-table td { vertical-align: top; }
.nowrap { white-space: nowrap; }
.pref-table td.c, .pref-table th.c { text-align: center; width: 90px; }
.pref-table input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.contact { display: inline-flex; margin-left: 6px; color: var(--text-3); vertical-align: middle; }
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */
@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f7f7f8; --hover: #f2f2f4; --text: #121216; --text-2: #6b6b76;
    --text-3: #a3a3ad; --border: #ebebee; --line: #f1f1f3; --track: #efeff2; --row-hover: #fff;
  }
  .sidebar, .mobile-bar, .nav-backdrop, .page-actions, .report-actions, .report-filters, #toasts { display: none !important; }
  .layout { display: block; }
  body, .page { background: #fff; }
  .page { padding: 0; max-width: none; }
  .table-wrap { overflow: visible; box-shadow: none; }
  .stat, .table-wrap, .task-row { break-inside: avoid; box-shadow: none; }
  a { color: inherit; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--shadow-lg); z-index: 60;
  }
  .layout.nav-open .sidebar { transform: none; }
  .layout.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(18, 18, 22, .35); z-index: 55; }
  .mobile-bar {
    display: flex; align-items: center; gap: 8px; height: var(--mobile-bar-h); padding: 0 12px; flex: none;
    border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 30;
  }
  .mobile-bar .brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
  .mobile-bar .brand-logo { width: 28px; height: 28px; }
  .page { padding: 14px 16px 48px; }
  .widgets { grid-template-columns: 1fr 1fr; }
  .widgets .widget:first-child { grid-column: 1 / -1; }
  .board-header { padding: 10px 16px 0; }
  .canvas { padding: 14px 16px 16px; gap: 14px; }
  .drawer { position: fixed; right: 0; top: var(--mobile-bar-h); bottom: 0; width: min(340px, 100vw); z-index: 30; box-shadow: var(--shadow-lg); }
  /* On small screens the board page scrolls as a whole; columns keep their own height. */
  body.on-board { overflow: auto; }
  body.on-board .layout { height: auto; min-height: 100vh; overflow: visible; }
  .board-page { flex: none; }
  .board-body { min-height: calc(100vh - var(--mobile-bar-h)); }
  .canvas { height: calc(100vh - var(--mobile-bar-h) - 12px); }
  .view-scroll { overflow-x: auto; overflow-y: visible; }
}
@media (max-width: 760px) {
  .card-grid { grid-template-columns: 1fr; }
  .overlay { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; border: 0; }
  .nav-label { display: none; }
  .board-title { max-width: 170px; }
  .board-actions .btn { width: 30px; padding: 0; }
  .search-box { flex: 1 1 100%; }
  .search-box .input { width: 100%; }
  .filterbar { width: 100%; }
  .filterbar .select { flex: 1 1 40%; min-width: 0; }
  .report-filters .select { min-width: 0; flex: 1 1 140px; }
  .load-bar { display: none; }
  .list, .add-list, .list-placeholder { width: 270px; }
}
