:root {
    --black: #111111;
    --ink: #202020;
    --muted: #666666;
    --line: #d7d7d7;
    --line-strong: #9b9b9b;
    --surface: #ffffff;
    --surface-subtle: #f6f6f4;
    --surface-muted: #ececea;
    --sidebar: #161616;
    --sidebar-soft: #252525;
    --shadow: 0 18px 50px rgba(0, 0, 0, .09);
    --radius: 10px;
    --sidebar-width: 274px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--surface-subtle);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--surface-subtle); }
body { margin: 0; min-height: 100vh; font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--black); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.045em; line-height: 1.05; }
h2 { margin-bottom: 6px; font-size: 18px; letter-spacing: -.02em; }
h3 { margin-bottom: 5px; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.screen-index { display: block; margin-bottom: 36px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.brand__mark { display: inline-grid; width: 32px; height: 32px; place-items: center; border: 1px solid currentColor; font-size: 15px; }
.brand--inverse { color: #fff; }
.button { min-height: 40px; padding: 0 16px; border: 1px solid var(--black); border-radius: 6px; background: white; font-size: 13px; font-weight: 700; }
.button:hover { background: var(--surface-muted); }
.button--primary { background: var(--black); color: #fff; }
.button--primary:hover { background: #333; }
.button--secondary { border-color: var(--line-strong); }
.button--wide { width: 100%; min-height: 46px; }
.icon-button { display: inline-grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: white; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

/* Login */
.auth-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(380px, 1.08fr) minmax(440px, .92fr); background: white; }
.auth-panel { padding: 48px clamp(40px, 6vw, 96px); }
.auth-panel--context { display: flex; flex-direction: column; justify-content: space-between; background: var(--black); color: white; }
.auth-context__content { max-width: 650px; }
.auth-context__content h1 { max-width: 590px; font-size: clamp(42px, 5vw, 70px); }
.auth-context__content > p:not(.eyebrow) { max-width: 560px; color: #c8c8c8; font-size: 17px; }
.auth-panel--context .eyebrow { color: #aaa; }
.auth-panel__foot { margin: 0; color: #888; font-size: 12px; }
.process-line { display: flex; align-items: center; gap: 12px; margin-top: 52px; color: #d8d8d8; font-size: 12px; }
.process-line i { width: 42px; height: 1px; background: #5a5a5a; }
.auth-panel--form { display: grid; place-items: center; background: var(--surface-subtle); }
.auth-box { width: min(420px, 100%); }
.auth-box h2 { margin: 0 0 8px; font-size: 34px; }
.auth-form { display: grid; gap: 22px; margin-top: 34px; }
.field { display: grid; gap: 8px; font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 5px; outline: none; background: white; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--black); box-shadow: 0 0 0 2px #ddd; }
.field small { color: var(--muted); font-weight: 400; }
.input-action { position: relative; display: block; }
.input-action input { padding-right: 62px; }
.input-action button { position: absolute; top: 6px; right: 6px; height: 32px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.form-row { display: flex; align-items: center; justify-content: space-between; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.check input, .task-row input { accent-color: var(--black); }
.auth-note { display: grid; gap: 3px; margin-top: 28px; padding: 14px 16px; border: 1px solid var(--line); background: white; font-size: 12px; }
.auth-note span { color: var(--muted); }

/* Role selection */
.selection-layout { min-height: 100vh; background: var(--surface-subtle); }
.selection-header { display: flex; min-height: 80px; padding: 0 clamp(24px, 5vw, 72px); align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: white; }
.selection-user { display: flex; align-items: center; gap: 10px; }
.selection-user > span:last-child { display: grid; }
.selection-user small { color: var(--muted); }
.selection-content { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 64px 0; }
.selection-title { max-width: 720px; }
.selection-title > p:last-child { color: var(--muted); font-size: 16px; }
.role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 42px; }
.role-card { position: relative; display: flex; min-height: 330px; padding: 24px; flex-direction: column; border: 1px solid var(--line-strong); background: white; transition: transform .18s ease, box-shadow .18s ease; }
.role-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.role-card__index { position: absolute; top: 20px; right: 20px; color: var(--muted); font-size: 11px; }
.role-card__symbol { display: grid; width: 54px; height: 54px; margin-bottom: 38px; place-items: center; border: 1px solid var(--black); border-radius: 50%; font-size: 14px; font-weight: 800; }
.role-card > strong { font-size: 21px; }
.role-card__description { margin-top: 10px; color: var(--muted); }
.role-card__action { display: flex; margin-top: auto; padding-top: 28px; justify-content: space-between; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.role-card__action b { font-size: 17px; }
.selection-note { display: flex; gap: 16px; margin-top: 22px; padding: 14px 18px; border-left: 3px solid var(--black); background: white; font-size: 12px; }
.selection-note span { color: var(--muted); }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: var(--sidebar-width); padding: 22px 16px 18px; flex-direction: column; overflow-y: auto; background: var(--sidebar); color: #d7d7d7; }
.sidebar__brand { display: flex; padding: 0 6px 22px; align-items: center; justify-content: space-between; border-bottom: 1px solid #303030; }
.sidebar__close { display: none; border-color: #3d3d3d; background: transparent; color: white; }
.workspace-switcher { display: grid; gap: 3px; margin: 18px 0 8px; padding: 13px; border: 1px solid #353535; border-radius: 7px; background: var(--sidebar-soft); }
.workspace-switcher__label, .main-nav__heading { color: #8f8f8f; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.workspace-switcher strong { margin-top: 3px; color: white; }
.workspace-switcher > span:not(.workspace-switcher__label) { color: #a8a8a8; font-size: 11px; }
.workspace-switcher a { margin-top: 8px; color: white; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.main-nav { display: grid; gap: 3px; margin-top: 16px; }
.main-nav__heading { padding: 0 10px 8px; }
.nav-item { display: grid; min-height: 40px; padding: 0 10px; grid-template-columns: 25px 1fr auto; gap: 8px; align-items: center; border-radius: 5px; color: #bdbdbd; font-size: 12px; }
.nav-item:hover { background: #222; color: white; }
.nav-item.is-active { background: white; color: var(--black); font-weight: 750; }
.nav-item.is-locked { color: #686868; }
.nav-item__symbol { text-align: center; font-size: 15px; }
.nav-item small { min-width: 22px; padding: 2px 5px; border: 1px solid currentColor; border-radius: 10px; text-align: center; font-size: 9px; }
.sidebar__footer { display: flex; gap: 9px; margin-top: auto; padding: 16px 8px 0; align-items: flex-start; border-top: 1px solid #303030; }
.sidebar__footer > span:last-child { display: grid; font-size: 10px; }
.sidebar__footer strong { color: white; font-weight: 600; }
.sidebar__footer small { color: #888; }
.status-dot { width: 8px; height: 8px; margin-top: 3px; border: 2px solid #fff; border-radius: 50%; }
.app-area { width: calc(100% - var(--sidebar-width)); margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; height: 68px; padding: 0 26px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 10px; }
.topbar__menu { display: none; }
.breadcrumbs { display: flex; gap: 8px; color: var(--muted); font-size: 12px; }
.breadcrumbs b { font-weight: 400; }
.breadcrumbs strong { color: var(--ink); }
.popover { position: relative; }
.popover > summary { list-style: none; cursor: pointer; }
.popover > summary::-webkit-details-marker { display: none; }
.popover__panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 50; width: 310px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; box-shadow: var(--shadow); }
.popover__heading { display: flex; padding: 14px 16px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.popover__heading > span, .popover__heading > div { display: grid; }
.popover__heading small { color: var(--muted); font-weight: 400; }
.stage-switcher > summary { display: grid; min-width: 170px; height: 42px; padding: 5px 34px 5px 12px; grid-template-rows: 13px 18px; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: white; }
.stage-switcher__label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.stage-switcher .chevron { position: absolute; top: 12px; right: 12px; }
.stage-panel { width: 350px; padding-bottom: 8px; }
.stage-option { display: grid; min-height: 62px; margin: 6px 8px 0; padding: 8px; grid-template-columns: 36px 1fr 20px; gap: 10px; align-items: center; border: 1px solid transparent; border-radius: 6px; }
.stage-option:hover, .stage-option.is-selected { border-color: var(--line); background: var(--surface-subtle); }
.stage-option__number { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-weight: 750; }
.stage-option > span:nth-child(2) { display: grid; }
.stage-option small { color: var(--muted); font-size: 11px; }
.stage-option i { font-style: normal; }
.notification-button { position: relative; font-size: 17px; }
.notification-button > span { position: absolute; top: -5px; right: -4px; display: grid; width: 18px; height: 18px; place-items: center; border: 2px solid white; border-radius: 50%; background: var(--black); color: white; font-size: 9px; }
.notifications-panel { width: 390px; }
.notification-row { display: grid; width: 100%; padding: 13px 16px; grid-template-columns: 8px 1fr; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }
.notification-row:hover { background: var(--surface-subtle); }
.notification-row > i { width: 6px; height: 6px; margin-top: 6px; border: 1px solid var(--line-strong); border-radius: 50%; }
.notification-row.is-unread > i { background: var(--black); border-color: var(--black); }
.notification-row > span { display: grid; }
.notification-row small { color: var(--muted); }
.popover__footer { width: 100%; height: 42px; border: 0; background: var(--surface-subtle); font-size: 12px; font-weight: 700; }
.profile-summary { display: grid; padding-left: 6px; grid-template-columns: 32px 1fr 16px; gap: 8px; align-items: center; }
.profile-summary > span:nth-child(2) { display: grid; min-width: 120px; }
.profile-summary small { color: var(--muted); font-size: 10px; }
.profile-panel { width: 260px; padding: 8px; }
.profile-card { display: flex; gap: 10px; margin-bottom: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.profile-card > span:last-child { display: grid; }
.profile-card small, .profile-card em { color: var(--muted); font-size: 10px; font-style: normal; }
.profile-panel > button, .profile-panel > a { display: block; width: 100%; padding: 10px; border: 0; border-radius: 4px; background: white; text-align: left; font-size: 12px; }
.profile-panel > button:hover, .profile-panel > a:hover { background: var(--surface-subtle); }
.avatar { display: inline-grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 1px solid var(--black); border-radius: 50%; background: white; color: var(--black); font-size: 11px; font-weight: 800; }
.avatar--small { width: 32px; height: 32px; font-size: 9px; }
.workspace { width: min(1520px, 100%); min-height: calc(100vh - 68px); margin: 0 auto; padding: 30px clamp(20px, 3vw, 46px) 60px; }

/* Dashboard */
.page-heading { display: flex; gap: 24px; margin-bottom: 24px; align-items: flex-end; justify-content: space-between; }
.page-heading h1 { margin-bottom: 8px; font-size: 31px; }
.page-heading__description { max-width: 700px; margin: 0; color: var(--muted); }
.page-heading__actions { display: flex; gap: 8px; flex: 0 0 auto; }
.stage-banner { display: grid; min-height: 82px; margin-bottom: 16px; padding: 16px 18px; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line-strong); background: repeating-linear-gradient(135deg, #fff, #fff 8px, #fafafa 8px, #fafafa 16px); }
.stage-banner__index { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--black); border-radius: 50%; font-weight: 800; }
.stage-banner div { display: grid; }
.stage-banner p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.stage-banner > span:last-child { color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.metric-card { min-height: 126px; padding: 16px; border: 1px solid var(--line); background: white; }
.metric-card__top { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.metric-card__marker { font-weight: 700; }
.metric-card strong { display: block; margin: 13px 0 3px; font-size: 27px; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 12px; }
.panel { overflow: hidden; border: 1px solid var(--line); background: white; }
.panel--wide { min-height: 330px; }
.panel__header { display: flex; min-height: 70px; padding: 15px 18px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel__header .eyebrow { margin-bottom: 4px; }
.panel__header h2 { margin: 0; }
.panel__header a { color: var(--muted); font-size: 11px; font-weight: 700; }
.funnel-summary { display: grid; height: 250px; padding: 24px 22px 18px; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: end; }
.funnel-summary__item { display: grid; height: 100%; grid-template-rows: 1fr auto auto; align-items: end; text-align: center; }
.funnel-summary__bar { width: min(68px, 70%); height: var(--height); margin: 0 auto 10px; border: 1px solid var(--black); background: repeating-linear-gradient(45deg, #efefef, #efefef 5px, #fff 5px, #fff 10px); }
.funnel-summary__item strong { font-size: 18px; }
.funnel-summary__item span { color: var(--muted); font-size: 10px; }
.task-list { padding: 2px 16px 14px; }
.task-row { display: grid; padding: 12px 2px; grid-template-columns: 18px 1fr; gap: 10px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.task-row:last-child { border: 0; }
.task-row span { display: grid; }
.task-row small { color: var(--muted); font-size: 10px; }
.timeline { margin: 0; padding: 10px 18px 16px; list-style: none; }
.timeline li { position: relative; display: grid; padding: 10px 0 10px 18px; grid-template-columns: 1fr; }
.timeline li:not(:last-child)::after { content: ''; position: absolute; top: 23px; bottom: -7px; left: 3px; width: 1px; background: var(--line); }
.timeline i { position: absolute; top: 15px; left: 0; width: 7px; height: 7px; border: 1px solid var(--black); border-radius: 50%; background: white; }
.timeline span { display: grid; grid-template-columns: 1fr auto; }
.timeline strong { grid-column: 1; }
.timeline small { grid-column: 1; color: var(--muted); }
.timeline time { grid-column: 2; grid-row: 1 / 3; color: var(--muted); font-size: 10px; }
.health-label { display: inline-flex; gap: 7px; align-items: center; font-size: 10px; font-weight: 700; }
.health-label i { width: 7px; height: 7px; border: 2px solid var(--black); border-radius: 50%; }
.health-list { padding: 4px 18px 14px; }
.health-list > div { display: grid; padding: 11px 0; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line); }
.health-list > div:last-child { border: 0; }
.health-list span { color: var(--muted); }
.health-list small { grid-column: 1 / 3; color: var(--muted); font-size: 10px; }
.placeholder-panel { min-height: 540px; padding: 18px; }
.placeholder-toolbar { display: flex; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.placeholder-toolbar span { width: 120px; height: 34px; border: 1px solid var(--line); background: var(--surface-subtle); }
.placeholder-toolbar span:nth-child(2) { width: 180px; }
.placeholder-toolbar button { width: 110px; margin-left: auto; border: 0; background: var(--black); }
.placeholder-layout { display: grid; min-height: 360px; padding-top: 18px; grid-template-columns: 210px 1fr; gap: 18px; }
.placeholder-layout aside { border: 1px solid var(--line); background: var(--surface-subtle); }
.placeholder-layout > div { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.placeholder-layout > div span { border: 1px solid var(--line); background: repeating-linear-gradient(135deg, #fff, #fff 8px, #fafafa 8px, #fafafa 16px); }
.prototype-label { display: flex; gap: 12px; margin-top: 18px; padding: 12px; border: 1px dashed var(--line-strong); }
.prototype-label span { color: var(--muted); }

/* Modal and toast */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 380px; padding: 13px 16px; border: 1px solid var(--black); background: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .18s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; padding: 24px; place-items: center; background: rgba(0,0,0,.56); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid var(--black); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.modal > header { display: flex; padding: 20px 22px; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal > header h2 { margin: 0; font-size: 23px; }
.modal__body { padding: 22px; }
.modal > footer { display: flex; padding: 16px 22px; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); background: var(--surface-subtle); }
.form-grid { display: grid; gap: 16px; }
.form-grid--two { grid-template-columns: repeat(2, 1fr); }
.inline-message { display: grid; gap: 2px; margin-top: 18px; padding: 13px; border-left: 3px solid var(--black); background: var(--surface-subtle); font-size: 12px; }
.inline-message span { color: var(--muted); }

/* Shared module controls */
.tag { display: inline-flex; width: max-content; min-height: 23px; padding: 3px 8px; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; white-space: nowrap; color: var(--ink); font-size: 10px; font-weight: 750; line-height: 1; }
.tag--solid { border-color: var(--black); background: var(--black); color: white; }
.tag--outline, .tag--neutral { background: white; }
.metric-grid--compact .metric-card { min-height: 108px; }
.module-panel, .board-panel { margin-bottom: 14px; }
.filter-bar { display: flex; min-height: 68px; padding: 12px 14px; gap: 12px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.search-box { display: flex; width: min(380px, 100%); height: 40px; padding: 0 12px; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-subtle); }
.search-box span { color: var(--muted); font-size: 18px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.filter-bar__controls { display: flex; gap: 7px; align-items: center; }
.filter-control { display: flex; height: 40px; min-width: 132px; padding: 0 8px 0 11px; gap: 8px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: 10px; }
.filter-control b { color: var(--muted); font-weight: 400; }
.filter-control select { max-width: 86px; border: 0; background: transparent; color: var(--muted); font-size: 10px; outline: 0; }
.view-strip { display: flex; min-height: 52px; padding: 8px 14px; gap: 12px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.demo-states { display: flex; gap: 4px; align-items: center; }
.demo-states > span { margin-right: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.demo-states button, .segmented button { min-height: 30px; padding: 0 10px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; }
.demo-states button:hover, .demo-states button.is-active, .segmented button:hover, .segmented button.is-active { border-color: var(--line-strong); background: white; color: var(--black); }
.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-muted); }
.segmented button.is-active { border-color: var(--line); }
.state-content[hidden] { display: none !important; }
.state-content--empty, .state-content--error { min-height: 340px; }
.empty-state { display: grid; min-height: 340px; padding: 54px 24px; place-items: center; align-content: center; text-align: center; }
.empty-state__icon { display: grid; width: 58px; height: 58px; margin-bottom: 18px; place-items: center; border: 1px dashed var(--line-strong); border-radius: 50%; font-size: 22px; }
.empty-state h3 { margin: 0 0 6px; font-size: 18px; }
.empty-state p { max-width: 460px; margin: 0 0 18px; color: var(--muted); font-size: 12px; }

/* Tables and record summaries */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: white; font-size: 11px; }
.data-table th { height: 44px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); color: var(--muted); font-size: 9px; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { min-height: 58px; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.data-table tbody tr:hover, .data-table tbody tr.is-selected { background: var(--surface-subtle); }
.data-table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 var(--black); }
.data-table--disabled { opacity: .58; }
.entity-cell { display: flex; gap: 9px; align-items: center; }
.entity-cell > span:last-child { display: grid; }
.entity-cell small, .cell-subtitle { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.row-menu { min-width: 28px; height: 28px; padding: 0 6px; border: 0; border-radius: 4px; background: transparent; }
.row-menu:hover { background: var(--surface-muted); }
.table-footer { display: flex; min-height: 58px; padding: 10px 14px; gap: 12px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.table-footer > div { display: flex; }
.table-footer > div button { width: 30px; height: 30px; border: 1px solid var(--line); background: white; font-size: 10px; }
.table-footer > div button.is-current { background: var(--black); color: white; }
.detail-grid { display: grid; margin-bottom: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-card { padding: 18px; }
.detail-card > header, .customer-profile > header, .ticket-detail > header, .permissions-preview > header { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.detail-card > header h2, .customer-profile > header h2, .ticket-detail > header h2 { margin: 0; }
.definition-grid { display: grid; margin: 18px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.definition-grid > div { padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.definition-grid dt, .stacked-definitions dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.definition-grid dd, .stacked-definitions dd { margin: 3px 0 0; font-size: 11px; font-weight: 700; }
.definition-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.detail-actions { display: flex; gap: 8px; }
.mini-stats { display: grid; margin-top: 18px; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); }
.mini-stats > div { display: grid; padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mini-stats > div:nth-child(even) { border-right: 0; }
.mini-stats > div:nth-last-child(-n+2) { border-bottom: 0; }
.mini-stats strong { font-size: 20px; }
.mini-stats span { color: var(--muted); font-size: 10px; }
.stacked-definitions { margin: 0; }
.stacked-definitions > div { display: grid; padding: 10px 0; grid-template-columns: minmax(100px, .8fr) 1.2fr; gap: 12px; border-bottom: 1px solid var(--line); }
.stacked-definitions > div:last-child { border-bottom: 0; }
.stacked-definitions dd { text-align: right; }

/* Commercial and implementation boards */
.kanban { display: grid; min-width: 1080px; padding: 14px; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 10px; overflow-x: auto; background: var(--surface-subtle); }
.kanban-column { min-height: 430px; border: 1px solid var(--line); background: #efefed; }
.kanban-column > header { display: flex; min-height: 46px; padding: 0 11px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: white; font-size: 11px; }
.kanban-column > header span { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 9px; }
.kanban-column__cards { display: grid; padding: 9px; gap: 8px; }
.kanban-card { display: grid; width: 100%; min-height: 138px; padding: 12px; gap: 5px; border: 1px solid var(--line); border-radius: 5px; background: white; text-align: left; box-shadow: 0 2px 5px rgba(0,0,0,.025); }
.kanban-card:hover, .kanban-card.is-selected { border-color: var(--black); }
.kanban-card.is-selected { box-shadow: inset 3px 0 var(--black); }
.kanban-card > strong { margin-top: 4px; font-size: 13px; }
.kanban-card > span:not(.kanban-card__top):not(.kanban-card__meta) { color: var(--muted); font-size: 10px; }
.kanban-card__top, .kanban-card__meta { display: flex; align-items: center; justify-content: space-between; }
.kanban-card__top small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.kanban-card__top b { color: var(--muted); font-size: 10px; }
.kanban-card__meta { margin-top: auto; padding-top: 7px; border-top: 1px solid var(--line); }
.kanban-card__meta em { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid var(--black); border-radius: 50%; font-size: 8px; font-style: normal; font-weight: 800; }
.kanban-card__meta small { margin-right: auto; margin-left: 6px; color: var(--muted); font-size: 9px; }
.kanban-card__meta time { color: var(--muted); font-size: 9px; }
.kanban-add { min-height: 38px; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); font-size: 10px; }
.kanban--implementation { grid-template-columns: repeat(5, minmax(210px, 1fr)); }
.kanban--six { grid-template-columns: repeat(6, minmax(205px, 1fr)); }
.record-drawer { margin-bottom: 14px; border: 1px solid var(--line-strong); background: white; box-shadow: var(--shadow); }
.record-drawer__header { display: flex; padding: 17px 20px; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.record-drawer__header h2 { margin: 0; font-size: 23px; }
.record-drawer__header > div:first-child > span { color: var(--muted); font-size: 10px; }
.record-drawer__header > div:last-child { display: flex; gap: 8px; align-items: center; }
.record-drawer__tabs { display: flex; min-height: 45px; padding: 0 18px; gap: 20px; align-items: end; overflow-x: auto; border-bottom: 1px solid var(--line); }
.record-drawer__tabs button { height: 44px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); white-space: nowrap; font-size: 11px; font-weight: 700; }
.record-drawer__tabs button.is-active { border-color: var(--black); color: var(--black); }
.record-drawer__tabs button span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; place-items: center; border-radius: 10px; background: var(--surface-muted); font-size: 9px; }
.record-drawer__body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); }
.record-primary { padding: 18px; border-right: 1px solid var(--line); }
.record-side { padding: 18px; background: var(--surface-subtle); }
.contact-card { display: flex; padding: 15px; align-items: center; justify-content: space-between; border: 1px solid var(--line); }
.contact-card > div:first-child { display: flex; gap: 10px; align-items: center; }
.contact-card > div:first-child > span:last-child { display: grid; }
.contact-card small { color: var(--muted); }
.large-initials { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--black); border-radius: 50%; font-weight: 800; }
.contact-actions { display: flex; gap: 6px; }
.contact-actions button { display: grid; min-width: 62px; height: 52px; padding: 5px; place-items: center; border: 1px solid var(--line); background: white; }
.contact-actions button b { font-size: 11px; }
.contact-actions button span { color: var(--muted); font-size: 8px; }
.record-section { margin-top: 12px; padding: 15px; border: 1px solid var(--line); background: white; }
.record-section > header { display: flex; align-items: center; justify-content: space-between; }
.record-section h3 { margin: 0; font-size: 13px; }
.next-action { display: grid; margin-top: 12px; padding: 10px; grid-template-columns: 45px 1fr auto; gap: 10px; align-items: center; background: var(--surface-subtle); }
.next-action > span:first-child { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--black); font-size: 9px; font-weight: 800; }
.next-action > div { display: grid; }
.next-action small { color: var(--muted); }
.record-section--actions { display: grid; gap: 8px; }
.record-section--actions .link-button { margin-top: 5px; text-align: center; }
.notice-bar { display: flex; min-height: 58px; margin-bottom: 14px; padding: 12px 15px; gap: 12px; align-items: center; border: 1px solid var(--line-strong); background: white; }
.notice-bar > span { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border: 1px solid var(--black); border-radius: 50%; font-weight: 800; }
.notice-bar p { margin: 0; color: var(--muted); font-size: 11px; }
.notice-bar strong { color: var(--ink); }
.implementation-detail { margin-bottom: 14px; }
.implementation-detail__body { padding: 18px; }
.progress-block { display: grid; padding: 18px; grid-template-columns: 112px 1fr; gap: 22px; align-items: center; border: 1px solid var(--line); }
.progress-ring { display: grid; width: 98px; height: 98px; place-items: center; align-content: center; border: 9px double var(--black); border-radius: 50%; }
.progress-ring strong { font-size: 18px; }
.progress-ring span { color: var(--muted); font-size: 9px; }
.progress-block p { color: var(--muted); font-size: 11px; }
.step-line { display: grid; grid-template-columns: repeat(4, 1fr); }
.step-line span { position: relative; padding-top: 18px; color: var(--muted); font-size: 9px; }
.step-line span::before { content: ''; position: absolute; top: 6px; right: 0; left: 0; height: 1px; background: var(--line); }
.step-line span::after { content: ''; position: absolute; top: 2px; left: 0; width: 9px; height: 9px; border: 1px solid var(--line-strong); border-radius: 50%; background: white; }
.step-line span.is-done::before, .step-line span.is-done::after, .step-line span.is-current::after { border-color: var(--black); background: var(--black); }
.step-line span.is-current { color: var(--black); font-weight: 700; }
.checklist { border: 1px solid var(--line); }
.checklist > header { display: flex; padding: 13px; justify-content: space-between; border-bottom: 1px solid var(--line); }
.checklist > header h3 { margin: 0; }
.checklist > header span { color: var(--muted); font-size: 10px; }
.checklist label { display: flex; padding: 11px 13px; gap: 9px; border-bottom: 1px solid var(--line); font-size: 11px; }
.checklist label:last-child { border: 0; }

/* Stage 2 and 3 modules */
.automation-layout { display: grid; grid-template-columns: 190px minmax(520px, 1fr) 260px; gap: 12px; }
.version-list > header, .simulation-panel > header, .reconciliation-card > header, .decision-checklist > header { padding: 16px; border-bottom: 1px solid var(--line); }
.version-row { display: flex; width: 100%; padding: 12px; align-items: center; justify-content: space-between; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }
.version-row.is-active { box-shadow: inset 3px 0 var(--black); background: var(--surface-subtle); }
.version-row > span { display: grid; }
.version-row small { color: var(--muted); font-size: 9px; }
.version-draft { width: calc(100% - 20px); min-height: 38px; margin: 10px; border: 1px dashed var(--line-strong); background: white; font-size: 10px; }
.rule-builder__header { display: flex; padding: 16px; gap: 14px; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.rule-builder__header h2 { margin: 0; }
.rule-builder__header > div:last-child { display: flex; gap: 6px; }
.rule-builder__header span { color: var(--muted); font-size: 10px; }
.logic-block { display: grid; margin: 16px; padding: 16px; grid-template-columns: 34px 1fr; gap: 12px; border: 1px solid var(--line); background: var(--surface-subtle); }
.logic-number { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--black); border-radius: 50%; font-weight: 800; }
.condition-row { display: grid; margin-bottom: 8px; grid-template-columns: .8fr .8fr 1.4fr 28px; gap: 6px; }
.condition-row select, .condition-row button { min-height: 36px; padding: 0 8px; border: 1px solid var(--line); background: white; font-size: 10px; }
.logic-connector { height: 10px; margin: -16px 0; text-align: center; }
.logic-connector span { position: relative; z-index: 1; padding: 4px 10px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.destination-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.destination-options label { display: flex; padding: 12px; gap: 8px; border: 1px solid var(--line); background: white; }
.destination-options label.is-selected { border-color: var(--black); }
.destination-options label span { display: grid; }
.destination-options small { color: var(--muted); font-size: 9px; }
.rule-footer { display: flex; min-height: 64px; padding: 12px 16px; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); background: var(--surface-subtle); font-size: 10px; }
.simulation-panel { align-self: start; }
.simulation-panel .stacked-definitions { padding: 8px 14px; }
.simulation-result { display: grid; margin: 14px; padding: 14px; border: 1px solid var(--black); }
.simulation-result span, .simulation-result small { color: var(--muted); font-size: 9px; }
.simulation-result strong { margin: 5px 0; font-size: 17px; }
.commission-program { margin-bottom: 12px; }
.commission-program .panel__header > div:last-child { display: flex; gap: 8px; align-items: center; }
.commission-program__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.commission-program__grid > div { display: grid; padding: 15px 17px; border-right: 1px solid var(--line); }
.commission-program__grid > div:last-child { border: 0; }
.commission-program__grid span, .commission-program__grid small { color: var(--muted); font-size: 9px; }
.commission-program__grid strong { margin: 4px 0; font-size: 17px; }
.calculation-panel { display: grid; margin-top: 12px; padding: 18px; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.calculation-panel p { margin: 0; color: var(--muted); font-size: 11px; }
.calculation-panel > small { grid-column: 1 / 3; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); }
.formula { display: flex; gap: 8px; align-items: center; }
.formula span, .formula strong { padding: 8px 10px; border: 1px solid var(--line); font-size: 10px; }
.formula strong { border-color: var(--black); background: var(--black); color: white; }
.billing-layout, .customers-layout, .support-layout, .budget-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
.reconciliation-card, .customer-profile, .ticket-detail, .decision-checklist { align-self: start; padding-bottom: 16px; }
.reconciliation-card .stacked-definitions, .customer-profile .stacked-definitions, .ticket-detail .stacked-definitions { padding: 0 16px 12px; }
.reconciliation-card > .button, .customer-profile > .button, .ticket-detail > .button { width: calc(100% - 32px); margin: 0 16px; }
.reconciliation-score { display: grid; margin: 16px; padding: 18px; place-items: center; border: 1px solid var(--black); }
.reconciliation-score strong { font-size: 29px; }
.reconciliation-score span { color: var(--muted); font-size: 10px; }
.metric-card--split { display: grid; align-content: space-between; }
.metric-card--split > span { color: var(--muted); font-size: 11px; }
.distribution { display: flex; width: 100%; height: 20px; margin: 12px 0; gap: 3px; }
.distribution i { width: var(--part); border: 1px solid var(--black); background: repeating-linear-gradient(45deg,#fff,#fff 4px,#ddd 4px,#ddd 8px); }
.distribution i:nth-child(2) { background: #c5c5c5; }
.distribution i:nth-child(3) { background: var(--black); }
.customer-profile > header, .ticket-detail > header { padding: 16px; border-bottom: 1px solid var(--line); }
.customer-profile > header span { color: var(--muted); font-size: 9px; }
.customer-profile__score { display: grid; padding: 16px; grid-template-columns: 1fr auto; gap: 8px; }
.customer-profile__score > div { grid-column: 1 / 3; height: 8px; background: var(--surface-muted); }
.customer-profile__score > div i { display: block; height: 100%; background: var(--black); }
.ticket-list { display: grid; }
.ticket-row { display: grid; width: 100%; min-height: 92px; padding: 14px; grid-template-columns: 1fr auto; gap: 12px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }
.ticket-row.is-selected { box-shadow: inset 3px 0 var(--black); background: var(--surface-subtle); }
.ticket-row > span { display: grid; align-content: center; }
.ticket-row > span:last-child { grid-template-columns: repeat(2, auto); gap: 5px; justify-items: end; }
.ticket-row small, .ticket-row em, .ticket-row time { color: var(--muted); font-size: 9px; font-style: normal; }
.ticket-row time { grid-column: 1 / 3; }
.ticket-message { margin: 16px; padding: 14px; border-left: 3px solid var(--black); background: var(--surface-subtle); }
.ticket-message p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.external-note { display: flex; margin: 0 16px 14px; padding: 12px; gap: 10px; border: 1px dashed var(--line-strong); }
.external-note > span { font-size: 18px; }
.external-note p { display: grid; margin: 0; }
.external-note small { color: var(--muted); font-size: 9px; }
.definition-warning { display: flex; margin-bottom: 14px; padding: 16px; gap: 14px; border: 2px solid var(--black); background: repeating-linear-gradient(135deg,#fff,#fff 8px,#f2f2f2 8px,#f2f2f2 16px); }
.definition-warning > span { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid var(--black); border-radius: 50%; font-weight: 800; }
.definition-warning p { margin: 4px 0 0; color: var(--muted); }
.decision-checklist label { display: flex; padding: 12px 16px; gap: 9px; border-bottom: 1px solid var(--line); font-size: 10px; }
.decision-checklist label:last-child { border: 0; }
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; }
.settings-nav { align-self: start; padding: 8px; }
.settings-nav button { width: 100%; min-height: 39px; padding: 0 11px; border: 0; border-radius: 4px; background: white; color: var(--muted); text-align: left; font-size: 11px; }
.settings-nav button:hover, .settings-nav button.is-active { background: var(--black); color: white; }
.settings-content { display: grid; gap: 12px; }
.permissions-preview { padding: 16px; }
.permissions-preview > header > div span { color: var(--muted); font-size: 10px; }
.permission-groups { display: grid; margin-top: 16px; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.permission-groups > div { display: grid; padding: 14px; align-content: start; border-right: 1px solid var(--line); }
.permission-groups > div:last-child { border: 0; }
.permission-groups > div > strong { margin-bottom: 10px; }
.permission-groups span { display: flex; padding: 5px 0; gap: 6px; color: var(--muted); font-size: 9px; }
.permission-groups i { color: var(--black); font-style: normal; font-weight: 800; }
.permissions-preview > footer { display: flex; margin-top: 14px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }

/* Demonstration loading states */
.skeleton-table { padding: 14px; }
.skeleton-table > span, .skeleton-table i, .skeleton-board strong, .skeleton-board i { display: block; border-radius: 3px; background: linear-gradient(90deg,#ededeb 25%,#fafafa 50%,#ededeb 75%); background-size: 200% 100%; animation: skeleton-shift 1.5s infinite linear; }
.skeleton-table > span { width: 100%; height: 36px; }
.skeleton-table > div { display: grid; height: 58px; grid-template-columns: 1.4fr 1fr .8fr .8fr; gap: 28px; align-items: center; border-bottom: 1px solid var(--line); }
.skeleton-table i { height: 10px; }
.skeleton-board { display: grid; min-height: 430px; padding: 14px; grid-template-columns: repeat(5, 1fr); gap: 10px; background: var(--surface-subtle); }
.skeleton-board section { padding: 12px; border: 1px solid var(--line); }
.skeleton-board strong { width: 60%; height: 10px; margin-bottom: 20px; }
.skeleton-board section div { display: grid; height: 120px; margin-bottom: 9px; padding: 13px; gap: 12px; align-content: start; border: 1px solid var(--line); background: white; }
.skeleton-board i { height: 9px; }
.skeleton-board i:nth-child(2) { width: 70%; }
@keyframes skeleton-shift { to { background-position: -200% 0; } }

/* Modal-specific details */
.modal-summary { display: grid; margin-bottom: 18px; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.modal-summary > div { display: grid; padding: 12px; border-right: 1px solid var(--line); }
.modal-summary > div:last-child { border-right: 0; }
.modal-summary span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.modal-summary strong { margin-top: 3px; }
.check-list { display: grid; margin-top: 16px; border: 1px solid var(--line); }
.check-list label { display: flex; padding: 11px; gap: 9px; border-bottom: 1px solid var(--line); font-size: 11px; }
.check-list label:last-child { border: 0; }
.impact-summary { display: grid; gap: 8px; margin-top: 16px; padding: 14px; border: 1px dashed var(--line-strong); }
.impact-summary > div { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.impact-summary span { color: var(--muted); font-size: 10px; }
.impact-summary strong { text-align: right; font-size: 10px; }

/* Extended functional prototype */
.context-cell { position: relative; }
.context-menu { position: absolute; top: calc(100% - 8px); right: 14px; z-index: 12; width: 170px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 6px; background: white; box-shadow: var(--shadow); }
.context-menu[hidden] { display: none; }
.context-menu button { display: block; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 4px; background: white; text-align: left; font-size: 11px; }
.context-menu button:hover { background: var(--surface-subtle); }
.course-card footer { position: relative; }
.course-card footer .context-menu { top: auto; right: 12px; bottom: 58px; }
[data-selectable] { transition: box-shadow .15s ease, background .15s ease; }
tr[data-selectable] { cursor: pointer; }
tr[data-selectable]:hover, tr[data-selectable].is-selected { box-shadow: inset 3px 0 var(--black); background: var(--surface-subtle); }
.task-row.is-complete strong { color: var(--muted); text-decoration: line-through; }
.record-drawer[hidden] { display: none; }
.tab-placeholder { min-height: 180px; padding: 32px; border-top: 1px solid var(--line); background: white; }
.tab-placeholder p { max-width: 760px; color: var(--muted); }
.module-tabs { display: flex; gap: 4px; padding: 5px; border: 1px solid var(--line); background: white; }
.module-tabs > button { min-height: 38px; padding: 0 14px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.module-tabs > button:hover, .module-tabs > button.is-active { background: var(--black); color: white; }
.automation-layout + [data-tab-panel], .module-tabs + [data-tab-panel] { margin-top: 12px; }
.simple-flow-panel { min-height: 300px; }
.flow-steps { display: grid; min-height: 170px; padding: 28px; grid-template-columns: repeat(7, auto); gap: 14px; align-items: center; justify-content: center; }
.flow-steps > div { display: grid; width: 175px; min-height: 112px; padding: 14px; align-content: start; border: 1px solid var(--line); }
.flow-steps > div > span { display: grid; width: 24px; height: 24px; margin-bottom: 12px; place-items: center; border: 1px solid var(--black); border-radius: 50%; font-size: 9px; font-weight: 800; }
.flow-steps small { margin-top: 4px; color: var(--muted); }
.panel-actions { display: flex; padding: 14px 18px; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); }
.analytics-toolbar { display: flex; margin-bottom: 12px; padding: 10px; gap: 12px; align-items: center; justify-content: space-between; overflow-x: auto; }
.analytics-toolbar .module-tabs { flex: 1 0 auto; border: 0; padding: 0; }
.analytics-filters { display: flex; gap: 8px; align-items: flex-end; }
.analytics-filters label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.analytics-filters select { min-width: 125px; height: 38px; padding: 0 8px; border: 1px solid var(--line); background: white; font-size: 10px; }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .5fr); gap: 12px; }
.chart-panel { min-height: 350px; }
.line-chart { display: flex; height: 220px; padding: 24px 26px 0; gap: 9px; align-items: end; background: repeating-linear-gradient(to bottom, transparent 0, transparent 54px, var(--line) 55px); }
.line-chart span { width: 100%; height: var(--h); border: 1px solid var(--black); background: repeating-linear-gradient(45deg,#fff,#fff 5px,#e9e9e7 5px,#e9e9e7 10px); transition: height .25s ease; }
.line-chart span:hover { background: var(--black); }
.chart-axis { display: flex; padding: 9px 26px; justify-content: space-between; color: var(--muted); font-size: 9px; }
.breakdown-panel { padding-bottom: 12px; }
.bar-row { display: grid; padding: 12px 18px; grid-template-columns: 125px 1fr 42px; gap: 10px; align-items: center; font-size: 10px; }
.bar-row > div { height: 8px; background: var(--surface-muted); }
.bar-row i { display: block; height: 100%; background: var(--black); }
.bar-row strong { text-align: right; }
.training-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 12px; }
.training-sidebar { align-self: start; padding: 12px; }
.training-sidebar .search-box { width: 100%; }
.training-sidebar nav { display: grid; margin-top: 12px; }
.training-sidebar nav button { min-height: 40px; padding: 0 11px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; font-size: 11px; }
.training-sidebar nav button.is-active, .training-sidebar nav button:hover { background: var(--black); color: white; }
.training-help { margin-top: 16px; padding: 13px; border: 1px dashed var(--line-strong); }
.training-help p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-content: start; }
.course-card { display: grid; min-height: 390px; grid-template-rows: 120px 1fr auto; border: 1px solid var(--line); background: white; }
.course-card[hidden] { display: none; }
.course-card__cover { display: grid; padding: 14px; grid-template-columns: 1fr auto; align-content: space-between; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(135deg,#fff,#fff 10px,#f0f0ee 10px,#f0f0ee 20px); }
.course-card__cover span { font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.course-card__cover strong { grid-column: 2; font-size: 48px; line-height: .9; }
.course-card__body { padding: 16px; }
.course-card__body > div { display: flex; align-items: center; justify-content: space-between; }
.course-card__body > div small { color: var(--muted); font-size: 9px; }
.course-card__body h2 { margin-top: 15px; font-size: 20px; }
.course-card__body > p { color: var(--muted); font-size: 10px; }
.course-card__body dl { margin: 18px 0 0; }
.course-card__body dl > div { display: grid; padding: 7px 0; grid-template-columns: 75px 1fr; border-top: 1px solid var(--line); }
.course-card__body dt { color: var(--muted); font-size: 9px; }
.course-card__body dd { margin: 0; font-size: 10px; font-weight: 700; }
.course-card footer { display: flex; padding: 12px; gap: 7px; border-top: 1px solid var(--line); }
.course-card footer .button { flex: 1; }
.message-preview { margin: 0 16px 16px; padding: 14px; border: 1px solid var(--line); background: var(--surface-subtle); }
.message-preview small { color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.message-preview strong { display: block; margin: 5px 0 8px; }
.message-preview p { margin: 0; color: var(--muted); font-size: 10px; }
.process-list { display: grid; padding: 10px 18px 18px; }
.process-list span { display: flex; min-height: 48px; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.process-list b { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; }
.process-list span.is-done { color: var(--black); font-weight: 700; }
.process-list span.is-done b { background: var(--black); color: white; }
.audience-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; }
.group-detail { align-self: start; }
.group-detail > header { padding: 18px; border-bottom: 1px solid var(--line); }
.group-detail > header span { color: var(--muted); font-size: 10px; }
.group-members > div { display: flex; min-height: 62px; padding: 10px 14px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.group-members > div > span { display: flex; gap: 8px; align-items: center; }
.group-members > div > span > span { display: grid; }
.group-members small { color: var(--muted); font-size: 9px; }
.group-members button { width: 28px; height: 28px; border: 0; background: transparent; }
.group-detail footer { padding: 14px; }
.payment-summary { display: grid; min-height: 96px; padding: 14px 18px; grid-template-columns: repeat(2, minmax(180px, 1fr)) auto; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); }
.payment-summary > div { display: grid; }
.payment-summary span, .payment-summary small { color: var(--muted); font-size: 9px; }
.payment-summary strong { font-size: 20px; }
.payment-total { display: grid; margin-bottom: 18px; padding: 22px; place-items: center; border: 1px solid var(--black); background: var(--surface-subtle); }
.payment-total span, .payment-total small { color: var(--muted); }
.payment-total strong { font-size: 32px; }
.stepper { display: grid; margin-bottom: 18px; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.stepper span { padding: 12px; border-right: 1px solid var(--line); color: var(--muted); font-size: 9px; text-align: center; }
.stepper span:last-child { border: 0; }
.stepper span.is-current { background: var(--black); color: white; font-weight: 700; }
.chapter-builder { margin-top: 18px; border: 1px solid var(--line); }
.chapter-builder > header, .chapter-builder > div { display: grid; min-height: 52px; padding: 10px 12px; grid-template-columns: 38px 1fr auto 28px; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); }
.chapter-builder > header { display: flex; justify-content: space-between; }
.chapter-builder > div:last-child { border: 0; }
.chapter-builder small { color: var(--muted); }
.chapter-builder button:not(.link-button) { border: 0; background: transparent; }
.course-reader { display: grid; padding: 0 !important; grid-template-columns: 210px 1fr; }
.course-reader aside { display: grid; align-content: start; padding: 10px; border-right: 1px solid var(--line); background: var(--surface-subtle); }
.course-reader aside button { min-height: 42px; padding: 0 10px; border: 0; background: transparent; text-align: left; font-size: 10px; }
.course-reader aside button.is-active { background: var(--black); color: white; }
.course-reader article { padding: 24px; }
.video-placeholder { display: grid; min-height: 170px; margin: 18px 0; place-items: center; align-content: center; border: 1px solid var(--black); background: repeating-linear-gradient(135deg,#fff,#fff 10px,#f0f0ee 10px,#f0f0ee 20px); }
.video-placeholder span { display: grid; width: 42px; height: 42px; margin-bottom: 8px; place-items: center; border: 1px solid var(--black); border-radius: 50%; }
.video-placeholder small { color: var(--muted); }
.resource-row, .document-review > div { display: flex; padding: 12px; gap: 10px; align-items: center; border: 1px solid var(--line); }
.resource-row > span, .document-review > div > span { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid var(--black); font-size: 9px; font-weight: 800; }
.resource-row > div, .document-review p { display: grid; flex: 1; margin: 0; }
.resource-row small, .document-review small { color: var(--muted); }
.recipient-resolution { display: grid; margin-top: 18px; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.recipient-resolution div { display: grid; padding: 13px; border-right: 1px solid var(--line); }
.recipient-resolution div:last-child { border: 0; }
.recipient-resolution span { color: var(--muted); font-size: 9px; }
.recipient-resolution strong { font-size: 18px; }
.dual-list { display: grid; margin-top: 18px; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dual-list section { border: 1px solid var(--line); }
.dual-list header { display: grid; min-height: 62px; padding: 10px; gap: 6px; border-bottom: 1px solid var(--line); }
.dual-list header input { height: 30px; padding: 0 8px; border: 1px solid var(--line); }
.dual-list label { display: grid; min-height: 46px; padding: 8px 10px; grid-template-columns: 20px 1fr; border-bottom: 1px solid var(--line); font-size: 10px; }
.dual-list label small { grid-column: 2; color: var(--muted); }
.collision-preview { display: flex; margin-top: 16px; padding: 14px; gap: 12px; border: 2px solid var(--black); }
.collision-preview > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid var(--black); border-radius: 50%; font-weight: 800; }
.collision-preview p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.document-review { display: grid; margin-bottom: 16px; gap: 8px; }
.formula--center { justify-content: center; margin-bottom: 18px; }
.modal--large { width: min(900px, 100%); }
.pipeline-list { display: grid; padding: 14px; gap: 7px; }
.pipeline-list > div { display: grid; min-height: 54px; padding: 9px 12px; grid-template-columns: 28px 1fr auto 90px; gap: 10px; align-items: center; border: 1px solid var(--line); }
.pipeline-list > div > span { color: var(--muted); }
.pipeline-list > div > button { height: 30px; border: 0; background: transparent; color: var(--muted); font-size: 9px; text-decoration: underline; }
.settings-note { display: flex; padding: 13px 16px; gap: 10px; border-top: 1px solid var(--line); background: var(--surface-subtle); font-size: 10px; }
.settings-note span { color: var(--muted); }
.toggle-list { display: grid; }
.toggle-list label { display: flex; min-height: 62px; padding: 12px 16px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.toggle-list label > span { display: grid; }
.toggle-list small { color: var(--muted); }
.catalog-grid { display: grid; padding: 16px; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.catalog-grid button { display: grid; min-height: 95px; padding: 16px; align-content: center; border: 1px solid var(--line); background: white; text-align: left; }
.catalog-grid button:hover { border-color: var(--black); background: var(--surface-subtle); }
.catalog-grid small { margin-top: 4px; color: var(--muted); }
.audit-list { display: grid; }
.audit-list > div { display: grid; min-height: 70px; padding: 13px 16px; grid-template-columns: 100px 1fr; border-bottom: 1px solid var(--line); }
.audit-list time { grid-row: 1 / 3; color: var(--muted); font-size: 9px; }
.audit-list small { color: var(--muted); }

@media (max-width: 1250px) {
    .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .flow-steps { justify-content: start; overflow-x: auto; }
}

@media (max-width: 1100px) {
    .role-grid { grid-template-columns: repeat(2, 1fr); }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .profile-summary > span:nth-child(2), .profile-summary .chevron { display: none; }
    .automation-layout { grid-template-columns: 180px 1fr; }
    .simulation-panel { grid-column: 1 / 3; }
    .billing-layout, .customers-layout, .support-layout { grid-template-columns: 1fr; }
    .analytics-grid, .audience-layout { grid-template-columns: 1fr; }
    .reconciliation-card, .customer-profile, .ticket-detail { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; }
    .reconciliation-card > header, .customer-profile > header, .ticket-detail > header { grid-column: 1 / 3; }
}

@media (max-width: 820px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-panel--context { min-height: 42vh; }
    .auth-context__content { margin-top: 70px; }
    .auth-context__content h1 { font-size: 42px; }
    .process-line { flex-wrap: wrap; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow); }
    .sidebar__close, .topbar__menu { display: inline-grid; }
    .app-area { width: 100%; margin-left: 0; }
    .breadcrumbs { display: none; }
    .topbar { padding: 0 14px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-heading__actions { width: 100%; }
    .page-heading__actions .button { flex: 1; }
    .filter-bar, .view-strip { align-items: stretch; flex-direction: column; }
    .search-box { width: 100%; }
    .filter-bar__controls { overflow-x: auto; }
    .detail-grid, .record-drawer__body, .budget-layout, .settings-layout { grid-template-columns: 1fr; }
    .record-primary { border-right: 0; border-bottom: 1px solid var(--line); }
    .automation-layout { grid-template-columns: 1fr; }
    .training-layout { grid-template-columns: 1fr; }
    .training-sidebar nav { grid-template-columns: repeat(4, minmax(120px, 1fr)); overflow-x: auto; }
    .analytics-toolbar { align-items: stretch; flex-direction: column; }
    .analytics-filters { overflow-x: auto; }
    .payment-summary { grid-template-columns: 1fr 1fr; }
    .payment-summary .button { grid-column: 1 / 3; }
    .simulation-panel { grid-column: auto; }
    .version-list { display: none; }
    .commission-program__grid, .permission-groups { grid-template-columns: repeat(2, 1fr); }
    .calculation-panel { grid-template-columns: 1fr; }
    .calculation-panel > small { grid-column: auto; }
    .formula { overflow-x: auto; }
}

@media (max-width: 620px) {
    .auth-panel { padding: 32px 24px; }
    .selection-header { padding: 0 18px; }
    .selection-user > span:last-child { display: none; }
    .selection-content { width: calc(100% - 32px); padding: 40px 0; }
    .role-grid { grid-template-columns: 1fr; }
    .role-card { min-height: 280px; }
    .workspace { padding: 24px 14px 48px; }
    .stage-switcher > summary { min-width: 120px; }
    .stage-switcher__label { display: none; }
    .topbar__right { gap: 5px; }
    .profile-summary { grid-template-columns: 32px; }
    .metric-grid { grid-template-columns: 1fr; }
    .stage-banner { grid-template-columns: 42px 1fr; }
    .stage-banner > span:last-child { grid-column: 2; }
    .funnel-summary { padding-inline: 8px; gap: 4px; }
    .funnel-summary__item span { writing-mode: vertical-rl; transform: rotate(180deg); }
    .popover__panel { position: fixed; top: 68px; right: 10px; left: 10px; width: auto; }
    .form-grid--two { grid-template-columns: 1fr; }
    .demo-states { overflow-x: auto; }
    .demo-states > span { display: none; }
    .definition-grid, .definition-grid--four { grid-template-columns: 1fr; }
    .contact-card { align-items: stretch; flex-direction: column; gap: 12px; }
    .contact-actions button { flex: 1; }
    .next-action { grid-template-columns: 42px 1fr; }
    .next-action .tag { grid-column: 2; }
    .progress-block { grid-template-columns: 1fr; }
    .step-line { grid-template-columns: 1fr; gap: 6px; }
    .step-line span { padding: 0 0 0 18px; }
    .step-line span::before { top: 0; right: auto; bottom: 0; left: 5px; width: 1px; height: auto; }
    .step-line span::after { top: 3px; }
    .destination-options, .commission-program__grid, .permission-groups { grid-template-columns: 1fr; }
    .condition-row { grid-template-columns: 1fr; }
    .rule-builder__header, .rule-footer { flex-direction: column; }
    .billing-layout, .customers-layout, .support-layout, .budget-layout { grid-template-columns: 1fr; }
    .reconciliation-card, .customer-profile, .ticket-detail { display: block; }
    .modal-summary { grid-template-columns: 1fr; }
    .modal-summary > div { border-right: 0; border-bottom: 1px solid var(--line); }
    .course-grid, .dual-list, .course-reader { grid-template-columns: 1fr; }
    .course-reader aside { display: none; }
    .recipient-resolution, .stepper { grid-template-columns: repeat(2, 1fr); }
    .bar-row { grid-template-columns: 90px 1fr 38px; }
    .payment-summary { grid-template-columns: 1fr; }
    .payment-summary .button { grid-column: auto; }
}
