/* ==========================================================================
   Lumaque Tracker — styles
   Change the accent and status colours in the :root block below.
   ========================================================================== */
:root {
  --accent: #24382F;            /* deep forest green — the one brand colour */
  --accent-ink: #F6F3EE;        /* text on accent */
  --accent-soft: #E4EBE6;       /* tint used for hover / selection */

  --bg: #F6F3EE;                /* off-white ground */
  --surface: #FFFFFF;
  --surface-2: #F1EDE6;
  --border: #E3DDD3;
  --border-strong: #CFC7BB;
  --ink: #1F1F1C;
  --ink-2: #5C5953;
  --ink-3: #8C887F;
  --focus: #3B82F6;

  --s-not_started: #9CA3AF;     /* grey  */
  --s-in_progress: #F59E0B;     /* orange */
  --s-stuck: #DC2626;           /* red */
  --s-waiting: #3B82F6;         /* blue */
  --s-done: #16A34A;            /* green */

  --p-low: #94A3B8;
  --p-medium: #3B82F6;
  --p-high: #F97316;
  --p-critical: #DC2626;

  --danger: #DC2626;
  --warn: #D97706;
  --row-h: 40px;
  --radius: 8px;
  --shadow: 0 6px 24px rgba(30, 25, 15, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #7FB39A;
    --accent-ink: #0F1A15;
    --accent-soft: #1F2E27;
    --bg: #15171A;
    --surface: #1D2024;
    --surface-2: #262A2F;
    --border: #2F343B;
    --border-strong: #454B54;
    --ink: #ECEAE4;
    --ink-2: #B4B0A6;
    --ink-3: #7F7B72;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); line-height: 1.4; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.muted { color: var(--ink-2); }
.small { font-size: 12px; }
.error { color: var(--danger); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font-weight: 500; line-height: 1.2; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: 0.6; cursor: default; }
input[type="text"], input[type="password"], input[type="date"], input[type="search"], select, textarea {
  padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); width: 100%;
}
textarea { resize: vertical; min-height: 72px; }
label.field { display: block; margin-bottom: 10px; font-size: 12px; color: var(--ink-2); }
label.field > input, label.field > select, label.field > textarea { margin-top: 4px; font-size: 14px; color: var(--ink); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- sign-in ---------- */
.signin { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 16px; }
.signin .card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px 28px; text-align: center; box-shadow: var(--shadow); }
.signin .card h1 { font-size: 20px; margin: 12px 0 4px; }
.signin .card input { margin: 16px 0 10px; }
.signin .card .btn { width: 100%; justify-content: center; }
.signin .card .small { margin: 18px 0 0; }
.signin .card .small a { color: var(--ink-3); text-decoration: none; }
.signin .card.shake { animation: shake 0.4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; }
.logo.small { width: 26px; height: 26px; font-size: 14px; border-radius: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 15px; font-weight: 500; }
.chip:hover { background: var(--accent-soft); border-color: var(--accent); }
.footer { font-size: 11px; color: var(--ink-3); text-align: center; padding: 18px 12px 12px; }

/* ---------- avatars & pills ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.avatar.xl { width: 64px; height: 64px; font-size: 24px; }
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.external { border-radius: 8px; }
.avatar.empty { background: transparent; color: var(--ink-3); border: 1px dashed var(--border-strong); box-shadow: none; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 96px; height: 28px; padding: 0 10px; border-radius: 6px; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.s-not_started { background: var(--s-not_started); }
.pill.s-in_progress { background: var(--s-in_progress); }
.pill.s-stuck { background: var(--s-stuck); }
.pill.s-waiting { background: var(--s-waiting); }
.pill.s-done { background: var(--s-done); }
.pill.p-low { background: var(--p-low); }
.pill.p-medium { background: var(--p-medium); }
.pill.p-high { background: var(--p-high); }
.pill.p-critical { background: var(--p-critical); }
.pill.p-none { background: transparent; color: var(--ink-3); border: 1px dashed var(--border-strong); font-weight: 500; }
.pill.full { width: 100%; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot.p-low { background: var(--p-low); } .dot.p-medium { background: var(--p-medium); } .dot.p-high { background: var(--p-high); } .dot.p-critical { background: var(--p-critical); }
.date { white-space: nowrap; }
.date.overdue { color: var(--danger); font-weight: 600; }
.date.soon { color: var(--warn); font-weight: 600; }
.date.empty { color: var(--ink-3); }
.bubble { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 600; }
.bubble.has { background: var(--accent-soft); color: var(--accent); }
.tag { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100%; }
.sidebar { width: 220px; flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; font-weight: 700; font-size: 15px; }
nav { padding: 6px 10px; flex: 1; overflow: auto; }
nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 500; }
nav a:hover { background: var(--surface-2); }
nav a.active { background: var(--accent-soft); color: var(--accent); }
nav a .ico { width: 18px; height: 18px; flex: none; opacity: 0.85; }
nav .nav-label { padding: 12px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.sidebar-foot { border-top: 1px solid var(--border); padding: 10px; }
.sidebar-foot .me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.sidebar-foot .me:hover { background: var(--surface-2); }
.sidebar-foot .links { display: flex; gap: 12px; padding: 6px 8px 0; font-size: 12px; }
.sidebar-foot .links a { color: var(--ink-3); text-decoration: none; }
.sidebar-foot .links a:hover { color: var(--accent); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.topbar h2 { margin: 0 8px 0 0; font-size: 18px; }
.topbar .search { width: 220px; }
.topbar .person-filter { display: flex; gap: 4px; }
.topbar .person-filter .avatar { cursor: pointer; opacity: 0.55; transition: opacity 0.15s, transform 0.15s; }
.topbar .person-filter .avatar:hover { opacity: 0.9; }
.topbar .person-filter .avatar.on { opacity: 1; transform: scale(1.1); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.topbar select { width: auto; padding: 6px 28px 6px 10px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { margin: 0; }
.view { padding: 18px 20px 8px; flex: 1; }
.menu-btn { display: none; position: fixed; top: 10px; left: 10px; z-index: 30; width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.menu-btn span { display: block; width: 18px; height: 2px; background: var(--ink); }
.sidebar-backdrop { display: none; }

/* ---------- board table ---------- */
.group { margin-bottom: 26px; }
.group-head { display: flex; align-items: center; gap: 10px; padding: 4px 0 8px; }
.group-head .chev { width: 24px; height: 24px; border: none; background: transparent; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.group-head .chev:hover { background: var(--surface-2); }
.group-head .chev svg { transition: transform 0.15s; }
.group.collapsed .chev svg { transform: rotate(-90deg); }
.group-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.group-head .sub { color: var(--ink-2); font-size: 13px; }
.group-head .count { color: var(--ink-3); font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); border-left: 4px solid var(--group-color, var(--border)); }
.group.collapsed .table-wrap { display: none; }
table.board { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1150px; table-layout: fixed; }
table.board th, table.board td { height: var(--row-h); padding: 0 8px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.board th:last-child, table.board td:last-child { border-right: none; }
table.board tr:last-child td { border-bottom: none; }
table.board th { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); position: sticky; top: 0; cursor: pointer; user-select: none; }
table.board th:hover { color: var(--ink); }
table.board th .sort { font-size: 10px; margin-left: 4px; }
table.board td.c-name, table.board th.c-name { position: sticky; left: 0; z-index: 2; background: var(--surface); }
table.board th.c-name { z-index: 3; background: var(--surface-2); }
table.board tr:hover td { background: var(--surface-2); }
table.board td.c-name { padding-left: 4px; }
.c-handle { width: 26px; }
.c-name { width: 300px; }
.c-owner, .c-sec { width: 92px; }
.c-status, .c-priority { width: 120px; }
.c-date { width: 100px; }
.c-updates { width: 64px; text-align: center !important; }
.c-last { width: 118px; }
.c-menu { width: 36px; }
.name-cell { display: flex; align-items: center; gap: 6px; height: var(--row-h); }
.name-cell .handle { width: 14px; color: var(--ink-3); opacity: 0; cursor: grab; flex: none; }
tr:hover .name-cell .handle { opacity: 1; }
.name-cell .name-text { flex: 0 1 auto; min-width: 55%; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.name-cell .name-text:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--border-strong); }
.name-cell .open-btn { opacity: 0; font-size: 11px; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); flex: none; }
tr:hover .name-cell .open-btn { opacity: 1; }
.name-cell .remark-hint { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 0; }
td.cell { cursor: pointer; }
td.cell:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
td.cell .pill { width: 100%; }
td.cell input.inline { width: 100%; padding: 4px 6px; border-radius: 4px; }
.owners { display: flex; align-items: center; gap: 4px; }
tr.dragging { opacity: 0.4; }
tr.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
tr.drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }
tr.add-row td { background: var(--surface); }
tr.add-row input { width: 100%; border: none; background: transparent; padding: 6px 4px; color: var(--ink); }
tr.add-row input::placeholder { color: var(--ink-3); }
.menu-dots { border: none; background: transparent; color: var(--ink-3); padding: 4px 6px; border-radius: 4px; font-weight: 700; letter-spacing: 1px; }
.menu-dots:hover { background: var(--surface-2); color: var(--ink); }
.group.drop-target .table-wrap { box-shadow: 0 0 0 2px var(--accent); }
.empty { color: var(--ink-3); text-align: center; padding: 40px 12px; }
.empty h3 { margin: 0 0 6px; color: var(--ink-2); font-weight: 600; }

