:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #f0f2f5;
  --border: #e3e6eb;
  --text: #1b1f27;
  --muted: #69707d;
  --accent: #0f4c5c;
  --accent-soft: #e2eef0;
  --danger: #d33a2f;
  --danger-soft: #fdecea;
  --warn: #c76a00;
  --warn-soft: #fff3e0;
  --ok: #1e8a4c;
  --ok-soft: #e6f5ec;
  --p-urgent: #d33a2f;
  --p-high: #e07a00;
  --p-medium: #0f4c5c;
  --p-low: #8a919c;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a;
    --panel: #1a1d24;
    --panel-2: #22262f;
    --border: #2c313b;
    --text: #e8eaef;
    --muted: #9aa1ad;
    --accent: #5fb3c4;
    --accent-soft: #163a42;
    --danger: #ff6b5f;
    --danger-soft: #3a1f1d;
    --warn: #ffab40;
    --warn-soft: #3a2c17;
    --ok: #4cc883;
    --ok-soft: #1a3326;
    --p-urgent: #ff6b5f;
    --p-high: #ffab40;
    --p-medium: #5fb3c4;
    --p-low: #8a919c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Cambria, "Cambria Math", Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); }
.boot { padding: 40px; color: var(--muted); }

/* ---------- controls ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}
textarea { resize: vertical; min-height: 80px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[readonly], textarea[readonly] { background: var(--panel-2); }
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--border); background: var(--panel); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 550; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: default; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea { font-size: 14px; font-weight: 400; color: var(--text); }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.auth-card .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.auth-card p { margin: 0; color: var(--muted); }
.auth-card .btn { width: 100%; padding: 10px; }
.error { color: var(--danger); font-size: 13px; min-height: 1em; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--panel); border-right: 1px solid var(--border);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 0 6px; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; flex: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text); font-weight: 500;
}
.side nav a:hover { background: var(--panel-2); text-decoration: none; }
.side nav a.active { background: var(--accent-soft); color: var(--accent); }
.side nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.side nav .count { margin-left: auto; font-size: 12px; background: var(--danger); color: #fff; border-radius: 10px; padding: 0 7px; font-weight: 600; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid var(--border); }
.side .me .who-name { font-weight: 600; line-height: 1.2; }
.side .me small { color: var(--muted); }
main { padding: 26px 32px 60px; width: 100%; min-width: 0; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { margin: 4px 0 0; color: var(--muted); }

.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; flex: none; letter-spacing: .02em;
}
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px;
}
.stat:hover { border-color: var(--accent); }
.stat .num { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.stats.boxes { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.stats.boxes .stat { padding: 12px 14px; color: var(--text); font: inherit; }
.stats.boxes .num { font-size: 24px; }
.stat.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--accent-soft); }
.stat.info .num { color: var(--accent); }
.stat.good .num { color: var(--ok); }
.dash-list { max-height: 520px; overflow-y: auto; }
.card-head input[type=search] { padding: 6px 10px; font-size: 13px; }
.stat.bad .num { color: var(--danger); }
.stat.warn .num { color: var(--warn); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); gap: 8px; }
.card-head .muted { font-size: 13px; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.mini { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.mini:last-child { border-bottom: 0; }
.mini:hover { background: var(--panel-2); }
.mini .t { flex: 1; min-width: 0; }
.mini .t div:first-child { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .t div:last-child { font-size: 12px; color: var(--muted); }

table.people { width: 100%; border-collapse: collapse; }
table.people th, table.people td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--border); }
table.people th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.people td.n, table.people th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.people tr.click { cursor: pointer; }
table.people tr.click:hover td { background: var(--panel-2); }
table.people tr:last-child td { border-bottom: 0; }
.pcell { display: flex; align-items: center; gap: 10px; }
.red { color: var(--danger); font-weight: 650; }
.table-wrap { overflow-x: auto; }

/* ---------- task list ---------- */
.quick-add { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.quick-add input[name=title] { flex: 1 1 260px; }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer;
  font-weight: 550; color: var(--muted); white-space: nowrap; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1 1 200px; }
