/* BSC-CMS — Light Glassmorphism with Blue-Purple Royal Accents (Design System Spec) */
:root {
  --grad-primary: linear-gradient(135deg, #1D5F86 0%, #2E86B8 100%);
  --grad-purple: linear-gradient(135deg, #2E86B8 0%, #7C6FD6 100%);
  --grad-cyan: linear-gradient(135deg, #06B6D4 0%, #2E86B8 100%);
  --grad-ambient: linear-gradient(180deg, #EEF6FB 0%, #F3F7FB 50%, #FFFFFF 100%);
  --brand: #246A93; --brand-dark: #1D5F86; --blue: #246A93; --indigo: #1F6A94; --violet: #2E86B8; --purple: #A855F7; --cyan: #06B6D4;
  --text: #0F172A; --muted: #475569; --faint: #94A3B8; --line: rgba(148, 163, 184, .28);
  --lv-debug: #06B6D4; --lv-info: #2563EB; --lv-warning: #F59E0B; --lv-error: #EF4444; --lv-critical: #991B1B;
  --success: #059669;
  --glass-bg: rgba(255, 255, 255, .78);
  --glass-border: 1px solid rgba(255, 255, 255, .9);
  --radius: 18px; --radius-sm: 12px;
  --shadow: inset 0 1px 1px 0 rgba(255, 255, 255, .8), 0 8px 32px 0 rgba(30, 64, 175, .08);
  --shadow-hover: 0 12px 36px 0 rgba(30, 64, 175, .12);
  --ease: all 220ms cubic-bezier(.4, 0, .2, 1);
  --sidebar: 272px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text); background: var(--grad-ambient); background-attachment: fixed;
  font-size: 14px; line-height: 1.5; min-height: 100vh;
}
body::before, body::after {
  content: ""; position: fixed; z-index: -1; border-radius: 50%; filter: blur(80px); opacity: .45; pointer-events: none;
}
body::before { width: 520px; height: 520px; background: #BFDCEE; top: -160px; right: -120px; }
body::after { width: 440px; height: 440px; background: #E9D5FF; bottom: -160px; left: 120px; }
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
code, pre, .mono { font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
h1.mono { font-size: 1.45rem; letter-spacing: -.02em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } small { font-size: 12px; }
.req { color: var(--lv-error); }

/* Glass primitives */
.glass {
  background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow); transition: var(--ease);
}
.glass.hover:hover, .card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card { padding: 20px 22px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child, .card-head { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 18px 14px; margin: 0; border-radius: 0 var(--radius) var(--radius) 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--grad-primary); display: grid; place-items: center; color: #fff; font-weight: 800; letter-spacing: .5px; box-shadow: 0 6px 18px rgba(29, 95, 134, .35); }
.brand b { display: block; font-size: 15px; } .brand small { color: var(--muted); }
.nav-section { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 16px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 12px; color: #334155; font-weight: 550; font-size: 14.5px; transition: var(--ease); }
.nav .ico { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: rgba(36, 106, 147, .08); color: var(--indigo); transition: var(--ease); }
.nav a:hover .ico { background: rgba(36, 106, 147, .16); }
.nav a.active .ico { background: rgba(255, 255, 255, .22); color: #fff; }
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.btn .icon { margin: -2px 0; }
.bell .icon { color: var(--indigo); }
.nav a:hover { background: rgba(36, 106, 147, .08); color: var(--indigo); text-decoration: none; }
.nav a.active { background: var(--grad-primary); color: #fff; box-shadow: 0 6px 18px rgba(29, 95, 134, .28); }
.nav .count { margin-left: auto; background: rgba(239, 68, 68, .12); color: var(--lv-error); border-radius: 999px; padding: 0 8px; font-size: 11px; font-weight: 700; }
.nav a.active .count { background: rgba(255, 255, 255, .25); color: #fff; }
.main { flex: 1; min-width: 0; padding: 18px 28px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; margin-bottom: 22px; position: sticky; top: 12px; z-index: 20; }
.topbar .crumbs { color: var(--muted); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad-purple); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip small { display: block; color: var(--muted); line-height: 1.1; }
.bell { position: relative; font-size: 18px; padding: 6px 8px; border-radius: 10px; }
.bell .dot { position: absolute; top: 0; right: 0; background: var(--lv-error); color: #fff; border-radius: 999px; font-size: 10px; padding: 0 5px; font-weight: 700; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid-4, .grid-6 { grid-template-columns: repeat(2, 1fr); } .split { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { flex-direction: column; } .sidebar { width: 100%; height: auto; position: static; border-radius: 0 0 var(--radius) var(--radius); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; } .main { padding: 14px 16px 40px; } .topbar { position: static; }
}

/* Stats */
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: 13px; letter-spacing: .01em; font-weight: 600; }
.stat .value { font-size: 30px; font-weight: 750; margin-top: 4px; background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat.purple .value { background-image: var(--grad-purple); } .stat.cyan .value { background-image: var(--grad-cyan); }
.stat.warn .value { background-image: linear-gradient(135deg, #F59E0B, #EF4444); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--grad-primary); opacity: .07; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; padding: 9px 16px; border-radius: 12px; font-weight: 600; font-size: 13.5px; transition: var(--ease); text-decoration: none !important; font-family: inherit; line-height: 1.2; white-space: nowrap; }
.btn-primary { background: var(--grad-primary); color: #fff; box-shadow: 0 6px 18px rgba(29, 95, 134, .25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(29, 95, 134, .32); }
.btn-purple { background: var(--grad-purple); color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, .7); color: var(--indigo); border: 1px solid rgba(36, 106, 147, .25); }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: linear-gradient(135deg, #EF4444, #991B1B); color: #fff; }
.btn-success { background: linear-gradient(135deg, #10B981, #059669); color: #fff; }
.btn-warn { background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { color: var(--indigo); font-weight: 600; background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 860px) { .form-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 12px; } .form-grid .field { margin-bottom: 0; }
.field > label, label.lbl { display: block; font-weight: 600; font-size: 12.5px; color: #334155; margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(148, 163, 184, .45);
  background: rgba(255, 255, 255, .85); font: inherit; color: var(--text); transition: var(--ease);
}
.input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(36, 106, 147, .14); background: #fff; }
.input[disabled], .input[readonly] { background: rgba(241, 245, 249, .8); color: var(--muted); }
select[multiple].input { min-height: 120px; }
textarea.input { resize: vertical; }
.has-error .input, .input.is-invalid { border-color: var(--lv-error); }
.field-error { color: var(--lv-error); font-size: 12px; margin-top: 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(36, 106, 147, .25); background: rgba(255, 255, 255, .7); cursor: pointer; font-size: 12.5px; }
.check-pill input { accent-color: var(--indigo); }
.check-pill:has(input:checked) { background: rgba(36, 106, 147, .12); border-color: var(--violet); color: var(--indigo); font-weight: 600; }
.inline-form { display: inline; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
fieldset { border: 1px dashed rgba(36, 106, 147, .3); border-radius: 14px; padding: 12px 16px; margin: 0 0 14px; }
legend { font-weight: 700; color: var(--indigo); padding: 0 6px; font-size: 13px; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; background: rgba(148, 163, 184, .45); transition: var(--ease); cursor: pointer; box-shadow: inset 0 1px 3px rgba(15, 23, 42, .15); }
.switch .slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: var(--ease); box-shadow: 0 2px 6px rgba(15, 23, 42, .2); }
.switch input:checked + .slider { background: var(--grad-primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 14px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(248, 250, 252, .6); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr { transition: var(--ease); }
.table tbody tr:hover { background: rgba(36, 106, 147, .04); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 28px; }
dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 12.5px; } dl.kv dd { margin: 0; font-weight: 500; word-break: break-word; }

/* Badges & pills */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.badge-success { background: rgba(16, 185, 129, .12); color: #047857; border-color: rgba(16, 185, 129, .25); }
.badge-info { background: rgba(37, 99, 235, .1); color: var(--blue); border-color: rgba(37, 99, 235, .22); }
.badge-warning { background: rgba(245, 158, 11, .13); color: #B45309; border-color: rgba(245, 158, 11, .3); }
.badge-danger { background: rgba(239, 68, 68, .1); color: #B91C1C; border-color: rgba(239, 68, 68, .25); }
.badge-critical { background: #991B1B; color: #fff; }
.badge-debug { background: rgba(6, 182, 212, .12); color: #0E7490; border-color: rgba(6, 182, 212, .3); }
.badge-neutral { background: rgba(148, 163, 184, .15); color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(36, 106, 147, .1); color: var(--indigo); margin: 0 2px; }
.pill-clause { background: rgba(6, 182, 212, .1); color: #0E7490; }
.pill-version { background: var(--grad-purple); color: #fff; }
.pill-version.draft { background: rgba(245, 158, 11, .15); color: #B45309; }
.pill-version.deprecated { background: rgba(148, 163, 184, .2); color: var(--muted); text-decoration: line-through; }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 8px; background: rgba(15, 23, 42, .05); color: var(--muted); margin: 2px; font-family: "Cascadia Code", Consolas, monospace; }

/* Alerts */
.alerts { margin-bottom: 16px; display: grid; gap: 8px; }
.alert { padding: 11px 16px; border-radius: 14px; border: 1px solid; font-weight: 500; backdrop-filter: blur(16px); }
.alert-success { background: rgba(236, 253, 245, .9); border-color: rgba(16, 185, 129, .35); color: #065F46; }
.alert-error { background: rgba(254, 242, 242, .92); border-color: rgba(239, 68, 68, .35); color: #991B1B; }
.alert-warning { background: rgba(255, 251, 235, .92); border-color: rgba(245, 158, 11, .4); color: #92400E; }
.alert-info { background: rgba(239, 246, 255, .92); border-color: rgba(37, 99, 235, .3); color: #1E40AF; }
.alert-dev { background: rgba(236, 254, 255, .95); border-color: rgba(6, 182, 212, .45); color: #155E75; font-family: Consolas, monospace; }
.alert ul { margin: 6px 0 0 18px; padding: 0; }

/* Guest / auth */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; }
.auth-card .brand { justify-content: center; padding-bottom: 8px; }
/* Company logo */
.brand-logo { flex-direction: column; align-items: flex-start; gap: 6px; text-decoration: none !important; }
.brand-logo img { display: block; width: 132px; max-width: 100%; height: auto; }
.brand-logo small { color: var(--muted); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; padding-left: 4px; }
.auth-card .brand-logo { align-items: center; }
.auth-card .brand-logo img { width: 240px; }
.brand-mark-img { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.otp-input { letter-spacing: 14px; font-size: 26px; text-align: center; font-weight: 700; }
.guest-wide { max-width: 760px; width: 100%; }

/* Pipeline board */
.board { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.board-col { padding: 12px; min-height: 240px; }
.board-col h4 { display: flex; justify-content: space-between; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.board-card { display: block; padding: 12px; margin-bottom: 10px; border-radius: 14px; background: #fff; border: 1px solid rgba(226, 232, 240, .9); color: var(--text); transition: var(--ease); }
.board-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); text-decoration: none; }
.board-card b { display: block; font-size: 13px; }

/* Workflow stepper */
.stepper { display: flex; gap: 0; margin: 6px 0 16px; }
.step { flex: 1; text-align: center; position: relative; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.step .dot { width: 28px; height: 28px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; background: rgba(148, 163, 184, .2); color: var(--muted); position: relative; z-index: 1; font-size: 12px; }
.step::before { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 3px; background: rgba(148, 163, 184, .25); }
.step:first-child::before { display: none; }
.step.done .dot { background: var(--grad-primary); color: #fff; } .step.done::before, .step.current::before { background: var(--violet); }
.step.current .dot { background: var(--grad-purple); color: #fff; box-shadow: 0 0 0 5px rgba(168, 85, 247, .18); }
.step.done, .step.current { color: var(--indigo); }
.step.rejected .dot { background: var(--lv-error); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid rgba(36, 106, 147, .25); position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--violet); }
.timeline li.reject::before { background: var(--lv-error); }

/* Template builder & dynamic forms */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1200px) { .builder { grid-template-columns: 1fr; } }
.builder-preview { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; }
.block { border-radius: 16px; background: rgba(255, 255, 255, .85); border: 1px solid rgba(199, 210, 254, .8); padding: 12px 14px; margin-bottom: 12px; }
.block-head { display: flex; gap: 8px; align-items: center; }
.block-head .handle { cursor: grab; color: var(--faint); user-select: none; }
.block-fields { margin-top: 10px; padding-left: 10px; border-left: 3px solid rgba(36, 106, 147, .2); }
.field-row { background: rgba(248, 250, 252, .9); border-radius: 12px; padding: 10px; margin-bottom: 8px; border: 1px solid rgba(226, 232, 240, .9); }
.field-row .row { display: grid; grid-template-columns: 1.3fr 2fr .9fr auto; gap: 8px; align-items: center; }
.field-row .extra { margin-top: 8px; display: grid; gap: 6px; }
.item-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 6px; }
.icon-btn { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 15px; padding: 4px 6px; border-radius: 8px; }
.icon-btn:hover { background: rgba(239, 68, 68, .1); color: var(--lv-error); }
.section-card { padding: 0; margin-bottom: 14px; overflow: hidden; }
.section-card > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 10px; font-weight: 650; background: linear-gradient(90deg, rgba(36, 106, 147, .07), transparent); }
.section-card > summary::-webkit-details-marker { display: none; }
.section-card > summary::after { content: "▾"; margin-left: auto; color: var(--faint); transition: var(--ease); }
.section-card:not([open]) > summary::after { transform: rotate(-90deg); }
.section-index { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--grad-primary); color: #fff; font-size: 12px; }
.section-body { padding: 14px 18px 6px; }
.doc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(36, 106, 147, .06); border: 1px solid rgba(36, 106, 147, .2); }
.guidance { margin: 0 0 12px; border-radius: 12px; background: rgba(6, 182, 212, .07); border: 1px dashed rgba(6, 182, 212, .4); }
.guidance > summary { cursor: pointer; padding: 8px 12px; font-size: 12.5px; font-weight: 650; color: #0E7490; }
.guidance > div { padding: 0 12px 10px; font-size: 12.5px; color: #334155; max-height: 320px; overflow-y: auto; }
.report-cover dl.kv { grid-template-columns: 120px 1fr; }
.readonly-block { padding: 10px 12px; border-radius: 12px; background: rgba(248, 250, 252, .9); border: 1px solid var(--line); min-height: 40px; }
.file-list { list-style: none; padding: 0; margin: 0 0 6px; } .file-list li { padding: 3px 0; }
.checklist td:nth-child(3) select { min-width: 120px; }

/* Calendar */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; padding: 4px; }
.cal-day { min-height: 104px; border-radius: 12px; background: rgba(255, 255, 255, .65); border: 1px solid rgba(226, 232, 240, .8); padding: 6px; font-size: 11.5px; }
.cal-day.out { opacity: .4; } .cal-day.today { border-color: var(--violet); box-shadow: 0 0 0 2px rgba(36, 106, 147, .2); }
.cal-day .d { font-weight: 700; color: var(--muted); }
.cal-ev { display: block; margin-top: 3px; padding: 2px 6px; border-radius: 6px; background: var(--grad-primary); color: #fff !important; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.t-ST1, .cal-ev.t-ST2 { background: var(--grad-purple); } .cal-ev.f-RA { background: var(--grad-cyan); }
.cal-ev.s-Completed { opacity: .55; }

/* Module cards */
.module-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.module-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.module-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--grad-cyan); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 18px rgba(6, 182, 212, .25); }

/* Diagnostics console */
.console { background: rgba(15, 23, 42, .88); color: #E2E8F0; border-radius: var(--radius); padding: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 12px 40px rgba(15, 23, 42, .25); }
.console-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); gap: 12px; flex-wrap: wrap; }
.console-body { max-height: 640px; overflow-y: auto; font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.log-line { display: grid; grid-template-columns: 150px 96px 110px 1fr auto; gap: 12px; padding: 7px 16px; border-bottom: 1px solid rgba(255, 255, 255, .04); align-items: baseline; color: #CBD5E1; }
.log-line:hover { background: rgba(255, 255, 255, .04); text-decoration: none; }
.log-line .msg { color: #F1F5F9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv { font-weight: 800; letter-spacing: .04em; }
.lv-DEBUG { color: var(--lv-debug); } .lv-INFO, .lv-NOTICE { color: #60A5FA; } .lv-WARNING { color: var(--lv-warning); }
.lv-ERROR { color: #F87171; } .lv-CRITICAL, .lv-ALERT, .lv-EMERGENCY { color: #fff; background: var(--lv-critical); padding: 0 6px; border-radius: 6px; }
.heartbeat { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #10B981; box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); animation: pulse 1.6s infinite; }
.pulse.degraded { background: var(--lv-warning); box-shadow: 0 0 0 0 rgba(245, 158, 11, .6); }
.pulse.down { background: var(--lv-error); box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.pill-filter { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, .35); background: rgba(255, 255, 255, .06); color: #CBD5E1; cursor: pointer; font-size: 11.5px; font-weight: 700; }
.pill-filter input { display: none; }
.pill-filter:has(input:checked) { background: rgba(36, 106, 147, .35); border-color: #818CF8; color: #fff; }
.frames { list-style: none; margin: 0; padding: 0; }
.frames li { padding: 8px 12px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.frames .file { color: #93C5FD; } .frames .line { color: #FBBF24; } .frames .call { color: #C4B5FD; }
pre.trace { background: rgba(15, 23, 42, .92); color: #E2E8F0; padding: 14px; border-radius: 14px; overflow-x: auto; max-height: 420px; white-space: pre-wrap; }
pre.json { background: rgba(248, 250, 252, .95); padding: 12px; border-radius: 12px; overflow-x: auto; border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }

/* Misc */
.qr-box { background: #fff; border-radius: 14px; padding: 10px; display: inline-block; border: 1px solid rgba(199, 210, 254, .8); }
.qr-box svg { display: block; width: 168px; height: 168px; }
.progress { height: 8px; border-radius: 999px; background: rgba(148, 163, 184, .2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad-primary); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.pager a { padding: 5px 11px; border-radius: 10px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); color: var(--muted); }
.pager a.current { background: var(--grad-primary); color: #fff; border-color: transparent; }
.pager { align-items: center; }
.pager .gap { color: var(--muted); padding: 0 2px; }
.pager .small { margin-left: 8px; }
.search-box { display: flex; align-items: center; gap: 8px; position: relative; margin-bottom: 14px; max-width: 560px; }
.search-box .search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); display: flex; pointer-events: none; }
.search-box input[type=search] { padding-left: 38px; flex: 1; }
.search-box .search-clear { position: absolute; right: 92px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 18px; text-decoration: none; }
.page-head .search-box { margin-bottom: 0; min-width: 320px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .input { width: auto; min-width: 150px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 12px; color: var(--muted); font-weight: 600; background: rgba(255, 255, 255, .55); border: 1px solid var(--line); }
.tabs a.active { background: var(--grad-primary); color: #fff; border-color: transparent; }
.tabs a:hover { text-decoration: none; }
.notice-list a { display: block; padding: 12px 14px; border-radius: 12px; color: var(--text); border-bottom: 1px solid var(--line); }
.notice-list a.unread { background: rgba(36, 106, 147, .06); font-weight: 600; }
.notice-list a:hover { background: rgba(36, 106, 147, .1); text-decoration: none; }
.verify-status { font-size: 22px; font-weight: 800; padding: 14px 18px; border-radius: 16px; display: flex; gap: 12px; align-items: center; }
.verify-status.ok { background: rgba(16, 185, 129, .12); color: #047857; }
.verify-status.bad { background: rgba(239, 68, 68, .1); color: #B91C1C; }
.verify-status.warn { background: rgba(245, 158, 11, .13); color: #B45309; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); backdrop-filter: blur(4px); display: none; place-items: center; z-index: 100; padding: 16px; }
.modal-backdrop.open { display: grid; }
.modal { width: 100%; max-width: 520px; padding: 22px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.flex { display: flex; gap: 10px; align-items: center; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 40px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 12.5px; }

/* Returned report — revision call-to-action */
.revise-card { border-left: 4px solid #F59E0B; }
.review-comment { margin: 0 0 12px; padding: 10px 14px; background: rgba(255, 251, 235, .9); border-radius: 10px; color: #92400E; font-style: italic; }
.table tr.row-active td { background: rgba(14, 165, 233, .08); }

.finding-matrix td, .finding-matrix th { vertical-align: middle; }
.finding-matrix input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.span-all { grid-column: 1 / -1; }
.audit-type-input { display: flex; gap: 8px; } .audit-type-input select { flex: 1; } .audit-type-input input { width: 96px; flex: 0 0 96px; }
.filters label.muted { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.audit-log h2 { margin: 0 0 6px; }
@media print {
  .sidebar, .topbar, .no-print, .flash, .toast { display: none !important; }
  .app, .main { display: block !important; margin: 0 !important; padding: 0 !important; }
  body { background: #fff !important; }
  .glass { box-shadow: none !important; background: #fff !important; border: 1px solid #cbd5e1 !important; backdrop-filter: none !important; }
  .audit-log { break-inside: avoid-page; page-break-after: always; }
  .audit-log:last-child { page-break-after: auto; }
}
.site-rows { display: flex; flex-direction: column; gap: 8px; }
.site-row { display: flex; gap: 8px; align-items: center; }
.site-row .input { flex: 1; }
.site-label { flex: 0 0 52px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.site-list { margin: 0; padding-left: 18px; }
.site-head { flex: 0 0 auto; margin: 0; white-space: nowrap; }
.site-plan td { vertical-align: top; }
.folder-group { padding: 8px 0; border-bottom: 1px solid var(--line); }
.folder-group:last-of-type { border-bottom: 0; }
.folder-label { font-weight: 650; font-size: 13px; margin-bottom: 4px; }
.folder-item { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; padding: 3px 0 3px 6px; font-size: 13px; }
.folder-item a { word-break: break-word; }
.link-btn { background: none; border: 0; padding: 0; color: var(--lv-error); cursor: pointer; font: inherit; }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-hover); }
.combo-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.combo-list li.active, .combo-list li:hover { background: rgba(36, 106, 147, .1); }
.combo-list li[aria-selected="true"] { font-weight: 600; color: var(--brand-dark); }
.combo-list .combo-empty { color: var(--muted); cursor: default; }
.combo-list .combo-empty:hover { background: none; }
.site-plan .input { min-width: 0; }
.site-plan [data-plan-head][hidden] { display: none; }
.team-matrix td { vertical-align: middle; }
.team-matrix .input { min-width: 0; }

/* Client Profile Questionnaire (CPQ) */
[data-when][hidden], .cpq-set[hidden] { display: none !important; }
.cpq-set { margin-bottom: 12px; }
.cpq-set h3 { margin: 6px 0 8px; }
.cpq-site { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 12px; background: rgba(255, 255, 255, .55); }
.cpq-shifts { min-width: 980px; }
.cpq-shifts th { font-size: 11px; text-transform: none; letter-spacing: 0; white-space: normal; line-height: 1.25; vertical-align: bottom; }
.cpq-shifts td { padding: 4px; vertical-align: middle; }
.cpq-shifts .input { padding: 7px 8px; min-width: 0; }
.cpq-shifts .input.num { width: 58px; text-align: right; }
.cpq-shifts .shift-no { white-space: nowrap; font-weight: 600; font-size: 12.5px; }
.cpq-shifts td.num { text-align: right; font-weight: 700; }
.cpq-shifts .center { text-align: center; }
.cpq-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.cpq-totals > div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; background: #fff; }
.cpq-totals b { font-size: 22px; color: var(--brand-dark); }
@media (max-width: 700px) { .cpq-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cpq-answers.lh-doc { max-width: none; background: var(--glass-bg); font-family: inherit; font-size: 13.5px; }
.cpq-public-page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px; text-align: left; }
.cpq-public-head { padding: 0; overflow: hidden; margin-bottom: 16px; }
.cpq-banner { display: block; width: 100%; aspect-ratio: 215.9 / 40; object-fit: cover; object-position: right 30%; }
.cpq-public-intro { padding: 4px 24px 18px; }
.cpq-public-intro h1 { margin: 0 0 4px; }

/* schedule form: add-on audit types (scope extension / transition) */
.audit-addons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.audit-addons[hidden] { display: none; }
.audit-addons.has-error .check-pill { border-color: #EF4444; }
.pill-addon { background: #EEF6FB; color: var(--brand-dark); border: 1px solid rgba(29, 95, 134, .2); }

/* schedule form: type per standard (integrated audit) */
.std-types-toggle { margin-top: 10px; }
.std-types { display: grid; gap: 8px; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: #F6FAFD; border: 1px solid var(--line); }
.std-types[hidden] { display: none; }
.std-type-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(260px, 1.4fr); gap: 10px; align-items: center; }
.std-type-row span { font-weight: 600; font-size: 13.5px; }

/* client: audit plans to download (Audit Schedule page) */
.plan-dl { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plan-dl small { display: block; }

/* ── Proposal approval page (link in the proposal e-mail) ─────────────── */
.pa-page { max-width: 980px; }
.pa-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; margin-bottom: 14px; }
.pa-grid.pa-single { grid-template-columns: 1fr; }
.pa-grid .card h2, .pa-state h2 { margin: 0 0 10px; font-size: 18px; }
.pa-grid dl.kv { grid-template-columns: 120px 1fr; margin-bottom: 16px; }
.pa-pdf { width: 100%; justify-content: center; }
.pa-form .field { margin-bottom: 12px; }
.pa-agree { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #EEF6FB;
    border: 1px solid rgba(29, 95, 134, .18); font-size: 13.5px; line-height: 1.45; cursor: pointer; margin: 4px 0 6px; }
.pa-agree input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: var(--brand); }
.pa-agree.has-error { border-color: #EF4444; background: #FEF2F2; }
.pa-submit { width: 100%; justify-content: center; margin: 10px 0 8px; padding: 12px; font-size: 15px; }
.pa-state { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.pa-state p { margin: 0; color: var(--muted); }
.pa-state-icon { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; }
.pa-done { border-left: 4px solid var(--success); } .pa-done .pa-state-icon { background: var(--success); }
.pa-expired { border-left: 4px solid #F59E0B; } .pa-expired .pa-state-icon { background: #F59E0B; }
@media (max-width: 860px) { .pa-grid { grid-template-columns: 1fr; } }

/* ── CRM proposals pipeline ───────────────────────────────────────────── */
.pipe-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.pipe-head h1 { margin: 2px 0 6px; font-size: 30px; letter-spacing: -.02em; }
.pipe-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.pipe-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 13px; }
.pipe-arrow { color: var(--faint); font-size: 15px; line-height: 1; }
.pipe-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pipe-tools .search-box { margin: 0; min-width: 300px; }
.pipe-tools .search-box .input { border-radius: 999px; background: rgba(255, 255, 255, .9); }
.pipe-tools .search-box .btn { display: none; }
.pipe-tools .search-box .search-clear { right: 14px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(15, 23, 42, .06); }
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; transition: var(--ease); }
.seg a.on { background: #fff; color: var(--brand-dark); box-shadow: 0 2px 10px rgba(15, 23, 42, .1); }
.pipe-new { border-radius: 999px; padding: 10px 18px; }

.pipe-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.pipe-kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 16px; background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .7));
  border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 6px 24px rgba(30, 64, 175, .06); min-width: 0; }
.pipe-kpi .k-label { font-size: 13px; font-weight: 650; letter-spacing: .01em; color: var(--muted); }
.pipe-kpi .k-value { font-size: 26px; font-weight: 760; letter-spacing: -.02em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-kpi .k-value.k-money { font-size: 18px; padding: 6px 0 3px; }
.pipe-kpi .k-sub { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Stage colours */
.stage-slate { --tone: #64748B; --tone-soft: rgba(100, 116, 139, .12); }
.stage-blue { --tone: #2563EB; --tone-soft: rgba(37, 99, 235, .11); }
.stage-amber { --tone: #D97706; --tone-soft: rgba(217, 119, 6, .12); }
.stage-violet { --tone: #7C3AED; --tone-soft: rgba(124, 58, 237, .11); }
.stage-green { --tone: #059669; --tone-soft: rgba(5, 150, 105, .12); }
.stage-rose { --tone: #E11D48; --tone-soft: rgba(225, 29, 72, .1); }

/* All six stages fit the width (no horizontal scroll bar); the board wraps on smaller screens */
.pipe-board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: start; }
.pipe-col { position: relative; min-width: 0; border-radius: 18px; padding: 10px; background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 8px 28px rgba(30, 64, 175, .05); backdrop-filter: blur(10px); }
.pipe-col::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 3px; border-radius: 0 0 4px 4px; background: var(--tone); }
.pipe-col-head { display: flex; align-items: center; gap: 9px; padding: 8px 4px 12px; }
.pipe-ico { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--tone); background: var(--tone-soft); }
.pipe-col-title { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.pipe-col-title b { font-size: 13px; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-col-title small { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-count { flex: 0 0 auto; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--tone); background: var(--tone-soft); }
.pipe-cards { display: flex; flex-direction: column; gap: 9px; }
.pipe-card { display: block; position: relative; padding: 12px; border-radius: 14px; background: #fff; color: var(--text); text-decoration: none;
  border: 1px solid rgba(226, 232, 240, .95); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.pipe-card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tone); opacity: 0; transition: opacity .18s ease; }
.pipe-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, .1); border-color: transparent; text-decoration: none; }
.pipe-card:hover::before { opacity: 1; }
.pc-top { display: flex; gap: 10px; align-items: flex-start; }
.pc-avatar { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 11.5px; font-weight: 750; color: #fff;
  background: linear-gradient(135deg, var(--av), color-mix(in srgb, var(--av) 70%, #fff)); box-shadow: 0 4px 10px color-mix(in srgb, var(--av) 30%, transparent); }
.pc-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-name b { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-name .mono { font-size: 10.5px; color: var(--faint); letter-spacing: .01em; overflow-wrap: anywhere; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.type-chip, .std-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
.type-chip { color: var(--tone, var(--muted)); background: var(--tone-soft, rgba(148, 163, 184, .15)); }
.std-chip { color: #334155; background: #F1F5F9; border: 1px solid #E2E8F0; }
.pc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 9px; border-top: 1px dashed #E2E8F0; }
.pc-country { min-width: 0; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-country .cc { flex: 0 0 auto; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: #F1F5F9; color: #475569; }
.pc-amount { flex: 0 0 auto; font-size: 13.5px; font-weight: 760; letter-spacing: -.01em; white-space: nowrap; }
.pc-amount small { font-size: 10px; font-weight: 700; color: var(--faint); margin-right: 3px; }
.pc-meta { margin-top: 7px; font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-empty { display: grid; place-items: center; min-height: 92px; border: 1.5px dashed rgba(148, 163, 184, .45); border-radius: 14px; font-size: 12px; color: var(--faint); }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; color: var(--tone); background: var(--tone-soft); white-space: nowrap; }
.stage-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
.pipe-list .table td { vertical-align: middle; }

@media (max-width: 1380px) { .pipe-board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .pipe-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .pipe-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pipe-tools .search-box { min-width: 0; flex: 1 1 100%; } .pipe-head h1 { font-size: 25px; } }
@media (max-width: 480px) { .pipe-board, .pipe-kpis { grid-template-columns: 1fr; } }
.pc-name .mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.pipe-col-title b { white-space: normal; line-height: 1.25; }
.pc-country .cn { overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1381px) and (max-width: 1800px) { .pc-country .cn { display: none; } }
.pipe-kpi .k-value.k-money { white-space: normal; line-height: 1.3; }

/* Rich text editor */
.rte { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; overflow: hidden; transition: var(--ease); }
.rte:focus-within { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(36, 106, 147, .14); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--line); background: #F8FAFC; }
.rte-btn { min-width: 30px; height: 28px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: #334155; font: 600 12.5px/1 inherit; font-family: inherit; cursor: pointer; }
.rte-btn:hover { background: rgba(36, 106, 147, .1); color: var(--brand-dark); }
.rte-btn.on { background: rgba(36, 106, 147, .16); color: var(--brand-dark); }
.rte-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.rte-area { min-height: 120px; max-height: 520px; overflow-y: auto; padding: 10px 12px; outline: none; font-size: 14px; line-height: 1.55; cursor: text; }
.rte-area:empty::before { content: "Type here…"; color: var(--faint); }
.rte-content p { margin: 0 0 8px; }
.rte-content p:last-child { margin-bottom: 0; }
.rte-content ul, .rte-content ol { margin: 4px 0 8px 22px; padding: 0; }
.rte-content li { margin: 2px 0; }
.rte-content h3, .rte-content h4 { margin: 10px 0 4px; font-size: 14.5px; }
.rte-content blockquote { margin: 6px 0; padding: 6px 12px; border-left: 3px solid var(--violet); background: rgba(36, 106, 147, .06); border-radius: 0 8px 8px 0; }
.rte-content a { color: var(--indigo); text-decoration: underline; }
.lh-doc .rte-content { font-size: inherit; }
.lh-doc .rte-content h4 { font-size: 1.05em; }

/* Section text (objective, abbreviations, notes …) in the report form and in the template builder */
.section-text { margin: 0 0 14px; color: var(--text); line-height: 1.6; }
.builder-rte .rte-area { min-height: 70px; max-height: 320px; font-size: 13.5px; }

/* Previous non-conformities table (report form) */
.prev-nc { table-layout: fixed; width: 100%; }
.prev-nc th { font-size: 12px; white-space: normal; }
.prev-nc td { vertical-align: top; font-size: 13px; }
.prev-nc .input { width: 100%; min-width: 0; padding: 6px 8px; font-size: 13px; }
.prev-nc .prev-nc-text { white-space: normal; overflow-wrap: anywhere; }

.prev-nc .prev-nc-row + .prev-nc-row tr:first-child td { border-top: 2px solid var(--border, rgba(0,0,0,.08)); }
.prev-nc .prev-nc-details td { padding-top: 0; }
.prev-nc .prev-nc-details textarea { margin-top: 4px; }
.prev-nc td.prev-nc-ref { word-break: break-all; }
.prev-nc select.input { padding: 6px 4px; }
.prev-nc input[type="date"].input { padding: 6px 4px; }
.field-previous_ncs [data-add-tpl] { margin-top: 8px; }
.field-previous_ncs > small { display: block; margin-top: 6px; }

.section-index.unnumbered { opacity: .55; }

/* 3-year audit programme (3PR) grid */
.programme-grid { table-layout: auto; }
.programme-grid th.prog-col { min-width: 64px; }
.programme-grid td { vertical-align: top; }
.programme-grid .prog-label { min-width: 260px; width: 100%; resize: vertical; min-height: 38px; font-size: 13px; }
.programme-grid .prog-cell { width: 64px; min-width: 0; text-align: center; padding: 6px 4px; cursor: pointer; }
.programme-grid .prog-flag { width: 34px; text-align: center; padding-left: 4px; padding-right: 4px; }
.programme-grid tr.prog-hl td, .programme-table tr.prog-hl td { background: rgba(148, 163, 184, .22); }
.programme-grid tr.prog-heading td, .programme-table tr.prog-heading td { background: rgba(37, 99, 235, .08); font-weight: 700; }
.programme-grid tr.prog-heading .prog-cell { visibility: hidden; }
.programme-grid tr.prog-na td, .programme-table tr.prog-na td { color: var(--muted); }
.programme-grid tr.prog-na .prog-cell { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(148, 163, 184, .18) 6px 8px); }
.programme-grid tr.prog-na .prog-label { text-decoration: line-through; text-decoration-color: rgba(100, 116, 139, .6); }
.prog-tabs { margin-top: -4px; }
/* centred table columns (e.g. ST1 / ST2 / CA1 / CA2 of the 3PR): stronger than the default left-aligned header */
.table th.center, .table td.center { text-align: center; }
.programme-grid td.center .prog-cell { margin: 0 auto; display: block; }
/* 3PR menu tabs: one row; template count (Administrators only) */
.prog-tabs { flex-wrap: nowrap; align-items: center; }
.prog-tabs a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; background: rgba(37, 99, 235, .12); color: #1d4ed8; }
.tabs a.active .tab-count { background: rgba(255, 255, 255, .25); color: #fff; }

/* CPQ main-form editor (Administrator) */
.cpq-builtins { display: flex; flex-wrap: wrap; gap: 8px; }
.cpq-builtins .check-pill.locked { opacity: .85; }
.cpq-qs { display: grid; gap: 10px; margin-bottom: 8px; }
.cpq-q { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: rgba(255, 255, 255, .55); }
.cpq-q-grid { display: grid; grid-template-columns: minmax(200px, 1fr) 220px auto auto; gap: 8px; align-items: center; }
.cpq-q-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
@media (max-width: 760px) { .cpq-q-grid, .cpq-q-grid2 { grid-template-columns: 1fr; } }
.cpq-added { display: contents; }

/* Commercial flow: Client Profile → 3PR → Proposal → Client */
.flow-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: step; }
.flow-steps li { counter-increment: step; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px;
    background: rgba(255, 255, 255, .6); border: 1px solid var(--line); color: var(--muted); }
.flow-steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; background: rgba(148, 163, 184, .25); }
.flow-steps li.done { color: #047857; border-color: rgba(16, 185, 129, .35); }
.flow-steps li.done::before { content: '✓'; background: rgba(16, 185, 129, .18); }
.flow-steps li.current { color: #fff; background: var(--grad-primary); border-color: transparent; font-weight: 600; }
.flow-steps li.current::before { background: rgba(255, 255, 255, .25); }
.flow-steps li a { color: inherit; text-decoration: underline; }

/* CPQ: Site 1 shows the current full address (read-only) */
.input.site-from-address { background: rgba(241, 245, 249, .9); color: var(--muted); cursor: default; }

/* ===== Dashboard (staff) — hero, filters, KPI tiles, charts ===== */
.dash-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px 28px 20px; margin-bottom: 20px; color: #E6F0F8;
  background: radial-gradient(1200px 300px at 85% -40%, rgba(125, 211, 252, .35), transparent 60%),
              radial-gradient(600px 260px at 0% 120%, rgba(124, 111, 214, .35), transparent 60%),
              linear-gradient(135deg, #0B2540 0%, #12395E 48%, #1D5F86 100%);
  box-shadow: 0 18px 40px -18px rgba(11, 37, 64, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.dash-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent 30%, #000 100%); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%); }
.dash-hero > * { position: relative; z-index: 1; }
.dash-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.dash-hero h1 { color: #fff; font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin: 4px 0 4px; }
.dash-eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .14em; color: #93C5E8; font-weight: 650; }
.dash-scope { margin: 0; color: #B8CDE0; font-size: 13.5px; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-btn { display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 12px; font-weight: 650; font-size: 13.5px; color: #fff; cursor: pointer; font-family: inherit;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(8px); transition: var(--ease); }
.dash-btn:hover { background: rgba(255, 255, 255, .16); text-decoration: none; transform: translateY(-1px); }
.dash-btn-solid { background: #fff; color: #0B2540; border-color: #fff; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .35); }
.dash-btn-solid:hover { background: #E6F0F8; }
.dash-filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); }
.dash-filters label { display: flex; flex-direction: column; gap: 5px; min-width: 190px; flex: 0 1 220px; margin: 0; }
.dash-filters label > span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #93C5E8; font-weight: 650; }
.dash-filters select { appearance: none; -webkit-appearance: none; width: 100%; padding: 9px 34px 9px 12px; border-radius: 11px; font: inherit; font-size: 13.5px;
  color: #fff; background: rgba(255, 255, 255, .09) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2393C5E8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid rgba(255, 255, 255, .2); cursor: pointer; transition: var(--ease); box-shadow: none; }
.dash-filters select:hover, .dash-filters select:focus { background-color: rgba(255, 255, 255, .15); border-color: rgba(147, 197, 232, .7); outline: none; }
.dash-filters option { color: var(--text); background: #fff; }
.dash-reset { color: #BAE6FD; font-size: 13px; font-weight: 600; padding: 9px 4px; }

.dash-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.dash-kpi { --tone: #1D5F86; --tint: rgba(29, 95, 134, .1); position: relative; display: flex; flex-direction: column; padding: 18px 18px 16px; border-radius: 18px;
  background: #fff; border: 1px solid rgba(15, 23, 42, .06); box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -14px rgba(15, 42, 80, .22);
  color: var(--text); overflow: hidden; transition: var(--ease); }
.dash-kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--tone); opacity: .85; }
.dash-kpi::after { content: ""; position: absolute; right: -36px; bottom: -46px; width: 120px; height: 120px; border-radius: 50%; background: var(--tint); }
.dash-kpi:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 18px 40px -16px rgba(15, 42, 80, .32); }
.dash-kpi-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--tint); color: var(--tone); margin-bottom: 14px; }
.dash-kpi-label { font-size: 13px; letter-spacing: .01em; color: var(--muted); font-weight: 650; line-height: 1.35; min-height: 35px; }
.dash-kpi-value { font-size: 34px; font-weight: 780; letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; color: #0B2540; font-variant-numeric: tabular-nums; }
.dash-kpi-note { font-size: 12px; color: var(--faint); margin-top: 6px; position: relative; z-index: 1; }
.tone-blue { --tone: #1D5F86; --tint: rgba(29, 95, 134, .1); } .tone-violet { --tone: #6D5BD0; --tint: rgba(109, 91, 208, .1); }
.tone-amber { --tone: #D97706; --tint: rgba(217, 119, 6, .1); } .tone-rose { --tone: #E11D48; --tint: rgba(225, 29, 72, .09); }
.tone-cyan { --tone: #0891B2; --tint: rgba(8, 145, 178, .1); } .tone-emerald { --tone: #059669; --tint: rgba(5, 150, 105, .1); }

.dash-row { display: grid; gap: 20px; margin-bottom: 20px; align-items: stretch; }
.dash-row-2-1 { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.dash-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-card { background: rgba(255, 255, 255, .92); border: 1px solid rgba(15, 23, 42, .06); border-radius: 20px; padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 14px 36px -20px rgba(15, 42, 80, .25); min-width: 0; }
.dash-attention { margin-bottom: 20px; border-left: 4px solid #6D5BD0; }
.dash-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.dash-card-head h2 { font-size: 16.5px; font-weight: 720; margin: 0; color: #0B2540; }
.dash-card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--faint); }
.dash-link { font-size: 13px; font-weight: 600; white-space: nowrap; }
.dash-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.dash-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-done::before { background: linear-gradient(#1D5F86, #2E86B8); } .lg-planned::before { background: #7DD3FC; }
.dash-bars { width: 100%; height: auto; display: block; }
.dash-bars .grid-line { stroke: rgba(148, 163, 184, .25); stroke-dasharray: 3 4; }
.dash-bars .axis { font-size: 11px; fill: #94A3B8; font-family: inherit; }
.dash-bars .axis-now { fill: #1D5F86; font-weight: 700; }
.dash-bars .bar-val { font-size: 11px; fill: #0B2540; font-weight: 700; font-family: inherit; }
.dash-bars .now-band { fill: rgba(46, 134, 184, .07); }
.dash-bars .empty-bar { fill: rgba(148, 163, 184, .3); }
.dash-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dash-chip { font-size: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(29, 95, 134, .07); color: var(--muted); }
.dash-chip b { color: #0B2540; margin-right: 2px; }
.dash-chip-total { background: #0B2540; color: #B8CDE0; } .dash-chip-total b { color: #fff; }
.dash-donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.dash-donut { width: 150px; height: 150px; flex: none; }
.dash-donut .donut-track { fill: none; stroke: rgba(148, 163, 184, .18); stroke-width: 16; }
.dash-donut .donut-num { font-size: 26px; font-weight: 780; fill: #0B2540; font-family: inherit; }
.dash-donut .donut-cap { font-size: 10px; fill: #94A3B8; text-transform: uppercase; letter-spacing: .1em; font-family: inherit; }
.dash-legend-list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; }
.dash-legend-list li { display: grid; grid-template-columns: 12px 1fr auto 40px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px dashed rgba(148, 163, 184, .3); font-size: 13px; }
.dash-legend-list li:last-child { border-bottom: 0; }
.dash-legend-list i { width: 10px; height: 10px; border-radius: 3px; }
.dash-legend-list em { font-style: normal; color: var(--faint); font-size: 12px; text-align: right; }
.dash-table th { font-size: 11px; letter-spacing: .08em; }
.dash-client, .dash-person { display: flex; align-items: center; gap: 9px; }
.dash-flag { display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 5px; border-radius: 6px; font-size: 10.5px; font-weight: 750;
  letter-spacing: .04em; background: rgba(29, 95, 134, .08); color: #1D5F86; margin-right: 8px; flex: none; }
.dash-client .dash-flag { margin-right: 0; }
.dash-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 750; color: #fff; flex: none;
  background: linear-gradient(135deg, #1D5F86, #6D5BD0); }
.dash-soon { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(217, 119, 6, .12); color: #B45309; font-weight: 650; font-size: 11px; }
.dash-watch { display: flex; flex-direction: column; gap: 10px; }
.dash-watch-item { display: flex; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 14px; color: inherit; border: 1px solid rgba(148, 163, 184, .2); transition: var(--ease); }
.dash-watch-item:hover { text-decoration: none; background: rgba(29, 95, 134, .04); border-color: rgba(29, 95, 134, .25); }
.dash-days { width: 54px; height: 54px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; line-height: 1; }
.dash-days b { font-size: 19px; font-weight: 780; } .dash-days small { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }
.dash-days.tone-danger, .dash-days.tone-over { background: rgba(225, 29, 72, .1); color: #BE123C; }
.dash-days.tone-warning { background: rgba(217, 119, 6, .12); color: #B45309; }
.dash-days.tone-info { background: rgba(29, 95, 134, .1); color: #1D5F86; }
.dash-watch-body { display: flex; flex-direction: column; min-width: 0; }
.dash-watch-body b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-watch-body small { color: var(--faint); font-size: 11.5px; }
.dash-empty { color: var(--faint); margin: 6px 0; }
.dash-hbar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 30px; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; color: inherit; }
.dash-hbar-link { border-radius: 8px; } .dash-hbar-link:hover { text-decoration: none; background: rgba(29, 95, 134, .04); }
.dash-hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; }
.dash-hbar b { text-align: right; color: #0B2540; }
.dash-hbar-track, .dash-funnel-bar { height: 8px; border-radius: 999px; background: rgba(148, 163, 184, .18); overflow: hidden; }
.dash-hbar-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1D5F86, #2E86B8); }
.dash-hbar-track.alt > span { background: linear-gradient(90deg, #6D5BD0, #2E86B8); }
.dash-funnel-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 28px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.dash-funnel-row b { text-align: right; color: #0B2540; }
.dash-funnel-bar { height: 12px; }
.dash-funnel-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #059669, #0891B2); }
.dash-funnel-row.lost .dash-funnel-bar > span { background: #CBD5E1; }
.dash-funnel-row.lost { color: var(--faint); }
.dash-subhead { margin-top: 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 650; }
@media (max-width: 1400px) { .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .dash-row-2-1, .dash-row-3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .dash-hero { padding: 20px 16px 16px; } .dash-hero h1 { font-size: 24px; }
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dash-filters label { flex: 1 1 100%; min-width: 0; }
  .dash-kpi-value { font-size: 28px; }
}
.dash-client-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.dash-client-body b { font-weight: 650; color: #0B2540; }
.dash-client-body a { font-size: 11.5px; }
.dash-soon { margin-left: 0; margin-top: 3px; }
.dash-legend-list li.muted { display: block; border: 0; }
@media (max-width: 640px) { .topbar { flex-wrap: wrap; } .topbar-right { flex-wrap: wrap; max-width: 100%; } }
.pipe-filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: -4px 0 16px; }
.pipe-filters label { display: flex; flex-direction: column; gap: 4px; margin: 0; flex: 0 1 210px; min-width: 170px; }
.pipe-filters label > span { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.pipe-filters .input { border-radius: 12px; background: rgba(255, 255, 255, .9); padding: 8px 12px; }
.pipe-filters-clear { font-size: 13px; font-weight: 600; padding: 9px 2px; }
.pipe-filters-note { font-size: 12px; color: var(--faint); padding: 9px 0; }
@media (max-width: 640px) { .pipe-filters label { flex: 1 1 100%; min-width: 0; } }
/* Period filter (dashboard + pipeline) */
.period-range { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.period-range[hidden] { display: none; }
.period-range label { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 150px; }
.period-range label > span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 650; }
.period-apply { padding: 8px 16px; border-radius: 11px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; border: 1px solid transparent; }
.dash-filters .period-range label > span { color: #93C5E8; }
.dash-filters input[type=date] { padding: 8px 10px; border-radius: 11px; font: inherit; font-size: 13.5px; color: #fff; color-scheme: dark;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .2); }
.dash-filters input[type=date]:focus { outline: none; border-color: rgba(147, 197, 232, .7); background: rgba(255, 255, 255, .15); }
.dash-filters .period-apply { background: #fff; color: #0B2540; }
.dash-filters optgroup { color: var(--muted); background: #fff; }
.pipe-filters .period-range label > span { color: var(--faint); }
.pipe-filters .period-apply { background: var(--grad-primary); color: #fff; }
@media (max-width: 640px) { .period-range, .period-range label { flex: 1 1 100%; } }
.dash-filters .period-range, .pipe-filters .period-range { flex: 0 0 auto; flex-wrap: nowrap; }
.dash-filters .period-range label, .pipe-filters .period-range label { flex: 0 0 165px; min-width: 0; }
@media (max-width: 640px) { .dash-filters .period-range, .pipe-filters .period-range { flex: 1 1 100%; flex-wrap: wrap; } .dash-filters .period-range label, .pipe-filters .period-range label { flex: 1 1 40%; } }
/* One-row toolbar: tabs, then (pushed right) search / page actions */
.tab-row { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tab-row > .tabs { margin-bottom: 0; }
.tab-row > small { flex: 0 1 auto; }
.tab-row-end { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tab-row-end .search-box, .tab-row-end .filters { margin: 0; }
.tab-row-end .search-box { min-width: 300px; }
.tab-row-end .filters .input { min-width: 240px; }
.tabs .tab-btn { padding: 7px 14px; border-radius: 12px; font-size: inherit; color: #fff; background: var(--grad-primary); border-color: transparent; box-shadow: 0 4px 14px -6px rgba(29, 95, 134, .6); }
.tabs .tab-btn:hover { color: #fff; }
@media (max-width: 760px) { .tab-row-end { margin-left: 0; width: 100%; } .tab-row-end .search-box { min-width: 0; flex: 1; } }
@media (min-width: 761px) {
  .tab-row > .tabs a { white-space: nowrap; }
  .tab-row-end { flex-wrap: nowrap; }
  .tab-row-end .search-box { min-width: 240px; width: 280px; }
  .tab-row-end .filters .input { min-width: 0; width: 210px; }
  .tab-row > small { min-width: 0; }
}
.report-kind { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.report-kind.kind-online { background: rgba(29, 95, 134, .1); color: #1D5F86; }
.report-kind.kind-upload { background: rgba(109, 91, 208, .1); color: #5B4BC4; }

/* Finding (CAR) modal */
.modal.finding-modal { max-width: 760px; padding: 0; background: #fff; border-radius: 22px; border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: 0 30px 70px -20px rgba(11, 37, 64, .45); max-height: calc(100vh - 32px); overflow-y: auto; }
.fm-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid rgba(148, 163, 184, .22); position: sticky; top: 0; z-index: 2;
  background: linear-gradient(135deg, #0B2540 0%, #12395E 55%, #1D5F86 100%); color: #fff; border-radius: 22px 22px 0 0; }
.fm-head h3 { margin: 0; font-size: 18px; color: #fff; }
.fm-head p { margin: 2px 0 0; font-size: 12.5px; color: #B8CDE0; font-family: "JetBrains Mono", Consolas, monospace; }
.fm-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #BAE6FD; flex: none; }
.fm-close { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08);
  color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.fm-close:hover { background: rgba(255, 255, 255, .18); }
.finding-form { padding: 20px 22px 0; }
.fm-section { margin-bottom: 16px; }
.fm-label { font-weight: 650; font-size: 12.5px; color: #334155; margin-bottom: 8px; }
.fm-label small { font-weight: 500; color: var(--faint); margin-left: 6px; }
.type-pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.type-pill { position: relative; cursor: pointer; margin: 0; }
.type-pill input { position: absolute; opacity: 0; pointer-events: none; }
.type-pill span { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px; border-radius: 14px; border: 1.5px solid rgba(148, 163, 184, .35);
  background: #F8FAFC; transition: var(--ease); }
.type-pill b { font-size: 14px; color: #0B2540; } .type-pill small { font-size: 11.5px; color: var(--faint); }
.type-pill:hover span { border-color: rgba(29, 95, 134, .45); }
.type-pill input:focus-visible + span { box-shadow: 0 0 0 4px rgba(36, 106, 147, .18); }
.type-pill input:checked + span { background: rgba(29, 95, 134, .07); border-color: #1D5F86; box-shadow: inset 0 0 0 1px #1D5F86; }
.type-pill.type-major input:checked + span { background: rgba(225, 29, 72, .06); border-color: #E11D48; box-shadow: inset 0 0 0 1px #E11D48; }
.type-pill.type-minor input:checked + span { background: rgba(217, 119, 6, .07); border-color: #D97706; box-shadow: inset 0 0 0 1px #D97706; }
.type-pill.type-area-of-concern input:checked + span { background: rgba(109, 91, 208, .07); border-color: #6D5BD0; box-shadow: inset 0 0 0 1px #6D5BD0; }
.type-pill.type-ofi input:checked + span { background: rgba(5, 150, 105, .07); border-color: #059669; box-shadow: inset 0 0 0 1px #059669; }
.crit-list { display: flex; flex-direction: column; gap: 8px; }
.crit-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 36px; gap: 8px; align-items: center; padding: 8px; border-radius: 14px;
  background: #F8FAFC; border: 1px solid rgba(148, 163, 184, .25); }
.crit-row .input { background: #fff; }
.crit-remove { width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(148, 163, 184, .35); background: #fff; color: var(--muted); font-size: 18px; cursor: pointer; }
.crit-remove:hover { color: #BE123C; border-color: rgba(225, 29, 72, .4); background: rgba(225, 29, 72, .05); }
.crit-add { margin-top: 8px; padding: 7px 14px; border-radius: 10px; border: 1.5px dashed rgba(29, 95, 134, .45); background: rgba(29, 95, 134, .04);
  color: #1D5F86; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.crit-add:hover { background: rgba(29, 95, 134, .09); }
.finding-form .input { background: #fff; }
.finding-form textarea.input { line-height: 1.55; }
.fm-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; margin: 18px -22px 0; border-top: 1px solid rgba(148, 163, 184, .22);
  background: #F8FAFC; border-radius: 0 0 22px 22px; position: sticky; bottom: 0; }
@media (max-width: 640px) { .crit-row { grid-template-columns: 1fr 36px; } .crit-row select { grid-column: 1 / -1; } }
/* Click-to-tick table columns, e.g. "Opening meeting (√)" */
.sampling th.tick-col, .sampling td.tick-col { text-align: center; width: 104px; }
.tick-cell { display: inline-grid; place-items: center; cursor: pointer; margin: 0; }
.tick-cell input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick-cell span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; font-weight: 800; color: transparent;
  border: 1.5px solid rgba(148, 163, 184, .55); background: #fff; transition: var(--ease); user-select: none; }
.tick-cell:hover span { border-color: #2E86B8; background: rgba(46, 134, 184, .06); color: rgba(46, 134, 184, .35); }
.tick-cell input:checked + span { background: var(--grad-primary); border-color: transparent; color: #fff; box-shadow: 0 4px 12px -4px rgba(29, 95, 134, .55); }
.tick-cell input:focus-visible + span { box-shadow: 0 0 0 4px rgba(36, 106, 147, .2); }
.tick-mark { font-weight: 800; color: #1D5F86; }
.sampling th.tick-col { white-space: normal; line-height: 1.3; min-width: 84px; width: 92px; }
/* Standards grouped by category: Accredited / Non-accredited (Site Administration → Standard schemes) */
.std-group { padding: 10px 12px 12px; border-radius: 14px; border: 1px solid rgba(148, 163, 184, .25); background: rgba(248, 250, 252, .7); }
.std-group + .std-group { margin-top: 10px; }
.std-group-title { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: #0B2540; margin-bottom: 8px; }
.std-group-title small { font-weight: 500; color: var(--faint); }
.std-group.std-accredited { border-color: rgba(5, 150, 105, .25); background: rgba(5, 150, 105, .04); }
.std-group.std-accredited .std-group-title svg { color: #059669; }
/* Standard scheme directory: one-row register / edit form, full-width list */
.scheme-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, .8fr) minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.scheme-form .field { margin-bottom: 0; }
.scheme-form .field small.muted { display: none; }
.scheme-form-actions { display: flex; gap: 8px; padding-bottom: 1px; }
.scheme-form-card.editing { border-left: 4px solid var(--violet); }
.scheme-table { width: 100%; }
.scheme-table td { vertical-align: middle; }
.scheme-name { display: flex; align-items: center; gap: 10px; }
.scheme-name b { min-width: 46px; padding: 3px 8px; border-radius: 8px; background: rgba(29, 95, 134, .08); color: #1D5F86; text-align: center; font-size: 12px; }
@media (max-width: 1100px) { .scheme-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } .scheme-form-actions { grid-column: 1 / -1; justify-content: flex-end; } }
@media (max-width: 760px) { .scheme-table thead { display: none; } .scheme-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .scheme-table td { border: 0; padding: 2px 4px; } .scheme-table td:first-child { grid-column: 1 / -1; } .scheme-form { grid-template-columns: 1fr; } }
/* Site Administration → Proposal template */
.pt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.pt-layout[hidden] { display: none; }
.pt-side { position: sticky; top: 96px; }
.pt-ph { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12px; }
.pt-ph dt { color: #1D5F86; font-size: 11.5px; } .pt-ph dd { margin: 0; color: var(--muted); }
.pt-section { background: #fff; border: 1px solid rgba(15, 23, 42, .08); border-radius: 14px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.pt-section > summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; font-weight: 650; color: #0B2540; }
.pt-section > summary::-webkit-details-marker { display: none; }
.pt-section[open] > summary { border-bottom: 1px solid rgba(148, 163, 184, .25); }
.pt-no { min-width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(29, 95, 134, .1); color: #1D5F86; font-size: 12px; }
.pt-sum-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-tools { display: flex; gap: 4px; }
.pt-section-body { padding: 12px 14px 14px; }
.pt-section-head { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pt-section-head .field { flex: 1 1 320px; margin: 0; }
.pt-block .rte-area, .pt-section .rte-area { min-height: 110px; }
.pt-labels td { vertical-align: middle; }
.pt-labels .check-pill { white-space: normal; }
.pt-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; align-items: center; margin-top: 14px; padding: 12px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .96); border: 1px solid rgba(15, 23, 42, .08); box-shadow: 0 -8px 24px -16px rgba(15, 42, 80, .35); }
.pt-savebar .input { flex: 1; }
@media (max-width: 1100px) { .pt-layout { grid-template-columns: 1fr; } .pt-side { position: static; } }
/* Audit plan — online form */
.ap-obj-group[hidden] { display: none; }
.ap-obj-line { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-weight: 400; color: var(--text); }
.ap-obj-line input { margin-top: 3px; accent-color: var(--indigo); }
.ap-kv { margin: 12px 0 4px; }
.ap-na-row { grid-template-columns: minmax(0, .7fr) minmax(0, 1.6fr) 36px; }
.ap-itin-form td { vertical-align: top; }
.ap-itin-form textarea.input { min-height: 38px; }
[data-ap-fsms][hidden] { display: none; }
.apt-itin { grid-template-columns: 140px 140px minmax(0, 1fr) 36px; }
/* Audit plan itinerary: rows grouped per audit day, dragged by the handle */
.ap-day { border: 1px solid rgba(148, 163, 184, .3); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; background: #fff; transition: var(--ease); }
.ap-day.drop-target { border-color: #2E86B8; box-shadow: 0 0 0 3px rgba(46, 134, 184, .15); }
.ap-day-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; color: #0B2540; }
.ap-day-no { padding: 2px 10px; border-radius: 999px; background: rgba(29, 95, 134, .1); color: #1D5F86; font-size: 12px; font-weight: 700; }
.ap-day .table { margin-bottom: 4px; }
.ap-drag { cursor: grab; color: var(--faint); font-weight: 800; letter-spacing: -2px; text-align: center; user-select: none; vertical-align: middle !important; }
tr[data-ap-row].dragging { opacity: .45; background: rgba(46, 134, 184, .08); }
.ap-drag { touch-action: none; }
/* Document templates: one-row tabs + document control of the template */
.doc-tpl-tabs { margin-bottom: 18px; }
.doc-control-inline { gap: 8px; }
.doc-control-inline .input { width: 110px; padding: 7px 10px; }
.doc-control-inline .input[name="doc_date"] { width: 120px; }
/* Auditor dashboard */
.dash-stack { margin-bottom: 20px; }
.dash-row > div > .dash-stack:last-child { margin-bottom: 0; }
.aud-next { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 14px 16px; border-radius: 16px; color: #fff; text-decoration: none;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); transition: var(--ease); }
.aud-next:hover { background: rgba(255, 255, 255, .14); text-decoration: none; }
.aud-date { width: 56px; height: 60px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; line-height: 1;
  background: #fff; color: #0B2540; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .4); }
.aud-date b { font-size: 22px; font-weight: 800; } .aud-date small { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; color: #1D5F86; font-weight: 700; }
.aud-next-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.aud-next-body small { color: #93C5E8; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 650; }
.aud-next-body b { font-size: 17px; } .aud-next-body > span { color: #B8CDE0; font-size: 13px; }
.aud-plan { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.aud-plan.ok { background: rgba(16, 185, 129, .18); color: #A7F3D0; } .aud-plan.warn { background: rgba(245, 158, 11, .2); color: #FDE68A; } .aud-plan.todo { background: rgba(255, 255, 255, .12); color: #E2E8F0; }
.aud-plan.mini { font-size: 10.5px; padding: 2px 8px; }
.aud-plan.mini.ok { background: rgba(16, 185, 129, .12); color: #047857; } .aud-plan.mini.warn { background: rgba(245, 158, 11, .14); color: #B45309; } .aud-plan.mini.todo { background: rgba(148, 163, 184, .16); color: var(--muted); }
.aud-list { display: flex; flex-direction: column; gap: 10px; }
.aud-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(148, 163, 184, .22); color: inherit; transition: var(--ease); }
.aud-item:hover { text-decoration: none; border-color: rgba(29, 95, 134, .3); background: rgba(29, 95, 134, .03); }
.aud-date.small-date { width: 46px; height: 50px; background: rgba(29, 95, 134, .08); box-shadow: none; } .aud-date.small-date b { font-size: 18px; }
.aud-item-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.aud-item-body b { color: #0B2540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .aud-item-body small { color: var(--faint); font-size: 11.5px; }
.aud-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.aud-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(148, 163, 184, .3); color: inherit; }
.aud-line:last-child { border-bottom: 0; } .aud-line:hover { text-decoration: none; }
.aud-line > span:first-child { display: flex; flex-direction: column; min-width: 0; } .aud-line b { color: #0B2540; font-size: 13.5px; } .aud-line small { color: var(--faint); font-size: 11.5px; }
.aud-comment { font-style: italic; }
.dash-soon.over { background: rgba(225, 29, 72, .1); color: #BE123C; }
@media (max-width: 640px) { .aud-next { flex-wrap: wrap; } }
.aud-grid { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); }
.aud-tags { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.aud-grid .dash-client-body b { white-space: normal; }
@media (max-width: 1100px) { .aud-grid { grid-template-columns: 1fr; } }
/* Download menu (e.g. calendar .ics) */
.dl-menu { position: relative; }
.dl-menu > summary { list-style: none; cursor: pointer; }
.dl-menu > summary::-webkit-details-marker { display: none; }
.dl-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 290px; padding: 8px; border-radius: 14px; background: #fff;
  border: 1px solid rgba(15, 23, 42, .08); box-shadow: 0 18px 40px -16px rgba(15, 42, 80, .35); }
.dl-menu-list a { display: flex; flex-direction: column; padding: 9px 10px; border-radius: 10px; color: #0B2540; }
.dl-menu-list a:hover { background: rgba(29, 95, 134, .06); text-decoration: none; }
.dl-menu-list small { color: var(--faint); }
.dl-menu-list p { margin: 6px 10px 2px; font-size: 11.5px; color: var(--faint); }

/* Page dashboards (Clients, Audit Scheduling): KPI tiles and charts above the list */
.dash-kpi.is-static { cursor: default; }
.dash-kpi.is-static:hover { transform: none; }
.page-insights { margin-bottom: 20px; }
.page-insights .dash-card { min-width: 0; }
.ins-stack { display: flex; gap: 3px; height: 14px; border-radius: 8px; overflow: hidden; background: var(--line, #E2E8F0); margin: 6px 0 16px; }
.ins-stack span { min-width: 4px; }
.ins-cols { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: end; height: 168px; padding-top: 8px; }
.ins-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; text-decoration: none; color: inherit; }
.ins-col:hover { text-decoration: none; }
.ins-col b { font-size: 13px; }
.ins-col-bar { width: 100%; max-width: 44px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #2E86B8, #1D5F86); min-height: 4px; transition: filter .15s; }
.ins-col:hover .ins-col-bar { filter: brightness(1.12); }
.ins-col.is-now .ins-col-bar { background: linear-gradient(180deg, #F59E0B, #D97706); }
.ins-col small { color: var(--muted, #64748B); font-size: 11.5px; white-space: nowrap; }
.ins-col em { font-style: normal; font-size: 11px; color: var(--muted, #64748B); }
@media (max-width: 1280px) { .page-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .page-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Audit Reports dashboard */
.dash-legend-list li .ins-legend-link { grid-column: 1 / 3; display: grid; grid-template-columns: 12px 1fr; gap: 8px; align-items: center; color: inherit; }
.dash-legend-list li .ins-legend-link:hover { text-decoration: none; color: #1D5F86; }
.ins-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(148, 163, 184, .25); }
.ins-facts div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ins-facts span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-facts b { font-size: 20px; color: #0B2540; line-height: 1.2; }
.ins-facts em { font-style: normal; font-size: 11.5px; color: var(--faint); }
.page-insights .dash-hbar:has(.ins-hbar-note) .dash-hbar-label { flex-direction: column; align-items: flex-start; }
.ins-hbar-note { font-size: 11px; color: #64748B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* page dashboards: short item lists (e.g. longest waiting reviews) */
.ins-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.ins-list li { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 10px; background: #F6FAFD; border: 1px solid var(--line); font-size: 13px; min-width: 0; }
.ins-list li a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-list li small { font-size: 11.5px; }
/* list filter bar (ListFilter) */
.list-filters .lf-search { flex: 1 1 240px; min-width: 220px; }
.list-filters .lf-date .input { min-width: 140px; }
.dash-hbar-track.ins-split > span { position: relative; background: linear-gradient(90deg, #7FB3D1, #9CC4DC); }
.dash-hbar-track.ins-split > span > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: linear-gradient(90deg, #E11D48, #F43F5E); }

/* Hide / show a list page's dashboard (per user) */
.dash-toggle { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: 0 0 8px; }
.dash-toggle .btn { font-size: 12px; }
.dash-toggle.is-hidden { padding: 8px 14px; border-radius: 12px; background: rgba(148, 163, 184, .10); border: 1px dashed rgba(148, 163, 184, .45); margin-bottom: 14px; }
