/* DOLMS — components: cards, buttons, forms, tables, alerts, badges, pagination. */

/* cards */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-flush { padding: 0; overflow: hidden; }
.card-narrow { max-width: 560px; }
.stat { display: flex; flex-direction: column; gap: 4px; border-top: 3px solid var(--c-primary); }
.stat-label { color: var(--c-muted); font-size: .86rem; }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.stat-value-sm { font-size: 1.05rem; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px;
  font: inherit; font-weight: 600; font-size: .94rem; line-height: 1.2;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-secondary { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:hover { background: var(--c-bg); color: var(--c-text); }
.btn-ghost { background: transparent; color: var(--c-primary); border-color: transparent; }
.btn-ghost:hover { background: var(--c-primary-soft); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #991b1b; color: #fff; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; }
.icon-btn .icon { width: 22px; height: 22px; }
.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-weight: 600; font-size: .9rem; }
.req { color: var(--c-danger); }
.input {
  width: 100%; min-height: 40px;
  padding: 8px 12px;
  font: inherit; color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid #c5cdd5;
  border-radius: var(--radius-sm);
}
.input:focus { border-color: var(--c-primary); outline: 3px solid rgba(15, 107, 92, .18); outline-offset: 0; }
.input:disabled { background: var(--c-bg); color: var(--c-muted); }
.input[aria-invalid="true"] { border-color: var(--c-danger); background: var(--c-danger-soft); }
select.input { padding-right: 32px; }
.input-color { padding: 4px; width: 80px; }
.input-group { display: flex; gap: 6px; }
.input-group .input { flex: 1; }
.hint { margin: 0; color: var(--c-muted); font-size: .82rem; }
.field-error { margin: 0; color: var(--c-danger); font-size: .85rem; font-weight: 600; }
.field-check { justify-content: flex-end; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; min-height: 40px; }
.check input { width: 18px; height: 18px; accent-color: var(--c-primary); }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 16px; }
.filter-bar .field { flex: 1 1 180px; }
.filter-actions { display: flex; gap: 8px; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--c-border); }
.table thead th { background: #f7f9fa; font-weight: 700; font-size: .84rem; color: var(--c-muted); white-space: nowrap; position: sticky; top: 0; }
.table tbody tr:hover { background: #fafcfb; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .empty { text-align: center; color: var(--c-muted); padding: 28px; }
.col-actions { text-align: right; white-space: nowrap; }
.col-actions .inline + .inline, .col-actions .btn + .inline { margin-left: 4px; }
tr.is-muted td { color: var(--c-muted); }
.tree-indent { display: inline-block; }
.tree-indent.depth-1 { padding-left: 20px; }
.tree-indent.depth-2 { padding-left: 40px; }
.tree-indent.depth-3 { padding-left: 60px; }
.tree-indent.depth-4 { padding-left: 80px; }
.tree-indent.depth-1::before, .tree-indent.depth-2::before, .tree-indent.depth-3::before, .tree-indent.depth-4::before { content: "└ "; color: #a7b1bb; }
.diff { max-width: 320px; font-size: .82rem; }
.kv { display: block; word-break: break-word; }
.kv b { color: var(--c-muted); font-weight: 600; font-family: var(--mono); font-size: .78rem; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; border: 1px solid rgba(0, 0, 0, .15); }

/* meta list */
.meta-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; margin: 0 0 16px; }
.meta-list dt { color: var(--c-muted); font-size: .84rem; }
.meta-list dd { margin: 0; font-weight: 600; }

/* alerts */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius-sm); border: 1px solid; }
.alert .icon { margin-top: 3px; }
.alert p { margin: 0 0 4px; }
.alert-success { background: var(--c-success-soft); border-color: #b7e2c6; color: #14532d; }
.alert-error   { background: var(--c-danger-soft);  border-color: #f5c2c2; color: #7f1d1d; }
.alert-warning { background: var(--c-warning-soft); border-color: #f1dc9e; color: #713f12; }
.alert-info    { background: var(--c-info-soft);    border-color: #b9dcf2; color: #0c4a6e; }
.temp-pw code { font-size: 1.05rem; padding: 3px 8px; background: #fff; }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef1f4; color: var(--c-muted); white-space: nowrap; }
.badge-success { background: var(--c-success-soft); color: var(--c-success); }
.badge-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.badge-type-ministry { background: #ede9fe; color: #5b21b6; }
.badge-type-agency_hq { background: var(--c-info-soft); color: var(--c-info); }
.badge-type-zone { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.badge-type-circle { background: #fef3c7; color: #92400e; }
.badge-type-division { background: #fce7f3; color: #9d174d; }
.badge-action-login, .badge-action-logout { background: var(--c-info-soft); color: var(--c-info); }
.badge-action-create, .badge-action-activate { background: var(--c-success-soft); color: var(--c-success); }
.badge-action-deactivate, .badge-action-delete, .badge-action-password_reset { background: var(--c-danger-soft); color: var(--c-danger); }

/* pagination */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 16px; }
.pagination ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.pagination a, .pagination span[aria-current] {
  display: inline-flex; min-width: 36px; height: 36px; padding: 0 10px; align-items: center; justify-content: center;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); text-decoration: none; color: var(--c-text);
}
.pagination a:hover { background: var(--c-bg); }
.pagination span[aria-current] { background: var(--c-primary); color: #fff; border-color: var(--c-primary); font-weight: 700; }
.pagination .gap { padding: 0 4px; color: var(--c-muted); align-self: center; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
  .filter-bar .field { flex: 1 1 100%; }
  .table th, .table td { padding: 9px 10px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
}

/* ---------- Phase 2/3: senders, letters ---------- */
h3 { font-size: .95rem; margin: 14px 0 4px; color: var(--c-muted); }
.pre-line { white-space: pre-line; }
.plain-list { margin: 4px 0 8px; padding-left: 18px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: var(--c-primary-soft); }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 88px; height: 88px; font-size: 2rem; }
.avatar-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--c-primary-dark); font-weight: 700; }
.sender-cell { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.sender-cell:hover strong { color: var(--c-primary); text-decoration: underline; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head p { margin: 2px 0 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-row .card { margin: 0; padding: 14px 16px; }
.tracking { font-family: var(--mono); letter-spacing: .02em; }
.cell-subject { min-width: 220px; max-width: 420px; }
.badge-pmo { background: #fff1e6; color: var(--c-accent); }
.status-badge { border: 1px solid currentColor; }
.field-wide { flex: 2 1 260px !important; }
.input-filter { margin-bottom: 6px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.segmented { display: inline-flex; border: 1px solid #c5cdd5; border-radius: var(--radius-sm); overflow: hidden; }
.seg { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; cursor: pointer; border-right: 1px solid #c5cdd5; }
.seg:last-child { border-right: 0; }
.seg input { accent-color: var(--c-primary); }
.seg:has(input:checked) { background: var(--c-primary-soft); color: var(--c-primary-dark); font-weight: 600; }
.rhd-box { background: #f7faf9; border: 1px dashed #b8d6cf; border-radius: var(--radius-sm); padding: 14px; }
.form-footer { justify-content: flex-end; margin-bottom: 24px; }
.meta-list-1 { grid-template-columns: 1fr; }
.scan { margin: 0 0 16px; }
.scan-frame { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: #fafafa; }
.scan-img { max-width: 100%; max-height: 70vh; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.scan figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: .9rem; }
.scan figcaption .icon { width: 16px; height: 16px; vertical-align: -3px; }
.upload-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-top: 1px solid var(--c-border); padding-top: 14px; }
.upload-row .input { flex: 1 1 240px; }
.sender-card .sender-cell { align-items: flex-start; }
@media (max-width: 860px) {
  .profile-head { align-items: flex-start; }
  .scan-frame { height: 60vh; min-height: 320px; }
}
@media print {
  .scan-frame, .upload-row, .scan form { display: none !important; }
  .grid-2-1 { grid-template-columns: 1fr; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- Phase 4: progress, gallery, map ---------- */
.nav-badge { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--c-accent); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 20px; }
.badge-stale { background: var(--c-warning-soft); color: var(--c-warning); }
.stat-link { text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.stat-link:hover { color: inherit; box-shadow: 0 4px 14px rgba(16, 24, 40, .12); transform: translateY(-1px); }
.stat-warn { border-top-color: var(--c-warning); }
.latest-progress { background: var(--c-primary-soft); border-left: 4px solid var(--c-primary); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; }
.latest-progress p { margin: 0 0 6px; }
.latest-label { font-size: .82rem; font-weight: 700; color: var(--c-primary-dark); }
.add-progress { margin: 0 0 16px; }
.add-progress > summary { list-style: none; display: inline-flex; margin-bottom: 12px; }
.add-progress > summary::-webkit-details-marker { display: none; }
.add-progress[open] > summary { background: var(--c-primary-dark); }
.add-progress form { border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 16px; background: #fbfcfc; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--c-border); }
.timeline-item { position: relative; padding: 0 0 18px 14px; }
.timeline-item::before { content: ""; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--c-surface); border: 3px solid var(--c-primary); }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.timeline-item p { margin: 0 0 6px; }
.forward { color: var(--c-info); font-weight: 600; font-size: .9rem; }
.forward .icon { width: 16px; height: 16px; vertical-align: -3px; }
.attachments, .gallery { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.thumb { display: flex; flex-direction: column; width: 160px; text-decoration: none; color: inherit; font-size: .8rem; }
.gallery .thumb { width: 200px; }
.thumb img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-bg); }
.gallery .thumb img { height: 150px; }
.thumb span { margin-top: 4px; line-height: 1.35; }
.video { margin: 0; width: 320px; max-width: 100%; }
.video video { width: 100%; max-height: 240px; border-radius: var(--radius-sm); background: #000; }
.doc-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); text-decoration: none; font-size: .88rem; align-self: flex-start; }
.map { height: 260px; border-radius: var(--radius-sm); border: 1px solid var(--c-border); margin-bottom: 8px; z-index: 0; }
.map-picker { height: 300px; margin-top: 10px; }
.site-edit > summary { list-style: none; display: inline-flex; }
.site-edit > summary::-webkit-details-marker { display: none; }
@media (max-width: 860px) {
  .thumb, .gallery .thumb { width: calc(50% - 5px); }
  .video { width: 100%; }
}
@media print {
  .add-progress, .site-edit, .map { display: none !important; }
}

/* ---------- RHD HQ assignment ---------- */
.badge-unassigned { background: #fff1e6; color: var(--c-accent); border: 1px solid #fbd5bd; }
.assign-card { border-top: 3px solid var(--c-accent); }
.assign-card.is-assigned { border-top-color: #7c3aed; }
.assign-state { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.assign-state .icon { margin-top: 4px; color: var(--c-accent); }
.is-assigned .assign-state .icon { color: #7c3aed; }
.assign-edit > summary { list-style: none; display: inline-flex; margin-bottom: 10px; }
.assign-edit > summary::-webkit-details-marker { display: none; }
.rhd-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; background: var(--c-info-soft); color: var(--c-info); border-radius: var(--radius-sm); font-size: .9rem; }
.rhd-note .icon { margin-top: 3px; }
/* several assigned field offices (owner 2026-11-26) */
.office-lines { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.office-lines li { border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 8px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.office-line-head { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.office-line-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; }
.office-lines form { margin-left: auto; }
.pct { font-weight: 700; color: var(--c-primary-dark); font-size: .85rem; }
.removed-lines { margin-bottom: 12px; }
.removed-lines summary { cursor: pointer; color: var(--c-muted); }
.office-picker { max-height: 320px; overflow-y: auto; border: 1px solid #c5cdd5; border-radius: var(--radius-sm); padding: 6px 8px; background: var(--c-surface); }
.office-picker[aria-invalid="true"] { border-color: var(--c-danger); }
.office-pick { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px; cursor: pointer; border-bottom: 1px solid #f0f2f4; }
.office-pick:last-child { border-bottom: 0; }
.office-pick input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--c-primary); }
.office-pick.depth-1 { padding-left: 22px; }
.office-pick.depth-2 { padding-left: 40px; }
.office-pick[hidden] { display: none; }
.office-group { margin: 6px 0 2px; font-size: .8rem; font-weight: 700; color: var(--c-primary-dark); }
.clamp-4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- report (Ministry sheet format) ---------- */
.report-wrap { max-height: 75vh; }
.table-report { font-size: .84rem; }
.table-report th, .table-report td { padding: 8px 10px; border-right: 1px solid var(--c-border); }
.table-report thead th { white-space: normal; min-width: 90px; z-index: 1; }
.table-report .col-sl { min-width: 44px; text-align: right; }
.table-report .col-tracking { white-space: nowrap; }
.table-report .col-subject, .table-report .col-summary, .table-report .col-latest, .table-report .col-ministry_action { min-width: 240px; }
.table-report .col-offices { min-width: 260px; white-space: pre-line; }
.table-report .col-sender, .table-report .col-location { min-width: 160px; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { color: var(--c-primary); text-decoration: underline; }
th[aria-sort] .sort-link { color: var(--c-primary-dark); }
.saved-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; }
.saved-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.saved-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border: 1px solid var(--c-border); border-radius: 999px; background: var(--c-primary-soft); font-size: .86rem; }
.saved-chip a { text-decoration: none; font-weight: 600; }
.chip-x { border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 6px; color: var(--c-muted); }
.chip-x:hover { color: var(--c-danger); }
.saved-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.saved-form .input { width: 220px; min-height: 36px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.summary-grid .card { margin: 0; }
.summary-head { font-size: 1rem; margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--c-border); }
@media (max-width: 860px) {
  .summary-grid { grid-template-columns: 1fr; }
  .saved-form .input { width: 100%; }
}

/* ---------- MP profile ---------- */
.mp-head { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: start; }
.mp-photo { width: 140px; height: 170px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--c-border); background: var(--c-primary-soft); }
.mp-photo-empty { display: flex; align-items: center; justify-content: center; font-size: 3.2rem; font-weight: 700; color: var(--c-primary-dark); }
.mp-kicker { margin: 0 0 4px; font-size: .85rem; font-weight: 600; color: var(--c-primary); }
.mp-info h1 { font-size: 1.6rem; margin-bottom: 2px; }
.mp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 24px; margin: 14px 0 0; }
.mp-facts dt { color: var(--c-muted); font-size: .82rem; }
.mp-facts dd { margin: 0; font-weight: 700; font-size: 1.05rem; }
.mp-letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 16px; }
.mp-letter { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.mp-letter-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mp-letter-subject { font-weight: 600; margin: 0; }
.mp-update { display: flex; gap: 10px; background: var(--c-bg); border-radius: var(--radius-sm); padding: 10px; flex: 1; }
.mp-update p { margin: 0 0 4px; }
.mp-update-photo img { width: 96px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); }
.mp-letter > .btn { align-self: flex-start; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 860px) {
  .mp-head { grid-template-columns: 1fr; justify-items: start; }
  .mp-photo { width: 120px; height: 145px; }
  .mp-letters { grid-template-columns: 1fr; }
}

/* ---------- setup page ---------- */
.setup-card { max-width: 620px; }
.setup-card h2 { margin-top: 20px; font-size: 1.05rem; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--c-bg); }
.checklist .mark { font-weight: 700; width: 18px; }
.checklist li.ok .mark { color: var(--c-success); }
.checklist li.bad { background: var(--c-danger-soft); } .checklist li.bad .mark { color: var(--c-danger); }
.checklist li.warn { background: var(--c-warning-soft); } .checklist li.warn .mark { color: var(--c-warning); }
.ok-line { color: var(--c-success); font-weight: 600; }

.error-detail { text-align: left; background: var(--c-danger-soft); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .85rem; word-break: break-word; }

/* Owner 2026-11-30 — "Observation on using of DOLMS" */
.nav-badge-total { background: var(--c-info); }                       /* obs 4: totals, calm colour */
.cell-latest { min-width: 200px; max-width: 320px; }                    /* obs 2: latest progress column */
.latest-text { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; white-space: pre-line; }
.subject-link { color: inherit; text-decoration: none; }                /* obs 3: subject opens the letter */
.subject-link:hover, .subject-link:focus { color: var(--c-primary); text-decoration: underline; }
.required-note { display: flex; gap: 6px; align-items: center; margin: 0 0 14px; padding: 8px 12px; border-left: 4px solid var(--c-danger); background: var(--c-danger-soft); border-radius: 6px; font-size: .9rem; } /* obs 5 */
.complete-box { border-top: 4px solid var(--c-success); }               /* obs 15 */
.about-disclaimer { padding: 12px 14px; border-left: 4px solid var(--c-warning); background: var(--c-warning-soft); border-radius: 6px; } /* obs 11 */


/* ---- Dashboard (Phase 6, owner 2026-12-01). Chart colours: validated categorical slots (fixed order, never by rank). */
:root { --series-1: #257de0; --series-2: #f47230; --series-3: #00b894; --series-4: #f2a600;
        --chart-grid: #e7e7e7; --chart-axis: #c2c2c2; --meter-track: #cce3fd; --meter-over: #dc3c3d; }
.s1 { fill: var(--series-1); stroke: var(--series-1); }
.s2 { fill: var(--series-2); stroke: var(--series-2); }
.s3 { fill: var(--series-3); stroke: var(--series-3); }
.s4 { fill: var(--series-4); stroke: var(--series-4); }
rect.s1, rect.s2, rect.s3, rect.s4 { stroke: none; }
.dash-stats .stat-note { font-size: .8rem; color: var(--c-muted); }
.stat-good { border-top-color: var(--c-success); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.dash-grid > .card { margin: 0; }
.dash-wide { grid-column: 1 / -1; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 16px 16px 12px; }
.card-head h2 { margin: 0; }
.card-head .input-filter { max-width: 320px; }
.chart-empty { margin: 8px 0; }

/* horizontal bars: HTML label + stretched SVG bar + value at the bar end */
.hbars { display: flex; flex-direction: column; gap: 4px; }
.hbar-row { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr) auto; align-items: center; gap: 10px;
            padding: 5px 6px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
a.hbar-row:hover, .hbar-row:focus-visible { background: var(--c-primary-soft); color: inherit; }
.hbar-label { font-size: .88rem; line-height: 1.35; }
.hbar-track { display: block; height: 16px; }
.hbar-track svg { display: block; width: 100%; height: 16px; }
.hbar-value { font-size: .85rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* legend */
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0 0 10px; padding: 0; font-size: .85rem; color: var(--c-muted); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend strong { color: var(--c-text); font-weight: 600; }
.swatch-dot { width: 12px; height: 12px; flex: none; }

/* line chart */
.chart-line { display: block; width: 100%; max-width: 720px; height: auto; overflow: visible; }
.chart-line .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart-line .grid.base { stroke: var(--chart-axis); }
.chart-line .tick { fill: var(--c-muted); font-size: 11px; font-family: var(--font); }
.chart-line .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-line .dot { stroke: var(--c-surface); stroke-width: 2; }
.chart-line .hit { fill: transparent; stroke: none; }
.chart-line .guide { stroke: var(--chart-axis); stroke-width: 1; opacity: 0; }
.chart-line .hit-col:hover .guide, .chart-line .hit-col:focus .guide { opacity: 1; }
.chart-line .hit-col:focus { outline: none; }

/* donut */
.donut-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.chart-donut { width: 200px; max-width: 100%; height: auto; flex: none; }
.chart-donut .arc { fill: none; stroke-width: 26; }
.chart-donut a:hover .arc, .chart-donut g:focus .arc { stroke-width: 30; }
.chart-donut g:focus { outline: none; }
.chart-donut .donut-empty { fill: none; stroke: var(--chart-grid); stroke-width: 26; }
.chart-donut .donut-value { font-size: 30px; font-weight: 700; fill: var(--c-text); font-family: var(--font); }
.chart-donut .donut-label { font-size: 13px; fill: var(--c-muted); font-family: var(--font); }
.donut-wrap .chart-legend { flex-direction: column; flex: 1 1 180px; gap: 8px; }

/* money + budget meter */
.dash-money { margin-bottom: 16px; }
.money-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; align-items: start; }
.hero-figure { font-size: 2.6rem; font-weight: 700; line-height: 1.15; margin: 4px 0; color: var(--c-primary-dark); }
.pct-figure { font-size: 2rem; font-weight: 700; line-height: 1.2; margin: 0 0 6px; }
.budget-line { margin-bottom: 4px; }
.money-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.money-warn { display: flex; gap: 6px; align-items: flex-start; color: var(--c-warning); }
.meter { margin: 4px 0 8px; }
.meter svg { display: block; width: 100%; height: 14px; border-radius: 7px; }
.meter-track { fill: var(--meter-track); }
.meter-fill { fill: var(--series-1); }
.meter-fill.over { fill: var(--meter-over); }
.chart-table { margin-top: 10px; font-size: .88rem; }
.chart-table summary { cursor: pointer; color: var(--c-primary); }

/* tooltip (assets/js/dashboard.js) */
.chart-tip { position: fixed; z-index: 60; max-width: 280px; padding: 6px 10px; border-radius: var(--radius-sm); background: #1d2733;
             color: #fff; font-size: .82rem; line-height: 1.4; pointer-events: none; box-shadow: var(--shadow); }
.chart-tip[hidden] { display: none; }

/* admin: private dashboard links */
.dlink-new { border-top: 3px solid var(--c-success); margin-bottom: 16px; }
.dlink-new h2 { display: flex; align-items: center; gap: 8px; }
.dlink-new code { word-break: break-all; font-size: .95rem; }

@media (max-width: 900px) {
  .dash-grid, .money-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hbar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .hbar-label { grid-column: 1 / -1; }
  .hero-figure { font-size: 2.1rem; }
  .card-head .input-filter { max-width: none; width: 100%; }
}
@media print {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .chart-table, .input-filter { display: none; }
  .card { break-inside: avoid; }
}
