/* ------------------------------------------------------------------
   Agency CRM additions. Uses the tokens defined in app.css, so light
   and dark themes both follow automatically.
   ------------------------------------------------------------------ */

/* Navigation */
.topnav { flex-wrap: wrap; }
.nav-more { position: relative; }
.nav-more summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: ' ▾'; font-size: 10px; }
.nav-more[open] summary { background: var(--card-2); }
.nav-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 190px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 6px; display: grid; }
.nav-menu a { padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.nav-menu a:hover { background: var(--card-2); }

/* Generic helpers */
.form-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form input, .inline-form select { width: auto; }
.stack { display: grid; gap: 10px; }
.stack > form { margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; margin: 6px 0; cursor: pointer; }
.check input { width: auto; margin: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; max-height: 320px; overflow: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 6px 10px; }
.strong { font-weight: 700; }
.neg { color: var(--red); font-weight: 600; }
a.stat { text-decoration: none; color: inherit; transition: transform .1s ease, box-shadow .1s ease; }
a.stat:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.section-title { margin: 6px 0 10px; }
.group-head { grid-column: 1 / -1; margin: 10px 0 -4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }

.money-card { border-color: var(--amber); }
.money-card .card-head { background: var(--amber-soft); }

.todo-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -8px 0 20px; padding: 10px 14px; background: var(--amber-soft); border-radius: var(--radius); font-size: 13.5px; }
.todo-strip a { color: var(--amber); font-weight: 600; text-decoration: none; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.mini-list { list-style: none; margin: 0; padding: 4px 0; }
.mini-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .num { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }

.rag { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.rag-red { background: var(--red); }
.rag-amber { background: #d9a13b; }
.rag-green { background: var(--green); }
.rag-grey { background: var(--line); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--green); }

.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--paper); padding: 12px 0; border-top: 1px solid var(--line); z-index: 5; }

/* 2FA */
.qr { background: #fff; padding: 10px; border-radius: var(--radius); display: inline-block; border: 1px solid var(--line); }
.qr svg { display: block; width: 200px; height: 200px; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.recovery-codes code { font-family: var(--mono); font-size: 15px; padding: 8px 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); text-align: center; }

/* Board */
.board-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.board-filters select { width: auto; min-width: 160px; }
.kanban { grid-template-columns: repeat(6, minmax(230px, 1fr)); }
.project-page .kanban { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); }
.kanban .column-body { min-height: 60px; display: grid; gap: 8px; align-content: start; }
.kanban .task-card { cursor: grab; touch-action: manipulation; }
.kanban .task-card:active { cursor: grabbing; }
.task-card.is-triage { border-left: 3px solid var(--amber); }
.card-ghost { opacity: .4; outline: 2px dashed var(--blue); }
.column.kind-requests { background: var(--amber-soft); }
.dot-requests { background: var(--amber) !important; }
.add-card { padding: 6px 8px 10px; margin: 0; }
.add-card input { font-size: 13.5px; padding: 7px 9px; background: transparent; border: 1px dashed var(--line); }
.add-card input:focus { background: var(--card); border-style: solid; }
.card-labels { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.label-chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 9px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.cl-bar { height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; margin: 6px 0 2px; min-width: 40px; }
.cl-bar span { display: block; height: 100%; background: var(--green); }
.project-about summary { cursor: pointer; margin-top: 4px; }

/* Checklists */
.checklist { margin-bottom: 18px; }
.checklist-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.checklist-head form { margin: 0; }
.checklist-item { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.checklist-item form { margin: 0; }
.checklist-item.done .grow { text-decoration: line-through; color: var(--ink-3); }
.tick { background: none; border: 0; font-size: 18px; cursor: pointer; padding: 0 2px; color: var(--green); line-height: 1; }

/* Quick add — built for a phone */
.quick-add { max-width: 480px; margin: 0 auto; }
.quick-add input, .quick-add select { font-size: 16px; }

/* Money */
.pill-inv-draft    { background: var(--grey-soft); color: var(--ink-2); }
.pill-inv-open     { background: var(--blue-soft); color: var(--blue); }
.pill-inv-overdue  { background: var(--red); color: #fff; }
.pill-inv-void     { background: var(--grey-soft); color: var(--ink-3); text-decoration: line-through; }
.pill-inv-credit   { background: var(--amber-soft); color: var(--amber); }
.line-items input, .line-items select { padding: 6px 8px; }
.line-items tfoot td { border-bottom: 0; }
.doc-frame { overflow: hidden; }
.doc-frame iframe { width: 100%; height: 1020px; border: 0; display: block; background: #fff; }
details.contact { border-bottom: 1px solid var(--line-soft); padding: 8px 0; }
details.contact summary { cursor: pointer; }
details.contact form { display: grid; gap: 6px; margin: 8px 0; }
details > summary.btn { list-style: none; text-align: center; display: block; }
details > summary.btn::-webkit-details-marker { display: none; }
tr.needs td:first-child { border-left: 3px solid var(--amber); }

/* Revenue chart: two bars per month, invoiced vs cash received */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; height: 190px; align-items: end; }
.bar-group { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 4px; }
.bar-pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; }
.bar { flex: 1; border-radius: 3px 3px 0 0; min-height: 1px; }
.bar.inv, .key-inv { background: var(--blue); }
.bar.cash, .key-cash { background: var(--green); }
.bar-label { font-size: 11px; color: var(--ink-3); text-align: center; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: middle; }

/* Client-facing pages */
.public-doc { max-width: 860px; margin: 28px auto; padding: 0 16px; }
.public-actions { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.public-actions form { margin: 0; }
.public-doc .card { overflow: hidden; }

@media (max-width: 900px) {
    .form-grid, .dash-grid, .two-col { grid-template-columns: 1fr; }
    .doc-frame iframe { height: 760px; }
    .topbar-right .btn-secondary { display: none; }
}