/* ---------- popover ---------- */
.popover { position: fixed; z-index: 50; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 160px; max-height: 320px; overflow: auto; }
.popover .opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: none; background: transparent; border-radius: 6px; text-align: left; }
.popover .opt:hover, .popover .opt:focus { background: var(--surface-2); }
.popover .opt .pill { width: 100%; }
.popover .sep { height: 1px; background: var(--border); margin: 4px 0; }
.popover .opt.danger { color: var(--danger); }
.popover input[type="date"] { width: 100%; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; animation: rise 0.2s; }
.toast button { background: transparent; border: none; color: var(--accent); font-weight: 600; padding: 0; }
@media (prefers-color-scheme: dark) { .toast button { color: #B7E1CB; } }
.toast.err { background: var(--danger); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- item panel ---------- */
.panel-backdrop { position: fixed; inset: 0; background: rgba(20, 18, 12, 0.25); z-index: 40; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--border); z-index: 45; overflow: auto; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide 0.18s; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 10px; }
.panel-head .crumb { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.panel-head h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.panel-head h2[contenteditable] { outline: none; border-radius: 4px; padding: 2px 4px; margin-left: -4px; }
.panel-head h2[contenteditable]:hover { background: var(--surface-2); }
.panel-head h2[contenteditable]:focus { box-shadow: 0 0 0 2px var(--focus); }
.panel .close { border: none; background: transparent; font-size: 20px; color: var(--ink-3); padding: 4px 8px; border-radius: 6px; margin-left: auto; }
.panel .close:hover { background: var(--surface-2); color: var(--ink); }
.panel-body { padding: 0 20px 20px; }
.props { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; align-items: center; margin: 10px 0 16px; }
.props .k { font-size: 12px; color: var(--ink-2); }
.props .v { min-height: 30px; display: flex; align-items: center; }
.props .v .pill { min-width: 128px; cursor: pointer; }
.props .v .pick { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 2px 6px; border-radius: 6px; }
.props .v .pick:hover { background: var(--surface-2); }
.props .v input[type="date"] { width: auto; }
.remarks { width: 100%; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0 12px; }
.tabs button { border: none; background: transparent; padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--ink-2); font-weight: 500; margin-bottom: -1px; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.compose { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.compose textarea { min-height: 64px; }
.compose .hint { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.update { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.update .who { font-weight: 600; font-size: 13px; }
.update .when { color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.update .body { margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.act { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.act .when { color: var(--ink-3); font-size: 12px; }
.act .chg { color: var(--ink-2); }
.act .chg b { color: var(--ink); font-weight: 600; }

/* ---------- my tasks ---------- */
.section { margin-bottom: 22px; }
.section h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.section h3 .count { background: var(--surface-2); color: var(--ink-2); border-radius: 10px; padding: 0 8px; font-size: 11px; letter-spacing: 0; }
.section h3.danger { color: var(--danger); }
.list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.list-row { display: grid; grid-template-columns: 1fr 128px 110px auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); min-height: var(--row-h); }
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--surface-2); }
.list-row .crumb { font-size: 11px; color: var(--ink-3); }
.list-row .title { font-weight: 500; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .title:hover { color: var(--accent); }
.list-row .avatar { margin-right: 2px; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.kcol { background: var(--surface-2); border-radius: 10px; padding: 8px; min-height: 200px; border: 2px solid transparent; }
.kcol.over { border-color: var(--accent); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 600; font-size: 13px; }
.kcol-head .sw { width: 10px; height: 10px; border-radius: 3px; }
.kcol-head .n { color: var(--ink-3); font-weight: 500; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.kcard:hover { border-color: var(--border-strong); }
.kcard.dragging { opacity: 0.4; }
.kcard .t { font-weight: 500; margin-bottom: 8px; cursor: pointer; }
.kcard .t:hover { color: var(--accent); }
.kcard .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.kcard .grp { color: var(--ink-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.kcard .meta .right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ---------- timeline ---------- */
.tl-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.tl-toolbar select { width: auto; padding-right: 28px; }
.tl-toolbar .seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.tl-toolbar .seg button { border: none; background: var(--surface); padding: 6px 12px; }
.tl-toolbar .seg button.on { background: var(--accent); color: var(--accent-ink); }
.tl { display: flex; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.tl-left { width: 240px; flex: none; border-right: 1px solid var(--border); background: var(--surface); }
.tl-right { flex: 1; overflow-x: auto; position: relative; }
.tl-scroll { position: relative; }
.tl-head { height: 44px; border-bottom: 1px solid var(--border); position: relative; background: var(--surface-2); }
.tl-left .tl-head { display: flex; align-items: center; padding: 0 12px; font-weight: 600; font-size: 12px; color: var(--ink-2); }
.tl-col { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); font-size: 11px; color: var(--ink-2); padding: 4px 6px; white-space: nowrap; overflow: hidden; }
.tl-col.month { font-weight: 600; }
.tl-row { height: 32px; border-bottom: 1px solid var(--border); position: relative; }
.tl-row.grp { background: var(--surface-2); font-weight: 600; font-size: 13px; }
.tl-left .tl-row { display: flex; align-items: center; padding: 0 12px; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.tl-left .tl-row .chev { border: none; background: transparent; padding: 0; width: 18px; color: var(--ink-3); }
.tl-left .tl-row .lbl { overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.tl-left .tl-row .lbl:hover { color: var(--accent); }
.tl-bar { position: absolute; top: 7px; height: 18px; border-radius: 4px; color: #fff; font-size: 11px; line-height: 18px; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; opacity: 0.92; }
.tl-bar:hover { opacity: 1; box-shadow: 0 0 0 2px var(--accent-soft); }
.tl-grid { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); pointer-events: none; }
.tl-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--danger); pointer-events: none; z-index: 2; }
.tl-today::before { content: "today"; position: absolute; top: 24px; left: 3px; font-size: 10px; color: var(--danger); font-weight: 700; }
.tl-mark { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--mark, var(--accent)); pointer-events: none; z-index: 1; }
.tl-mark::before { content: attr(data-label); position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 600; color: var(--mark, var(--accent)); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.tl-unsched { margin-top: 14px; }
.tl-unsched h4 { margin: 0 0 6px; font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
.tl-unsched .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-unsched .tags button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.tl-unsched .tags button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; text-align: left; cursor: pointer; }
.tile:hover { border-color: var(--accent); }
.tile .n { font-size: 28px; font-weight: 700; line-height: 1.1; }
.tile .l { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.tile.danger .n { color: var(--danger); }
.tile.warn .n { color: var(--warn); }
.tile.good .n { color: var(--s-done); }
.dash-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; }
.card-box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.card-box h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); }
.mbar { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.mbar .who { display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; }
.mbar .bar { height: 14px; border-radius: 4px; background: var(--surface-2); display: flex; overflow: hidden; }
.mbar .bar span { height: 100%; }
.mbar .tot { text-align: right; color: var(--ink-2); }
.gbar { margin-bottom: 10px; font-size: 13px; }
.gbar .lbl { display: flex; justify-content: space-between; margin-bottom: 4px; }
.gbar .lbl .r { color: var(--ink-2); }
.gbar .bar { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.gbar .bar span { display: block; height: 100%; background: var(--s-done); }
.feed .item { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.feed .item:first-child { border-top: none; }
.feed .item .t { color: var(--ink-3); font-size: 12px; }
.feed .item .t a { color: var(--accent); text-decoration: none; cursor: pointer; }
.feed .item .b { white-space: pre-wrap; word-break: break-word; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--ink-2); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; background: var(--c); vertical-align: -1px; }

/* ---------- profile & admin ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-head h2 { margin: 0; }
.note { font-size: 12px; color: var(--ink-3); }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.admin-tabs button { border: none; background: transparent; padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--ink-2); font-weight: 500; margin-bottom: -1px; }
.admin-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.admin-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.admin-row:last-child { border-bottom: none; }
.admin-row.inactive { opacity: 0.55; }
.admin-row input[type="text"] { width: 150px; }
.admin-row input.short { width: 60px; }
.admin-row input[type="color"] { width: 34px; height: 30px; padding: 0 2px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }
.admin-row input[type="date"] { width: 150px; }
.admin-row .spacer { flex: 1; }
.admin-row .order { display: inline-flex; gap: 2px; }
.admin-row .order button { padding: 2px 6px; }
.admin-section { margin-bottom: 26px; }
.admin-section h3 { margin: 0 0 8px; font-size: 15px; }
.admin-section .btn-row { margin-top: 10px; }
.card-box.narrow { max-width: 480px; }
pre.cmds { background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 8px; overflow: auto; font-size: 12px; line-height: 1.6; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 35; transform: translateX(-100%); transition: transform 0.18s; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 34; }
  .menu-btn { display: flex; }
  .topbar { padding-left: 60px; }
  .view { padding: 12px; }
  .dash-grid { grid-template-columns: 1fr; }
  .c-name { width: 220px; }
  .name-cell .remark-hint { display: none; }
  .list-row { grid-template-columns: 1fr auto; }
  .list-row .date, .list-row .quick { grid-column: span 1; }
  .tl-left { width: 150px; }
}
@media (max-width: 560px) {
  .topbar .search { width: 100%; }
  .kanban { grid-template-columns: repeat(5, 240px); }
}