.filters .btn { padding: 7px 10px; }
.task-list { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list-foot { padding: 10px 16px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }
.row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) 170px 76px 100px 128px;
  align-items: center; gap: 12px; padding: 10px 14px 10px 12px;
  border-bottom: 1px solid var(--border); border-left: 3px solid transparent; cursor: pointer;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--panel-2); }
.row.pri-urgent { border-left-color: var(--p-urgent); }
.row.pri-high { border-left-color: var(--p-high); }
.row.is-done .title { text-decoration: line-through; color: var(--muted); }
.row .title { font-weight: 550; overflow-wrap: anywhere; }
.row .meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; }
.row .meta span { display: inline-flex; align-items: center; gap: 4px; }
.row .meta svg { width: 13px; height: 13px; }
.row .who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.row .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); background: transparent;
  cursor: pointer; display: grid; place-items: center; padding: 0; color: #fff;
}
.check:hover { border-color: var(--ok); }
.check.on { background: var(--ok); border-color: var(--ok); }
.check svg { width: 12px; height: 12px; }

.chip { font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; text-align: center; white-space: nowrap; }
.chip.p-urgent { background: var(--danger-soft); color: var(--p-urgent); }
.chip.p-high { background: var(--warn-soft); color: var(--p-high); }
.chip.p-medium { background: var(--accent-soft); color: var(--p-medium); }
.chip.p-low { background: var(--panel-2); color: var(--p-low); }
.due { font-size: 13px; white-space: nowrap; }
.due.overdue { color: var(--danger); font-weight: 650; }
.due.today { color: var(--warn); font-weight: 650; }
.due.soon { color: var(--warn); }
select.status { padding: 5px 8px; font-size: 13px; font-weight: 550; border-radius: 6px; }
select.status.s-done { color: var(--ok); }
select.status.s-blocked { color: var(--danger); }
select.status.s-in_progress { color: var(--accent); }
.loading { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 14, 22, .45); z-index: 50;
  display: flex; justify-content: center; align-items: flex-start; padding: 5vh 16px; overflow-y: auto;
}
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 760px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.narrow { max-width: 480px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.modal-head .crumb { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.x:hover { background: var(--panel-2); }
.modal-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.title-input { font-size: 19px; font-weight: 650; border-color: transparent; padding: 6px 8px; margin-left: -8px; width: calc(100% + 8px); }
.title-input:hover:not([readonly]) { border-color: var(--border); }
.title-input[readonly] { background: transparent; }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
div.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.details-locked {
  font-size: 14px; font-weight: 400; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  white-space: pre-wrap; overflow-wrap: anywhere; min-height: 44px;
}
.form-actions { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.note { font-size: 12px; color: var(--muted); background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.section { border-top: 1px solid var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.sub-list { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.sub-list .row { grid-template-columns: 26px minmax(0, 1fr) 150px 120px; padding: 8px 10px; }
.sub-add { display: grid; grid-template-columns: minmax(0, 1fr) 160px 110px 140px auto; gap: 8px; }
.reassign-form { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 8px; }
@media (max-width: 820px) { .reassign-form { grid-template-columns: 1fr; } }
.comment { display: flex; gap: 10px; }
.comment .bubble { flex: 1; background: var(--panel-2); border-radius: 10px; padding: 8px 12px; }
.comment .bubble .h { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.comment .bubble .h b { color: var(--text); }
.comment .bubble .b { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea { min-height: 44px; }
.activity { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.activity b { color: var(--text); font-weight: 600; }
.activity time { font-size: 12px; margin-left: 6px; }

/* ---------- people / settings ---------- */
.badge { font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 10px; background: var(--panel-2); color: var(--muted); }
.badge.director { background: var(--accent-soft); color: var(--accent); }
.badge.manager { background: var(--warn-soft); color: var(--warn); }
.badge.off { background: var(--danger-soft); color: var(--danger); }
.dl-group { display: inline-flex; gap: 0; }
.dl-group .btn { border-radius: 0; }
.dl-group .btn:first-child { border-radius: 8px 0 0 8px; }
.dl-group .btn:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.dl-group svg { width: 14px; height: 14px; }
.card-head .dl-group .btn { padding: 3px 8px; font-size: 12px; }
.modal-head .dl-group { margin-right: 4px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.import-table td, .import-table th { padding: 8px 12px; font-size: 13px; }
.import-table tr.imp-error td { background: var(--danger-soft); }
.import-table tr.imp-skip td { color: var(--muted); }
.import-table thead th { position: sticky; top: 0; background: var(--panel); }
.settings { display: flex; flex-direction: column; gap: 18px; max-width: 620px; }
.settings .card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.settings .card p { margin: 0; color: var(--muted); }
.form-col { display: flex; flex-direction: column; gap: 12px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 500; max-width: 360px; animation: pop .18s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
  .row { grid-template-columns: 26px minmax(0, 1fr) 140px 76px 90px 120px; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; gap: 10px; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand span { display: none; }
  .side nav { flex-direction: row; overflow-x: auto; order: 3; width: 100%; gap: 4px; }
  .side nav a { white-space: nowrap; padding: 6px 10px; }
  .side nav a svg { display: none; }
  .side .new-task { margin-left: auto; padding: 6px 12px; }
  .side .me { margin: 0; border: 0; padding: 0; }
  .side .me .who-text { display: none; }
  main { padding: 18px 16px 60px; }
  .row { grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "c t t" ". w w" ". p s"; row-gap: 6px; }
  .row > .check { grid-area: c; }
  .row > .main-col { grid-area: t; }
  .row > .who { grid-area: w; }
  .row > .pd { grid-area: p; display: flex; gap: 10px; align-items: center; }
  .row > select.status { grid-area: s; }
  .sub-list .row { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .fgrid { grid-template-columns: 1fr 1fr; }
  .sub-add { grid-template-columns: 1fr 1fr; }
  .sub-add input[name=title] { grid-column: 1 / -1; }
}
@media (min-width: 821px) {
  .row > .pd { display: contents; }
}
.locked-note { background: var(--ok-soft); color: var(--ok); }
.check:disabled { cursor: not-allowed; opacity: .85; }
select:disabled { cursor: not-allowed; opacity: .75; }
@media (prefers-color-scheme: dark) {
  .btn.primary { color: #0b1f24; }
}
img.avatar { object-fit: cover; background: var(--panel-2); display: inline-block; }
.avatar.xl { width: 88px; height: 88px; font-size: 30px; }
.avatar-editor { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* ---------- notifications & idle warning ---------- */
.brand .bell { margin-left: auto; position: relative; background: none; border: 0; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.brand .bell:hover { background: var(--panel-2); color: var(--text); }
.brand .bell svg { width: 20px; height: 20px; }
.bell-count { position: absolute; top: 0; right: 0; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }
.notif-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; max-height: 60vh; overflow-y: auto; }
.notif-row { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border); background: var(--panel); cursor: pointer; width: 100%; font: inherit; color: inherit; }
.notif-row:last-child { border-bottom: 0; }
.notif-row:hover { background: var(--panel-2); }
.notif-row.unread { background: var(--accent-soft); }
.notif-row.unread .nr-msg { font-weight: 600; }
.nr-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nr-msg { overflow-wrap: anywhere; }
.nr-when { font-size: 12px; color: var(--muted); }
.notif-pop { display: flex; align-items: flex-start; gap: 4px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); max-width: 380px; animation: pop .2s ease-out; }
.notif-pop-main { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: none; border: 0; padding: 12px 4px 12px 12px; cursor: pointer; font: inherit; color: inherit; flex: 1; }
.notif-pop .x { font-size: 20px; padding: 6px 10px; }
.idle-warn { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; background: var(--warn-soft); color: var(--text); border: 1px solid var(--warn); border-radius: 10px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); max-width: calc(100% - 32px); flex-wrap: wrap; }
@media (max-width: 820px) { .brand .bell { margin-left: 0; } }

.audit { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); background: var(--panel-2); border-radius: 8px; padding: 8px 12px; }
.audit b { color: var(--text); font-weight: 600; }

/* ---------- filter bars ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.filter-bar input[type=search] { flex: 1 1 220px; }
.filter-bar select { flex: 0 1 auto; max-width: 100%; }
.filter-count { font-size: 12px; margin-left: auto; white-space: nowrap; }
.scroll-table { max-height: 70vh; overflow: auto; }
.scroll-table thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }

/* ---------- Task board (sticky notes) ---------- */
.board-card { overflow: visible; }
.board-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.board-head h2 { display: flex; align-items: center; gap: 8px; }
.board-head h2 svg { width: 18px; height: 18px; color: var(--accent); }
.note-add { display: flex; gap: 10px; align-items: flex-start; padding: 0 16px 14px; flex-wrap: wrap; }
.note-add textarea { flex: 1 1 260px; min-height: 42px; resize: none; }
.note-colors { display: flex; gap: 6px; align-items: center; padding-top: 10px; }
.dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.dot.on { border-color: var(--text); }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; padding: 4px 16px 18px; }
.notes-empty { grid-column: 1 / -1; padding: 22px; border: 2px dashed var(--border); border-radius: 12px; }
.note-card {
  min-height: 130px; border-radius: 4px 4px 14px 4px; padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 8px 18px rgba(0,0,0,.06); color: #2b2b2b; position: relative;
  transition: transform .15s ease;
}
.note-card:nth-child(3n+1) { transform: rotate(-.6deg); }
.note-card:nth-child(3n+2) { transform: rotate(.5deg); }
.note-card:hover { transform: rotate(0) translateY(-2px); }
.note-text { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.4; }
.note-card.is-done { opacity: .6; }
.note-card.is-done .note-text { text-decoration: line-through; }
.note-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 26px; }
.note-tag { font-size: 11px; font-weight: 700; background: rgba(0,0,0,.08); padding: 2px 7px; border-radius: 10px; }
.note-tag.ok { background: rgba(30,138,76,.18); color: #145c33; }
.note-actions { display: flex; gap: 4px; margin-left: auto; }
.note-btn { border: 0; background: rgba(0,0,0,.08); color: #2b2b2b; border-radius: 6px; padding: 3px 9px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; }
.note-btn:hover { background: rgba(0,0,0,.16); }
.note-btn.ok { background: rgba(30,138,76,.2); color: #145c33; }
.note-btn.del { color: #a12a22; }
.note-edit { width: 100%; min-height: 80px; background: rgba(255,255,255,.6); border: 1px solid rgba(0,0,0,.15); color: #2b2b2b; font-size: 15px; }
.c-yellow { background: #fff3a8; } .c-green { background: #c9f2cf; } .c-blue { background: #cfe6ff; }
.c-pink { background: #ffd2e1; } .c-orange { background: #ffdcb8; } .c-purple { background: #e4d6ff; }
.notes-done { padding: 0 16px 6px; }
.notes-done summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0 10px; }
.notes-done .notes-grid { padding: 4px 0 14px; }
.board-layout { display: grid; gap: 18px; }
.board-layout.with-side { grid-template-columns: minmax(0, 1.7fr) minmax(400px, 1.15fr); align-items: start; }
table.people tr.sel td { background: var(--accent-soft); }
#board-date { padding: 6px 10px; }

/* ---------- phones & tablets ---------- */
@media (max-width: 1100px) {
  .board-layout.with-side { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .notes-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 4px 12px 14px; }
  .note-card { min-height: 110px; padding: 12px 12px 8px; }
  .note-add { padding: 0 12px 12px; }
  .board-head { padding: 12px; }
  .filter-bar { padding: 10px 12px; }
  .filter-bar select { flex: 1 1 140px; }
  .filter-count { margin-left: 0; }
  .page-head .form-actions { width: 100%; }
  .card-head { flex-wrap: wrap; }
  .card-head input[type=search] { max-width: none !important; flex: 1 1 100%; order: 3; }
  table.people th, table.people td { padding: 9px 10px; }
  .stats.boxes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal { max-width: 100%; }
  .fgrid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .stats.boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notes-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-color-scheme: dark) {
  .note-card { box-shadow: 0 2px 8px rgba(0,0,0,.5); }
}

.task-no { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 1px 6px; margin-right: 7px; vertical-align: 1px; font-variant-numeric: tabular-nums; }
.modal-head .task-no { font-size: 13px; margin: 0; }
