:root {
  color-scheme: light;
  --bg: #f4f2f4;
  --bg-tint: #f8f4f6;
  --panel: #ffffff;
  --panel-soft: #fbf8fa;
  --sidebar: #74455d;
  --sidebar-deep: #63374f;
  --sidebar-soft: #87556d;
  --brand: #8a4866;
  --brand-dark: #6d354f;
  --brand-strong: #9b526f;
  --brand-soft: #f1e4ea;
  --brand-faint: #faf4f7;
  --text: #292833;
  --text-strong: #1f1d25;
  --muted: #716d78;
  --muted-2: #96919b;
  --line: #e7e0e5;
  --line-strong: #d8cbd3;
  --success: #24836c;
  --success-soft: #e8f5f1;
  --warning: #b77a22;
  --warning-soft: #fff5e3;
  --danger: #b44955;
  --danger-soft: #fcebed;
  --info: #5473a8;
  --info-soft: #eaf0f9;
  --teal: #3f9188;
  --blue: #667ead;
  --shadow: 0 12px 32px rgba(72, 42, 58, .07);
  --shadow-soft: 0 5px 16px rgba(72, 42, 58, .05);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --sidebar-width: 264px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 80% 0, #faf6f8 0, transparent 34%), var(--bg); }
a { color: var(--brand); }
button, input, textarea, select { font: inherit; }
button:disabled, input:disabled, textarea:disabled, select:disabled { cursor: not-allowed; opacity: .55; }

.app-frame { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.app-frame-auth { grid-template-columns: 1fr; }
.workspace { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 18px 18px;
  background:
    radial-gradient(circle at 18% 5%, rgba(255,255,255,.13), transparent 23%),
    linear-gradient(160deg, var(--sidebar-soft), var(--sidebar) 48%, var(--sidebar-deep));
  color: #fff; display: flex; flex-direction: column; overflow-y: auto; z-index: 20;
  box-shadow: 8px 0 30px rgba(70, 39, 55, .08);
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 3px 5px 18px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 48px; }
.brand-mark svg { width: 48px; height: 48px; overflow: visible; }
.brand-shield { fill: rgba(255,255,255,.11); stroke: rgba(255,255,255,.92); stroke-width: 2.4; }
.brand-sheet { fill: rgba(255,255,255,.06); stroke: #fff; stroke-width: 2.1; stroke-linejoin: round; }
.brand-fold, .brand-check, .brand-trace { fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.brand-node { fill: #f3d8e4; stroke: #fff; stroke-width: 1.2; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 24px; letter-spacing: .06em; }
.brand-copy small { font-size: 11px; letter-spacing: .05em; opacity: .84; }

.side-nav { display: grid; gap: 5px; margin-top: 4px; }
.side-nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; color: rgba(255,255,255,.83); text-decoration: none; border-radius: 12px; transition: .18s ease; font-size: 14px; font-weight: 550; }
.side-nav-item:hover { color: #fff; background: rgba(255,255,255,.09); transform: translateX(2px); }
.side-nav-item.active { color: #fff; background: rgba(255,255,255,.18); box-shadow: inset 3px 0 0 #f3d7e3, 0 8px 18px rgba(61, 26, 44, .13); }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; font-size: 17px; line-height: 1; color: rgba(255,255,255,.9); }
.nav-icon::before { content: "◆"; font-size: 11px; }
.nav-icon-home::before { content: "⌂"; font-size: 20px; }
.nav-icon-audit::before { content: "✓"; border: 1.5px solid currentColor; border-radius: 6px; width: 18px; height: 18px; display: grid; place-items: center; font-size: 13px; }
.nav-icon-evidence::before { content: "▣"; font-size: 20px; }
.nav-icon-assessment::before { content: "⚖"; font-size: 18px; }
.nav-icon-findings::before { content: "△"; font-size: 22px; }
.nav-icon-history::before { content: "↺"; font-size: 20px; }
.nav-icon-verify::before { content: "◇"; border: 1.5px solid currentColor; border-radius: 50%; width: 19px; height: 19px; display: grid; place-items: center; }
.nav-icon-reports::before { content: "▤"; font-size: 20px; }
.nav-icon-settings::before { content: "⚙"; font-size: 18px; }
.nav-icon-assets::before { content: "▦"; font-size: 19px; }
.nav-icon-framework::before { content: "D"; border: 1.5px solid currentColor; border-radius: 50%; width: 19px; height: 19px; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.nav-icon-incidents::before { content: "!"; border: 1.5px solid currentColor; border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.nav-icon-license::before { content: "⌘"; font-size: 18px; }
.nav-icon-client::before { content: "▰"; font-size: 18px; }

.sidebar-quick { margin-top: auto; padding: 20px 7px 10px; display: grid; gap: 7px; }
.sidebar-label { color: rgba(255,255,255,.57); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; margin-bottom: 3px; }
.sidebar-quick a { color: rgba(255,255,255,.87); text-decoration: none; padding: 7px 5px; font-size: 13px; }
.quick-dot { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 6px; margin-right: 7px; background: rgba(255,255,255,.13); }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.14); margin-top: 10px; padding: 14px 7px 0; display: grid; gap: 4px; color: rgba(255,255,255,.62); font-size: 11px; }
.company-mini { color: rgba(255,255,255,.82); }

.topbar { min-height: 78px; padding: 15px 28px; display: flex; align-items: center; gap: 22px; justify-content: space-between; background: rgba(255,255,255,.86); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15; }
.global-search { flex: 1; max-width: 680px; height: 46px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 0 13px; background: #fff; box-shadow: var(--shadow-soft); }
.global-search:focus-within { border-color: #c9a5b7; box-shadow: 0 0 0 4px rgba(138,72,102,.08); }
.global-search input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 80px; color: var(--text); }
.global-search input::placeholder { color: var(--muted-2); }
.global-search kbd { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; color: var(--muted-2); background: var(--panel-soft); font-size: 10px; white-space: nowrap; }
.search-icon { width: 16px; height: 16px; border: 2px solid var(--muted-2); border-radius: 50%; position: relative; flex: 0 0 16px; }
.search-icon::after { content: ""; width: 6px; height: 2px; background: var(--muted-2); position: absolute; right: -5px; bottom: -2px; transform: rotate(45deg); border-radius: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); text-decoration: none; position: relative; }
.notification-dot { position: absolute; right: 8px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.bell-icon { width: 15px; height: 17px; border: 2px solid currentColor; border-radius: 8px 8px 5px 5px; position: relative; }
.bell-icon::after { content: ""; width: 5px; height: 2px; background: currentColor; position: absolute; bottom: -5px; left: 3px; border-radius: 5px; }
.help-icon { font-weight: 800; }
.user-box { display: grid; grid-template-columns: 38px auto 8px; align-items: center; gap: 9px; min-width: 160px; padding-left: 4px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); border-radius: 50%; font-size: 12px; font-weight: 800; }
.user-copy { display: grid; line-height: 1.25; }
.user-copy strong { font-size: 13px; color: var(--text-strong); }
.user-copy small { color: var(--muted); font-size: 11px; }
.online-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 3px var(--success-soft); }

.content { flex: 1; width: 100%; max-width: 1720px; margin: 0 auto; padding: 24px 28px 36px; }
.app-footer { display: flex; justify-content: space-between; gap: 16px; padding: 14px 28px 18px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; background: rgba(255,255,255,.58); }
.app-footer strong { color: var(--brand-dark); }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 20px; }
.page-head h1, .page-head h2 { margin: 0; color: var(--text-strong); font-size: clamp(24px, 2vw, 32px); letter-spacing: -.035em; }
.page-head p { margin: 7px 0 0; color: var(--muted); max-width: 820px; line-height: 1.55; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: .14em; font-weight: 750; font-size: 10px; margin-bottom: 7px; }

.button, button { border: 0; border-radius: 11px; padding: 10px 15px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: #fff; text-decoration: none; cursor: pointer; font-weight: 650; font-size: 13px; transition: .17s ease; }
.button:hover, button:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(112,55,82,.14); }
.button-soft { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #e2cad5; }
.button-soft:hover { background: #ead7e0; color: var(--brand-dark); }
.button-outline { background: #fff; color: var(--brand-dark); border: 1px solid var(--line-strong); }
.button-outline:hover { background: var(--brand-faint); color: var(--brand-dark); }
.button-success { background: var(--success); }
.button-success:hover { background: #1f6f5d; }
.button-danger { background: var(--danger); }
.button-small { min-height: 32px; padding: 7px 10px; font-size: 12px; border-radius: 9px; }
.button-link { background: transparent; color: var(--brand); padding-left: 0; padding-right: 0; }
.button-link:hover { background: transparent; box-shadow: none; }
.quick-action { white-space: nowrap; }

.action-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.action-card { min-width: 150px; flex: 1 1 150px; max-width: 225px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: var(--text); text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-soft); font-size: 13px; font-weight: 650; }
.action-card:hover { border-color: #d8bdca; transform: translateY(-1px); }
.action-card.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.action-symbol { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-size: 17px; }
.action-card.primary .action-symbol { background: rgba(255,255,255,.16); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.dashboard-main { min-width: 0; display: grid; gap: 16px; }
.dashboard-side { min-width: 0; display: grid; gap: 16px; }

.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.card { padding: 17px; }
.panel { padding: 20px; }
.panel + .panel, .card + .card { margin-top: 0; }
.card-header, .panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.card-header h2, .card-header h3, .panel-header h2, .panel-header h3 { margin: 0; color: var(--text-strong); font-size: 16px; }
.card-header p, .panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.card-link { font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { min-height: 112px; padding: 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-soft); display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-content: start; }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-weight: 850; }
.metric-card.teal .metric-icon { background: var(--success-soft); color: var(--teal); }
.metric-card.blue .metric-icon { background: var(--info-soft); color: var(--blue); }
.metric-card.amber .metric-icon { background: var(--warning-soft); color: var(--warning); }
.metric-card.danger .metric-icon { background: var(--danger-soft); color: var(--danger); }
.metric-copy { min-width: 0; }
.metric-label { color: var(--muted); font-size: 11px; line-height: 1.3; }
.metric-value, .stats { color: var(--text-strong); font-size: 27px; font-weight: 800; letter-spacing: -.035em; margin-top: 3px; }
.metric-hint { grid-column: 1 / -1; color: var(--muted-2); font-size: 10px; margin-top: 3px; }
.metric-hint.positive { color: var(--success); }
.metric-hint.negative { color: var(--danger); }

.workflow-panel { background: linear-gradient(135deg, #fff 0%, #fbf5f8 58%, #f6edf2 100%); overflow: hidden; position: relative; }
.workflow-panel::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(132,76,101,.11) .8px, transparent .8px); background-size: 18px 18px; opacity: .35; pointer-events: none; }
.workflow-panel > * { position: relative; }
.lifecycle { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); gap: 0; padding: 13px 4px 11px; }
.lifecycle-step { position: relative; text-align: center; padding: 0 6px; min-width: 0; }
.lifecycle-step:not(:last-child)::after { content: ""; position: absolute; left: calc(50% + 27px); right: calc(-50% + 27px); top: 26px; height: 2px; background: repeating-linear-gradient(90deg, #cdb9c3 0 5px, transparent 5px 10px); }
.lifecycle-step.complete:not(:last-child)::after, .lifecycle-step.ready:not(:last-child)::after { background: var(--success); }
.lifecycle-node { width: 54px; height: 54px; margin: 0 auto 9px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 2px solid #d8c7d0; color: var(--brand); box-shadow: 0 6px 14px rgba(100,57,77,.08); font-size: 17px; font-weight: 800; position: relative; z-index: 2; }
.lifecycle-step.complete .lifecycle-node { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.lifecycle-step.active .lifecycle-node, .lifecycle-step.ready .lifecycle-node { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 5px rgba(138,72,102,.08); }
.lifecycle-step.blocked .lifecycle-node, .lifecycle-step.attention .lifecycle-node { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.lifecycle-label { font-size: 11px; font-weight: 720; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lifecycle-meta { margin-top: 4px; font-size: 10px; color: var(--muted); }
.lifecycle-state { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 9px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lifecycle-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b8b4ba; }
.complete .lifecycle-state::before, .ready .lifecycle-state::before { background: var(--success); }
.active .lifecycle-state::before { background: var(--brand); }
.blocked .lifecycle-state::before, .attention .lifecycle-state::before { background: var(--warning); }
.workflow-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 15px 17px; margin-top: 8px; background: rgba(255,255,255,.76); border: 1px solid rgba(222,207,215,.9); border-radius: 13px; }
.trace-ok { display: flex; align-items: center; gap: 10px; }
.trace-icon { width: 34px; height: 34px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); border-radius: 50%; font-weight: 900; }
.trace-ok strong { display: block; font-size: 12px; }
.trace-ok small { color: var(--muted); }

.status-pill, .badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; background: #f1eff1; color: var(--muted); font-size: 10px; font-weight: 760; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.success, .badge.ok { background: var(--success-soft); color: var(--success); }
.status-pill.warning, .badge.warn { background: var(--warning-soft); color: var(--warning); }
.status-pill.danger, .badge.bad { background: var(--danger-soft); color: var(--danger); }
.status-pill.info { background: var(--info-soft); color: var(--info); }
.status-pill.brand { background: var(--brand-soft); color: var(--brand); }

.recommendation-list, .activity-list, .health-list, .risk-list, .compact-list { display: grid; gap: 0; }
.recommendation { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.recommendation:last-child { border-bottom: 0; padding-bottom: 0; }
.confidence { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 4px solid var(--success); background: #fff; font-size: 9px; font-weight: 800; color: var(--success); }
.recommendation.warning .confidence { border-color: var(--warning); color: var(--warning); }
.recommendation.danger .confidence { border-color: var(--danger); color: var(--danger); }
.recommendation h4 { margin: 1px 0 4px; font-size: 12px; color: var(--text-strong); }
.recommendation p { margin: 0; font-size: 10px; line-height: 1.45; color: var(--muted); }
.activity-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: start; }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 800; }
.activity-main strong { display: block; font-size: 11px; color: var(--text-strong); }
.activity-main small, .activity-time { color: var(--muted-2); font-size: 9px; }
.activity-time { text-align: right; max-width: 105px; }

.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { --value: 87; --tone: var(--brand); width: 112px; height: 112px; border-radius: 50%; background: conic-gradient(var(--tone) calc(var(--value) * 1%), #ece8eb 0); display: grid; place-items: center; position: relative; flex: 0 0 112px; }
.donut::before { content: ""; width: 82px; height: 82px; border-radius: 50%; background: #fff; position: absolute; }
.donut-content { position: relative; z-index: 1; text-align: center; }
.donut-value { font-size: 23px; font-weight: 850; color: var(--text-strong); }
.donut-label { color: var(--muted); font-size: 9px; }
.health-list { flex: 1; }
.health-row, .risk-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 7px 0; font-size: 11px; }
.health-status { color: var(--success); font-weight: 700; }
.health-status.attention { color: var(--warning); }
.risk-track { height: 5px; border-radius: 999px; background: #eee9ec; overflow: hidden; margin-top: 5px; }
.risk-fill { height: 100%; background: var(--success); border-radius: inherit; }
.risk-fill.high { background: var(--danger); }
.risk-fill.medium { background: var(--warning); }
.risk-label { font-size: 9px; font-weight: 750; }
.risk-label.high { color: var(--danger); }
.risk-label.medium { color: var(--warning); }
.risk-label.low { color: var(--success); }

.notice { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; font-size: 12px; }
.notice strong { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.notice.success { background: var(--success-soft); color: #1d6958; border-color: #cfe7df; }
.notice.danger { background: var(--danger-soft); color: #8d3540; border-color: #f1ccd1; }

.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
table, .table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td, .table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 11px; }
th, .table th { color: var(--muted); background: #faf8f9; text-transform: uppercase; letter-spacing: .045em; font-size: 9px; white-space: nowrap; }
tbody tr:hover { background: var(--brand-faint); }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 700; text-decoration: none; }
.table-primary { font-weight: 700; color: var(--text-strong); }
.table-secondary { color: var(--muted); margin-top: 3px; font-size: 10px; }
.empty-state { text-align: center; padding: 32px !important; color: var(--muted); }

.stack { display: grid; gap: 16px; }
.stack-form, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px; }
.inline-form { align-items: end; }
.form-grid .full, .stack-form .full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
input, textarea, select { width: 100%; min-height: 41px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--text); outline: 0; }
textarea { min-height: 88px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #bc91a5; box-shadow: 0 0 0 4px rgba(138,72,102,.08); }
.form-actions { grid-column: 1 / -1; display: flex; gap: 9px; justify-content: flex-end; padding-top: 2px; }
details.form-drawer { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
details.form-drawer summary { padding: 15px 18px; cursor: pointer; list-style: none; font-weight: 750; color: var(--text-strong); }
details.form-drawer summary::-webkit-details-marker { display: none; }
details.form-drawer summary::after { content: "+"; float: right; color: var(--brand); }
details.form-drawer[open] summary::after { content: "−"; }
details.form-drawer .drawer-body { padding: 0 18px 18px; border-top: 1px solid var(--line); padding-top: 16px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.info-item { padding: 12px; border-radius: 11px; background: var(--panel-soft); border: 1px solid var(--line); }
.info-item dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.info-item dd { margin: 5px 0 0; color: var(--text-strong); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.code-value, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; word-break: break-word; color: #56384a; }
pre { padding: 14px; border-radius: 12px; background: #f7f3f5; border: 1px solid var(--line); overflow: auto; white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--muted); }
.ok { color: var(--success); }
.warn { color: var(--warning); }
.bad { color: var(--danger); }
ul.clean { margin: 0; padding-left: 18px; }
.blocker-list { margin: 10px 0 0; padding-left: 18px; color: var(--warning); font-size: 11px; }

.audit-list { display: grid; gap: 10px; }
.audit-card { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(90px, .55fr)) auto; gap: 14px; align-items: center; padding: 14px 15px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text); box-shadow: var(--shadow-soft); }
.audit-card:hover { border-color: #d2b4c2; transform: translateY(-1px); }
.audit-card-title { min-width: 0; }
.audit-card-title strong { display: block; color: var(--text-strong); }
.audit-card-title small { color: var(--muted); }
.audit-card-stat { color: var(--muted); font-size: 10px; }
.audit-card-stat strong { display: block; color: var(--text); font-size: 12px; margin-top: 3px; }

.progress-track { height: 7px; background: #ece8eb; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #ae718d); }

.tabs { display: flex; gap: 7px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 15px; }
.tab { padding: 9px 11px; color: var(--muted); text-decoration: none; font-size: 11px; border-bottom: 2px solid transparent; }
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 750; }

.auth-page { background: linear-gradient(145deg, #f7f1f4, #eee4e9); }
.auth-page .content { display: grid; place-items: center; min-height: calc(100vh - 56px); }
.auth-page .panel { width: min(440px, 100%); }

@media (max-width: 1380px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .lifecycle { overflow-x: auto; grid-template-columns: repeat(7, minmax(120px, 1fr)); padding-bottom: 16px; }
}

@media (max-width: 1080px) {
  :root { --sidebar-width: 226px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-card { grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(90px, .7fr)) auto; }
  .audit-card-stat:nth-of-type(3) { display: none; }
  .quick-action { display: none; }
}

@media (max-width: 820px) {
  .app-frame { grid-template-columns: 1fr; }
  .sidebar { position: relative; width: 100%; height: auto; padding: 14px; }
  .brand { padding-bottom: 10px; }
  .side-nav { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .side-nav-item { flex: 0 0 auto; }
  .sidebar-quick, .sidebar-footer { display: none; }
  .topbar { position: relative; padding: 12px 16px; }
  .topbar-actions .icon-button, .user-copy { display: none; }
  .user-box { min-width: auto; grid-template-columns: 38px 8px; }
  .content { padding: 20px 16px 30px; }
  .app-footer { padding: 14px 16px; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .grid.two, .grid.three, .grid.four, .dashboard-side { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .workflow-summary { align-items: flex-start; flex-direction: column; }
  .audit-card { grid-template-columns: 1fr auto; }
  .audit-card-stat { display: none; }
}

@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr; }
  .action-card { max-width: none; }
  .global-search kbd { display: none; }
  .donut-wrap { align-items: flex-start; flex-direction: column; }
  .recommendation { grid-template-columns: 42px 1fr; }
  .recommendation .button { grid-column: 2; justify-self: start; }
}

.panel-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.blocker-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.blocker-card { padding: 15px; border: 1px solid #ead6df; border-radius: 14px; background: linear-gradient(145deg, #fff, #fff8fa); box-shadow: var(--shadow-soft); }
.blocker-card .blocker-list { color: var(--text); }
.blocker-card .blocker-list strong { color: var(--danger); }
.info-grid.single { grid-template-columns: 1fr; }
.payload-preview { min-height: 150px; margin: 0; }
.document-branding-card { overflow: hidden; }
.document-preview { display: grid; grid-template-rows: auto 1fr auto; min-height: 210px; border: 1px solid #dccbd3; border-radius: 14px; background: #fff; box-shadow: 0 16px 38px rgba(89, 49, 69, .09); overflow: hidden; }
.document-preview.tall { min-height: 390px; }
.document-preview-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fff, #fbf3f7); }
.document-preview-header strong, .document-preview-header small { display: block; }
.document-preview-header strong { color: var(--brand-dark); font-size: 15px; letter-spacing: .04em; }
.document-preview-header small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.mini-brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff; background: linear-gradient(145deg, var(--brand), #a96b87); font-weight: 850; box-shadow: 0 8px 18px rgba(122, 64, 90, .22); }
.document-preview-body { display: grid; align-content: start; gap: 10px; padding: 24px 20px; }
.document-preview-body span { height: 7px; border-radius: 999px; background: #eee7eb; }
.document-preview-body span:nth-child(2) { width: 92%; }
.document-preview-body span:nth-child(3) { width: 86%; }
.document-preview-body span.short { width: 58%; }
.document-preview-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); background: #faf7f8; font-size: 8px; }
.document-preview-footer strong { color: var(--brand-dark); }
@media (max-width: 820px) {
  .document-preview.tall { min-height: 280px; }
}

/* FINAL SYSTEM CLOSURE + DOCUMENT VERIFICATION */
.compact-value { font-size: 18px !important; line-height: 1.15; }
.wrap-code { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.report-document-workbench { background: linear-gradient(135deg, #fff 0%, #fbf5f8 100%); border-color: #dfcbd5; }
.document-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.document-actions form { min-width: 0; }
.document-action, .document-action-primary { width: 100%; min-height: 78px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; text-align: left; padding: 14px 16px; }
.document-action strong, .document-action-primary strong { display: block; font-size: 13px; }
.document-action small, .document-action-primary small { display: block; margin-top: 4px; opacity: .76; font-size: 10px; line-height: 1.35; }
.document-action .action-symbol, .document-action-primary .action-symbol { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.22); font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.document-action.button-outline .action-symbol { background: var(--brand-soft); color: var(--brand-dark); }
.helper-text { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.digest-card { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.digest-card span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.digest-card code { display: block; overflow-wrap: anywhere; word-break: break-word; color: var(--text-strong); font-size: 11px; }

.auth-page .public-verify-shell { width: min(1080px, 100%); }
.auth-page .public-verify-shell .panel { width: auto; }
.public-verify-shell { display: grid; gap: 16px; }
.public-verify-brand { display: flex; align-items: center; gap: 12px; color: var(--brand-dark); }
.public-verify-brand strong { display: block; font-size: 26px; letter-spacing: .07em; }
.public-verify-brand span { display: block; color: var(--muted); font-size: 12px; }
.public-verify-mark { width: 54px; height: 54px; display: grid; place-items: center; }
.public-verify-mark svg { width: 54px; height: 54px; overflow: visible; }
.public-verify-mark svg path:first-child { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 2.3; }
.public-verify-mark svg path:nth-child(2) { fill: #fff; stroke: var(--brand-dark); stroke-width: 2; }
.public-verify-mark svg path:nth-child(3) { fill: none; stroke: var(--brand-dark); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.public-verify-mark svg circle { fill: var(--brand); }
.verification-hero { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 18px; padding: 24px; border-radius: var(--radius-xl); border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.verification-hero.is-valid { border-color: #bcded3; background: linear-gradient(135deg, #fff, #f0faf6); }
.verification-hero.is-invalid { border-color: #e6bdc3; background: linear-gradient(135deg, #fff, #fdf1f3); }
.verification-hero h1 { margin: 3px 0 6px; font-size: 28px; color: var(--text-strong); }
.verification-hero p { margin: 0; color: var(--muted); line-height: 1.55; }
.verification-status-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--danger); font-size: 30px; font-weight: 800; box-shadow: 0 10px 26px rgba(180,73,85,.2); }
.verification-hero.is-valid .verification-status-icon { background: var(--success); box-shadow: 0 10px 26px rgba(36,131,108,.18); }
.verification-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; }
.public-verify-footer { display: flex; justify-content: space-between; gap: 16px; padding: 14px 4px; color: var(--muted); font-size: 11px; }
.public-verify-footer strong { color: var(--brand-dark); }

.closure-overview .panel { min-height: 100%; }
.closure-check-list { display: grid; gap: 9px; }
.closure-check { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.closure-check.is-ok { border-color: #cce6dd; background: #f5fbf8; }
.closure-check.is-failed { border-color: #edcbd0; background: #fff7f8; }
.closure-check-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-weight: 800; }
.closure-check.is-ok .closure-check-icon { background: var(--success-soft); color: var(--success); }
.closure-check strong { display: block; font-size: 12px; }
.closure-check small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.closure-blockers { border-color: #eccbd0; background: linear-gradient(135deg, #fff, #fff7f8); }
.compact-payload { min-height: 0; max-height: 130px; margin-top: 10px; }
.closure-warning-list { margin-bottom: 0; }
.closure-domain-grid { align-items: start; }

@media (max-width: 1100px) {
  .document-actions { grid-template-columns: 1fr; }
  .verification-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .verification-hero { grid-template-columns: 1fr; }
  .public-verify-footer { flex-direction: column; }
}

/* DIGITAL ECO SYSTEMS COMPANY IDENTITY */
.company-logo { display: block; width: min(100%, 300px); height: auto; object-fit: contain; }
.company-logo-footer { width: 196px; max-height: 44px; }
.company-logo-document { width: 124px; max-height: 28px; margin-right: 4px; }
.footer-company { display: flex; align-items: center; gap: 12px; min-width: 0; }
.footer-company > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.company-info-card { display: flex; align-items: center; gap: 16px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, #fff, #f9f6f7); }
.company-info-card .company-logo { flex: 0 0 210px; width: 210px; }
.company-info-card strong, .company-info-card span { display: block; }
.company-info-card strong { color: var(--text-strong); font-size: 13px; }
.company-info-card span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.company-info-card-login { margin-top: 20px; flex-direction: column; text-align: center; }
.company-info-card-login .company-logo { width: 250px; flex-basis: auto; }
.company-about-panel { display: grid; grid-template-columns: minmax(230px, 330px) minmax(0, 1fr); align-items: center; gap: 28px; overflow: hidden; background: linear-gradient(135deg, #fff 0%, #fcf8fa 62%, #f5edf1 100%); }
.company-about-panel h3 { margin: 4px 0 8px; color: var(--text-strong); }
.company-about-panel p { margin: 5px 0; line-height: 1.55; }
.company-about-logo { display: grid; place-items: center; min-height: 112px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.company-about-logo .company-logo { width: 292px; }
.document-preview-footer .company-logo { flex: 0 0 auto; }
.public-verify-footer .footer-company { min-width: 250px; }

@media (max-width: 820px) {
  .footer-company { align-items: flex-start; flex-direction: column; gap: 5px; }
  .footer-company > span { white-space: normal; }
  .company-about-panel { grid-template-columns: 1fr; }
  .company-about-logo { justify-items: start; }
  .company-info-card { align-items: flex-start; flex-direction: column; }
}

/* Customer Management */
.nav-icon-customers::before { content: "C"; border: 1.5px solid currentColor; border-radius: 50%; width: 19px; height: 19px; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.customer-metrics { grid-template-columns: repeat(6, minmax(130px, 1fr)); }
.inline-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-filter input, .inline-filter select { min-width: 150px; }
.table-subline { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.migration-row { background: rgba(173, 55, 55, .045); }
.check-field { display: flex !important; align-items: center; gap: 8px; padding-top: 26px; }
.check-field input { width: auto; }
@media (max-width: 1100px) { .customer-metrics { grid-template-columns: repeat(3, minmax(150px, 1fr)); } }
@media (max-width: 720px) { .customer-metrics { grid-template-columns: 1fr; } .inline-filter { align-items: stretch; } .inline-filter > * { width: 100%; } }

/* Customer Portal */
.nav-icon-portal::before { content: "P"; font-weight: 800; font-size: .72rem; }
.customer-card-grid,.portal-user-grid,.portal-audit-grid,.portal-request-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}.entity-card,.portal-user-card,.portal-audit-card,.request-card{display:block;border:1px solid var(--line);background:var(--surface);border-radius:16px;padding:16px;color:inherit;text-decoration:none;box-shadow:var(--shadow-soft)}.entity-card:hover,.portal-audit-card:hover,.entity-card.selected{border-color:var(--brand);transform:translateY(-1px)}.entity-card-head,.entity-card-foot,.portal-user-meta,.message-meta{display:flex;align-items:center;justify-content:space-between;gap:12px}.entity-card-head small{display:block;margin-top:4px;color:var(--muted)}.entity-card-foot{margin-top:14px;color:var(--muted);font-size:.86rem}.portal-user-meta{flex-wrap:wrap;margin:10px 0;color:var(--muted);font-size:.82rem}.form-grid.compact{gap:8px}.form-drawer.compact{margin-top:10px}.portal-page{margin:0;background:var(--page-bg);color:var(--text)}.portal-shell{min-height:100vh;display:flex;flex-direction:column}.portal-topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:14px clamp(18px,4vw,54px);background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}.portal-account{display:flex;align-items:center;gap:16px}.portal-account small{display:block;color:var(--muted)}.portal-content{width:min(1240px,calc(100% - 32px));margin:0 auto;padding:28px 0 48px;flex:1}.portal-footer{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px clamp(18px,4vw,54px);border-top:1px solid var(--line);background:var(--surface)}.portal-auth-card{width:min(520px,100%);margin:7vh auto 0;background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:clamp(24px,5vw,46px);box-shadow:var(--shadow)}.portal-auth-card h1{margin:.35rem 0}.security-note{margin-top:16px;padding:12px 14px;border-radius:12px;background:var(--surface-soft);color:var(--muted);font-size:.88rem}.portal-audit-card h2,.request-card h3{margin:14px 0 8px}.portal-audit-card p,.request-card p{color:var(--muted)}.activity-item.unread{border-left:3px solid var(--brand);background:var(--surface-soft)}.message-timeline{display:flex;flex-direction:column;gap:12px}.message-bubble{max-width:78%;border:1px solid var(--line);border-radius:16px;padding:12px 14px;background:var(--surface-soft)}.message-bubble.portal{margin-left:auto;background:rgba(122,64,90,.08);border-color:rgba(122,64,90,.25)}.message-bubble p{margin:8px 0 0;white-space:pre-wrap}.message-meta span{color:var(--muted);font-size:.8rem}@media(max-width:760px){.portal-topbar,.portal-footer{align-items:flex-start;flex-direction:column}.portal-account{width:100%;justify-content:space-between}.message-bubble{max-width:100%}}

/* Internal user and access management */
.auth-card{max-width:460px;margin:6vh auto 0}.auth-card .stack-form{margin-top:20px}
.user-box-link{text-decoration:none;color:inherit}.logout-form{margin:0}.logout-form button{white-space:nowrap}
.role-fieldset{grid-column:1/-1;border:1px solid var(--border-color,#d9dce3);border-radius:12px;padding:14px;display:grid;gap:10px}
.role-fieldset legend{padding:0 6px;font-weight:700}.check-row{display:flex!important;align-items:flex-start;gap:10px}.check-row input{width:auto!important;margin-top:3px}.check-row span{display:grid;gap:2px}.check-row small{color:var(--muted-color,#6b7280)}
.metric-value-small{font-size:1rem!important;line-height:1.35;overflow-wrap:anywhere}
