/* ============ VVT Hub design system ============ */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --muted: #667085;
  --faint: #98a2b3;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --ok: #079455;
  --ok-soft: #ecfdf3;
  --warn: #dc6803;
  --warn-soft: #fffaeb;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 3px rgba(16,24,40,.1), 0 1px 2px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px -4px rgba(16,24,40,.18), 0 4px 8px -2px rgba(16,24,40,.06);
  --sidebar-bg: #11131f;
  --sidebar-border: #232639;
  --sidebar-text: #9aa1b9;
  --sidebar-active: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::placeholder { color: var(--faint); }

/* ============ layout ============ */
#app { display: flex; height: 100vh; }
#sidebar {
  width: 232px; flex: 0 0 232px; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 6px;
}
#main { flex: 1; overflow-y: auto; min-width: 0; }
#view { padding: 26px 30px 60px; max-width: 1340px; margin: 0 auto; }

.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-weight: 800; font-size: 17px; display: flex; align-items: center; justify-content: center;
}
.brand-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--sidebar-text); }

#nav, #nav-bottom { display: flex; flex-direction: column; gap: 2px; }
#nav { flex: 0 0 auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--sidebar-text); cursor: pointer; font-weight: 500; font-size: 13.5px;
  border: none; background: none; width: 100%; text-align: left; font-family: inherit;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #e3e6f0; }
