/* ============================================================
   Command Center — Claude-inspired design system
   ivory paper · clay accent · serif display + grotesque body
   ============================================================ */
:root {
  --ivory:      #F0EEE6;   /* page */
  --paper:      #FAF9F5;   /* cards / raised surfaces */
  --paper-2:    #F4F2EA;   /* subtle fills */
  --ink:        #141413;   /* primary text */
  --ink-soft:   #46443E;   /* secondary text */
  --muted:      #77746C;   /* captions */
  --line:       #E2DED2;   /* hairlines */
  --line-soft:  #EBE8DE;
  --clay:       #D97757;   /* the accent */
  --clay-deep:  #BF5B3C;   /* accent hover/press */
  --clay-wash:  #F6E7DF;   /* accent tint bg */
  --slate:      #262620;   /* dark surface (sidebar) */
  --slate-soft: #6B6960;

  --ctx-personal:  #6B8E7B;
  --ctx-marketing: #C08A3E;
  --ctx-autodrive: #5B7C9E;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20,20,19,.04), 0 8px 24px -12px rgba(20,20,19,.14);
  --shadow-lift: 0 2px 4px rgba(20,20,19,.05), 0 18px 40px -18px rgba(20,20,19,.22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.01em; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 26px;
  padding: 26px 20px;
  background: var(--slate);
  color: #E9E6DD;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background:
    radial-gradient(circle at 30% 30%, #E8926E, var(--clay) 60%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--slate);
  transform: rotate(45deg);
}
.brand-name { font-family: var(--serif); font-size: 1.18rem; line-height: 1.05; letter-spacing: -.02em; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: #C9C5B9; text-decoration: none; font-size: .92rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.is-active { background: var(--clay); color: #fff; }
.nav-link.is-disabled { color: var(--slate-soft); cursor: default; }
.soon {
  margin-left: auto; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--slate-soft); border: 1px solid #3a3a32; border-radius: 999px; padding: 1px 7px;
}
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: 0 0 20px; }
.nav-icon svg { width: 18px; height: 18px; display: block; }

.sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 16px; border-top: 1px solid #35352d; font-size: .84rem; }
.who { color: #C9C5B9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout { color: var(--slate-soft); text-decoration: none; }
.logout:hover { color: var(--clay); }

/* ---------- Main ---------- */
.main { padding: 44px clamp(24px, 5vw, 64px) 80px; max-width: 1000px; }
/* Task views need room: list/calendar/dashboard get a bump, board fans out widest. */
.main--wide { max-width: 1320px; }
.main--board { max-width: min(1760px, 96vw); }
/* Full-bleed mini-apps (Licenses/LTD tile grid) — lifts the 1000px .main cap. */
.main--full { max-width: none; }
.eyebrow { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.page-head { margin-bottom: 30px; }
.greeting { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.08; letter-spacing: -.02em; margin: 6px 0 8px; }
.greeting em { font-style: italic; color: var(--clay-deep); }
.subline { color: var(--ink-soft); font-size: 1.02rem; max-width: 52ch; }

/* ---------- Cards grid (overview) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: inherit; position: relative;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s;
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: #D9D3C4; }
.card.is-soon { opacity: .62; }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-glyph { width: 34px; height: 34px; border-radius: 9px; background: var(--clay-wash); color: var(--clay-deep);
  display: grid; place-items: center; font-family: var(--serif); font-size: 1.1rem; }
.card-metric { font-family: var(--serif); font-size: 2.1rem; line-height: 1; letter-spacing: -.02em; }
.card-metric small { font-family: var(--sans); font-size: .8rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.card-title { font-size: 1.02rem; font-weight: 600; }
.card-sub { color: var(--muted); font-size: .88rem; }

/* ---------- Task app ---------- */
.toolbar { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.h-page { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -.02em; }
.count-pill { font-size: .82rem; color: var(--muted); }

.view-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.view-tab { padding: 9px 14px; font-size: .9rem; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.view-tab:hover { color: var(--ink); }
.view-tab.is-active { color: var(--clay-deep); border-bottom-color: var(--clay); font-weight: 600; }

.add-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 26px; }
.add-row { display: grid; grid-template-columns: 1fr 120px 120px 116px 140px 74px auto; gap: 10px; align-items: end; }
@media (max-width: 860px) { .add-row { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 560px) { .add-row { grid-template-columns: 1fr 1fr; } }

.admin-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.admin-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-sm); }
.admin-row input[type=color] { width: 30px; height: 30px; padding: 2px; flex: 0 0 auto; }
.admin-row input:not([type=color]) { flex: 0 1 220px; width: auto; }

.tag-admin-row{display:flex;align-items:center;gap:8px}
.tag-drag{cursor:grab;color:var(--muted);user-select:none}
.tag-swatches{display:flex;gap:4px}
.tag-swatch{width:16px;height:16px;border-radius:50%;border:1px solid var(--line);cursor:pointer;padding:0}
.tag-admin-row.dragging{opacity:.5}

/* People admin: each member is a vertical card (header + permission summary + inline edit). */
#users-admin .admin-row { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 14px; }
.admin-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-row-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.admin-row-perms { font-size: .82rem; color: var(--muted); }
.perm-sum b { color: var(--ink-soft); font-weight: 600; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 12px 0; }
.perm-block { display: flex; flex-direction: column; gap: 8px; }
.perm-h { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.perm-all { display: inline-flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0;
  font-size: .78rem; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
.perm-all input { width: 15px; height: 15px; accent-color: var(--clay); cursor: pointer; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chips.is-off { opacity: .4; pointer-events: none; }
.perm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; cursor: pointer;
  background: var(--ivory); border: 1px solid var(--line); border-radius: 999px; font-size: .84rem;
  color: var(--ink-soft); text-transform: capitalize; transition: border-color .12s, background .12s; }
#users-admin .perm-chip input { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--clay); cursor: pointer; margin: 0; }
.perm-chip:has(input:checked) { border-color: var(--clay); background: var(--clay-wash); color: var(--clay-deep); }
.perm-edit { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 2px; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: .74rem; color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
label.field-label { display: flex; flex-direction: column; gap: 5px; font-size: .74rem; color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase; font-weight: 600; margin-top: 10px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not([type=file]):not(.modal-title), select, textarea {
  font-family: var(--sans); font-size: .95rem; color: var(--ink);
  padding: 9px 11px; background: var(--ivory); border: 1px solid var(--line);
  border-radius: var(--radius-sm); width: 100%; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-wash); }
label.checkfield { flex-direction: column; align-items: flex-start; }
label.checkfield input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--clay); margin-top: 4px; cursor: pointer; }
input::placeholder { color: #A8A499; }

.btn { font-family: var(--sans); font-size: .92rem; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm); padding: 9px 16px; border: 1px solid transparent; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { background: var(--clay-deep); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--clay); color: var(--clay-deep); }
.btn-self { align-self: end; }

.section-label { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-label .eyebrow { white-space: nowrap; }
.section-label::after { content: ""; height: 1px; background: var(--line-soft); flex: 1; }

.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 13px 16px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.task.is-done { background: transparent; box-shadow: none; border-color: var(--line-soft); }
.task.is-done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }

.check { width: 22px; height: 22px; border: 1.6px solid #CFC9BB; border-radius: 999px; background: var(--ivory);
  cursor: pointer; display: grid; place-items: center; padding: 0; transition: border-color .15s, background .15s; }
.check:hover { border-color: var(--clay); }
.check.is-done { background: var(--clay); border-color: var(--clay); color: #fff; }
.check svg { width: 12px; height: 12px; }

.task-body { min-width: 0; }
.task-title { font-weight: 500; font-size: .98rem; }
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.tag { font-size: .7rem; font-weight: 600; letter-spacing: .03em; padding: 2px 9px; border-radius: 999px;
  text-transform: capitalize; background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--line); }
.tag.ctx-personal  { color: var(--ctx-personal);  border-color: color-mix(in srgb, var(--ctx-personal) 35%, var(--line)); }
.tag.ctx-marketing { color: var(--ctx-marketing); border-color: color-mix(in srgb, var(--ctx-marketing) 35%, var(--line)); }
.tag.ctx-autodrive { color: var(--ctx-autodrive); border-color: color-mix(in srgb, var(--ctx-autodrive) 35%, var(--line)); }
.tag.pri-high, .tag.pri-urgent { background: var(--clay-wash); color: var(--clay-deep); border-color: transparent; }
.tag--custom { border-color: transparent; color: var(--ink);
  background: color-mix(in srgb, var(--tag-c, #77746C) 18%, var(--paper));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tag-c, #77746C) 45%, transparent); }
.tag--custom .dot { display:inline-block; width:7px; height:7px; border-radius:50%;
  background: var(--tag-c, #77746C); margin-right:5px; vertical-align:middle; }
.recur-tag{background:var(--clay-wash);color:var(--clay-deep);border-color:transparent}
.recur-extra[hidden]{display:none}
.due { font-size: .78rem; color: var(--muted); }
.due.is-overdue { color: var(--clay-deep); font-weight: 600; }

.task-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 6px;
  border-radius: 7px; line-height: 0; transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--clay-deep); background: var(--clay-wash); }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .empty-glyph { font-family: var(--serif); font-size: 2rem; color: var(--clay); font-style: italic; }

/* ---------- Task: faithful-port extras ---------- */
.task { grid-template-rows: auto; }
.task-check { display: contents; }
.task.is-tonight { border-color: color-mix(in srgb, #E0A23C 45%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, #E0A23C 22%, transparent), var(--shadow); }

.tag.type-tag { font-family: var(--mono); font-size: .64rem; letter-spacing: .06em; background: var(--paper-2); color: var(--muted); min-width: 18px; text-align: center; }
.tag.tonight-tag { background: #FBEFD6; color: #9A6A1E; border-color: transparent; }
.tag.help-tag { background: #FBEFD6; color: #9A6A1E; border-color: transparent; }
.tag.agent-tag { background: #E7F0EA; color: var(--ctx-personal); border-color: transparent; }
.icon-btn.on { color: #B9832B; background: #FBEFD6; }
.btn-sm { font-size: .82rem; padding: 6px 12px; }
.icon-sm { font-size: 1.1rem; line-height: 1; padding: 2px 7px; }

/* Collapsible detail area spans the full task width (row 2) */
.task-detail { grid-column: 1 / -1; margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line); }
.task-detail > summary { cursor: pointer; font-size: .78rem; color: var(--muted); font-weight: 600;
  letter-spacing: .02em; list-style: none; user-select: none; padding: 2px 0; }
.task-detail > summary::-webkit-details-marker { display: none; }
.task-detail > summary::before { content: "\25B8"; display: inline-block; margin-right: 7px; transition: transform .15s; color: var(--clay); }
.task-detail[open] > summary::before { transform: rotate(90deg); }
.task-detail > *:not(summary) { margin-top: 12px; }

.subs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.sub { display: flex; align-items: center; gap: 10px; }
.sub-check { display: flex; }
.check-sm { width: 17px; height: 17px; border-width: 1.4px; }
.check-sm svg { width: 9px; height: 9px; }
.sub-text { flex: 1; font-size: .9rem; color: var(--ink-soft); }
.sub.is-done .sub-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }

.sub-add, .help-form { display: flex; gap: 8px; align-items: center; }
.sub-add input, .help-form input { flex: 1; }
.note-form { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.note-form label.field { margin: 0; }
.note-form textarea { width: 100%; }
.note-form .btn, .sub-add .btn { align-self: flex-start; }

.help-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--paper-2);
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.agent-answer { border-left: 2px solid var(--ctx-personal); padding-left: 12px; }
.agent-label { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ctx-personal); font-weight: 700; margin-bottom: 3px; }
.agent-text { font-size: .9rem; color: var(--ink-soft); line-height: 1.55; }
.help-echo { font-size: .78rem; color: var(--muted); font-style: italic; margin-top: 6px; }
.help-pending { font-size: .86rem; color: #9A6A1E; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 500px at 50% -10%, #F7EFE6, transparent),
    var(--ivory); }
.login-card { width: 100%; max-width: 372px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lift); padding: 34px 30px; }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-brand .brand-name { color: var(--ink); }
.login-title { font-family: var(--serif); font-size: 1.5rem; letter-spacing: -.02em; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: .92rem; margin-bottom: 22px; }
.login-card label.field { margin-bottom: 14px; }
.login-card .btn-primary { width: 100%; margin-top: 6px; padding: 11px; }
.error { background: var(--clay-wash); color: var(--clay-deep); border: 1px solid color-mix(in srgb, var(--clay) 30%, transparent);
  padding: 10px 13px; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 16px; padding: 14px 18px; }
  .brand-name { display: none; }
  .nav { flex-direction: row; margin: 0; flex: 1; }
  .soon { display: none; }
  .sidebar-foot { margin: 0; padding: 0; border: none; }
  .main { padding: 28px 20px 60px; }
}

/* ---------- Sidebar collapse + Toast ---------- */
.shell.is-collapsed { grid-template-columns: 64px 1fr; }
.shell.is-collapsed .brand-name, .shell.is-collapsed .nav-label, .shell.is-collapsed .soon, .shell.is-collapsed .who { display: none; }
.shell.is-collapsed .sidebar { padding-left: 14px; padding-right: 14px; }
.shell.is-collapsed .nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
.shell.is-collapsed .nav-icon { flex-basis: 22px; width: 22px; height: 22px; }
.shell.is-collapsed .nav-icon svg { width: 20px; height: 20px; }
.sidebar-toggle { background: transparent; border: none; color: #C9C5B9; cursor: pointer; font-size: 1.2rem; align-self: flex-start; padding: 4px 6px; }
.sidebar-toggle:hover { color: #fff; }
#toast { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast-item { background: var(--slate); color: var(--ivory); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); font-size: .88rem; }
.toast-item.is-error { background: var(--clay-deep); }

:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } a.card:hover { transform: none; } }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,20,19,.44); z-index: 60; }
.modal { position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%,-50%); width: min(560px,92vw); max-height: 88vh; overflow: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-head { display: flex; align-items: center; gap: 10px; }
.modal-title { font-family: var(--serif); font-size: 1.2rem; border: none; background: transparent; flex: 1; padding: 4px 0; }
.modal-title:focus { outline: none; border-bottom: 1px solid var(--clay); }
.modal-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
@media (max-width:560px){ .modal-grid { grid-template-columns: 1fr 1fr; } }
.modal-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.modal-tags .tag button { background: none; border: none; cursor: pointer; color: inherit; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.filter-bar select, .filter-bar input[type=search] { width: auto; padding: 7px 10px; font-size: .85rem; }
.filter-bar .chk { display: flex; align-items: center; gap: 5px; font-size: .85rem; color: var(--muted); }
.task[data-open] { cursor: pointer; }

/* ---------- Board ---------- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.bcol { flex: 0 0 268px; background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.bcol-head { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 10px; }
.bcol-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.bcol-n { margin-left: auto; color: var(--muted); }
.bcol-body { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.bcard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow); cursor: pointer; }
.bcard.is-drag { opacity: .5; }
.bcol-body.is-over { outline: 2px dashed var(--clay); outline-offset: 2px; border-radius: var(--radius-sm); }
.bcard-title { font-size: .92rem; margin-bottom: 6px; }
.bcard-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.board-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
@media (prefers-reduced-motion: no-preference) { .bcard { transition: box-shadow .12s; } }

/* ---------- Stage manager (owner) ---------- */
.stagemgr { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.stage-row { display: flex; align-items: center; gap: 8px; }
.stage-row input:not([type=color]):not([type=radio]) { flex: 1; }
.stage-row input[type=color] { width: 30px; height: 30px; padding: 2px; flex: 0 0 auto; }
.icon-btn:disabled { opacity: .4; cursor: default; }
.bcard-move { opacity: 0; pointer-events: none; margin-top: 8px; transition: opacity .12s; }
.bcard:hover .bcard-move, .bcard:focus-within .bcard-move { opacity: 1; pointer-events: auto; }
.bcard-move select{font-size:.8rem;padding:4px 6px} .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.stagemgr .chk { display: flex; align-items: center; gap: 5px; font-size: .85rem; color: var(--muted); }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 12px; }
.cal-title { font-family: var(--serif); font-size: 1.3rem; min-width: 200px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.cal-dow { margin-bottom: 6px; }
.cal-dowcell { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; }
.cal-cell { min-height: 92px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 5px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.is-empty { background: transparent; border-color: transparent; }
.cal-cell.is-today { border-color: var(--clay); box-shadow: 0 0 0 2px var(--clay-wash); }
.cal-daynum { align-self: flex-start; background: transparent; border: none; font-size: .8rem; color: var(--ink-soft); cursor: pointer; }
.cal-task { text-align: left; font-size: .72rem; padding: 2px 5px; border-radius: 4px; border: 1px solid var(--line); background: var(--ivory); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-task.ctx-personal  { color: var(--ctx-personal);  border-color: color-mix(in srgb, var(--ctx-personal) 35%, var(--line)); }
.cal-task.ctx-marketing { color: var(--ctx-marketing); border-color: color-mix(in srgb, var(--ctx-marketing) 35%, var(--line)); }
.cal-task.ctx-autodrive { color: var(--ctx-autodrive); border-color: color-mix(in srgb, var(--ctx-autodrive) 35%, var(--line)); }
.cal-more { font-size: .7rem; color: var(--muted); background: transparent; border: none; cursor: pointer; text-align: left; }
.cal-dots { display: none; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.cal-dot.ctx-personal  { background: var(--ctx-personal); }
.cal-dot.ctx-marketing { background: var(--ctx-marketing); }
.cal-dot.ctx-autodrive { background: var(--ctx-autodrive); }
.cal-dot.more { width: auto; font-size: .6rem; color: var(--muted); background: none; }
@media (max-width: 640px) {
  .cal-cell { min-height: 60px; }
  .cal-task, .cal-more { display: none; }
  .cal-dots { display: flex; gap: 3px; flex-wrap: wrap; padding: 2px 4px; }
}

/* ---------- Dashboard ---------- */
.dash-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 26px; }
@media (max-width: 640px){ .dash-cards { grid-template-columns: 1fr 1fr; } }
.dash-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; box-shadow: var(--shadow); }
.dash-card:hover { border-color: var(--clay); }
.dash-n { font-family: var(--serif); font-size: 2rem; color: var(--ink); }
.dash-label { font-size: .82rem; color: var(--muted); }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 8px; }
@media (max-width: 640px){ .dash-cols { grid-template-columns: 1fr; } }
.dash-bar { display: flex; align-items: center; gap: 10px; padding: 6px 0; text-decoration: none; color: var(--ink); }
.dash-bar-label { flex: 0 0 96px; font-size: .82rem; text-transform: capitalize; }
.dash-bar-track { flex: 1; height: 10px; background: var(--ivory); border-radius: 5px; overflow: hidden; }
.dash-bar-fill { display: block; height: 100%; background: var(--clay); }
.dash-bar-n { flex: 0 0 auto; color: var(--muted); font-size: .82rem; }
.dash-recent { display: flex; flex-direction: column; gap: 4px; }
.dash-recent-row { display: flex; justify-content: space-between; gap: 12px; background: transparent; border: none; border-bottom: 1px solid var(--line-soft); padding: 8px 2px; cursor: pointer; text-align: left; font-size: .9rem; }

/* ===== AI-agents Fleet HUD — neon-blue robotic console (always dark, self-contained) ===== */
.page-head--fleet { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.page-head--fleet > .ph-text { flex: 1 1 320px; min-width: 0; }

.fleet-hud {
  position: relative; overflow: hidden; flex: 0 0 auto;
  min-width: 230px; padding: 14px 20px; border-radius: 14px;
  background: radial-gradient(120% 140% at 100% 0%, #0c2236 0%, #05101d 70%);
  border: 1px solid rgba(64, 200, 255, .55);
  box-shadow: 0 0 22px rgba(38, 180, 255, .30), inset 0 0 30px rgba(8, 40, 72, .55);
  color: #bfeaff; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  animation: fh-pulse 3.2s ease-in-out infinite;
}
.fleet-hud::after {
  content: ""; position: absolute; left: 0; right: 0; top: -40%; height: 40%;
  background: linear-gradient(180deg, transparent, rgba(90, 220, 255, .16), transparent);
  animation: fh-scan 4.5s linear infinite; pointer-events: none;
}
.fleet-hud .fh-label { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: #4aa8cc; }
.fleet-hud .fh-est { opacity: .6; font-style: normal; margin-left: 4px; }
.fleet-hud .fh-save {
  font-size: 34px; font-weight: 700; line-height: 1.05; margin: 2px 0 4px;
  color: #5fe0ff; font-variant-numeric: tabular-nums; letter-spacing: .5px;
  text-shadow: 0 0 14px rgba(70, 210, 255, .85), 0 0 3px rgba(180, 240, 255, .9);
}
.fleet-hud .fh-strip { font-size: 11px; letter-spacing: .08em; color: #6fb8d8; white-space: nowrap; }

.fleet-hud--mini { min-width: 170px; padding: 11px 15px; border-radius: 12px; }
.fleet-hud--mini .fh-save { font-size: 24px; }
.fleet-hud--mini .fh-strip { font-size: 10px; }

@keyframes fh-scan  { 0% { top: -40%; } 100% { top: 100%; } }
@keyframes fh-pulse { 0%,100% { box-shadow: 0 0 18px rgba(38,180,255,.24), inset 0 0 30px rgba(8,40,72,.55); }
                      50%     { box-shadow: 0 0 30px rgba(58,200,255,.45), inset 0 0 34px rgba(8,40,72,.6); } }

@media (max-width: 720px) {
  .page-head--fleet { flex-direction: column; }
  .fleet-hud { width: 100%; }
  .fleet-hud .fh-strip { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .fleet-hud, .fleet-hud::after { animation: none; }
}

.fleet-setting { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.fleet-setting label { font-weight: 600; }
.fleet-setting input { width: 90px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
