*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
/* --danger is #b91c1c rather than #dc2626 (gitea #162). At 13px on --bg the
   lighter red measured 4.38:1, under AA's 4.5, so .text-danger failed wherever
   danger text sat on the page background rather than inside a card — it reads
   4.83:1 on --surface, which is why it surfaced on three pages and not
   everywhere, and why a page-level fix would have left the next one to inherit
   it. The darker red is 6.05:1 on --bg and 6.67:1 on white; it was already in
   this file as .btn-danger:hover, which moves down with it below. */
:root{--bg:#f3f4f6;--surface:#fff;--border:#e5e7eb;--border-light:#f0f0f0;--text:#1f2937;--text-muted:#5f6673;--primary:#5c4de8;--primary-hover:#4a3cc7;--primary-light:#ede9fe;--danger:#b91c1c;--success-bg:#dcfce7;--success-border:#86efac;--error-bg:#fee2e2;--error-border:#fca5a5;--radius:6px;--shadow-sm:0 1px 2px rgba(0,0,0,.05);--shadow:0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.06)}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-size:14px;line-height:1.5;color:var(--text);background:var(--bg)}
a{color:var(--primary);text-decoration:none}a:hover{text-decoration:underline}

/* ── Top Nav ─────────────────────────────────────────── */
.topnav{display:flex;align-items:center;gap:1rem;background:#1e293b;color:#fff;padding:0 1.5rem;height:48px;font-size:13px;position:sticky;top:0;z-index:100}
.nav-brand{color:#fff;font-weight:700;font-size:14px;margin-right:1rem;white-space:nowrap;display:flex;align-items:center}.nav-brand:hover{text-decoration:none}
.nav-version{font-weight:400;font-size:11px;opacity:.5;margin-left:3px}
.nav-links{display:flex;gap:2px;flex-wrap:wrap;align-items:center}
.nav-links a{color:#cbd5e1;padding:4px 10px;border-radius:4px;transition:all .15s}.nav-links a:hover{color:#fff;background:rgba(255,255,255,.08);text-decoration:none}
.nav-links a.nav-active{color:#fff;background:rgba(255,255,255,.12);font-weight:600}
.nav-user{margin-left:auto;display:flex;align-items:center;gap:.5rem;color:#cbd5e1;flex-shrink:0}
.nav-username{white-space:nowrap}.nav-username small{opacity:.8}
.nav-logo{height:28px;max-width:120px;object-fit:contain;margin-right:6px;vertical-align:middle;border-radius:3px}
.nav-project-badge{display:inline-flex;align-items:center;gap:.35rem;background:rgba(96,165,250,.15);color:#93c5fd;padding:2px 10px;border-radius:12px;font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap}
.nav-project-badge:hover{background:rgba(96,165,250,.25);color:#bfdbfe;text-decoration:none}

/* Admin dropdown */
.nav-dropdown{position:relative}
.nav-dropdown-toggle{background:none;border:1px solid #64748b;color:#cbd5e1;padding:4px 12px;border-radius:4px;cursor:pointer;font-size:13px;white-space:nowrap;transition:all .15s}
.nav-dropdown-toggle:hover{color:#fff;border-color:#94a3b8}
.nav-dropdown-toggle.nav-active{color:#fff;background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.2)}
.nav-dropdown-menu{display:none;position:absolute;top:100%;right:0;margin-top:6px;background:#1e293b;border:1px solid #475569;border-radius:var(--radius);min-width:190px;z-index:200;box-shadow:0 8px 24px rgba(0,0,0,.35);padding:4px 0}
.nav-dropdown.open .nav-dropdown-menu{display:block}
.nav-dropdown-label{padding:6px 14px 2px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#64748b}
.nav-dropdown-divider{height:1px;background:#334155;margin:4px 0}
.nav-dropdown-menu a{display:block;padding:5px 14px;color:#cbd5e1;font-size:13px;white-space:nowrap;border-radius:0}
.nav-dropdown-menu a:hover{background:#334155;color:#fff;text-decoration:none}
.nav-dropdown-menu a.nav-active{color:#a5b4fc;background:rgba(165,180,252,.08)}
.btn-nav{color:#cbd5e1!important;background:transparent!important;border-color:#64748b!important;padding:2px 8px!important;font-size:12px!important}
.btn-nav:hover{color:#fff!important;background:rgba(255,255,255,.08)!important}

/* ── Breadcrumbs ─────────────────────────────────────── */
.breadcrumb-bar{background:var(--surface);border-bottom:1px solid var(--border);padding:0 1.5rem}
.breadcrumb-container{max-width:1200px;margin:0 auto;display:flex;align-items:center;gap:6px;padding:8px 0;font-size:12px;color:var(--text-muted)}
.breadcrumb-container a{color:var(--text-muted)}.breadcrumb-container a:hover{color:var(--primary)}
.breadcrumb-sep{color:#d1d5db;font-size:13px}
.breadcrumb-current{color:var(--text);font-weight:500}

/* ── Layout ──────────────────────────────────────────── */
.container{max-width:1200px;margin:0 auto;padding:1.25rem 1.5rem}
.flash-messages{margin-bottom:1rem}
.flash{padding:.5rem 1rem;border-radius:var(--radius);border:1px solid;margin-bottom:.5rem;font-size:13px;white-space:pre-line;transition:opacity .3s}
.flash-success{background:var(--success-bg);border-color:var(--success-border)}.flash-error{background:var(--error-bg);border-color:var(--error-border)}
.flash-warning{background:#fef3c7;border-color:#fcd34d;color:#92400e}
/* "info" is the batch-skip category (rooms.batch_assign, and the
   bulk-update skip clauses from gitea #233). It has been flashed since
   #161 with no rule of its own, so it fell back to a bare
   currentColor border -- same shape of gap as the #237 badge rules. */
.flash-info{background:#e0f2fe;border-color:#7dd3fc;color:#075985}
.page-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:1.25rem;gap:.75rem;flex-wrap:wrap}
.page-header h1,.page-header h2{font-size:1.25rem;font-weight:700;color:var(--text)}
.header-actions{display:flex;gap:.5rem;align-items:flex-start}
.room-meta{display:flex;align-items:center;gap:.5rem;margin-top:4px;flex-wrap:wrap}
.status-text{color:var(--text-muted);font-size:13px;font-weight:600}
.status-note{color:var(--text-muted);font-size:12px;font-style:italic}
.subtitle{color:var(--text-muted);font-size:13px;margin-bottom:1rem}.text-muted{color:var(--text-muted)}

/* ── Buttons ─────────────────────────────────────────── */
.btn-bar{display:flex;gap:.5rem;margin-bottom:1rem;flex-wrap:wrap;align-items:center}
.table-filter-input{padding:6px 10px;border:1px solid var(--border);border-radius:var(--radius);font-size:14px;font-family:inherit;min-width:200px;margin-left:auto;transition:border-color .15s,box-shadow .15s}
.table-filter-input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 2px rgba(92,77,232,.12)}
.status-bar{padding:8px 12px;background:#f0f9ff;border:1px solid #bae6fd;border-radius:var(--radius);gap:.75rem}
.status-label{font-size:12px;color:var(--text-muted);font-weight:600}
.btn{display:inline-flex;align-items:center;padding:7px 16px;font-size:13px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);color:var(--text);cursor:pointer;white-space:nowrap;text-decoration:none;transition:all .15s;font-weight:500;box-shadow:var(--shadow-sm)}
.btn:hover{background:#f9fafb;text-decoration:none;border-color:#d1d5db}.btn-primary{background:var(--primary);color:#fff;border-color:var(--primary)}.btn-primary:hover{background:var(--primary-hover)}
/* Hover is a step darker again now that --danger is the old hover colour, or
   pointing at a destructive button would change nothing on screen (#162). */
.btn-danger{color:#fff;background:var(--danger);border-color:var(--danger)}.btn-danger:hover{background:#991b1b}
.btn-sm{padding:3px 10px;font-size:12px;box-shadow:none}.btn-link{border:none;background:none;color:var(--primary);padding:2px 4px;cursor:pointer;font-size:12px;box-shadow:none;font-weight:500}.btn-link:hover{text-decoration:underline}
.btn:disabled{opacity:.4;cursor:not-allowed}
.btn-status-in-review{background:#f59e0b;color:#fff;border-color:#f59e0b}.btn-status-in-review:hover{background:#d97706}
.btn-status-draft{background:#6b7280;color:#fff;border-color:#6b7280}.btn-status-draft:hover{background:#4b5563}
.btn-status-approved{background:#16a34a;color:#fff;border-color:#16a34a}.btn-status-approved:hover{background:#15803d}
.btn-status-archived{background:#64748b;color:#fff;border-color:#64748b}.btn-status-archived:hover{background:#475569}

/* ── Action Groups (room sheet) ──────────────────────── */
.action-groups{display:flex;gap:.75rem;margin-bottom:1rem;flex-wrap:wrap;align-items:stretch}
.action-group{display:flex;gap:.5rem;align-items:center;padding:6px 10px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);flex-wrap:wrap}
/* gitea #264: the room sheet's Check Out / Save / Check In controls used to
   scroll out of view on a long sheet, forcing a scroll back to the top to
   save. Pin the bar just under the top nav (sticky, 48px tall) instead of
   restructuring the page. A solid background stops sheet content from
   showing through while it's pinned; z-index sits above ordinary content
   but stays below modal overlays (100) so a modal still covers it. Scoped
   to room_sheet.html only -- .action-groups is shared by other list pages
   that don't need this. */
.sheet-actions-sticky{position:sticky;top:48px;z-index:60;background:var(--bg);padding:.5rem 0;margin:-.5rem 0 .5rem;box-shadow:0 2px 4px rgba(0,0,0,.05)}
.action-group-label{font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.03em;margin-right:2px}
.async-export-status{font-size:12px;color:var(--text-muted);display:flex;align-items:center;gap:.4rem}
.async-export-status:empty{display:none}
.btn-dropdown-wrap{position:relative;display:inline-block}
.btn-dropdown-menu{display:none;position:absolute;top:100%;left:0;z-index:100;min-width:180px;margin-top:2px;padding:4px 0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
.btn-dropdown-wrap.open .btn-dropdown-menu{display:block}
.btn-dropdown-menu a{display:block;padding:6px 14px;font-size:13px;color:var(--text);text-decoration:none;white-space:nowrap}
.btn-dropdown-menu a:hover{background:var(--hover)}

/* ── Tables ──────────────────────────────────────────── */
.data-table{width:100%;border-collapse:collapse;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-sm)}
.data-table th,.data-table td{padding:8px 12px;text-align:left;border-bottom:1px solid var(--border-light);font-size:13px}
.data-table th{background:#f9fafb;font-weight:600;font-size:12px;color:var(--text-muted);position:relative;user-select:none}
.data-table th.sortable{cursor:pointer}.data-table th.sortable:hover{background:#f0f1f3;color:var(--text)}
.data-table th .sort-arrow{font-size:10px;margin-left:3px;opacity:.4}.data-table th.sort-asc .sort-arrow,.data-table th.sort-desc .sort-arrow{opacity:1;color:var(--primary)}
.data-table tbody tr{cursor:pointer;transition:background .1s}.data-table tbody tr:hover{background:#f8faff}.data-table tbody tr.selected{background:var(--primary-light)}
.empty-row{color:var(--text-muted);text-align:center;padding:2rem!important;cursor:default!important}
.text-small{font-size:12px;max-width:250px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.text-xs{font-size:11px}
.row-inactive{opacity:.5}.check-mark{color:#16a34a;font-weight:bold}
.actions{white-space:nowrap}.actions .btn{margin-right:4px}.inline-form{display:inline}
.role-select{padding:2px 4px;font-size:12px;border:1px solid var(--border);border-radius:var(--radius);margin-right:4px}

/* ── Badges ──────────────────────────────────────────── */
.badge{display:inline-block;padding:2px 8px;font-size:11px;font-weight:600;border-radius:3px}
.badge-action{background:#e0f2fe;color:#0369a1}
.badge-status-draft{background:#dbeafe;color:#1e40af}.badge-status-in-review{background:#fef3c7;color:#92400e}
.badge-status-approved{background:#dcfce7;color:#166534}.badge-status-archived{background:#e2e8f0;color:#475569}
.badge-status-comment-incorporation{background:#fce4ec;color:#880e4f}.badge-status-comment-incorporation-review{background:#fff3e0;color:#e65100}
.badge-status-for-approval{background:#e8eaf6;color:#283593}
.badge-status-active{background:#dcfce7;color:#166534}.badge-status-idle{background:#fef3c7;color:#92400e}.badge-status-offline{background:#e2e8f0;color:#475569}
/* Bug-report statuses (gitea #237) — same badge-status-<value> convention
   as the room and active-user badges above; the markup already emitted
   these three classes, only the rules were missing. */
.badge-status-open{background:#dbeafe;color:#1e40af}.badge-status-acknowledged{background:#fef3c7;color:#92400e}.badge-status-resolved{background:#dcfce7;color:#166534}
.badge-subroom{background:#f3e8ff;color:#7c3aed;font-size:12px}.badge-subroom a{color:#7c3aed;text-decoration:underline}
/* Checkout-lock marker (gitea #233): the bulk-update checklist disables a
   checked-out room, and a disabled control with no visible reason is the
   defect, not the fix -- this badge names the holder. */
.badge-locked{background:#fee2e2;color:#991b1b}
/* Organizational room marker (gitea #265): a parent room built only to
   propagate common values to children, not a physical plant room -- the
   badge on the rooms list, room sheet header, and Data Quality tab all
   share this one class. */
.badge-organizational{background:#cffafe;color:#0e7490}

/* ── Parameter Groups (room sheet) ───────────────────── */
.param-group{margin-bottom:1rem;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-sm)}
.group-header{display:flex;align-items:center;gap:.5rem;padding:10px 12px;background:#f9fafb;cursor:pointer;user-select:none;font-size:13px;border-bottom:1px solid var(--border)}
.group-header:hover{background:#f0f1f3}.group-toggle{font-size:11px;transition:transform .2s;width:14px}
.param-group.collapsed .group-toggle{transform:rotate(-90deg)}.param-group.collapsed .group-body{display:none}
.group-body{border:none;border-radius:0}
.sheet-table .col-param{font-weight:600;width:140px}.sheet-table .col-units{width:55px;color:var(--text-muted)}
.sheet-table .col-value{width:150px}.sheet-table .col-note{width:320px}
.sheet-table .col-citations{min-width:200px}
.inline-history{margin-top:4px;font-size:11px;color:var(--text-muted);border-top:1px dashed var(--border);padding-top:3px;line-height:1.5}
/* Note is a resizable textarea (gitea #68): defaults to one-row height, drag the corner to expand. */
.sheet-note{resize:vertical;min-height:32px;height:34px;line-height:1.3;overflow-y:auto}
.sheet-table tbody tr{cursor:default}
.sheet-input{width:100%;padding:5px 8px;border:1px solid var(--border);border-radius:var(--radius);font-size:13px;font-family:inherit;transition:border-color .15s}
.sheet-input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 2px rgba(92,77,232,.15)}
.sheet-select{padding:5px 8px;font-size:13px;border:1px solid var(--border);border-radius:var(--radius);background:#fff}

/* ── Inheritance ─────────────────────────────────────── */
.inherited-row{background:#fffbeb}.inherited-row:hover{background:#fef3c7!important}
.inherited-badge{color:#d97706;font-size:11px;font-weight:700;margin-left:2px}
.btn-reset-inherit{cursor:pointer;border:1px solid var(--border);background:#fff;color:var(--text-muted);font-size:10px;padding:1px 5px;border-radius:3px;margin-left:4px;line-height:1.3}
.btn-reset-inherit:hover{background:#fef3c7;color:#d97706;border-color:#d97706}
.inheritance-legend{display:flex;gap:1rem;margin-bottom:.75rem;font-size:12px;color:var(--text-muted)}
.legend-item{display:flex;align-items:center;gap:4px}
.legend-swatch{width:16px;height:12px;border-radius:2px;border:1px solid #ddd}
.inherited-swatch{background:#fffbeb}.own-swatch{background:#fff}
.subroom-row td:first-child{padding-left:24px}.subroom-indent{color:var(--primary);font-weight:700}
.subroom-list{display:flex;align-items:center;gap:.5rem;margin-bottom:1rem;padding:8px 12px;background:#f9fafb;border:1px solid var(--border);border-radius:var(--radius);flex-wrap:wrap;font-size:13px}
/* Gitea #277: "Roll up parents" -- the Rooms list's per-parent collapse
   toggle. The arrow is a plain disclosure triangle (matches .group-toggle's
   rotate-on-collapse convention used by param groups); the "(N hidden)"
   cue next to it reuses .text-muted/.text-xs rather than a new badge color. */
.room-collapse-toggle{background:none;border:none;cursor:pointer;padding:0;margin-right:4px;font-size:10px;color:var(--primary);vertical-align:middle;line-height:1}
.subroom-hidden-badge{margin-left:4px;white-space:nowrap}
.subroom-collapsed-hidden{display:none}
.highlight-row{animation:highlightFade 2s ease-out}@keyframes highlightFade{0%{background:#fef08a}100%{background:transparent}}

/* ── Citations ───────────────────────────────────────── */
.citation-tag{display:inline-block;background:#e0f2fe;color:#0369a1;font-size:11px;padding:1px 6px;border-radius:3px;margin:1px 2px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.citation-code{display:inline-block;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--text-muted);margin-right:4px;letter-spacing:.01em}
.citation-tag small{opacity:.7;margin-left:3px}
/* gitea #190: a value-list item this room selected before the item was
   disabled in the dictionary. Still the room's real value (and still what
   every export prints), so the text is unchanged — only muted and dashed,
   to explain why it is no longer offered to other rooms. */
.vl-tag-inactive{background:#f1f5f9;color:var(--text-muted);border:1px dashed #cbd5e1}
.vl-inactive-note{color:var(--text-muted);font-size:11px;margin-left:4px;font-style:italic}
.citation-list{max-height:400px;overflow-y:auto}
.citation-option{display:flex;align-items:flex-start;gap:.5rem;padding:6px 0;border-bottom:1px solid #eee;cursor:pointer}
.citation-option:hover{background:#f8faff}.citation-option input{margin-top:3px}
.cit-label{font-size:13px}.cit-label strong{color:var(--primary)}

/* ── Snapshots ───────────────────────────────────────── */
.snap-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1rem;margin-bottom:1rem}
.snap-panel h3{font-size:1rem;margin-bottom:.75rem}
.snap-create{display:flex;gap:.5rem;margin-bottom:.75rem;align-items:center}
.snap-label-input{padding:4px 8px;border:1px solid var(--border);border-radius:var(--radius);font-size:13px;flex:1;max-width:300px}
.snap-table{margin-bottom:.5rem}.snap-table tbody tr{cursor:default}

/* ── Compare ─────────────────────────────────────────── */
.compare-form{margin-bottom:1.5rem}.form-group-btn{display:flex;align-items:flex-end}
.compare-header{display:flex;gap:1rem;margin-bottom:.75rem}
.compare-table .cell-diff{background:#fef3c7}.compare-table .cell-same{background:#dcfce7}
.compare-table .diff-row{background:#fffbeb}.compare-table .diff-row:hover{background:#fef3c7!important}
.compare-table .diff-row td:nth-child(4),.compare-table .diff-row td:nth-child(5){font-weight:600;color:#92400e}

/* ── Forms ────────────────────────────────────────────── */
.form-group{margin-bottom:.75rem}.form-group label{display:block;font-size:13px;font-weight:600;margin-bottom:4px;color:var(--text)}
.form-group input[type="text"],.form-group input[type="password"],.form-group input[type="number"],.form-group input[type="email"],.form-group input[type="url"],.form-group select,.form-group textarea{width:100%;padding:7px 10px;border:1px solid var(--border);border-radius:var(--radius);font-size:14px;font-family:inherit;transition:border-color .15s,box-shadow .15s}
.form-group input:focus,.form-group select:focus,.form-group textarea:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 2px rgba(92,77,232,.12)}
.form-row{display:flex;gap:1rem;flex-wrap:wrap}.form-row .form-group{flex:1}

/* ── Modal ────────────────────────────────────────────── */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);display:flex;align-items:center;justify-content:center;z-index:100}
.modal{background:var(--surface);border-radius:8px;padding:1.5rem;width:90%;max-width:500px;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.2)}
.modal-wide{max-width:700px}.modal h2{font-size:1.05rem;font-weight:700;margin-bottom:1rem}
.modal-actions{display:flex;gap:.5rem;margin-top:1rem;justify-content:flex-end}
.modal-actions-col{display:flex;flex-direction:column;gap:.5rem;margin-top:1rem}

/* ── Login ────────────────────────────────────────────── */
.login-container{max-width:400px;margin:4rem auto;background:var(--surface);padding:2rem;border-radius:8px;border:1px solid var(--border);box-shadow:var(--shadow)}
.login-container h1{font-size:1.3rem;margin-bottom:1.5rem;text-align:center;font-weight:700}
.login-container form{text-align:left}
.login-logo-wrap{text-align:center;margin-bottom:1.25rem}
.login-logo{max-height:120px;max-width:80%;object-fit:contain}
.login-fields{display:flex;gap:1rem}.login-fields .form-group{flex:1}.btn-login{margin-top:.5rem;padding:10px 24px}
.error-page{text-align:center;padding:4rem 1rem}.error-page h1{font-size:2rem;margin-bottom:1rem;color:var(--danger)}.error-page p{margin-bottom:1.5rem;color:var(--text-muted)}
/* The class had no user until the error pages arrived (#140), and they carry
   more than one way back, so the buttons need to sit apart and to centre: .btn
   is an inline-flex, which text-align on the parent does not centre on its own. */
.error-page .btn{display:inline-flex;margin:0 .25rem}

/* ── Config Sections ─────────────────────────────────── */
.config-section{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1rem 1.25rem;margin-bottom:1rem;box-shadow:var(--shadow-sm)}
.config-section legend{font-weight:600;font-size:15px;padding:0 .5rem;color:var(--text)}
.config-section-title{font-size:.95rem;font-weight:600;margin-bottom:.75rem;padding-bottom:.5rem;border-bottom:1px solid var(--border-light)}
.config-section label input[type="checkbox"]{margin-right:4px}
.config-section small{display:block;color:var(--text-muted);font-size:11px;margin-top:2px}
.checkbox-label{display:flex;align-items:center;gap:.5rem;margin:.5rem 0;cursor:pointer;font-size:14px}

/* ── Dashboard Cards ─────────────────────────────────── */
.health-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.75rem;margin-bottom:1.5rem}
.health-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:.875rem 1rem;text-align:center;box-shadow:var(--shadow-sm)}
.health-card-number{font-size:1.75rem;font-weight:700;color:var(--primary);line-height:1.1}
.health-card-label{font-size:12px;color:var(--text-muted);margin-top:4px}
.health-section{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1rem 1.25rem;margin-bottom:1rem;box-shadow:var(--shadow-sm)}
.health-section h3{font-size:.95rem;font-weight:600;margin-bottom:.75rem}.health-section h3 small{font-weight:400}
.health-count{font-size:12px;color:var(--text-muted);font-weight:400}
.health-bar-chart{display:flex;flex-direction:column;gap:.5rem}
.bar-row{display:flex;align-items:center;gap:.5rem}
.bar-label{min-width:80px;text-align:center;font-size:11px}
.bar-track{flex:1;height:18px;background:#f0f0f0;border-radius:3px;overflow:hidden}
.bar-fill{height:100%;background:var(--primary);border-radius:3px;min-width:2px}
.bar-value{min-width:30px;font-size:13px;font-weight:600;text-align:right}
.fill-bar-track{display:inline-block;width:120px;height:10px;background:#f0f0f0;border-radius:3px;overflow:hidden;vertical-align:middle}
.fill-bar-track.fill-bar-sm{width:60px;height:6px}
.fill-bar{height:100%;border-radius:3px}
.fill-bar-low{background:#ef4444}.fill-bar-mid{background:#f59e0b}.fill-bar-high{background:#22c55e}

/* ── Tabs ─────────────────────────────────────────────── */
.tab-bar{display:flex;gap:0;border-bottom:2px solid var(--border);margin-bottom:1.25rem}
.tab-btn{padding:8px 20px;font-size:13px;font-weight:600;color:var(--text-muted);background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-2px;cursor:pointer;transition:all .15s}
.tab-btn:hover{color:var(--text)}.tab-btn.active{color:var(--primary);border-bottom-color:var(--primary)}
.tab-panel{display:none}.tab-panel.active{display:block}

/* ── Search / Filter ─────────────────────────────────── */
.search-bar{margin-bottom:1rem}
.search-form{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.search-input{padding:7px 10px;border:1px solid var(--border);border-radius:var(--radius);font-size:13px;min-width:200px;transition:border-color .15s,box-shadow .15s}
.search-input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 2px rgba(92,77,232,.12)}
.search-select{padding:7px 8px;border:1px solid var(--border);border-radius:var(--radius);font-size:13px;background:var(--surface)}

/* ── Projects ────────────────────────────────────────── */
.project-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem;margin-top:1rem}
.project-card{border:1px solid var(--border);border-radius:8px;padding:1.25rem;background:var(--surface);transition:box-shadow .15s;box-shadow:var(--shadow-sm)}
.project-card:hover{box-shadow:0 4px 12px rgba(0,0,0,.1)}
.project-card-active{border-color:var(--primary);background:#fafafe}
.project-card-header{display:flex;align-items:center;justify-content:space-between}
.project-card-header h3{margin:0;font-size:16px;font-weight:600}
.project-card-header h3 a{color:var(--text);text-decoration:none}
.project-card-header h3 a:hover{color:var(--primary)}
.project-card-actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.empty-state{padding:3rem 1rem;text-align:center}
.empty-state h2{color:#666;margin-bottom:.5rem}

/* ── Value Lists ─────────────────────────────────────── */
.vl-card{border-bottom:1px solid #eee;background:var(--surface)}
.vl-card-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;gap:.5rem;flex-wrap:wrap}
.vl-card-header .actions{display:flex;gap:4px;flex-wrap:wrap}
.vl-tags{display:inline-flex;flex-wrap:wrap;gap:2px}

/* ── Profile data table ─────────────────────────────── */
.profile-data-table input.data-cell{width:90px;padding:2px 6px;border:1px solid var(--border);border-radius:3px;font-size:13px;text-align:right}
.profile-data-table td{padding:4px 6px}
.profile-inline-chart{min-height:180px}

/* ── Roles ───────────────────────────────────────────── */
.roles-table .role-col{text-align:center;min-width:70px}.roles-table .perm-name{font-family:monospace;font-size:12px;white-space:nowrap}
.roles-table .perm-desc{font-size:12px;color:var(--text-muted)}
.workflow-diagram{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.5rem 0}
.workflow-arrow{color:var(--text-muted);font-size:13px}.workflow-arrow small{font-family:monospace;font-size:11px}

/* ── Help ────────────────────────────────────────────── */
.help-toc{background:#f9fafb;border:1px solid var(--border);border-radius:var(--radius);padding:1rem 1.25rem;margin-bottom:1.5rem}
.help-toc h3{margin:0 0 .5rem;font-size:14px;color:#666}
.help-toc a{display:inline-block;margin-right:1rem;margin-bottom:.25rem;color:var(--primary);font-size:14px}
.help-section{margin-bottom:2rem;padding-bottom:1.5rem;border-bottom:1px solid #eee}
.help-section h2{color:var(--text);margin-bottom:.5rem;font-size:1.1rem}
.help-dl{margin:.75rem 0}
.help-dl dt{font-weight:600;margin-top:.5rem}
.help-dl dd{margin:0 0 .5rem 1rem;color:#555}
.help-workflow{display:flex;align-items:center;gap:.5rem;margin:.75rem 0;flex-wrap:wrap}

/* ── Bulk Update ──────────────────────────────────────── */
.room-checklist{max-height:300px;overflow-y:auto;border:1px solid var(--border);border-radius:var(--radius);padding:4px 0}
.room-check-item{display:flex;align-items:center;gap:.5rem;padding:4px 10px;cursor:pointer;font-size:13px}
.room-check-item:hover{background:#f8faff}
.room-check-item.disabled{opacity:.4;cursor:not-allowed}
.room-check-item.hidden{display:none}

/* ── Tooltips ────────────────────────────────────────── */
.tooltip-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:#d0d5dd;color:#444;font-size:11px;font-weight:700;cursor:help;margin-left:4px}
.tip-bubble{position:fixed;background:#333;color:#fff;padding:6px 10px;border-radius:4px;font-size:12px;font-weight:400;white-space:normal;word-wrap:break-word;max-width:320px;width:max-content;z-index:10000;pointer-events:none;line-height:1.4;text-align:left}
.tip-arrow{position:fixed;width:0;height:0;border:5px solid transparent;border-bottom-color:#333;z-index:10001;pointer-events:none}

/* ── Review Comments ────────────────────────────────── */
.comment-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;border-radius:9px;font-size:11px;font-weight:700;padding:0 5px}
.comment-badge.open{background:#ffcdd2;color:#c62828}
.comment-badge.resolved{background:#c8e6c9;color:#2e7d32}
.comment-thread{margin-bottom:.75rem;padding:.75rem;border:1px solid #e0e0e0;border-radius:6px;background:#fafafa}
.comment-thread.comment-resolved{background:#f0f8f0;border-color:#c8e6c9}
.comment-header{display:flex;gap:.5rem;align-items:center;margin-bottom:.4rem;flex-wrap:wrap}
.comment-param{font-weight:600;font-size:13px}
.comment-meta{font-size:11px;color:#888}
.comment-body{font-size:13px;line-height:1.5;margin-bottom:.25rem}
.comment-response{margin-left:1.25rem;padding:.4rem .6rem;border-left:3px solid #1976d2;margin-bottom:.25rem;background:#fff}
/* gitea #180 — reopen entries carry the QA justification for a withdrawn signoff */
.comment-reopen{margin-left:1.25rem;padding:.4rem .6rem;border-left:3px solid #b45309;margin-bottom:.25rem;background:#fffbeb;font-size:13px}
.comment-actions{display:flex;gap:.5rem;align-items:center;margin-top:.4rem;flex-wrap:wrap}
.comment-respond-form{display:flex;gap:.25rem;align-items:center;flex:1}
.comment-input{flex:1;padding:4px 8px;border:1px solid #ccc;border-radius:4px;font-size:12px}
.col-comments{white-space:nowrap}
.btn-success{background:#2e7d32;color:#fff;border:1px solid #1b5e20}.btn-success:hover{background:#1b5e20}
.btn-warning{background:#f57f17;color:#fff;border:1px solid #e65100}.btn-warning:hover{background:#e65100}

/* ── Reviewer Parameter Checks ──────────────────────── */
.col-check{text-align:center;width:40px;min-width:40px}
.check-toggle{cursor:pointer;border:none;background:none;font-size:16px;padding:2px 6px;border-radius:4px}
.check-toggle:hover{background:#e0e0e0}
.check-ok{color:#2e7d32;font-weight:700}
.check-stale{color:#f57f17;font-weight:700}
.check-empty{color:#bbb}
/* Status badge colors for new statuses */
.badge-status-comment-incorporation{background:#fff3e0;color:#e65100;border:1px solid #ffcc80}
.badge-status-comment-incorporation-review{background:#e8eaf6;color:#283593;border:1px solid #9fa8da}
.badge-status-approval-review{background:#e0f7fa;color:#00695c;border:1px solid #80cbc4}
.btn-status-comment-incorporation{background:#fff3e0;color:#e65100;border:1px solid #ffcc80}
.btn-status-comment-incorporation:hover{background:#ffe0b2}
.btn-status-comment-incorporation-review{background:#e8eaf6;color:#283593;border:1px solid #9fa8da}
.btn-status-comment-incorporation-review:hover{background:#c5cae9}
.btn-status-approval-review{background:#e0f7fa;color:#00695c;border:1px solid #80cbc4}
.btn-status-approval-review:hover{background:#b2dfdb}
.btn-status-approved{background:#c8e6c9;color:#1b5e20;border:1px solid #a5d6a7}
.btn-status-approved:hover{background:#a5d6a7}
.form-select{width:100%;padding:6px 8px;border:1px solid #ccc;border-radius:4px;font-size:13px}

/* ── Keyboard shortcuts (gitea #45) ─────────────────────────── */
kbd{display:inline-block;padding:1px 6px;font-family:ui-monospace,monospace;font-size:11px;background:#f3f4f6;border:1px solid #d1d5db;border-bottom-width:2px;border-radius:4px;color:#374151}
.shortcuts-table td{padding:4px 8px}
.shortcuts-table td:first-child{white-space:nowrap}
tr.kbd-row-active td{background:#fef9c3 !important;box-shadow:inset 3px 0 0 #eab308}

/* Mobile: let the topnav wrap instead of overflowing the viewport. */
@media (max-width:640px){
  .topnav{flex-wrap:wrap;height:auto;padding:6px 1rem;row-gap:6px}
  .nav-user{margin-left:0}
}

/* SAT-driven parameters (gitea #75) */
.sat-value{white-space:pre-wrap}
.sat-badge{display:inline-block;margin-left:.4rem;padding:1px 6px;border-radius:10px;font-size:11px;font-weight:600;vertical-align:middle}
.sat-badge.sat-ok{background:#e6f4ea;color:#1e7e34}
.sat-badge.sat-ood{background:#fff3cd;color:#8a6d00}
.sat-badge.sat-nodata{background:#f1f3f5;color:#6b7280}

/* Export busy feedback (gitea #72) */
.btn-busy{opacity:.65;pointer-events:none;position:relative;padding-right:26px}
.btn-busy::after{content:"";position:absolute;right:8px;top:50%;width:12px;height:12px;margin-top:-6px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:rwa-spin .8s linear infinite}
@keyframes rwa-spin{to{transform:rotate(360deg)}}