.nav-item.active { background: rgba(99,102,241,.22); color: var(--sidebar-active); }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.sync-pill {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; padding: 7px 10px;
  border-radius: 8px; background: rgba(255,255,255,.05); cursor: default;
}
.sync-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; flex: 0 0 8px; }
.sync-pill.ok .dot { background: #22c55e; }
.sync-pill.syncing .dot { background: #f59e0b; animation: pulse 1s infinite; }
.sync-pill.error .dot { background: #ef4444; }
@keyframes pulse { 50% { opacity: .35; } }

/* ============ view header & toolbar ============ */
.view-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.view-title { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.2px; }
.view-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #f9fafb; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: #fecdca; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f2f4f7; color: var(--text); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-icon { padding: 6px; line-height: 0; }
.btn svg { width: 15px; height: 15px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ============ inputs ============ */
.input, .select, .textarea {
  padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text); outline: none; min-width: 0;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.13); }
.textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.select { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.search-input { min-width: 200px; }

/* ============ cards & KPIs ============ */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }
.card-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 0 0 12px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin-top: 3px; }
.kpi-hint { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
/* let cards shrink with their track instead of forcing min-content width
   (otherwise narrow viewports get horizontal page scroll) */
.grid-2 > *, .grid-3 > *, .settings-grid > * { min-width: 0; }

/* ============ tables ============ */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.table { border-collapse: collapse; width: 100%; font-size: 13px; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
  padding: 9px 12px; border-bottom: 1px solid var(--border); background: #fafbfc; white-space: nowrap; position: relative;
}
.table td { padding: 8px 12px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbff; }
.table td.editable { cursor: pointer; }
.table td.editable:hover { box-shadow: inset 0 0 0 1px var(--border-strong); border-radius: 4px; }
.table .row-click { cursor: pointer; }
.cell-input { width: 100%; border: 1px solid var(--accent); border-radius: 4px; padding: 4px 6px; font: inherit; outline: none; }
.th-x { position: absolute; top: 2px; right: 2px; font-size: 10px; color: var(--faint); cursor: pointer; padding: 2px 4px; border-radius: 4px; display: none; }
.table th:hover .th-x { display: inline; }
.th-x:hover { background: var(--danger-soft); color: var(--danger); }

/* ============ chips & badges ============ */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap; line-height: 1.4;
}
.chip .chip-dot { width: 6px; height: 6px; border-radius: 50%; }
.chip-x { cursor: pointer; opacity: .55; font-weight: 700; margin-left: 2px; }
.chip-x:hover { opacity: 1; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #eef1f5; color: var(--muted); font-size: 11px; font-weight: 700; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; margin: 1px 3px 1px 0; }

/* ============ kanban ============ */
.kanban { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 14px; }
.kanban-col { flex: 0 0 260px; background: #eef0f4; border-radius: var(--radius); padding: 10px; min-height: 120px; }
.kanban-col.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.kanban-col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-weight: 700; font-size: 13px; }
.kanban-col-head .count { margin-left: auto; }
.kanban-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  padding: 10px 12px; margin-bottom: 8px; cursor: grab; font-size: 12.5px;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .45; }
.kanban-card .kc-title { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.kanban-card .kc-meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }

/* ============ progress ============ */
.progress { height: 5px; border-radius: 999px; background: #e8eaf0; overflow: hidden; min-width: 50px; }
.progress-bar { height: 100%; border-radius: 999px; background: var(--accent); transition: width .25s; }
.progress-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ============ modal & toast ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16,18,28,.55); display: flex; align-items: flex-start;
  justify-content: center; padding: 6vh 16px 16px; z-index: 100; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  animation: modal-in .15s ease-out;
}
.modal.wide { max-width: 760px; }
@keyframes modal-in { from { transform: translateY(10px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close { border: none; background: none; font-size: 20px; color: var(--faint); cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.modal-close:hover { background: #f2f4f7; color: var(--text); }
.modal-body { padding: 16px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.modal-foot .left { margin-right: auto; }
#toast-zone { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1f2433; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: modal-in .18s ease-out;
}
.toast.error { background: var(--danger); }

/* ============ empty state ============ */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .es-icon { font-size: 34px; margin-bottom: 8px; }
.empty-state h4 { margin: 0 0 4px; color: var(--text); }
.empty-state p { margin: 0 0 14px; font-size: 13px; }

/* ============ SOP hub ============ */
.sops-layout { display: flex; gap: 16px; align-items: flex-start; }
.sops-side { flex: 0 0 264px; position: sticky; top: 0; }
.sops-main { flex: 1; min-width: 0; }
.doc-list { display: flex; flex-direction: column; gap: 1px; }
.doc-cat { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); padding: 12px 10px 4px; }
.doc-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text);
}
.doc-item:hover { background: #f2f4f7; }
.doc-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.doc-item .doc-pin { margin-left: auto; font-size: 11px; }
.editor-title {
  width: 100%; border: none; outline: none; font-size: 24px; font-weight: 800; font-family: inherit;
  padding: 4px 0; background: transparent; color: var(--text); letter-spacing: -.3px;
}
.editor-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.editor-meta .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.md-editor {
  width: 100%; min-height: 56vh; border: none; outline: none; resize: vertical; font-family: var(--mono);
  font-size: 13px; line-height: 1.7; color: var(--text); background: transparent;
}
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 5px 12px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; font-family: inherit; }
.seg button.active { background: var(--accent); color: #fff; }

/* ============ login screen ============ */
.login-screen { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #11131f, #1e2235); }
.login-card { width: 100%; max-width: 360px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 26px 24px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-title { font-weight: 800; font-size: 18px; letter-spacing: .2px; }
.login-sub { color: var(--muted); font-size: 12.5px; }
.login-card .input { width: 100%; }
.login-err { color: var(--danger); font-size: 12.5px; margin-top: 10px; min-height: 16px; }
.login-foot { color: var(--faint); font-size: 11.5px; margin-top: 14px; text-align: center; }

/* ============ markdown body ============ */
.markdown-body { font-size: 14px; line-height: 1.7; max-width: 760px; }
.markdown-body h1 { font-size: 22px; margin: 18px 0 8px; letter-spacing: -.3px; }
.markdown-body h2 { font-size: 18px; margin: 18px 0 6px; }
.markdown-body h3 { font-size: 15px; margin: 14px 0 4px; }
.markdown-body p { margin: 8px 0; }
.markdown-body ul, .markdown-body ol { margin: 8px 0; padding-left: 24px; }
.markdown-body li { margin: 3px 0; }
.markdown-body li.md-check { list-style: none; margin-left: -20px; }
.markdown-body li.md-check input { margin-right: 7px; accent-color: var(--accent); cursor: pointer; }
.markdown-body code { background: #f1f3f7; border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-family: var(--mono); font-size: 12px; }
.markdown-body pre { background: #14161f; color: #e6e8f0; padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.markdown-body pre code { background: none; border: none; color: inherit; padding: 0; }
.markdown-body blockquote { margin: 8px 0; padding: 6px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; color: #3730a3; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.markdown-body a { font-weight: 600; }

/* ============ bar chart ============ */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 18px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, #6366f1, #4f46e5); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bar-val { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.bar-label { font-size: 11px; color: var(--faint); font-weight: 600; }

/* ============ misc lists ============ */
.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid #f0f2f5; font-size: 13px; }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .grow > div { overflow: hidden; text-overflow: ellipsis; }
.list-row .muted { color: var(--muted); font-size: 12px; }
.overdue { color: var(--danger); font-weight: 700; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.settings-grid .full { grid-column: 1 / -1; }
.row-line { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.color-swatch { width: 26px; height: 26px; padding: 0; border: 1px solid var(--border-strong); border-radius: 6px; cursor: pointer; background: none; }
pre.code-snippet { background: #14161f; color: #d2d7e5; font-family: var(--mono); font-size: 11.5px; padding: 12px; border-radius: 8px; overflow-x: auto; user-select: all; }

/* ============ responsive ============ */
@media (max-width: 860px) {
  #app { flex-direction: column; }
  #sidebar { width: 100%; flex: 0 0 auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 4px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; } .brand-text { display: none; }
  #nav { flex-direction: row; }
  .sidebar-footer { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .sync-pill .sync-label { display: none; }
  .nav-item span:not(.nav-ico) { display: none; }
  .nav-item { padding: 9px; }
  #view { padding: 16px 14px 50px; }
  .form-grid, .grid-2, .grid-3, .settings-grid { grid-template-columns: 1fr; }
  .sops-layout { flex-direction: column; }
  .sops-side { position: static; flex: 1 1 auto; width: 100%; }
}

/* ============================================================
   SPEC2 additions — Goals rings · Calendar · Insight bars
   (appended block; existing rules above untouched)
   ============================================================ */

/* ---- goal rings (dashboard "This month's goals") ---- */
.goal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.goal-card {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--panel);
}
.ring { width: 92px; height: 92px; flex: 0 0 92px; position: relative; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #eef0f4; }
.ring-fill { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.ring-fill.ok { stroke: var(--ok); }
.ring-center {
  position: absolute; inset: 0; transform: rotate(90deg);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: var(--text);
}
.goal-meta { min-width: 0; }
.goal-meta .goal-name { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.goal-meta .goal-value { font-size: 20px; font-weight: 800; letter-spacing: -.3px; margin-top: 2px; }
.goal-meta .goal-of { font-size: 12px; color: var(--faint); }
.goal-pace { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.goal-pace.ok { color: var(--ok); font-weight: 700; }

/* ---- calendar ---- */
.cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-toolbar .cal-month { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.cal-toolbar .spacer { flex: 1; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-dow > div { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .4px; text-align: center; padding: 2px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  min-height: 92px; max-height: 150px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--panel); padding: 5px 6px; display: flex; flex-direction: column; gap: 3px;
}
.cal-cell.other-month { background: #fafbfc; opacity: .6; }
.cal-cell.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-daynum { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.cal-cell.today .cal-daynum { color: var(--accent); }
.cal-event {
  font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 5px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4;
  border-left: 3px solid var(--accent);
}
.cal-event:hover { filter: brightness(.97); }
.cal-more { font-size: 10.5px; font-weight: 700; color: var(--muted); cursor: pointer; padding: 1px 4px; }
.cal-more:hover { color: var(--accent); }

/* ---- insight bars (dashboard "Upsell & client insights") ---- */
.insight-bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-row .lbl { flex: 0 0 120px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bar-row .track { flex: 1; height: 8px; border-radius: 999px; background: #eef0f4; overflow: hidden; min-width: 40px; }
.bar-row .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #4f46e5); min-width: 2px; transition: width .3s; }
.bar-row .val { flex: 0 0 auto; color: var(--muted); font-weight: 700; white-space: nowrap; }

@media (max-width: 860px) {
  .goal-grid { grid-template-columns: 1fr; }
  .cal-dow > div { font-size: 9.5px; }
  .cal-cell { min-height: 68px; padding: 3px 4px; }
  .cal-daynum { font-size: 10.5px; }
  .cal-event { font-size: 9.5px; padding: 1px 4px; }
  .bar-row .lbl { flex-basis: 84px; }
}

/* ============================================================
   SPEC3 additions — Quick Search · Sidebar search button
   (appended block; existing rules above untouched)
   ============================================================ */

/* ---- sidebar "Search…" button (under .brand) ---- */
.sidebar-search {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; margin: 0 0 8px; border-radius: 8px;
  border: 1px solid var(--sidebar-border); background: rgba(255,255,255,.05);
  color: var(--sidebar-text); cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 500; text-align: left;
}
.sidebar-search:hover { background: rgba(255,255,255,.1); color: #e3e6f0; }
.sidebar-search .ss-mag { font-size: 15px; line-height: 1; flex: 0 0 auto; }
.sidebar-search .ss-label { flex: 1; min-width: 0; }
.sidebar-search .ss-kbd {
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--sidebar-text);
  background: rgba(255,255,255,.08); border: 1px solid var(--sidebar-border);
  border-radius: 5px; padding: 1px 6px; flex: 0 0 auto;
}

/* ---- quick search overlay (command palette) ---- */
.qs-overlay {
  position: fixed; inset: 0; z-index: 250; background: rgba(16,18,28,.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px; overflow-y: auto;
}
.qs-panel {
  width: 100%; max-width: 560px; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: modal-in .15s ease-out;
}
.qs-inputwrap {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.qs-mag { font-size: 18px; color: var(--faint); line-height: 1; flex: 0 0 auto; }
.qs-input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 16px; color: var(--text);
}
.qs-esc {
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--faint);
  background: #f2f4f7; border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; flex: 0 0 auto;
}
.qs-list { max-height: 56vh; overflow-y: auto; padding: 6px; }
.qs-hint { padding: 22px 14px; text-align: center; color: var(--faint); font-size: 13px; }
.qs-group {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  color: var(--faint); padding: 10px 10px 4px;
}
.qs-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  cursor: pointer;
}
.qs-row.active { background: var(--accent-soft); }
.qs-type {
  flex: 0 0 auto; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); background: #f2f4f7; border-radius: 5px; padding: 2px 6px; min-width: 46px; text-align: center;
}
.qs-type-job { color: #4338ca; background: var(--accent-soft); }
.qs-type-client { color: #027a48; background: var(--ok-soft); }
.qs-type-sop { color: #b54708; background: var(--warn-soft); }
.qs-text { flex: 1; min-width: 0; }
.qs-label { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-row .chip { flex: 0 0 auto; }

@media (max-width: 860px) {
  .sidebar-search { width: auto; margin: 0 4px 0 0; padding: 8px; flex: 0 0 auto; }
  .sidebar-search .ss-label, .sidebar-search .ss-kbd { display: none; }
}
@media (max-width: 480px) {
  .qs-overlay { padding: 8vh 10px 10px; }
  .qs-input { font-size: 15px; }
}
