:root {
    --ink: #071225;
    --ink-soft: #25344c;
    --muted: #5c6c84;
    --muted-light: #64748b;
    --line: #dbe5f2;
    --line-soft: #eaf0f7;
    --surface: #ffffff;
    --canvas: #f4f7fb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --cyan: #0ea5e9;
    --green: #047857;
    --green-soft: #ecfdf5;
    --amber: #b45309;
    --amber-soft: #fffbeb;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(7, 18, 37, .03), 0 14px 40px rgba(30, 64, 175, .055);
    --shadow-raised: 0 18px 55px rgba(7,18,37,.12);
    --sidebar: 264px;
    --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
svg { display: block; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }
.muted { color: var(--muted); }
.text-danger { color: var(--red) !important; }

/* Shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar); padding: 0 16px 18px; color: #cbd5e1; background: #0b1120; display: flex; flex-direction: column; }
.brand { height: 88px; padding: 0 10px; display: flex; align-items: center; gap: 12px; color: white; }
.brand-mark { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: block; box-shadow: 0 9px 24px rgba(79,70,229,.35); }
.brand-mark.large { width: 50px; height: 50px; border-radius: 14px; }
.brand > span:last-of-type, .login-brand > div { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong, .login-brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small, .login-brand small { margin-top: 3px; color: #818cf8; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.main-nav { min-height: 0; display: flex; flex-direction: column; gap: 5px; overflow-x: hidden; overflow-y: auto; }
.nav-link { height: 45px; padding: 0 13px; border-radius: 10px; display: flex; align-items: center; gap: 12px; color: #94a3b8; font-weight: 600; transition: .2s ease; }
.nav-link svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:first-child svg { fill: currentColor; stroke: none; }
.nav-link:hover { color: white; background: rgba(255,255,255,.05); transform: translateX(2px); }
.nav-link.active { color: white; background: linear-gradient(90deg, rgba(79,70,229,.25), rgba(79,70,229,.09)); box-shadow: inset 3px 0 #6366f1; }
.nav-link.active svg { color: #818cf8; }
.sidebar-footer { margin-top: auto; padding: 15px 6px 0; border-top: 1px solid rgba(148,163,184,.12); }
.user-card { padding: 6px 2px 14px; display: flex; align-items: center; gap: 10px; }
.avatar { flex: 0 0 auto; width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #4f46e5, #0891b2); font-weight: 800; }
.avatar.soft { width: 38px; height: 38px; color: var(--primary); background: var(--primary-soft); }
.user-copy { min-width: 0; display: flex; flex-direction: column; }
.user-copy strong { overflow: hidden; color: #e2e8f0; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { color: #64748b; font-size: 10px; }
.logout-button { width: 100%; padding: 8px; border: 0; color: #64748b; background: transparent; text-align: left; font-size: 12px; transition: color .2s; }
.logout-button:hover { color: #fca5a5; }
.sidebar-close, .sidebar-overlay { display: none; }
.main-area { min-width: 0; min-height: 100vh; margin-left: var(--sidebar); }
.demo-banner { min-height: 40px; padding: 7px 36px; display: flex; justify-content: center; align-items: center; gap: 12px; color: #312e81; background: linear-gradient(90deg, #e0e7ff, #cffafe); border-bottom: 1px solid #c7d2fe; font-size: 11px; }
.demo-banner strong { padding: 2px 8px; border-radius: 99px; color: white; background: var(--primary); text-transform: uppercase; font-size: 9px; letter-spacing: .1em; }
.demo-banner time { padding-left: 12px; border-left: 1px solid rgba(79,70,229,.25); color: #4338ca; font-size: 10px; font-weight: 750; white-space: nowrap; }
.demo-banner form { display: inline-flex; }
.demo-banner form button { padding: 3px 8px; border: 1px solid rgba(79,70,229,.25); border-radius: 7px; color: #4338ca; background: rgba(255,255,255,.5); font-size: 9px; font-weight: 750; }
.demo-banner-copy-compact { display: none; }
.setup-banner { min-height: 56px; padding: 9px 36px; display: flex; align-items: center; gap: 13px; color: #78350f; background: #fffbeb; border-bottom: 1px solid #fde68a; }
.setup-banner > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.setup-banner strong { font-size: 11px; }
.setup-banner small { color: #a16207; font-size: 9px; }
.setup-banner a { margin-left: auto; color: #92400e; font-size: 10px; font-weight: 800; white-space: nowrap; }
.setup-progress { flex: 0 0 auto; width: 52px; height: 6px; border-radius: 99px; overflow: hidden; background: #fde68a; }
.setup-progress i { height: 100%; display: block; border-radius: inherit; background: #d97706; }
.topbar { position: relative; z-index: 30; height: 98px; padding: 0 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px; overflow: visible; background: rgba(245,247,251,.82); backdrop-filter: blur(12px); }
.topbar h1 { margin: 2px 0 0; font-size: 25px; line-height: 1.2; letter-spacing: -.035em; }
.eyebrow, .section-kicker { margin: 0; color: var(--muted-light); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.quick-add { padding: 10px 15px; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; gap: 8px; color: var(--ink-soft); background: white; box-shadow: 0 1px 2px rgba(15,23,42,.03); font-size: 12px; font-weight: 700; }
.quick-add:hover { border-color: #c7d2fe; color: var(--primary); }
.quick-add svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.quick-create { position: relative; margin-left: auto; }
.quick-create-menu { position: absolute; z-index: 80; top: calc(100% + 9px); right: 0; width: 280px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: white; box-shadow: 0 18px 48px rgba(15,23,42,.17); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right; transition: .18s var(--ease); }
.quick-create.is-open .quick-create-menu { opacity: 1; visibility: visible; transform: none; }
.quick-create-menu a { padding: 11px; border-radius: 9px; display: flex; flex-direction: column; }
.quick-create-menu a:hover { color: var(--primary); background: var(--primary-soft); }
.quick-create-menu strong { font-size: 11px; }
.quick-create-menu small { margin-top: 2px; color: var(--muted-light); font-size: 8px; }
.menu-button { display: none; }
.icon-button { padding: 0; border: 0; background: transparent; }
.page-content { padding: 0 36px 46px; }
.app-footer { padding: 0 36px 24px; color: var(--muted-light); font-size: 10px; text-align: center; }

/* Common elements */
.panel { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-header { min-height: 68px; padding: 20px 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-header h2 { margin: 3px 0 0; font-size: 16px; line-height: 1.25; letter-spacing: -.02em; }
.panel-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.button { min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 750; transition: transform .2s var(--ease), background .2s, border .2s, box-shadow .2s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: linear-gradient(145deg, #5b54e8, #4338ca); box-shadow: 0 7px 18px rgba(79,70,229,.18); }
.button-primary:hover { box-shadow: 0 10px 25px rgba(79,70,229,.26); }
.button-secondary { border-color: var(--line); color: var(--ink-soft); background: white; }
.button-secondary:hover { border-color: #c7d2fe; color: var(--primary); }
.button-danger { border-color: #fecaca; color: #b91c1c; background: var(--red-soft); }
.button-danger:hover { border-color: #fca5a5; color: #991b1b; background: #fee2e2; }
.button-ghost { color: var(--muted); background: transparent; }
.button-small { min-height: 33px; padding: 6px 10px; font-size: 11px; }
.button-block { width: 100%; }
.text-link { color: var(--primary); font-size: 11px; font-weight: 750; }
.text-link:hover { color: var(--primary-dark); }
.icon-link { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 20px; }
.badge { width: fit-content; padding: 4px 8px; border-radius: 99px; display: inline-flex; align-items: center; color: var(--muted); background: #f1f5f9; font-size: 9px; font-weight: 800; letter-spacing: .03em; white-space: nowrap; }
.badge-success { color: #047857; background: var(--green-soft); }
.badge-danger { color: #b91c1c; background: var(--red-soft); }
.badge-warning { color: #b45309; background: var(--amber-soft); }
.badge-info { color: #0369a1; background: #f0f9ff; }
.badge-neutral { color: #475569; background: #f1f5f9; }
.back-row { margin: -4px 0 17px; }
.back-row a { color: var(--muted); font-size: 12px; font-weight: 650; }
.back-row a:hover { color: var(--primary); }
.toolbar-actions { display: flex; align-items: center; gap: 9px; }
.page-toolbar { min-height: 56px; margin-bottom: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.filter-tabs { padding: 4px; border: 1px solid var(--line); border-radius: 10px; display: flex; gap: 2px; background: white; overflow-x: auto; }
.filter-tabs a { padding: 7px 11px; border-radius: 7px; color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.filter-tabs a:hover, .filter-tabs a.active { color: var(--primary); background: var(--primary-soft); }
.search-form { width: min(520px, 55%); display: flex; gap: 8px; }
.search-form label { flex: 1; }
.search-form input { width: 100%; height: 41px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: white; }
.search-form input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef2ff; }
.search-form button { padding: 0 15px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: white; font-size: 11px; font-weight: 700; }

/* Flash */
.flash-stack { position: fixed; z-index: 100; top: 18px; right: 22px; width: min(390px, calc(100vw - 30px)); display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 12px 12px 12px 15px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: white; box-shadow: 0 16px 40px rgba(15,23,42,.15); animation: flash-in .35s var(--ease); font-size: 12px; }
.flash button { border: 0; color: var(--muted); background: transparent; font-size: 19px; }
.flash-success { border-left-color: var(--green); }
.flash-error { border-left-color: var(--red); }
.flash-warning { border-left-color: var(--amber); }
.flash-info { border-left-color: var(--primary); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-10px); } }

/* Dashboard */
.metrics-grid { margin-bottom: 18px; display: grid; grid-template-columns: 1.35fr repeat(4, 1fr); gap: 13px; }
.metric-card { position: relative; min-width: 0; min-height: 122px; padding: 20px; border: 1px solid var(--line-soft); border-radius: 14px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; background: white; box-shadow: 0 1px 2px rgba(15,23,42,.02); }
.metric-card > span, .metric-card > div > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.metric-card strong { margin: 7px 0 2px; display: block; font-size: 23px; line-height: 1.1; letter-spacing: -.04em; white-space: nowrap; }
.metric-card small { color: var(--muted-light); font-size: 9px; }
.metric-featured { color: white; background: linear-gradient(135deg, #4338ca 0%, #4f46e5 58%, #0891b2 130%); border-color: transparent; box-shadow: 0 14px 35px rgba(67,56,202,.2); }
.metric-featured > div { position: relative; z-index: 1; }
.metric-featured > div > span, .metric-featured small { color: #c7d2fe; }
.metric-featured strong { font-size: 27px; }
.metric-orb { position: absolute; right: -30px; bottom: -48px; width: 120px; height: 120px; border: 22px solid rgba(255,255,255,.08); border-radius: 50%; }
.dashboard-grid { margin-bottom: 18px; display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(270px, .8fr); gap: 18px; }
.lower-grid { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); }
.chart-panel { min-height: 310px; }
.chart { height: 214px; padding: 22px 24px 20px; display: flex; align-items: flex-end; gap: 10px; }
.chart-column { position: relative; height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.chart-column i { width: min(24px, 60%); min-height: 4px; border-radius: 5px 5px 2px 2px; display: block; background: linear-gradient(#6366f1, #4f46e5); transition: height .6s var(--ease), opacity .2s; opacity: .72; }
.chart-column:hover i { opacity: 1; }
.chart-column small { color: var(--muted-light); font-size: 8px; }
.chart-value { position: absolute; z-index: 2; bottom: calc(100% + 5px); padding: 3px 6px; border-radius: 5px; color: white; background: var(--ink); font-size: 8px; opacity: 0; transform: translateY(4px); transition: .2s; white-space: nowrap; pointer-events: none; }
.chart-column:hover .chart-value { opacity: 1; transform: none; }
.reminder-list { padding: 0 20px 16px; }
.reminder-item { padding: 12px 3px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 11px; }
.reminder-item:last-child { border-bottom: 0; }
.reminder-item:hover strong { color: var(--primary); }
.reminder-item > span { min-width: 0; display: flex; flex-direction: column; }
.reminder-item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.reminder-item small { margin-top: 2px; color: var(--muted-light); font-size: 9px; }
.priority-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 4px #f1f5f9; }
.priority-high { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.priority-urgent { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.priority-low { background: #0ea5e9; box-shadow: 0 0 0 4px #f0f9ff; }
.project-list { padding: 0 20px 14px; }
.project-row { padding: 11px 2px; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.project-row:last-child { border-bottom: 0; }
.project-row > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.project-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.project-row small { color: var(--muted-light); font-size: 9px; }
.project-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 800; }
.empty-compact { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.empty-compact p { margin: 0 0 5px; }
.empty-compact a { color: var(--primary); font-weight: 700; }

/* Tables */
.table-panel { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 18px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); color: var(--muted-light); background: #fbfcfe; text-align: left; text-transform: uppercase; font-size: 8px; letter-spacing: .08em; white-space: nowrap; }
td { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 11px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbff; }
td > small, td > span + small, .table-main + small { margin-top: 2px; display: block; color: var(--muted-light); font-size: 9px; }
.table-main { color: var(--ink); font-weight: 750; }
.table-main:hover { color: var(--primary); }
.amount { color: var(--ink); font-weight: 750; white-space: nowrap; }
.identity { display: flex; align-items: center; gap: 10px; }
.identity > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.identity strong { color: var(--ink); font-size: 11px; }
.identity small { color: var(--muted-light); font-size: 9px; }
.actions-cell { text-align: right; }
.row-action { color: var(--primary); font-size: 10px; font-weight: 700; }
.table-empty { min-height: 130px; padding: 40px !important; color: var(--muted-light); text-align: center; }
.table-empty strong, .table-empty span { display: block; }
.table-empty strong { margin-bottom: 4px; color: var(--ink-soft); font-size: 12px; }
.sum-chip { display: flex; flex-direction: column; text-align: right; }
.sum-chip small { color: var(--muted-light); font-size: 9px; }
.sum-chip strong { font-size: 15px; }
.document-number-cell { display: flex; align-items: center; gap: 8px; }
.mobile-document-status { display: none; }

/* Forms */
.form-page { width: 100%; }
.narrow-form { max-width: 850px; }
.form-card { margin-bottom: 18px; padding-bottom: 23px; }
.form-grid { padding: 2px 22px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px 20px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.field em { color: var(--muted-light); font-size: 9px; font-style: normal; font-weight: 500; }
.field input, .field textarea, .field select, .status-form select { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: #fff; transition: border .2s, box-shadow .2s, background .2s; }
.field input, .field select, .status-form select { height: 41px; padding: 0 12px; }
.field textarea { min-height: 78px; padding: 10px 12px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #b4bfce; }
.field input:focus, .field textarea:focus, .field select:focus, .status-form select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef2ff; }
.field small { color: var(--muted-light); font-size: 9px; }
.field-wide { grid-column: 1 / -1; }
.field-actions { justify-content: flex-end; }
.form-actions { margin-top: 18px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.danger-zone { margin-top: 28px; padding: 18px 20px; border-color: #fee2e2; display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: none; }
.danger-zone strong { color: #991b1b; font-size: 12px; }
.danger-zone p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.danger-zone form { flex: 0 0 auto; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 36px; }
.input-suffix > span { position: absolute; top: 50%; right: 12px; color: var(--muted); transform: translateY(-50%); }
.sticky-actions { position: sticky; z-index: 5; bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); box-shadow: 0 10px 35px rgba(15,23,42,.12); }
.sticky-actions > span { margin-right: auto; color: var(--muted); font-size: 10px; }

/* Client profile */
.profile-header { min-height: 110px; margin-bottom: 18px; padding: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.profile-identity { display: flex; align-items: center; gap: 16px; }
.profile-avatar { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; color: white; background: linear-gradient(145deg,#4f46e5,#0891b2); box-shadow: 0 9px 22px rgba(79,70,229,.2); font-size: 20px; font-weight: 800; }
.profile-identity h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.03em; }
.profile-identity p { margin: 2px 0 0; color: var(--muted); }
.profile-grid { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 18px; align-items: start; }
.contact-card { padding-bottom: 20px; }
.detail-list { margin: 0; padding: 0 22px; }
.detail-list > div { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.detail-list dt { color: var(--muted-light); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.detail-list dd { margin: 3px 0 0; color: var(--ink-soft); font-size: 11px; }
.detail-list a { color: var(--primary); }
.internal-note { margin: 18px 20px 0; padding: 14px; border-radius: 10px; background: #fffbeb; }
.internal-note strong { color: #92400e; font-size: 10px; }
.internal-note p { margin: 5px 0 0; color: #78350f; font-size: 10px; }
.profile-history { display: flex; flex-direction: column; gap: 18px; }
.compact-list { padding: 0 20px 14px; }
.compact-list > a { min-height: 48px; padding: 8px 2px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 15px; }
.compact-list > a:last-of-type { border-bottom: 0; }
.compact-list > a > span:first-child { min-width: 0; margin-right: auto; display: flex; flex-direction: column; }
.compact-list strong { font-size: 11px; }
.compact-list small { color: var(--muted-light); font-size: 9px; }

/* Pipeline */
.pipeline-grid { display: grid; grid-template-columns: repeat(5, minmax(190px,1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.pipeline-column { min-width: 190px; }
.pipeline-title { height: 38px; padding: 0 4px; display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.pipeline-title > span { display: flex; align-items: center; gap: 7px; }
.pipeline-title b { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); background: #e9eef5; font-size: 9px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.status-contacted { background: #0ea5e9; }.status-quote_sent { background: #f59e0b; }.status-won { background: #10b981; }.status-lost { background: #ef4444; }
.pipeline-cards { min-height: 430px; padding: 8px; border: 1px solid var(--line-soft); border-radius: 13px; background: #eef2f7; }
.prospect-card { margin-bottom: 8px; padding: 14px; border: 1px solid transparent; border-radius: 10px; display: block; background: white; box-shadow: 0 2px 8px rgba(15,23,42,.04); transition: .2s var(--ease); }
.prospect-card:hover { border-color: #c7d2fe; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,23,42,.08); }
.prospect-card > div { display: flex; flex-direction: column; }
.prospect-card strong { font-size: 11px; }
.prospect-card small { color: var(--muted-light); font-size: 9px; }
.prospect-card p { min-height: 42px; margin: 10px 0; color: var(--muted); font-size: 9px; }
.prospect-card footer { padding-top: 9px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 8px; font-weight: 700; }
.prospect-card time { color: var(--muted-light); }
.pipeline-empty { padding: 30px 5px; color: var(--muted-light); text-align: center; font-size: 9px; }

/* Document editor */
.document-form-grid { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 18px; align-items: start; }
.document-summary { position: sticky; top: 20px; padding: 22px; }
.document-summary h2 { margin: 4px 0 22px; font-size: 17px; }
.document-summary .field { margin-bottom: 13px; }
.summary-lines { margin: 20px 0; }
.summary-lines > div { padding: 8px 0; display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.summary-lines dd { margin: 0; color: var(--ink); font-weight: 750; }
.summary-lines .summary-total { margin-top: 6px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 800; }
.summary-lines .summary-total dd { color: var(--primary); font-size: 18px; }
.summary-note { margin: 0 0 18px; color: var(--muted-light); font-size: 9px; }
.document-summary .button + .button { margin-top: 5px; }
.number-chip { padding: 7px 10px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 800; }
.line-items-card { overflow: hidden; }
.line-items { padding: 0 22px; }
.line-head, .line-item { display: grid; grid-template-columns: minmax(220px,1fr) 80px 125px 90px 26px; gap: 9px; align-items: center; }
.line-head { padding: 0 2px 8px; color: var(--muted-light); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.line-item { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.line-item textarea, .line-item input { width: 100%; border: 1px solid var(--line); border-radius: 8px; outline: none; background: white; }
.line-item textarea { min-height: 48px; padding: 8px 10px; resize: vertical; font-size: 11px; }
.line-item > input, .line-item .input-suffix input { height: 39px; padding: 0 8px; font-size: 11px; }
.line-item textarea:focus, .line-item input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef2ff; }
.line-item > strong { text-align: right; font-size: 10px; }
.line-item > button { width: 26px; height: 26px; border: 0; border-radius: 7px; color: var(--muted-light); background: #f1f5f9; font-size: 17px; }
.line-item > button:hover { color: var(--red); background: var(--red-soft); }
.input-suffix.compact > span { right: 8px; font-size: 10px; }

/* Document detail */
.document-show-toolbar { min-height: 48px; margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.document-show-toolbar > div { display: flex; align-items: center; gap: 9px; }
.document-show-toolbar form { display: inline-flex; }
.lock-label { color: var(--muted); font-size: 9px; }
.document-paper { position: relative; min-height: 720px; max-width: 990px; margin: 0 auto 18px; padding: 46px 54px; overflow: hidden; }
.paper-watermark { position: absolute; z-index: 0; top: 43%; left: 18%; color: rgba(148,163,184,.12); font-size: 95px; font-weight: 900; letter-spacing: .08em; transform: rotate(-30deg); pointer-events: none; }
.specimen-ribbon { position: absolute; top: 18px; right: -42px; width: 190px; padding: 5px; color: white; background: var(--red); text-align: center; font-size: 8px; font-weight: 800; transform: rotate(35deg); }
.paper-header, .paper-meta, .paper-table, .paper-bottom { position: relative; z-index: 1; }
.paper-header { padding-bottom: 28px; border-bottom: 2px solid var(--ink); display: flex; justify-content: space-between; }
.paper-header > div { display: flex; flex-direction: column; }
.paper-brand { font-size: 24px; font-weight: 850; letter-spacing: -.05em; }
.paper-header small { color: var(--muted); font-size: 9px; }
.paper-header > div:last-child { text-align: right; }
.paper-header > div:last-child span { color: var(--primary); font-size: 18px; font-weight: 850; letter-spacing: .06em; }
.paper-header > div:last-child strong { margin-top: 4px; font-size: 11px; }
.paper-meta { margin: 32px 0; display: grid; grid-template-columns: 1fr 280px; gap: 40px; align-items: start; }
.paper-meta dl { margin: 0; }
.paper-meta dl > div { margin-bottom: 9px; display: flex; }
.paper-meta dt { width: 120px; color: var(--muted); font-size: 9px; }
.paper-meta dd { margin: 0; font-size: 10px; font-weight: 700; }
.paper-meta address { padding: 18px; border-radius: 10px; display: flex; flex-direction: column; background: #f8fafc; font-style: normal; }
.paper-meta address small { margin-bottom: 7px; color: var(--muted-light); font-size: 8px; font-weight: 800; }
.paper-meta address strong { margin-bottom: 3px; font-size: 12px; }
.paper-meta address span { color: var(--muted); font-size: 9px; }
.paper-table-head, .paper-table-row { display: grid; grid-template-columns: minmax(0,1fr) 70px 110px 100px; gap: 10px; }
.paper-table-head { padding: 11px 14px; color: white; background: var(--ink); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.paper-table-row { min-height: 52px; padding: 14px; border-bottom: 1px solid var(--line); align-items: start; color: var(--ink-soft); font-size: 9px; }
.paper-table-row > span:nth-child(n+2), .paper-table-row strong { text-align: right; }
.paper-bottom { margin-top: 28px; display: grid; grid-template-columns: 1fr 260px; gap: 45px; align-items: start; }
.paper-notes strong { display: block; margin-top: 10px; font-size: 9px; }
.paper-notes p { margin: 4px 0; color: var(--muted); font-size: 8px; }
.paper-totals { margin: 0; }
.paper-totals > div { padding: 8px 12px; display: flex; justify-content: space-between; font-size: 9px; }
.paper-totals dd { margin: 0; font-weight: 750; }
.paper-totals > div:last-child { margin-top: 5px; padding: 13px 12px; color: white; background: var(--primary); font-size: 12px; font-weight: 800; }
.status-panel { max-width: 990px; margin: 0 auto; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.status-panel h2 { margin: 3px 0 2px; font-size: 14px; }
.status-panel p { margin: 0; color: var(--muted); font-size: 10px; }
.status-form { display: flex; gap: 8px; }
.status-form select { min-width: 140px; }

/* Reminders */
.reminder-board { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.reminder-card { min-height: 145px; padding: 20px; display: grid; grid-template-columns: 30px 1fr; gap: 13px; }
.reminder-overdue { border-left: 3px solid var(--red); }
.reminder-check button { width: 25px; height: 25px; border: 1px solid #cbd5e1; border-radius: 8px; color: white; background: white; font-weight: 800; }
.reminder-check button:not(:empty) { border-color: var(--green); background: var(--green); }
.reminder-card-head { display: flex; align-items: center; gap: 7px; }
.reminder-card-head { flex-wrap: wrap; }
.entity-chip { color: var(--muted-light); font-size: 10px; }
.notification-chip { padding: 3px 7px; border-radius: 99px; color: #4338ca; background: #eef2ff; font-size: 10px; font-weight: 750; }
.notification-sent { color: #047857; background: var(--green-soft); }
.notification-failed { color: #b91c1c; background: var(--red-soft); }
.notification-cancelled { color: var(--muted); background: #f1f5f9; }
.reminder-body h2 { margin: 10px 0 4px; font-size: 14px; }
.reminder-body p { margin: 0 0 15px; color: var(--muted); font-size: 10px; }
.reminder-body footer { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.reminder-body footer a { color: var(--primary); font-weight: 700; }
.reminder-actions { display: flex; align-items: center; gap: 10px; }
.reminder-actions form { display: inline-flex; }
.reminder-actions button { padding: 0; border: 0; color: var(--red); background: transparent; font-size: 9px; font-weight: 700; }
.empty-state { grid-column: 1/-1; min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty-state > span { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); font-size: 23px; }
.empty-state h2 { margin: 15px 0 4px; font-size: 17px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 22px; align-items: start; }
.settings-nav { position: sticky; top: 20px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; background: white; }
.settings-nav a { padding: 9px 10px; border-radius: 8px; color: var(--muted); font-size: 10px; font-weight: 700; }
.settings-nav a:hover, .settings-nav a.active { color: var(--primary); background: var(--primary-soft); }
.settings-content { min-width: 0; }
.settings-section { scroll-margin-top: 16px; }
.template-grid { padding: 0 22px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.template-card { padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfe; }
.template-card h3 { margin: 0 0 14px; font-size: 12px; }
.template-card .field { margin-top: 12px; }
.template-card > small { display: block; margin-top: 7px; color: var(--muted-light); font-size: 8px; }
.export-grid { padding: 0 22px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.export-grid a { min-height: 84px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; justify-content: center; background: #fafbfe; transition: .2s; }
.export-grid a:hover { border-color: #a5b4fc; background: var(--primary-soft); transform: translateY(-1px); }
.export-grid strong { font-size: 11px; }
.export-grid span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.profile-checklist { margin-bottom: 18px; padding: 20px 22px; display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,.8fr); gap: 24px; border-color: #fde68a; background: linear-gradient(145deg,#fff,#fffbeb); }
.profile-checklist h2 { margin: 4px 0; font-size: 16px; }
.profile-checklist p { margin: 0; color: var(--muted); font-size: 10px; }
.profile-checklist ul { margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; list-style: none; }
.profile-checklist li { position: relative; padding-left: 13px; color: #92400e; font-size: 10px; }
.profile-checklist li:before { content:""; position: absolute; top: 5px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: #f59e0b; }
.toggle-field { min-height: 62px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: row; align-items: center; gap: 12px; background: #fafbfe; }
.toggle-field input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary); }
.toggle-field > span { display: flex; flex-direction: column; }
.toggle-field strong { font-size: 11px; }
.toggle-field small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.provider-status { padding: 4px 8px; border-radius: 99px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.provider-status.is-ready { color: #047857; background: var(--green-soft); }
.provider-status.is-offline { color: #b45309; background: var(--amber-soft); }
.notification-help, .invite-note { justify-content: center; }
.notification-help > span, .invite-note > span { padding: 10px 12px; border-radius: 9px; color: var(--muted); background: #f8fafc; font-size: 10px; }
.notification-disabled, .notification-sent-state { margin: 0 22px; padding: 14px 15px; border-radius: 10px; color: var(--muted); background: #f8fafc; font-size: 10px; }
.notification-sent-state { color: #047857; background: var(--green-soft); display: flex; flex-direction: column; }
.notification-sent-state span { margin-top: 2px; font-size: 10px; }

/* Administration des comptes */
.access-link-card { margin-bottom: 18px; padding: 20px 22px; border-color: #c7d2fe; display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,1fr); align-items: center; gap: 22px; background: linear-gradient(145deg,#fff,#eef2ff); }
.access-link-card h2 { margin: 4px 0; font-size: 16px; }
.access-link-card p { margin: 0; color: var(--muted); font-size: 10px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { min-width: 0; height: 40px; padding: 0 11px; border: 1px solid #c7d2fe; border-radius: 9px; flex: 1; color: var(--ink-soft); background: white; font-size: 11px; }
.admin-grid { margin-bottom: 18px; display: grid; grid-template-columns: minmax(0,1.6fr) minmax(240px,.7fr); gap: 18px; }
.admin-grid .form-card { margin: 0; }
.beta-summary { padding: 24px; display: flex; flex-direction: column; justify-content: center; color: white; background: linear-gradient(145deg,#4338ca,#0e7490); }
.beta-summary > span { color: #c7d2fe; font-size: 10px; font-weight: 700; }
.beta-summary > strong { margin: 6px 0 0; font-size: 38px; letter-spacing: -.05em; }
.beta-summary > small { color: #a5f3fc; font-size: 10px; }
.beta-summary p { margin: 20px 0 0; color: #dbeafe; font-size: 10px; }
.account-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.account-actions form { display: inline-flex; }
.account-actions button { padding: 0; border: 0; background: transparent; }
.accounts-table td:first-child strong, .accounts-table td:first-child small { display: block; }

/* Onboarding */
.onboarding-modal { position: fixed; inset: 0; z-index: 120; padding: 20px; display: grid; place-items: center; background: rgba(2,6,23,.62); backdrop-filter: blur(5px); }
.onboarding-card { width: min(520px,100%); padding: 30px; border: 1px solid rgba(255,255,255,.45); border-radius: 20px; background: white; box-shadow: 0 30px 90px rgba(2,6,23,.3); animation: onboarding-in .35s var(--ease); }
.onboarding-kicker { color: var(--primary); font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.onboarding-card h2 { margin: 8px 0; font-size: 24px; letter-spacing: -.035em; }
.onboarding-card p { margin: 0; color: var(--muted); font-size: 11px; }
.onboarding-progress { height: 7px; margin-top: 22px; border-radius: 99px; overflow: hidden; background: #e2e8f0; }
.onboarding-progress i { height: 100%; display: block; background: linear-gradient(90deg,#4f46e5,#06b6d4); }
.onboarding-card > small { margin-top: 7px; display: block; color: var(--muted-light); font-size: 10px; }
.onboarding-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 8px; }
@keyframes onboarding-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Guest/login */
.guest-shell { min-height: 100vh; overflow-x: hidden; background: #070d1b; }
.guest-main { position: relative; z-index: 2; min-height: 100vh; padding: 40px max(5vw,30px); display: grid; grid-template-columns: minmax(360px,460px) minmax(420px,650px); align-items: center; justify-content: center; gap: 8vw; }
.guest-background { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.guest-background:before { content:""; position:absolute; inset:0; background-image: linear-gradient(rgba(148,163,184,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(148,163,184,.025) 1px,transparent 1px); background-size: 55px 55px; }
.guest-background span { position: absolute; border-radius: 50%; filter: blur(2px); }
.guest-background span:nth-child(1) { width: 480px; height: 480px; top: -240px; left: 18%; background: radial-gradient(circle,rgba(79,70,229,.3),transparent 70%); }
.guest-background span:nth-child(2) { width: 620px; height: 620px; right: -280px; bottom: -300px; background: radial-gradient(circle,rgba(6,182,212,.18),transparent 70%); }
.guest-background span:nth-child(3) { width: 250px; height: 250px; left: 42%; bottom: 0; background: radial-gradient(circle,rgba(79,70,229,.12),transparent 70%); }
.login-card { width: 100%; padding: 36px; border: 1px solid rgba(148,163,184,.16); border-radius: 22px; color: var(--ink); background: rgba(255,255,255,.97); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-heading { margin: 38px 0 27px; }
.login-kicker { color: var(--primary); font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.login-heading h1 { margin: 8px 0 8px; font-size: 29px; letter-spacing: -.045em; }
.login-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 70px; }
.password-wrap button { position: absolute; top: 50%; right: 8px; border: 0; color: var(--primary); background: transparent; transform: translateY(-50%); font-size: 9px; font-weight: 750; }
.login-divider { margin: 20px 0; border-top: 1px solid var(--line); text-align: center; }
.login-divider span { position: relative; top: -10px; padding: 0 10px; color: var(--muted-light); background: white; font-size: 9px; }
.demo-entry-card { margin-top: 13px; padding: 14px 15px; border: 1px solid #dbeafe; border-radius: 11px; color: var(--ink-soft); background: linear-gradient(145deg,#f8fafc,#eef2ff); }
.demo-entry-card strong { display: block; color: #3730a3; font-size: 10px; }
.demo-entry-card p { margin: 3px 0 9px; color: var(--muted); font-size: 9px; }
.demo-entry-card ul { margin: 0; padding: 0; display: grid; gap: 5px; list-style: none; }
.demo-entry-card li { position: relative; padding-left: 14px; color: var(--muted); font-size: 8.5px; }
.demo-entry-card li:before { content:""; position: absolute; top: 5px; left: 1px; width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(5,150,105,.1); }
.login-story { color: white; }
.story-label { color: #818cf8; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.login-story h2 { margin: 12px 0 34px; font-size: clamp(31px,4vw,49px); line-height: 1.08; letter-spacing: -.055em; }
.activation-story { max-width: 500px; color: #94a3b8; font-size: 13px; }
.story-preview { position: relative; padding: 24px; border: 1px solid rgba(255,255,255,.1); border-radius: 20px; background: linear-gradient(145deg,rgba(255,255,255,.09),rgba(255,255,255,.025)); box-shadow: 0 30px 80px rgba(0,0,0,.25); backdrop-filter: blur(10px); transform: perspective(1000px) rotateY(-5deg) rotateX(2deg); }
.preview-top { margin-bottom: 22px; display: flex; gap: 5px; }
.preview-top span { width: 6px; height: 6px; border-radius: 50%; background: #334155; }
.preview-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.preview-grid article { min-height: 90px; padding: 15px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; display: flex; flex-direction: column; background: rgba(15,23,42,.42); }
.preview-grid small { color: #94a3b8; font-size: 8px; }
.preview-grid strong { margin: 8px 0 2px; font-size: 22px; }
.preview-grid i { color: #67e8f9; font-size: 8px; font-style: normal; }
.preview-chart { height: 145px; margin-top: 12px; padding: 20px 15px 0; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; display: flex; align-items: flex-end; gap: 12px; background: rgba(15,23,42,.42); }
.preview-chart span { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(#818cf8,#4f46e5); opacity: .75; }
.guest-flashes { position: fixed; }
.empty-page { min-height: 65vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-page > span { color: #c7d2fe; font-size: 80px; font-weight: 900; line-height: 1; }
.empty-page h2 { margin: 13px 0 5px; }
.empty-page p { margin: 0 0 20px; color: var(--muted); }

/* Responsive */
@media (max-width: 1180px) {
    .metrics-grid { grid-template-columns: repeat(3,1fr); }
    .metric-featured { grid-column: span 1; }
    .pipeline-grid { grid-template-columns: repeat(5,220px); }
}
@media (max-width: 960px) {
    :root { --sidebar: 224px; }
    .page-content, .topbar { padding-left: 24px; padding-right: 24px; }
    .metrics-grid { grid-template-columns: repeat(2,1fr); }
    .metric-featured { grid-column: span 2; }
    .dashboard-grid, .lower-grid { grid-template-columns: 1fr; }
    .document-form-grid { grid-template-columns: 1fr; }
    .document-summary { position: static; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { position: static; flex-direction: row; overflow-x: auto; scroll-padding-inline: 9px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
    .admin-grid { grid-template-columns: 1fr; }
    .beta-summary { min-height: 180px; }
    .access-link-card { grid-template-columns: 1fr; }
    .profile-checklist { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 260px minmax(0,1fr); }
    .guest-main { grid-template-columns: minmax(340px,450px); }
    .login-story { display: none; }
}
@media (max-width: 760px), (max-height: 480px) and (max-width: 960px) {
    .sidebar { width: min(284px,85vw); padding-bottom: max(18px,env(safe-area-inset-bottom)); visibility: hidden; pointer-events: none; transform: translateX(-105%); transition: transform .3s var(--ease),visibility 0s linear .3s; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
    body.menu-open .sidebar { visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s; }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 40; display: block; background: rgba(2,6,23,.58); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .3s; }
    body.menu-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .sidebar-close { width: 44px; height: 44px; margin-left: auto; display: grid; place-items: center; color: #94a3b8; }
    .sidebar-close svg, .menu-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
    .main-area { margin-left: 0; }
    .menu-button { display: grid; place-items: center; }
    .topbar { height: 82px; padding: 0 18px; justify-content: flex-start; }
    .topbar h1 { font-size: 21px; }
    .quick-add { margin-left: auto; }
    .quick-add span { display: none; }
    .quick-create { margin-left: auto; }
    .quick-create-menu { position: fixed; top: 72px; right: 14px; width: min(330px,calc(100vw - 28px)); }
    .demo-banner { min-height: 78px; padding: 8px 12px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px 8px; text-align: left; }
    .demo-banner-copy { min-width: 0; font-size: 10px; line-height: 1.35; }
    .demo-banner-copy-wide { display: none; }
    .demo-banner-copy-compact { display: inline; }
    .demo-banner time { padding-left: 0; border-left: 0; font-size: 10px; }
    .demo-banner form { justify-self: end; }
    .demo-banner form button { min-height: 44px; padding: 0 11px; font-size: 10px; }
    .setup-banner { padding: 10px 14px; flex-wrap: wrap; }
    .setup-banner > span:nth-child(2) { flex: 1; }
    .setup-banner a { margin-left: 65px; }
    .page-content { padding: 0 14px max(35px,env(safe-area-inset-bottom)); }
    .app-footer { padding-left: 18px; padding-right: 18px; }
    .page-toolbar { align-items: stretch; flex-direction: column-reverse; }
    .toolbar-actions { justify-content: flex-end; }
    .filter-tabs { max-width: 100%; }
    .search-form { width: 100%; }
    .profile-header { align-items: flex-start; flex-direction: column; }
    .profile-grid { grid-template-columns: 1fr; }
    .contact-card { order: 2; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .line-items { overflow-x: auto; }
    .line-head, .line-item { min-width: 660px; }
    .document-paper { padding: 35px 26px; }
    .paper-meta { grid-template-columns: 1fr 220px; }
    .paper-bottom { grid-template-columns: 1fr 220px; gap: 20px; }
    .document-show-toolbar, .status-panel { align-items: stretch; flex-direction: column; }
    .document-show-toolbar .toolbar-actions { flex-wrap: wrap; justify-content: flex-start; }
    .status-form { width: 100%; }
    .status-form select { flex: 1; }
    .reminder-board { grid-template-columns: 1fr; }
    .template-grid, .export-grid { grid-template-columns: 1fr; }
    .profile-checklist ul { grid-template-columns: 1fr; }
    .account-actions { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
    .metrics-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .metric-card { min-height: 108px; padding: 15px; }
    .metric-featured { grid-column: span 2; }
    .metric-card strong { font-size: 19px; }
    .metric-featured strong { font-size: 24px; }
    .chart { padding-left: 12px; padding-right: 12px; gap: 5px; }
    .chart-column i { width: 12px; }
    .panel-header { padding: 17px; }
    th, td { padding-left: 14px; padding-right: 14px; }
    .form-grid, .line-items, .template-grid, .export-grid { padding-left: 16px; padding-right: 16px; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .danger-zone { align-items: stretch; flex-direction: column; }
    .danger-zone .button { width: 100%; }
    .sticky-actions > span { display: none; }
    .profile-header .toolbar-actions { width: 100%; }
    .profile-header .toolbar-actions .button { flex: 1; }
    .document-show-toolbar .button { flex: 1; }
    .document-paper { min-width: 0; padding: 25px 16px; }
    .mobile-document-status { display: inline-flex; }
    .document-table th:nth-child(6), .document-table td:nth-child(6) { display: none; }
    .document-paper.panel { border-radius: 8px; }
    .paper-meta, .paper-bottom { grid-template-columns: 1fr; gap: 18px; }
    .paper-table { overflow-x: auto; }
    .paper-table-head, .paper-table-row { min-width: 560px; }
    .guest-main { padding: 18px; display: block; }
    .login-card { margin: 4vh auto; padding: 28px 22px; }
    .login-heading { margin: 29px 0 23px; }
    .login-heading h1 { font-size: 25px; }
    .access-link-card, .onboarding-card { padding: 22px; }
    .copy-field { align-items: stretch; flex-direction: column; }
    .copy-field .button { width: 100%; }
    .onboarding-actions { align-items: stretch; flex-direction: column-reverse; }
    .onboarding-actions form, .onboarding-actions .button { width: 100%; }
    .onboarding-actions form .button { width: 100%; }
    .setup-banner a { width: 100%; margin-left: 0; padding-left: 65px; }
}

/* ========================================================================== 
   TheoNum Pilot 1.4 — premium application foundation
   ========================================================================== */

html { scroll-padding-top: 112px; }
body { min-width: 0; }
body.dialog-open { overflow: hidden; }
body.menu-open { overflow: hidden; }
a, button, input, select, textarea { touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .7; }
button, a { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, textarea, select, [tabindex]):focus-visible { outline: 3px solid rgba(37,99,235,.34); outline-offset: 3px; }
::selection { color: #fff; background: #2563eb; }
.skip-link { position: fixed; z-index: 2000; top: 12px; left: 12px; padding: 11px 16px; border-radius: 10px; color: #fff; background: var(--ink); font-weight: 750; transform: translateY(-180%); transition: transform .18s var(--ease); }
.skip-link:focus { transform: none; }
.sr-only { border: 0; clip-path: inset(50%); white-space: nowrap; }

/* Application shell */
.sidebar { width: var(--sidebar); padding: 0 18px 20px; background: radial-gradient(circle at 25% 8%, rgba(37,99,235,.2), transparent 31%), linear-gradient(180deg,#071225 0%,#09162a 57%,#060d1b 100%); box-shadow: inset -1px 0 rgba(148,163,184,.08); }
.brand { height: 94px; padding: 0 8px; gap: 13px; }
.brand-mark-wrap { position: relative; flex: 0 0 auto; }
.brand-mark-wrap > i { position: absolute; inset: -5px; z-index: -1; border: 1px solid rgba(96,165,250,.28); border-radius: 16px; opacity: .7; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 12px 30px rgba(37,99,235,.32); }
.brand strong { font-size: 17px; }
.brand small { color: #60a5fa; font-size: 10px; letter-spacing: .18em; }
.main-nav { gap: 10px; padding: 4px 3px 10px 0; overflow-x: hidden; overscroll-behavior: contain; scrollbar-color: rgba(96,165,250,.42) transparent; scrollbar-width: thin; }
.main-nav::-webkit-scrollbar { width: 4px; }
.main-nav::-webkit-scrollbar-track { background: transparent; }
.main-nav::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(96,165,250,.42); }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-group-label { padding: 0 13px 7px; color: #52647f; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-link { position: relative; min-height: 45px; height: auto; border: 1px solid transparent; color: #8fa2bd; font-size: 13px; font-weight: 650; }
.nav-link::after { position: absolute; right: 13px; width: 5px; height: 5px; border-radius: 50%; content: ''; background: #60a5fa; opacity: 0; transform: scale(0); transition: .2s var(--ease); }
.nav-link:hover { border-color: rgba(148,163,184,.08); color: #f8fafc; background: rgba(255,255,255,.045); transform: translateX(2px); }
.nav-link.active { border-color: rgba(96,165,250,.16); color: #fff; background: linear-gradient(90deg,rgba(37,99,235,.28),rgba(37,99,235,.08)); box-shadow: inset 3px 0 #3b82f6, 0 8px 28px rgba(2,6,23,.12); }
.nav-link.active::after { opacity: 1; transform: scale(1); }
.nav-link.active svg { color: #60a5fa; }
.sidebar-footer { padding: 16px 7px 0; border-color: rgba(148,163,184,.11); }
.user-card { padding-bottom: 12px; }
.user-copy strong { font-size: 13px; }
.user-copy small { color: #71839f; font-size: 11px; }
.logout-button { min-height: 40px; border-radius: 9px; font-size: 12px; }
.logout-button:hover { padding-left: 11px; color: #fecaca; background: rgba(239,68,68,.07); }
.main-area { min-height: 100dvh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 30; height: 96px; padding: 0 clamp(22px,3vw,46px); border-bottom: 1px solid rgba(219,229,242,.78); background: rgba(244,247,251,.88); backdrop-filter: blur(18px) saturate(145%); }
.topbar-heading { min-width: 0; }
.topbar h1 { overflow: hidden; margin-top: 4px; font-size: clamp(23px,2.1vw,29px); text-overflow: ellipsis; white-space: nowrap; }
.eyebrow, .section-kicker { color: #74849b; font-size: 10px; letter-spacing: .14em; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.command-trigger, .quick-add { min-height: 44px; border-color: #d8e3f1; border-radius: 12px; color: #40516a; background: rgba(255,255,255,.9); box-shadow: 0 4px 16px rgba(7,18,37,.04); }
.command-trigger { min-width: 230px; padding: 0 11px 0 14px; display: flex; align-items: center; gap: 10px; border: 1px solid #d8e3f1; text-align: left; font-size: 12px; }
.command-trigger > svg, .quick-add svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.command-trigger span { margin-right: auto; }
.command-trigger kbd, .command-card kbd { padding: 3px 6px; border: 1px solid #dbe5f2; border-bottom-width: 2px; border-radius: 6px; color: #71839b; background: #f8fafc; font: 700 9px/1.2 inherit; }
.command-trigger:hover, .quick-add:hover { border-color: #a8c3f5; color: var(--primary); box-shadow: 0 8px 24px rgba(37,99,235,.1); transform: translateY(-1px); }
.quick-add { padding: 0 16px; }
.quick-create-menu { top: calc(100% + 11px); width: 310px; padding: 9px; border-color: #dce6f2; border-radius: 16px; box-shadow: 0 26px 70px rgba(7,18,37,.18); }
.quick-create-menu a { min-height: 68px; padding: 12px; border: 1px solid transparent; }
.quick-create-menu a:hover { border-color: #dbeafe; background: #f2f7ff; }
.quick-create-menu strong { font-size: 13px; }
.quick-create-menu small { margin-top: 3px; font-size: 11px; line-height: 1.35; }
.page-content { width: min(100%,1700px); min-height: calc(100dvh - 150px); margin: 0 auto; padding: 10px clamp(22px,3vw,46px) 54px; outline: 0; }
.app-footer { padding: 4px 32px 28px; font-size: 11px; }

/* Common components */
.panel { border-color: #e4ecf6; border-radius: 18px; box-shadow: var(--shadow); }
.panel-header { min-height: 76px; padding: 22px 24px; }
.panel-header h2 { margin-top: 5px; font-size: 18px; }
.panel-header p { max-width: 62ch; margin-top: 7px; color: var(--muted); font-size: 13px; }
.button { min-height: 44px; padding: 10px 17px; border-radius: 11px; font-size: 13px; font-weight: 750; transition: transform .18s var(--ease), background .18s, border .18s, box-shadow .18s, color .18s; }
.button:active { transform: translateY(1px) scale(.985); }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { background: linear-gradient(145deg,#2f70f2,#1d4ed8); box-shadow: 0 10px 24px rgba(37,99,235,.22); }
.button-primary:hover { box-shadow: 0 14px 30px rgba(37,99,235,.3); }
.button-secondary { border-color: #d9e3f0; }
.button-secondary:hover { border-color: #a9c4f6; background: #f8fbff; }
.button-light { border-color: rgba(255,255,255,.18); color: #dbeafe; background: rgba(255,255,255,.08); }
.button-light:hover { border-color: rgba(255,255,255,.3); color: #fff; background: rgba(255,255,255,.13); }
.button-small { min-height: 38px; padding: 8px 12px; font-size: 12px; }
.button-danger { border-color: #fecaca; }
.text-link, .row-action { font-size: 12px; }
.text-link { display: inline-flex; align-items: center; min-height: 32px; }
.icon-link { width: 38px; height: 38px; border-radius: 11px; font-size: 23px; }
.badge { min-height: 25px; padding: 5px 9px; font-size: 10px; letter-spacing: .035em; }
.back-row { margin: 4px 0 18px; }
.back-row a { min-height: 38px; display: inline-flex; align-items: center; font-size: 13px; }
.back-row a:hover { transform: translateX(-2px); }
.page-toolbar { margin-bottom: 18px; }
.toolbar-actions { flex-wrap: wrap; gap: 9px; }
.list-toolbar { min-height: 58px; align-items: center; }
.search-form { width: min(590px,58%); }
.search-form label { position: relative; }
.search-form label > svg { position: absolute; top: 50%; left: 14px; width: 17px; height: 17px; fill: none; stroke: #8090a7; stroke-width: 1.9; transform: translateY(-50%); pointer-events: none; }
.search-form input { height: 46px; padding: 0 15px 0 42px; border-color: #d9e3f0; border-radius: 12px; font-size: 14px; }
.search-form input:focus { border-color: #7eabf8; box-shadow: 0 0 0 4px rgba(37,99,235,.11); }
.search-form button { min-height: 46px; padding: 0 17px; border-color: #d9e3f0; border-radius: 11px; font-size: 12px; }
.list-context { min-height: 64px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.list-context > div:first-child h2 { margin: 4px 0 0; font-size: 20px; }
.filter-tabs { padding: 5px; border-color: #dae4f1; border-radius: 12px; box-shadow: 0 3px 14px rgba(7,18,37,.025); }
.filter-tabs a { min-height: 34px; padding: 8px 13px; display: inline-flex; align-items: center; border-radius: 8px; font-size: 11px; }
.filter-tabs a:hover, .filter-tabs a.active { color: #1d4ed8; background: #edf4ff; }
.filter-tabs, .settings-nav { overscroll-behavior-inline: contain; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar, .settings-nav::-webkit-scrollbar { display: none; }
.filter-tabs a, .settings-nav a { scroll-snap-align: start; }
.pipeline-grid, .table-wrap, .line-items, .paper-table { scrollbar-color: #c4d2e5 transparent; scrollbar-width: thin; }
.pipeline-grid::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .line-items::-webkit-scrollbar, .paper-table::-webkit-scrollbar { width: 6px; height: 6px; }
.pipeline-grid::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb, .line-items::-webkit-scrollbar-thumb, .paper-table::-webkit-scrollbar-thumb { border-radius: 99px; background: #c4d2e5; }
.list-insights { display: flex; align-items: stretch; gap: 9px; }
.list-insights > span { min-width: 135px; padding: 10px 14px; border: 1px solid #e1e9f4; border-radius: 12px; display: flex; flex-direction: column; background: rgba(255,255,255,.72); }
.list-insights small { color: var(--muted); font-size: 10px; }
.list-insights strong { margin-top: 2px; font-size: 15px; font-variant-numeric: tabular-nums; }
.list-insights .has-attention { border-color: #fed7aa; background: #fffaf3; }
.list-insights .has-attention strong { color: #c2410c; }
.table-panel { border-radius: 18px; }
th { padding: 12px 20px; color: #6f8098; background: #f9fbfe; font-size: 10px; letter-spacing: .09em; }
td { padding: 17px 20px; color: #34455e; font-size: 13px; }
tbody tr { transition: background .16s; }
tbody tr:hover td { background: #f8fbff; }
td > small, td > span + small, .table-main + small { margin-top: 4px; font-size: 11px; }
.table-main { font-size: 13px; }
.amount { font-variant-numeric: tabular-nums; }
.identity strong { font-size: 13px; }
.identity small { font-size: 11px; }
.actions-cell { width: 100px; }
.row-action-arrow { display: inline-flex; align-items: center; gap: 6px; }
.row-action-arrow span { transition: transform .18s var(--ease); }
.row-action-arrow:hover span { transform: translateX(3px); }
.table-empty { padding: 58px 24px !important; }
.table-empty strong { font-size: 15px; }
.table-empty span { margin: 5px auto 14px; max-width: 48ch; font-size: 13px; }

/* Forms and feedback */
.form-page { max-width: 1180px; }
.narrow-form { max-width: 900px; }
.form-card { margin-bottom: 20px; padding-bottom: 26px; }
.form-grid { padding: 4px 24px; gap: 20px 22px; }
.field { gap: 8px; }
.field > span:first-child { color: #34455e; font-size: 12px; font-weight: 750; }
.field em { font-size: 11px; }
.field input, .field select, .status-form select { min-height: 46px; height: 46px; padding: 0 13px; }
.field textarea { min-height: 96px; padding: 12px 13px; }
.field input, .field textarea, .field select, .status-form select { border-color: #d6e1ef; border-radius: 11px; font-size: 14px; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: #b8c9dc; }
.field input:focus, .field textarea:focus, .field select:focus, .status-form select:focus { border-color: #78a6f5; box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.field small { color: #64748b; font-size: 11px; line-height: 1.45; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: #ef4444; background: #fffafa; box-shadow: 0 0 0 3px rgba(239,68,68,.08); }
.field .field-error { color: #b91c1c; font-size: 11px; font-weight: 650; }
.form-actions { min-height: 56px; gap: 10px; }
.save-state { margin-right: auto; display: inline-flex; align-items: center; gap: 7px; color: #708198; font-size: 11px; }
.save-state::before { width: 7px; height: 7px; border-radius: 50%; content: ''; background: #10b981; box-shadow: 0 0 0 4px #ecfdf5; }
.save-state.is-dirty { color: #a16207; }
.save-state.is-dirty::before { background: #f59e0b; box-shadow: 0 0 0 4px #fffbeb; }
.danger-zone { padding: 21px 22px; border-radius: 15px; }
.danger-zone strong { font-size: 13px; }
.danger-zone p { font-size: 12px; }
.sticky-actions { bottom: 16px; padding: 13px 15px; border-color: #d8e3f0; border-radius: 14px; }
.button.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.button.is-loading::after { position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.38); border-top-color: currentColor; border-radius: 50%; content: ''; color: #fff; animation: pilot-spin .65s linear infinite; }
.button-secondary.is-loading::after, .button-danger.is-loading::after { border-color: rgba(37,99,235,.18); border-top-color: var(--primary); }
@keyframes pilot-spin { to { transform: rotate(360deg); } }

.flash-stack { z-index: 1000; top: 18px; right: 20px; width: min(420px,calc(100vw - 28px)); }
.flash { min-height: 52px; padding: 13px 13px 13px 16px; border-radius: 13px; font-size: 13px; box-shadow: 0 22px 60px rgba(7,18,37,.18); transition: opacity .18s, transform .18s; }
.flash.is-leaving { opacity: 0; transform: translateY(-8px) scale(.98); }
.flash > button:not(.flash-action) { min-width: 34px; min-height: 34px; border-radius: 8px; }
.flash-action { min-height: 34px; padding: 0 9px; border: 0; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 800; }

/* Search and confirmation dialogs */
.command-dialog, .confirm-dialog { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: start center; padding: min(13vh,120px) 18px 24px; opacity: 0; transition: opacity .18s ease; }
.command-dialog[hidden], .confirm-dialog[hidden] { display: none; }
.command-dialog.is-open, .confirm-dialog.is-open { opacity: 1; }
.dialog-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(3,10,24,.67); backdrop-filter: blur(8px); cursor: default; }
.command-card, .confirm-card { position: relative; width: min(680px,100%); border: 1px solid rgba(255,255,255,.54); border-radius: 20px; background: #fff; box-shadow: 0 32px 100px rgba(2,8,23,.34); opacity: 0; transform: translateY(-14px) scale(.985); transition: opacity .22s var(--ease), transform .22s var(--ease); }
.is-open > .command-card, .is-open > .confirm-card { opacity: 1; transform: none; }
.command-card > header { padding: 22px 22px 17px; display: flex; align-items: center; gap: 13px; }
.command-card > header > span { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.command-card > header svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.command-card > header div { margin-right: auto; }
.command-card h2, .confirm-card h2 { margin: 4px 0 0; font-size: 19px; }
.command-card .icon-button { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.command-card .icon-button:hover { color: var(--ink); background: #f1f5f9; }
.command-form { position: relative; margin: 0 22px; }
.command-form > svg { position: absolute; top: 50%; left: 16px; width: 19px; height: 19px; fill: none; stroke: #64748b; stroke-width: 1.8; transform: translateY(-50%); }
.command-form input { width: 100%; height: 58px; padding: 0 130px 0 48px; border: 1px solid #cfdded; border-radius: 14px; outline: none; font-size: 16px; }
.command-form input:focus { border-color: #73a2f3; box-shadow: 0 0 0 4px rgba(37,99,235,.11); }
.command-form button { position: absolute; top: 8px; right: 8px; min-height: 42px; padding: 0 15px; border: 0; border-radius: 10px; color: #fff; background: var(--primary); font-size: 12px; font-weight: 750; }
.command-shortcuts { padding: 18px 22px 22px; display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.command-shortcuts > span { grid-column: 1/-1; color: #64748b; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.command-shortcuts a { min-height: 48px; padding: 0 12px; border: 1px solid #e4ebf4; border-radius: 11px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; }
.command-shortcuts a:hover { border-color: #bcd2f9; color: var(--primary); background: #f7faff; }
.command-shortcuts svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.command-card > footer { padding: 12px 22px; border-top: 1px solid #e9eff6; display: flex; justify-content: space-between; color: #64748b; background: #fafcff; font-size: 10px; }
.confirm-dialog { place-items: center; padding-top: 24px; }
.confirm-card { width: min(470px,100%); padding: 27px; display: grid; grid-template-columns: 48px 1fr; gap: 17px; }
.confirm-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #b91c1c; background: #fef2f2; font-size: 22px; font-weight: 900; }
.confirm-card p:not(.eyebrow) { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.confirm-actions { grid-column: 1/-1; margin-top: 8px; display: flex; justify-content: flex-end; gap: 9px; }

/* Controlled page motion */
.js [data-reveal] { opacity: 0; transform: translateY(10px); transition: opacity .32s var(--ease), transform .32s var(--ease); transition-delay: calc(var(--reveal-index,0) * 35ms); }
.page-ready [data-reveal] { opacity: 1; transform: none; }

/* Dashboard */
.dashboard-welcome { position: relative; min-height: 190px; margin-bottom: 18px; padding: 32px 34px; border: 1px solid rgba(96,165,250,.15); border-radius: 22px; display: flex; align-items: center; justify-content: space-between; gap: 28px; overflow: hidden; color: #fff; background: radial-gradient(circle at 83% 0%,rgba(37,99,235,.52),transparent 33%),linear-gradient(120deg,#071225,#0c1d38 58%,#0b2b55); box-shadow: 0 24px 60px rgba(7,18,37,.18); }
.dashboard-welcome > div { position: relative; z-index: 2; }
.dashboard-welcome h2 { max-width: 660px; margin: 14px 0 7px; font-size: clamp(24px,3vw,37px); line-height: 1.16; letter-spacing: -.04em; }
.dashboard-welcome p { margin: 0; color: #afc4df; font-size: 14px; }
.welcome-pill { width: fit-content; padding: 6px 10px; border: 1px solid rgba(147,197,253,.18); border-radius: 99px; display: flex; align-items: center; gap: 7px; color: #bfdbfe; background: rgba(37,99,235,.12); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.welcome-pill svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.welcome-actions { flex: 0 0 auto; display: flex; gap: 9px; }
.button-glow { box-shadow: 0 0 0 1px rgba(147,197,253,.13),0 12px 35px rgba(37,99,235,.38); }
.welcome-grid { position: absolute; inset: 0; opacity: .14; background-image: linear-gradient(rgba(96,165,250,.25) 1px,transparent 1px),linear-gradient(90deg,rgba(96,165,250,.25) 1px,transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(90deg,transparent 35%,#000); }
.welcome-glow { position: absolute; right: 8%; bottom: -150px; width: 350px; height: 350px; border-radius: 50%; background: #2563eb; filter: blur(100px); opacity: .22; }
.dashboard-metrics { grid-template-columns: 1.35fr repeat(4,1fr); gap: 14px; }
.dashboard-metrics .metric-card { min-height: 148px; padding: 21px; justify-content: flex-start; }
.dashboard-metrics .metric-card:hover { border-color: #bfd3f2; transform: translateY(-2px); box-shadow: 0 16px 36px rgba(37,99,235,.09); }
.metric-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-heading > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-heading > i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; }
.metric-heading svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.75; }
.metric-heading .metric-icon-warning { color: #b45309; background: #fffbeb; }
.metric-heading .metric-icon-danger { color: #dc2626; background: #fef2f2; }
.metric-heading .metric-icon-success { color: #047857; background: #ecfdf5; }
.dashboard-metrics .metric-card strong { margin: 17px 0 4px; font-size: clamp(21px,2vw,28px); font-variant-numeric: tabular-nums; }
.dashboard-metrics .metric-card small { color: #64748b; font-size: 11px; }
.dashboard-metrics .metric-featured { background: linear-gradient(145deg,#1756d8,#2563eb 58%,#0ea5e9 145%); }
.dashboard-metrics .metric-featured .metric-heading > span, .dashboard-metrics .metric-featured small { color: #dbeafe; }
.dashboard-metrics .metric-featured .metric-heading > i { color: #fff; background: rgba(255,255,255,.12); }
.dashboard-metrics .metric-featured strong { margin-top: 15px; }
.metric-link { position: absolute; bottom: 16px; left: 21px; display: flex; align-items: center; gap: 6px; color: #dbeafe; font-size: 10px; font-weight: 750; }
.metric-link svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .18s; }
.metric-card:hover .metric-link svg { transform: translateX(3px); }
.dashboard-main-grid { grid-template-columns: minmax(0,1.7fr) minmax(330px,.72fr); }
.chart-panel { min-height: 366px; }
.chart-header { align-items: center; }
.chart-total { min-width: 165px; display: grid; text-align: right; }
.chart-total small { color: var(--muted); font-size: 10px; }
.chart-total strong { margin: 2px 0; font-size: 19px; font-variant-numeric: tabular-nums; }
.chart-total a { color: var(--primary); font-size: 10px; font-weight: 750; }
.chart { height: 255px; padding: 28px 26px 24px; gap: 11px; }
.chart-column { border-radius: 8px; }
.chart-column::before { position: absolute; inset: 0 0 25px; border-bottom: 1px solid #edf2f7; content: ''; pointer-events: none; }
.chart-column i { position: relative; z-index: 1; width: min(29px,66%); border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg,#60a5fa,#2563eb); opacity: .82; transform-origin: bottom; transition: transform .5s var(--ease),opacity .18s; }
.js .chart-column i { transform: scaleY(0); }
.page-ready .chart-column i { transform: scaleY(1); }
.chart-column small { z-index: 1; color: #64748b; font-size: 10px; }
.chart-value { bottom: calc(100% + 7px); padding: 5px 7px; border-radius: 7px; font-size: 10px; }
.chart-column:hover .chart-value, .chart-column:focus .chart-value { opacity: 1; transform: none; }
.chart-column:focus { outline: 2px solid rgba(37,99,235,.35); outline-offset: 3px; }
.action-panel { overflow: hidden; }
.dashboard-reminders { padding: 0 22px 8px; }
.dashboard-reminders .reminder-item { min-height: 60px; }
.dashboard-reminders .reminder-item strong { font-size: 12px; }
.dashboard-reminders .reminder-item small { font-size: 10px; }
.dashboard-reminders .reminder-item > svg, .project-row > svg { width: 15px; height: 15px; fill: none; stroke: #94a3b8; stroke-width: 1.8; }
.panel-footer-link { min-height: 48px; padding: 0 22px; border-top: 1px solid #edf2f7; display: flex; align-items: center; justify-content: space-between; color: var(--primary); font-size: 11px; font-weight: 750; }
.panel-footer-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.empty-check { width: 40px; height: 40px; margin-bottom: 9px; border-radius: 12px; display: grid; place-items: center; color: #059669; background: #ecfdf5; }
.empty-check svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.lower-grid { grid-template-columns: minmax(0,1.18fr) minmax(360px,.82fr); }
.project-list { padding: 0 22px 14px; }
.project-row { min-height: 62px; grid-template-columns: 40px minmax(0,1fr) auto 16px; }
.project-row strong { font-size: 12px; }
.project-row small { margin-top: 3px; font-size: 10px; }
.project-icon { width: 38px; height: 38px; border-radius: 11px; font-size: 12px; }

/* Search page */
.search-hero { padding: 30px; display: grid; grid-template-columns: minmax(280px,.85fr) minmax(420px,1.15fr); align-items: center; gap: 34px; }
.search-hero h2 { margin: 6px 0; font-size: 24px; }
.search-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.global-search-form { position: relative; }
.global-search-form > svg { position: absolute; top: 50%; left: 16px; width: 19px; height: 19px; fill: none; stroke: #64748b; stroke-width: 1.8; transform: translateY(-50%); }
.global-search-form input { width: 100%; height: 58px; padding: 0 132px 0 48px; border: 1px solid #cfdded; border-radius: 14px; outline: 0; font-size: 15px; }
.global-search-form input:focus { border-color: #73a2f3; box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.global-search-form .button { position: absolute; top: 7px; right: 7px; }
.results-summary { margin: 24px 0 14px; display: flex; gap: 7px; font-size: 13px; }
.results-summary span { color: var(--muted); }
.search-results-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.search-result-group { overflow: hidden; }
.search-result-group > header { padding: 20px 22px; border-bottom: 1px solid #e8eef6; display: flex; align-items: center; gap: 12px; }
.search-result-group > header > span { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.search-result-group > header svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.search-result-group h2 { margin: 0; font-size: 16px; }
.search-result-group header small { color: var(--muted); font-size: 10px; }
.search-result-list a { min-height: 67px; padding: 11px 20px; border-bottom: 1px solid #edf2f7; display: grid; grid-template-columns: minmax(0,1fr) auto 17px; align-items: center; gap: 14px; }
.search-result-list a:last-child { border-bottom: 0; }
.search-result-list a:hover { background: #f8fbff; }
.search-result-list a > span:first-child { min-width: 0; display: flex; flex-direction: column; }
.search-result-list strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.search-result-list small { color: var(--muted); font-size: 11px; }
.search-result-list > a > svg { width: 16px; height: 16px; fill: none; stroke: #94a3b8; stroke-width: 1.8; }
.search-result-aside { display: flex; align-items: center; gap: 8px; }
.search-result-aside b { font-size: 12px; font-variant-numeric: tabular-nums; }
.search-result-aside i { font-style: normal; }
.search-start-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.search-start-card { min-height: 88px; padding: 17px; display: grid; grid-template-columns: 42px minmax(0,1fr) 18px; align-items: center; gap: 13px; }
.search-start-card:hover { border-color: #bfd3f2; transform: translateY(-2px); }
.search-start-card > span { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.search-start-card svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.search-start-card div { display: flex; flex-direction: column; }
.search-start-card strong { font-size: 13px; }
.search-start-card small { color: var(--muted); font-size: 10px; }
.search-start-card > svg { color: #94a3b8; }
.inline-message { margin: 18px 0; padding: 14px 16px; border-radius: 12px; font-size: 13px; }
.inline-message-warning { border: 1px solid #fed7aa; color: #9a3412; background: #fff7ed; }
.search-empty { margin-top: 18px; }
.search-empty > span svg, .empty-state > span svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* Pipeline */
.pipeline-context { align-items: center; }
.pipeline-grid { gap: 14px; }
.pipeline-title { height: 54px; padding: 0 7px; font-size: 12px; }
.pipeline-title > span > span { display: flex; flex-direction: column; }
.pipeline-title small { margin-top: 1px; color: #64748b; font-size: 10px; font-weight: 650; }
.pipeline-title b { width: 28px; height: 28px; border-radius: 9px; font-size: 10px; }
.pipeline-cards { min-height: 460px; padding: 10px; border-color: #e0e8f2; border-radius: 15px; background: #eef3f9; }
.prospect-card { position: relative; margin-bottom: 10px; padding: 16px; border-color: #e9eff6; border-radius: 13px; box-shadow: 0 4px 14px rgba(7,18,37,.045); }
.prospect-card:hover { border-color: #a9c5f7; box-shadow: 0 12px 28px rgba(37,99,235,.1); }
.prospect-card strong { font-size: 13px; }
.prospect-card small { font-size: 10px; }
.prospect-card p { min-height: 48px; font-size: 11px; line-height: 1.5; }
.prospect-card footer { padding-top: 11px; font-size: 10px; }
.prospect-open { margin-top: 12px; display: flex; align-items: center; justify-content: flex-end; gap: 5px; color: var(--primary); font-size: 10px; font-weight: 750; opacity: 0; transition: opacity .18s; }
.prospect-card:hover .prospect-open, .prospect-card:focus .prospect-open { opacity: 1; }
.prospect-open svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.pipeline-empty { min-height: 120px; display: grid; place-items: center; align-content: center; gap: 8px; }
.pipeline-empty span { width: 34px; height: 4px; border-radius: 99px; background: #dce5f0; }
.pipeline-empty p { margin: 0; font-size: 10px; }

/* Project workspace */
.project-hero { min-height: 132px; margin-bottom: 16px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.project-hero-main { min-width: 0; display: flex; align-items: center; gap: 17px; }
.project-symbol { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#2563eb,#0ea5e9); box-shadow: 0 12px 30px rgba(37,99,235,.22); font-size: 22px; font-weight: 850; }
.project-meta-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.project-hero h2 { overflow: hidden; margin: 8px 0 2px; font-size: 25px; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.project-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.project-progress { margin-bottom: 16px; padding: 21px 23px 23px; }
.project-progress > header { margin-bottom: 19px; display: flex; align-items: flex-end; justify-content: space-between; }
.project-progress h2 { margin: 4px 0 0; font-size: 17px; }
.project-progress > header > strong { color: var(--primary); font-size: 12px; }
.project-progress ol, .document-lifecycle ol { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6,1fr); list-style: none; }
.project-progress li, .document-lifecycle li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; color: #91a0b4; text-align: center; }
.project-progress li::after, .document-lifecycle li::after { position: absolute; z-index: 0; top: 15px; left: 50%; width: 100%; height: 2px; content: ''; background: #e3eaf3; }
.project-progress li:last-child::after, .document-lifecycle li:last-child::after { display: none; }
.project-progress li > span, .document-lifecycle li > span { position: relative; z-index: 1; width: 31px; height: 31px; border: 2px solid #dce5f0; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 10px; font-weight: 800; }
.project-progress li small, .document-lifecycle li small { font-size: 10px; font-weight: 700; }
.project-progress li.is-complete::after, .document-lifecycle li.is-complete::after { background: #93c5fd; }
.project-progress li.is-complete > span, .document-lifecycle li.is-complete > span { border-color: #93c5fd; color: #2563eb; background: #eff6ff; }
.project-progress li.is-current > span, .document-lifecycle li.is-current > span { border-color: #2563eb; color: #fff; background: #2563eb; box-shadow: 0 0 0 5px #eff6ff; }
.project-progress li.is-current small, .document-lifecycle li.is-current small { color: #1d4ed8; }
.project-progress svg, .document-lifecycle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.project-metrics { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; }
.project-metric { min-height: 118px; padding: 19px; border: 1px solid #e3eaf4; border-radius: 16px; display: flex; flex-direction: column; justify-content: center; background: #fff; box-shadow: 0 5px 20px rgba(7,18,37,.035); }
.project-metric > span { color: var(--muted); font-size: 11px; }
.project-metric strong { margin: 7px 0 2px; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.project-metric small { color: #8a98ac; font-size: 10px; }
.project-metric-success { border-color: #ccefe0; background: linear-gradient(145deg,#fff,#f1fdf8); }
.project-metric-success strong { color: #047857; }
.project-workspace { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(310px,.75fr); align-items: start; gap: 18px; }
.project-primary, .project-aside { display: flex; flex-direction: column; gap: 18px; }
.project-documents { padding: 0 22px 14px; }
.project-documents > a { min-height: 67px; padding: 10px 2px; border-bottom: 1px solid #edf2f7; display: grid; grid-template-columns: 42px minmax(0,1fr) auto auto 16px; align-items: center; gap: 13px; }
.project-documents > a:last-child { border-bottom: 0; }
.project-documents > a:hover strong { color: var(--primary); }
.project-documents > a > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.project-documents strong { font-size: 12px; }
.project-documents small { color: var(--muted); font-size: 10px; }
.project-documents b { font-size: 12px; font-variant-numeric: tabular-nums; }
.project-documents i { font-style: normal; }
.project-documents > a > svg { width: 15px; height: 15px; fill: none; stroke: #94a3b8; stroke-width: 1.8; }
.document-kind { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #1d4ed8; background: #eff6ff; font-size: 9px; font-weight: 850; }
.document-kind-invoice { color: #047857; background: #ecfdf5; }
.project-empty { min-height: 150px; }
.project-notes-content { min-height: 120px; padding: 0 24px 24px; color: #40516a; font-size: 13px; line-height: 1.75; }
.project-reminders { padding: 0 20px 14px; }
.project-reminders a { min-height: 58px; border-bottom: 1px solid #edf2f7; display: grid; grid-template-columns: 9px minmax(0,1fr) 15px; align-items: center; gap: 12px; }
.project-reminders a:last-child { border-bottom: 0; }
.project-reminders span { display: flex; flex-direction: column; }
.project-reminders strong { font-size: 12px; }
.project-reminders small { color: var(--muted); font-size: 10px; }
.project-reminders svg { width: 15px; height: 15px; fill: none; stroke: #94a3b8; stroke-width: 1.8; }
.project-details dl { margin: 0; padding: 0 22px 18px; }
.project-details dl > div { padding: 11px 0; border-bottom: 1px solid #edf2f7; display: flex; justify-content: space-between; gap: 15px; }
.project-details dl > div:last-child { border-bottom: 0; }
.project-details dt { color: var(--muted); font-size: 11px; }
.project-details dd { margin: 0; font-size: 12px; font-weight: 700; text-align: right; }
.project-details a { color: var(--primary); }

/* Document studio and detail */
.document-studio-intro { min-height: 112px; margin-bottom: 18px; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.document-studio-intro > div, .document-detail-identity { min-width: 0; display: flex; align-items: center; gap: 15px; }
.studio-icon { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #2563eb; background: linear-gradient(145deg,#eff6ff,#dbeafe); box-shadow: inset 0 0 0 1px #dbeafe; }
.studio-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.document-studio-intro h2 { margin: 5px 0 2px; font-size: 20px; }
.document-studio-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.document-studio-intro ol { margin: 0; padding: 0; display: flex; gap: 9px; list-style: none; }
.document-studio-intro li { min-height: 38px; padding: 0 12px 0 7px; border: 1px solid #e1e9f3; border-radius: 99px; display: flex; align-items: center; gap: 7px; color: #64748b; font-size: 10px; font-weight: 700; }
.document-studio-intro li span { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: #edf2f7; font-size: 9px; }
.document-studio-intro li.is-current { border-color: #bfdbfe; color: #1d4ed8; background: #f7faff; }
.document-studio-intro li.is-current span { color: #fff; background: #2563eb; }
.document-form-grid { grid-template-columns: minmax(0,1fr) 330px; gap: 20px; }
.document-section { padding-bottom: 28px; }
.section-heading-number { display: flex; align-items: flex-start; gap: 13px; }
.section-heading-number > span { width: 34px; height: 34px; border: 1px solid #dbeafe; border-radius: 10px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; font-size: 10px; font-weight: 850; }
.section-heading-number h2 { margin-top: 4px; }
.number-chip { min-height: 32px; padding: 7px 11px; font-size: 11px; }
.status-field { max-width: calc(50% - 11px); }
.line-items { padding: 0 24px 8px; }
.line-head, .line-item { grid-template-columns: minmax(250px,1fr) 92px 142px 112px 78px; gap: 11px; }
.line-head { padding: 0 0 10px; font-size: 9px; }
.line-item { padding: 13px 0; transition: opacity .18s, transform .2s var(--ease); }
.line-item.is-entering { opacity: 0; transform: translateY(8px); }
.line-item.is-removing { opacity: 0; transform: translateX(8px); }
.line-field { min-width: 0; display: block; }
.line-field.has-error input,
.line-field.has-error textarea,
.line-field.has-error select { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.line-field.has-error .field-error { color: #b91c1c; font-size: 10px; font-weight: 700; }
.line-item textarea, .line-item input { border-color: #d6e1ef; border-radius: 10px; font-size: 13px; }
.line-item textarea { min-height: 60px; padding: 10px 11px; }
.line-item input { height: 44px !important; padding: 0 10px !important; }
.line-item textarea:focus, .line-item input:focus { border-color: #78a6f5; box-shadow: 0 0 0 4px rgba(37,99,235,.09); }
.line-total { display: flex; align-items: center; justify-content: flex-end; }
.line-total strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.line-actions { display: flex; justify-content: flex-end; gap: 5px; }
.line-actions button { width: 36px; height: 36px; border: 1px solid #e0e8f2; border-radius: 9px; display: grid; place-items: center; color: #64748b; background: #f8fafc; }
.line-actions button:hover { border-color: #bfd3f2; color: #2563eb; background: #eff6ff; }
.line-actions button:last-child:hover { border-color: #fecaca; color: #dc2626; background: #fef2f2; }
.line-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.line-mobile-label { display: none; }
.document-summary { top: 112px; padding: 0; overflow: hidden; }
.document-summary > header { padding: 23px 22px 18px; border-bottom: 1px solid #e9eff6; background: linear-gradient(145deg,#fff,#f8fbff); }
.document-summary > header h2 { margin: 5px 0 10px; font-size: 18px; }
.document-summary .save-state { font-size: 10px; }
.summary-context { padding: 16px 22px; border-bottom: 1px solid #e9eff6; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.summary-context > div { min-width: 0; display: flex; flex-direction: column; }
.summary-context small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.summary-context strong { overflow: hidden; margin-top: 2px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.summary-discount { padding: 17px 22px 0; display: grid; grid-template-columns: 1.3fr .7fr; gap: 10px; }
.document-summary .field { margin: 0; }
.document-summary .field > span:first-child { font-size: 10px; }
.document-summary .field input, .document-summary .field select { height: 42px; min-height: 42px; font-size: 12px; }
.document-summary .summary-lines { margin: 17px 22px; }
.summary-lines > div { padding: 9px 0; font-size: 12px; }
.summary-lines .summary-total { padding-top: 17px; font-size: 15px; }
.summary-lines .summary-total dd { font-size: 22px; font-variant-numeric: tabular-nums; }
.document-summary .summary-note { margin: 0 22px 18px; padding: 11px; border-radius: 10px; display: flex; align-items: flex-start; gap: 8px; color: #52647c; background: #f1f5f9; font-size: 10px; }
.summary-note svg { flex: 0 0 auto; width: 15px; height: 15px; fill: none; stroke: #2563eb; stroke-width: 1.8; }
.document-summary > .button { width: calc(100% - 44px); margin-right: 22px; margin-left: 22px; }
.document-summary > .button:last-child { margin-bottom: 18px; }
.button-submit-document { justify-content: space-between; }
.document-detail-hero { min-height: 112px; margin-bottom: 15px; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.document-detail-identity > div > div { display: flex; align-items: center; gap: 9px; }
.document-detail-identity h2 { margin: 7px 0 1px; font-size: 23px; }
.document-detail-identity p { margin: 0; color: var(--muted); font-size: 13px; }
.lock-label { min-height: 25px; display: inline-flex; align-items: center; gap: 5px; font-size: 10px; }
.lock-label svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.document-lifecycle { margin-bottom: 15px; padding: 20px 24px 22px; display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 24px; }
.document-lifecycle h2 { margin: 4px 0 0; font-size: 16px; }
.document-lifecycle ol { grid-template-columns: repeat(5,1fr); }
.document-paper { border-color: #dbe4ee; box-shadow: 0 18px 55px rgba(7,18,37,.075); }
.status-panel { padding: 22px 24px; }
.status-panel p { font-size: 12px; }

/* Existing feature polish */
.profile-header { min-height: 132px; padding: 24px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 18px; }
.profile-identity h2 { font-size: 24px; }
.detail-list dt { font-size: 10px; }
.detail-list dd { font-size: 13px; }
.compact-list strong { font-size: 12px; }
.compact-list small { font-size: 10px; }
.reminder-board { gap: 15px; }
.reminder-card { border-radius: 16px; }
.reminder-check button { width: 44px; height: 44px; }
.reminder-check button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.reminder-body h2 { font-size: 14px; }
.reminder-body p { font-size: 12px; }
.reminder-body footer { font-size: 10px; }
.reminder-actions button { min-height: 34px; font-size: 10px; }
.empty-state > span { display: grid; place-items: center; }
.settings-nav a { min-height: 40px; padding: 10px 12px; font-size: 12px; }
.template-card > small, .export-grid span { font-size: 10px; }
.toggle-field strong { font-size: 13px; }
.toggle-field small { font-size: 11px; }
.provider-status { font-size: 10px; }
.onboarding-card { border-radius: 22px; box-shadow: 0 32px 100px rgba(2,8,23,.28); }

/* Responsive refinements */
@media (max-width: 1320px) {
    .dashboard-metrics { grid-template-columns: repeat(3,1fr); }
    .dashboard-metrics .metric-featured { grid-column: span 1; }
    .project-metrics { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 1100px) {
    :root { --sidebar: 238px; }
    .command-trigger { min-width: 48px; width: 48px; padding: 0; justify-content: center; }
    .command-trigger span, .command-trigger kbd { display: none; }
    .dashboard-main-grid, .lower-grid { grid-template-columns: 1fr; }
    .project-workspace { grid-template-columns: 1fr; }
    .project-aside { display: grid; grid-template-columns: repeat(2,1fr); }
    .search-hero { grid-template-columns: 1fr; gap: 20px; }
    .document-studio-intro ol { display: none; }
    .document-form-grid { grid-template-columns: 1fr; }
    .document-summary { position: static; }
    .document-summary > .button { max-width: 360px; margin-right: auto; margin-left: auto; }
    .document-summary > .button:last-child { margin-bottom: 22px; }
    .summary-context, .summary-discount { max-width: 650px; }
}

@media (max-width: 760px), (max-height: 480px) and (max-width: 960px) {
    body { font-size: 16px; }
    .sidebar { width: min(300px,88vw); }
    .main-area { margin-left: 0; }
    .topbar { height: 80px; padding: 0 15px; }
    .topbar-heading { max-width: calc(100vw - 156px); }
    .topbar h1 { font-size: 20px; }
    .topbar .eyebrow { font-size: 9px; }
    .menu-button { width: 44px; height: 44px; flex: 0 0 auto; }
    .topbar-tools { gap: 6px; }
    .command-trigger { width: 44px; min-width: 44px; min-height: 44px; }
    .quick-add { min-width: 44px; width: 44px; padding: 0; justify-content: center; }
    .quick-create-menu { top: 69px; }
    .page-content { padding: 8px 14px 38px; }
    .page-toolbar { align-items: stretch; flex-direction: column-reverse; }
    .list-toolbar > .button { width: 100%; }
    .toolbar-actions { width: 100%; }
    .toolbar-actions .button { flex: 1; }
    .search-form { width: 100%; }
    .search-form input, .field input, .field textarea, .field select, .status-form select { font-size: 16px; }
    .list-context { align-items: stretch; flex-direction: column; }
    .filter-tabs { width: 100%; overflow-x: auto; scroll-padding-inline: 5px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
    .list-insights { display: grid; grid-template-columns: repeat(2,1fr); }
    .list-insights > span { min-width: 0; }
    .panel-header { padding: 20px 18px; }
    .panel-header h2 { font-size: 17px; }
    .form-grid { padding-right: 18px; padding-left: 18px; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .form-actions .save-state { align-self: center; margin: 4px 0; }
    .form-actions .button { width: 100%; }

    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .data-table tbody { padding: 8px; }
    .data-table tr { margin-bottom: 9px; padding: 10px 14px; border: 1px solid #e1e9f3; border-radius: 13px; background: #fff; }
    .data-table tr:last-child { margin-bottom: 0; }
    .data-table td { min-height: 39px; padding: 9px 0; border-bottom: 1px solid #edf2f7; display: grid; grid-template-columns: minmax(105px,.42fr) minmax(0,1fr); align-items: center; gap: 13px; text-align: right; }
    .data-table td::before { content: attr(data-label); color: #64748b; font-size: 10px; font-weight: 750; text-align: left; text-transform: uppercase; letter-spacing: .05em; }
    .data-table td:first-child { min-height: 54px; }
    .data-table td:last-child { border-bottom: 0; }
    .data-table td[colspan] { display: block; }
    .data-table td[colspan]::before, .actions-cell::before { display: none; }
    .data-table .identity, .data-table td > span, .data-table td > div { justify-self: end; }
    .data-table .identity { text-align: left; }
    .data-table .actions-cell { min-height: 42px; display: flex; justify-content: flex-end; }
    .document-table td:nth-child(6) { display: grid; }
    .mobile-document-status { display: none; }

    .dashboard-welcome { min-height: 245px; padding: 25px 22px; align-items: flex-start; flex-direction: column; justify-content: center; }
    .dashboard-welcome h2 { font-size: 28px; }
    .welcome-actions { width: 100%; }
    .welcome-actions .button { flex: 1; }
    .dashboard-metrics { grid-template-columns: repeat(2,1fr); }
    .dashboard-metrics .metric-featured { grid-column: span 2; }
    .dashboard-metrics .metric-card { min-height: 138px; }
    .chart-header { align-items: flex-start; flex-direction: column; }
    .chart-total { text-align: left; }
    .chart { height: 230px; padding-right: 14px; padding-left: 14px; gap: 5px; }
    .chart-column i { width: min(19px,72%); }
    .chart-column small { font-size: 9px; }
    .lower-grid { grid-template-columns: 1fr; }

    .command-dialog { padding: 9vh 10px 18px; }
    .command-card { border-radius: 17px; }
    .command-card > header { padding: 18px 17px 14px; }
    .command-form { margin: 0 17px; }
    .command-form input { padding-right: 48px; font-size: 16px; }
    .command-form button { width: 38px; padding: 0; overflow: hidden; color: transparent; }
    .command-form button::after { color: #fff; content: '→'; font-size: 17px; }
    .command-shortcuts { padding: 15px 17px 18px; grid-template-columns: repeat(2,1fr); }
    .confirm-card { padding: 22px; }

    .search-results-grid, .search-start-grid { grid-template-columns: 1fr; }
    .search-hero { padding: 23px 19px; }
    .global-search-form input { padding-right: 48px; font-size: 16px; }
    .global-search-form .button { width: 40px; padding: 0; overflow: hidden; color: transparent; }
    .global-search-form .button::after { color: #fff; content: '→'; font-size: 17px; }

    .pipeline-grid { grid-template-columns: 1fr; overflow: visible; }
    .pipeline-column { min-width: 0; }
    .pipeline-cards { min-height: 110px; }
    .prospect-open { opacity: 1; }

    .project-hero { align-items: stretch; flex-direction: column; }
    .project-hero-actions { width: 100%; }
    .project-hero-actions .button { flex: 1 1 150px; }
    .project-progress ol { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px 8px; }
    .project-progress li:nth-child(3)::after,
    .project-progress li:last-child::after { display: none; }
    .project-aside { display: flex; }
    .project-documents > a { grid-template-columns: 42px minmax(0,1fr) 15px; }
    .project-documents > a > b, .project-documents > a > i { display: none; }

    .document-studio-intro { align-items: flex-start; }
    .document-studio-intro p { font-size: 11px; }
    .status-field { max-width: none; }
    .line-items { padding-right: 16px; padding-left: 16px; overflow: visible; }
    .line-head { display: none; }
    .line-item { min-width: 0; margin-bottom: 12px; padding: 15px; border: 1px solid #dfe8f3; border-radius: 14px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; background: #fbfdff; }
    .line-description { grid-column: 1/-1; }
    .line-total { min-height: 46px; align-items: flex-start; justify-content: center; flex-direction: column; }
    .line-actions { align-items: flex-end; }
    .line-mobile-label { margin-bottom: 6px; display: block; color: #64748b; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
    .line-total .line-mobile-label { margin: 0; }
    .summary-context, .summary-discount { max-width: none; }
    .document-detail-hero { align-items: stretch; flex-direction: column; }
    .document-detail-hero .toolbar-actions { justify-content: flex-start; }
    .document-lifecycle { grid-template-columns: 1fr; overflow: hidden; }
    .document-lifecycle ol { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px 8px; padding: 8px 4px; }
    .document-lifecycle li:nth-child(3)::after,
    .document-lifecycle li:last-child::after { display: none; }
    .document-paper { padding: 34px 22px; }
}

@media (max-width: 520px) {
    .dashboard-welcome h2 { font-size: 25px; }
    .welcome-actions { align-items: stretch; flex-direction: column; }
    .dashboard-metrics { grid-template-columns: 1fr; }
    .dashboard-metrics .metric-featured { grid-column: auto; }
    .dashboard-metrics .metric-card { min-height: 126px; }
    .metric-link { display: none; }
    .list-insights { grid-template-columns: 1fr; }
    .toolbar-actions { align-items: stretch; flex-direction: column; }
    .project-metrics { grid-template-columns: 1fr; }
    .project-hero-main { align-items: flex-start; }
    .project-symbol { width: 52px; height: 52px; }
    .project-hero h2 { font-size: 21px; white-space: normal; }
    .project-hero-actions { flex-direction: column; }
    .project-hero-actions .button { flex: none; width: 100%; }
    .document-studio-intro { padding: 19px; }
    .document-studio-intro .studio-icon { display: none; }
    .summary-context, .summary-discount { grid-template-columns: 1fr; }
    .line-item { grid-template-columns: 1fr; }
    .line-description { grid-column: auto; }
    .line-actions { justify-content: flex-end; }
    .document-detail-identity { align-items: flex-start; }
    .document-detail-hero .toolbar-actions { flex-direction: column; }
    .document-detail-hero .button, .document-detail-hero form { width: 100%; }
    .document-detail-hero form .button { width: 100%; }
    .confirm-card { grid-template-columns: 1fr; }
    .confirm-actions { grid-column: auto; align-items: stretch; flex-direction: column-reverse; }
    .confirm-actions .button { width: 100%; }
    .command-card > footer { display: none; }
    .search-result-list a { grid-template-columns: minmax(0,1fr) 16px; }
    .search-result-aside { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    [data-reveal], .chart-column i { opacity: 1; transform: none; }
}

/* ========================================================================== 
   TheoNum Pilot 1.4.2 — completeness and accessibility pass
   ========================================================================== */

/* Authentication gateway */
.guest-shell { min-height: 100dvh; color: #eaf2ff; background: #050b18; }
.guest-main { min-height: calc(100dvh - 54px); padding: clamp(28px,4vw,64px) clamp(20px,5vw,76px); display: block; }
.guest-background { background: radial-gradient(circle at 14% 12%,rgba(37,99,235,.2),transparent 32%),radial-gradient(circle at 88% 84%,rgba(14,165,233,.15),transparent 34%),#050b18; }
.guest-background::before { background-image: linear-gradient(rgba(96,165,250,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(96,165,250,.035) 1px,transparent 1px); background-size: 64px 64px; mask-image: linear-gradient(to bottom,#000,transparent 92%); }
.guest-background::after { position: absolute; inset: 0; content: ''; background: linear-gradient(120deg,transparent 38%,rgba(37,99,235,.055) 49%,transparent 61%); }
.guest-background span { filter: blur(8px); opacity: .8; }
.guest-background span:nth-child(1) { width: 540px; height: 540px; top: -320px; left: 10%; background: radial-gradient(circle,rgba(37,99,235,.36),transparent 70%); }
.guest-background span:nth-child(2) { width: 700px; height: 700px; right: -390px; bottom: -430px; background: radial-gradient(circle,rgba(14,165,233,.23),transparent 70%); }
.guest-background span:nth-child(3) { width: 300px; height: 300px; left: 48%; bottom: -190px; background: radial-gradient(circle,rgba(59,130,246,.16),transparent 70%); }
.guest-background > i { position: absolute; top: 10%; bottom: 9%; left: 48.5%; width: 1px; background: linear-gradient(transparent,rgba(148,163,184,.13),transparent); }
.guest-footer { position: relative; z-index: 2; min-height: 54px; padding: 0 clamp(22px,5vw,76px); display: flex; align-items: center; justify-content: space-between; gap: 18px; color: #8492a8; font-size: 11px; }
.guest-footer span { display: inline-flex; align-items: center; gap: 7px; }
.guest-footer svg { width: 15px; height: 15px; fill: none; stroke: #60a5fa; stroke-width: 1.8; }
.guest-skip-link { color: #fff; }
.auth-layout { width: min(1370px,100%); min-height: min(810px,calc(100dvh - 182px)); margin: 0 auto; display: grid; grid-template-columns: minmax(390px,475px) minmax(480px,1fr); align-items: center; gap: clamp(60px,8vw,130px); }
.auth-card { position: relative; width: 100%; padding: 38px 40px 34px; border: 1px solid rgba(226,232,240,.86); border-radius: 28px; color: var(--ink); background: rgba(255,255,255,.975); box-shadow: 0 38px 100px rgba(0,0,0,.38),0 1px 0 rgba(255,255,255,.7) inset; overflow: hidden; }
.auth-card::before { position: absolute; top: 0; right: 0; left: 0; height: 4px; content: ''; background: linear-gradient(90deg,#2563eb,#60a5fa 62%,#06b6d4); }
.auth-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.login-brand { min-width: 0; display: inline-flex; align-items: center; gap: 13px; }
.login-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.login-brand strong { color: #081326; font-size: 17px; }
.login-brand small { margin-top: 5px; color: #2563eb; font-size: 9px; }
.auth-logo-wrap { position: relative; flex: 0 0 auto; display: block; }
.auth-logo-wrap > i { position: absolute; inset: -6px; z-index: -1; border: 1px solid rgba(37,99,235,.18); border-radius: 19px; box-shadow: 0 10px 28px rgba(37,99,235,.18); }
.auth-security { min-height: 32px; padding: 0 11px; border: 1px solid #dbe7f5; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; color: #475569; background: #f8fafc; font-size: 10px; font-weight: 750; white-space: nowrap; }
.auth-security svg { width: 14px; height: 14px; fill: none; stroke: #2563eb; stroke-width: 1.8; }
.auth-card .login-heading { margin: 42px 0 27px; }
.auth-card .login-kicker { font-size: 10px; letter-spacing: .14em; }
.auth-card .login-heading h1 { max-width: 390px; margin: 8px 0 10px; font-size: clamp(29px,3vw,37px); line-height: 1.08; letter-spacing: -.05em; }
.auth-card .login-heading p { max-width: 410px; color: #5c6c84; font-size: 13px; line-height: 1.65; }
.auth-card .login-heading p strong { color: #25344c; }
.auth-form { gap: 17px; }
.auth-field > span:first-child { margin-bottom: 7px; font-size: 12px; }
.auth-field input { min-height: 52px; border-color: #d9e3ef; border-radius: 13px; background: #fcfdff; font-size: 14px; }
.auth-field input:hover { border-color: #bccce0; }
.auth-field input:focus { border-color: #60a5fa; background: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.09),0 8px 25px rgba(37,99,235,.06); }
.auth-field .password-wrap button { min-width: 62px; min-height: 40px; right: 6px; border-radius: 9px; font-size: 10px; }
.auth-submit { min-height: 52px; margin-top: 2px; padding: 0 19px; border-radius: 13px; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 13px 28px rgba(37,99,235,.24); }
.auth-submit svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s var(--ease); }
.auth-submit:hover svg { transform: translateX(3px); }
.auth-separator { margin: 25px 0 20px; display: flex; align-items: center; gap: 12px; color: #64748b; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.auth-separator::before, .auth-separator::after { height: 1px; flex: 1; content: ''; background: #e2e8f0; }
.auth-demo-button { min-height: 49px; gap: 9px; border-radius: 13px; }
.auth-demo-button svg { width: 17px; height: 17px; fill: none; stroke: #2563eb; stroke-width: 1.8; }
.demo-entry-card { margin-top: 14px; padding: 16px; border-color: #dbe7f8; border-radius: 14px; background: linear-gradient(145deg,#f8fbff,#eef4ff); }
.demo-entry-head { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 11px; }
.demo-entry-head > span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #2563eb; background: #fff; box-shadow: 0 5px 14px rgba(37,99,235,.09); }
.demo-entry-head svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.demo-entry-card strong { color: #1e3a8a; font-size: 11px; }
.demo-entry-card p { margin: 4px 0 0; color: #5c6c84; font-size: 10px; line-height: 1.5; }
.demo-entry-card ul { margin-top: 12px; gap: 7px; }
.demo-entry-card li { padding-left: 0; display: flex; align-items: flex-start; gap: 7px; color: #475569; font-size: 10px; line-height: 1.45; }
.demo-entry-card li::before { display: none; }
.demo-entry-card li svg { width: 13px; height: 13px; flex: 0 0 auto; fill: none; stroke: #047857; stroke-width: 2.2; }
.auth-card-footer { margin-top: 22px; padding-top: 17px; border-top: 1px solid #e8eef5; display: flex; align-items: center; justify-content: center; gap: 6px; color: #64748b; font-size: 10px; }
.auth-card-footer a { color: #1d4ed8; font-weight: 750; }
.auth-card-footer svg { width: 14px; height: 14px; fill: none; stroke: #2563eb; stroke-width: 1.8; }
.auth-showcase { min-width: 0; color: #fff; }
.showcase-copy { max-width: 710px; }
.showcase-copy .story-label { display: inline-flex; align-items: center; gap: 8px; color: #93c5fd; font-size: 10px; }
.showcase-copy .story-label svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.showcase-copy h2 { margin: 16px 0 18px; font-size: clamp(40px,5.2vw,68px); line-height: 1.01; letter-spacing: -.065em; }
.showcase-copy h2 em { color: #60a5fa; font-style: normal; }
.showcase-copy > p { max-width: 620px; margin: 0; color: #9fb0c8; font-size: 14px; line-height: 1.7; }
.pilot-preview { position: relative; max-width: 730px; margin-top: 38px; border: 1px solid rgba(148,163,184,.17); border-radius: 24px; background: rgba(9,19,38,.86); box-shadow: 0 36px 90px rgba(0,0,0,.36),0 0 0 1px rgba(255,255,255,.025) inset; overflow: hidden; transform: perspective(1200px) rotateY(-3deg) rotateX(1deg); transform-origin: center right; }
.pilot-preview > header { height: 55px; padding: 0 18px; border-bottom: 1px solid rgba(148,163,184,.12); display: flex; align-items: center; gap: 13px; background: rgba(255,255,255,.025); }
.preview-brand { display: flex; align-items: center; gap: 7px; }
.preview-brand img { border-radius: 8px; }
.preview-brand i { width: 62px; height: 7px; border-radius: 99px; background: #273850; }
.preview-search { width: 120px; height: 27px; margin-left: auto; border: 1px solid #26354c; border-radius: 8px; }
.preview-avatar { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #2563eb; font-size: 9px; font-weight: 800; }
.pilot-preview-body { padding: 22px; }
.preview-welcome { display: flex; flex-direction: column; }
.preview-welcome > span { color: #60a5fa; font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; }
.preview-welcome strong { margin-top: 6px; font-size: 20px; }
.preview-welcome small { margin-top: 3px; color: #8291a8; font-size: 8px; }
.preview-metrics { margin-top: 18px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; }
.preview-metrics article { position: relative; min-height: 105px; padding: 17px; border: 1px solid #23334b; border-radius: 14px; display: flex; flex-direction: column; background: linear-gradient(145deg,#111f36,#0c172a); overflow: hidden; }
.preview-metrics article:first-child { background: linear-gradient(145deg,#1d4ed8,#2563eb 64%,#0ea5e9); }
.preview-metrics article > span { position: absolute; top: 13px; right: 13px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #93c5fd; background: rgba(255,255,255,.08); }
.preview-metrics article > span svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.preview-metrics small { color: #a8b5c8; font-size: 7px; }
.preview-metrics strong { margin-top: 15px; font-size: 24px; font-variant-numeric: tabular-nums; }
.preview-metrics i { margin-top: auto; color: #93c5fd; font-size: 7px; font-style: normal; }
.preview-metrics article:first-child small, .preview-metrics article:first-child i { color: #dbeafe; }
.preview-activity { margin-top: 12px; padding: 15px 17px; border: 1px solid #213047; border-radius: 14px; background: #0b1628; }
.preview-activity > header { margin-bottom: 5px; display: flex; justify-content: space-between; }
.preview-activity > header strong { font-size: 9px; }
.preview-activity > header small { color: #718198; font-size: 7px; }
.preview-activity > div { min-height: 44px; border-bottom: 1px solid #192940; display: grid; grid-template-columns: 7px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.preview-activity > div:last-child { border: 0; }
.preview-activity > div > span { width: 7px; height: 7px; border-radius: 50%; background: #60a5fa; box-shadow: 0 0 0 4px rgba(96,165,250,.1); }
.preview-activity p { margin: 0; display: flex; flex-direction: column; }
.preview-activity p strong { font-size: 8px; }
.preview-activity p small { color: #718198; font-size: 7px; }
.preview-activity div > i { color: #93c5fd; font-size: 7px; font-style: normal; }
.showcase-trust { max-width: 730px; margin-top: 20px; display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.showcase-trust > span { min-height: 62px; padding: 12px 14px; border: 1px solid rgba(148,163,184,.12); border-radius: 13px; display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; column-gap: 10px; background: rgba(255,255,255,.025); }
.showcase-trust svg { width: 18px; height: 18px; grid-row: span 2; fill: none; stroke: #60a5fa; stroke-width: 1.7; }
.showcase-trust strong { font-size: 10px; }
.showcase-trust small { color: #8291a8; font-size: 8px; }

/* Activation and public states */
.activation-progress { margin: -2px 0 24px; display: grid; grid-template-columns: auto 1fr auto; align-items: start; }
.activation-progress > span { width: 92px; display: flex; align-items: center; flex-direction: column; gap: 7px; color: #64748b; text-align: center; }
.activation-progress i { width: 29px; height: 29px; border: 2px solid #dbe5f1; border-radius: 50%; display: grid; place-items: center; color: #64748b; background: #fff; font-size: 10px; font-style: normal; font-weight: 800; }
.activation-progress svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.activation-progress .is-complete i { border-color: #93c5fd; color: #2563eb; background: #eff6ff; }
.activation-progress .is-current i { border-color: #2563eb; color: #fff; background: #2563eb; box-shadow: 0 0 0 5px #eff6ff; }
.activation-progress small { font-size: 10px; font-weight: 700; }
.activation-progress b { height: 2px; margin-top: 14px; background: linear-gradient(90deg,#93c5fd,#dbe5f1); }
.password-strength { margin-top: -7px; display: grid; grid-template-columns: 104px minmax(0,1fr); align-items: center; gap: 10px; }
.password-strength > span { height: 5px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.password-strength > span i { width: 0; height: 100%; display: block; border-radius: inherit; background: #dc2626; transition: width .22s var(--ease),background .22s; }
.password-strength small { color: #64748b; font-size: 10px; }
.password-strength[data-level="1"] > span i { width: 25%; }
.password-strength[data-level="2"] > span i { width: 50%; background: #b45309; }
.password-strength[data-level="3"] > span i { width: 75%; background: #2563eb; }
.password-strength[data-level="4"] > span i { width: 100%; background: #047857; }
.security-visual { position: relative; min-height: 330px; margin-top: 34px; display: grid; place-items: center; }
.security-orbit { position: absolute; border: 1px solid rgba(96,165,250,.18); border-radius: 50%; }
.orbit-one { width: 230px; height: 230px; }
.orbit-two { width: 320px; height: 320px; border-style: dashed; }
.security-core { position: relative; z-index: 2; width: 112px; height: 112px; border: 1px solid rgba(147,197,253,.32); border-radius: 34px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#1d4ed8,#2563eb,#0ea5e9); box-shadow: 0 25px 65px rgba(37,99,235,.35); transform: rotate(7deg); }
.security-core > svg { width: 50px; height: 50px; fill: none; stroke: currentColor; stroke-width: 1.3; transform: rotate(-7deg); }
.security-core > i { position: absolute; right: -8px; bottom: -8px; width: 36px; height: 36px; border: 5px solid #071225; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #059669; transform: rotate(-7deg); }
.security-core > i svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.security-visual article { position: absolute; width: 205px; min-height: 64px; padding: 12px 14px; border: 1px solid rgba(148,163,184,.14); border-radius: 14px; display: flex; align-items: center; gap: 11px; background: rgba(14,25,45,.9); box-shadow: 0 18px 42px rgba(0,0,0,.2); }
.security-visual article:nth-of-type(1) { top: 24px; left: 5%; }
.security-visual article:nth-of-type(2) { right: 3%; bottom: 25px; }
.security-visual article > svg { width: 21px; height: 21px; fill: none; stroke: #60a5fa; stroke-width: 1.6; }
.security-visual article span { display: flex; flex-direction: column; }
.security-visual article strong { font-size: 10px; }
.security-visual article small { color: #8291a8; font-size: 8px; }
.auth-state-layout { grid-template-columns: minmax(390px,475px) minmax(400px,620px); }
.auth-state-card { padding-bottom: 38px; }
.auth-state-icon { width: 66px; height: 66px; margin-top: 50px; border-radius: 19px; display: grid; place-items: center; color: #b45309; background: #fffbeb; box-shadow: 0 0 0 8px rgba(255,251,235,.7); }
.auth-state-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.auth-state-card .login-heading { margin-top: 26px; }
.auth-recovery { margin-top: 20px; padding: 15px 16px; border: 1px solid #e3eaf3; border-radius: 13px; background: #f8fafc; }
.auth-recovery strong { font-size: 11px; }
.auth-recovery p { margin: 4px 0 0; color: #64748b; font-size: 10px; }
.auth-recovery a { color: #1d4ed8; font-weight: 700; }
.compact-showcase { align-self: center; }
.state-page { position: relative; width: min(760px,100%); min-height: 560px; margin: clamp(20px,5vh,70px) auto; padding: 70px clamp(24px,7vw,80px); border-radius: 28px; display: flex; align-items: center; flex-direction: column; justify-content: center; text-align: center; overflow: hidden; }
.state-page::before { position: absolute; inset: 0; content: ''; background: radial-gradient(circle at 50% 0,rgba(37,99,235,.1),transparent 42%); pointer-events: none; }
.state-code { position: absolute; top: 28px; right: 36px; color: #dbe7f5; font-size: 56px; font-weight: 900; letter-spacing: -.06em; }
.state-icon { position: relative; width: 76px; height: 76px; margin-bottom: 25px; border-radius: 23px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 10px rgba(239,246,255,.7); }
.state-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.state-icon-warning { color: #b45309; background: #fffbeb; box-shadow: 0 0 0 10px rgba(255,251,235,.72); }
.state-icon-danger { color: #b91c1c; background: #fef2f2; box-shadow: 0 0 0 10px rgba(254,242,242,.72); }
.state-page h1, .state-page h2 { position: relative; max-width: 580px; margin: 9px 0 11px; font-size: clamp(27px,4vw,38px); letter-spacing: -.045em; }
.state-page p { position: relative; max-width: 580px; margin: 0; color: #5c6c84; font-size: 14px; line-height: 1.7; }
.state-actions { position: relative; margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.guest-shell .state-page { color: var(--ink); background: rgba(255,255,255,.975); box-shadow: 0 35px 100px rgba(0,0,0,.35); }

/* Client 360° view */
.client-hero { position: relative; margin-bottom: 14px; padding: 26px 28px; overflow: hidden; }
.client-hero::after { position: absolute; right: -70px; bottom: -120px; width: 250px; height: 250px; border: 42px solid rgba(37,99,235,.045); border-radius: 50%; content: ''; pointer-events: none; }
.client-hero-meta { display: flex; align-items: center; gap: 11px; }
.client-health { display: inline-flex; align-items: center; gap: 6px; color: #047857; font-size: 10px; font-weight: 750; }
.client-health i { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px #ecfdf5; }
.client-hero-actions { position: relative; z-index: 1; }
.button-icon-label svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.client-metrics { margin-bottom: 14px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.client-metrics article { min-height: 114px; padding: 17px; border: 1px solid #e0e8f2; border-radius: 16px; display: grid; grid-template-columns: 39px minmax(0,1fr); align-items: center; gap: 12px; background: #fff; box-shadow: 0 5px 20px rgba(7,18,37,.035); }
.client-metrics article > span { width: 39px; height: 39px; border-radius: 11px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; }
.client-metrics article > span svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.client-metrics article > div { min-width: 0; display: flex; flex-direction: column; }
.client-metrics small { color: #64748b; font-size: 10px; }
.client-metrics strong { margin: 4px 0 1px; overflow: hidden; font-size: 19px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.client-metrics i { color: #64748b; font-size: 10px; font-style: normal; }
.client-metrics .client-metric-success > span { color: #047857; background: #ecfdf5; }
.client-workspace { display: grid; grid-template-columns: minmax(260px,320px) minmax(0,1fr); align-items: start; gap: 14px; }
.client-sidebar, .client-activity-stack { display: grid; gap: 14px; }
.client-contact-card .panel-header, .client-activity-section .panel-header { padding-bottom: 17px; }
.client-contact-actions { padding: 0 18px 15px; display: grid; gap: 8px; }
.client-contact-actions > a { min-height: 62px; padding: 10px 11px; border: 1px solid #e3eaf3; border-radius: 12px; display: grid; grid-template-columns: 34px minmax(0,1fr) 14px; align-items: center; gap: 10px; transition: border-color .2s,background .2s,transform .2s; }
.client-contact-actions > a:hover { border-color: #bfdbfe; background: #f8fbff; transform: translateY(-1px); }
.client-contact-actions > a > svg { width: 34px; height: 34px; padding: 8px; border-radius: 9px; color: #2563eb; background: #eff6ff; fill: none; stroke: currentColor; stroke-width: 1.8; }
.client-contact-actions a > span { min-width: 0; display: flex; flex-direction: column; }
.client-contact-actions strong { font-size: 11px; }
.client-contact-actions small { overflow: hidden; color: #64748b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.client-contact-actions a > i svg { width: 14px; height: 14px; fill: none; stroke: #94a3b8; stroke-width: 1.8; }
.client-detail-list { padding: 0 20px 18px; }
.client-detail-list > div { padding: 13px 0; }
.client-note-card { padding: 18px; display: grid; grid-template-columns: 37px minmax(0,1fr); gap: 11px; color: #713f12; background: linear-gradient(145deg,#fffbeb,#fffdf6); }
.client-note-card > span { width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center; color: #b45309; background: #fff; }
.client-note-card svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.client-note-card strong { font-size: 11px; }
.client-note-card p { margin: 4px 0 0; color: #854d0e; font-size: 10px; line-height: 1.55; }
.client-record-list > a { min-height: 68px; padding: 11px 19px; border-top: 1px solid #edf2f7; display: grid; grid-template-columns: 39px minmax(0,1fr) auto 16px; align-items: center; gap: 12px; transition: background .18s; }
.client-record-list > a:hover { background: #f8fbff; }
.record-icon { width: 39px; height: 39px; border-radius: 11px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; }
.record-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.client-record-list > a > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.client-record-list strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.client-record-list small { color: #64748b; font-size: 10px; }
.client-record-list > a > svg { width: 14px; height: 14px; fill: none; stroke: #94a3b8; stroke-width: 1.8; }
.client-documents-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.client-record-list-compact > a { grid-template-columns: 37px minmax(0,1fr) auto auto; padding-right: 16px; }
.record-kind { width: 37px; height: 37px; border-radius: 10px; display: grid !important; place-items: center; color: #2563eb; background: #eff6ff; font-size: 9px; font-weight: 850; }
.record-kind-invoice { color: #7c3aed; background: #f5f3ff; }
.client-record-list b { font-size: 11px; font-variant-numeric: tabular-nums; }
.client-empty { margin: 0 18px 18px; }

/* Administration */
.admin-hero { position: relative; min-height: 190px; margin-bottom: 14px; padding: 28px 30px; display: grid; grid-template-columns: minmax(0,1fr) minmax(420px,.85fr); align-items: center; gap: 34px; overflow: hidden; }
.admin-hero::after { position: absolute; right: -90px; bottom: -170px; width: 360px; height: 360px; border: 55px solid rgba(37,99,235,.045); border-radius: 50%; content: ''; }
.admin-hero h2 { max-width: 600px; margin: 7px 0 8px; font-size: 27px; letter-spacing: -.04em; }
.admin-hero p { max-width: 620px; margin: 0; color: #5c6c84; font-size: 12px; }
.admin-hero-metrics { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.admin-hero-metrics > span { min-height: 90px; padding: 14px; border: 1px solid #e3eaf4; border-radius: 14px; display: flex; align-items: center; flex-direction: column; justify-content: center; background: #f8fbff; }
.admin-hero-metrics small { color: #64748b; font-size: 10px; }
.admin-hero-metrics strong { margin-top: 5px; font-size: 23px; }
.access-link-card { grid-template-columns: 48px minmax(260px,.75fr) minmax(340px,1fr); gap: 18px; }
.access-link-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #047857; background: #ecfdf5; }
.access-link-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.copy-field .button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.admin-invite-grid { grid-template-columns: minmax(0,1.5fr) minmax(280px,.7fr); }
.section-symbol { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; }
.section-symbol svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.invite-note { display: flex; align-items: flex-start; gap: 9px; }
.invite-note svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: #2563eb; stroke-width: 1.7; }
.admin-safety { padding: 24px; }
.admin-safety h2 { margin: 8px 0 18px; font-size: 20px; }
.admin-safety ul { margin: 0; padding: 0; display: grid; gap: 12px; list-style: none; }
.admin-safety li { min-height: 56px; padding: 10px; border: 1px solid #e5ecf4; border-radius: 11px; display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 9px; }
.admin-safety li > svg { width: 25px; height: 25px; padding: 5px; border-radius: 8px; color: #047857; background: #ecfdf5; fill: none; stroke: currentColor; stroke-width: 2; }
.admin-safety li span { display: flex; flex-direction: column; }
.admin-safety li strong { font-size: 10px; }
.admin-safety li small { color: #64748b; font-size: 10px; }
.count-chip { padding: 7px 10px; border-radius: 99px; color: #1d4ed8; background: #eff6ff; font-size: 10px; font-weight: 750; }
.account-identity { display: flex; align-items: center; gap: 10px; }
.account-identity > i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#2563eb,#0ea5e9); font-size: 11px; font-style: normal; font-weight: 800; }
.account-identity > span { display: flex; flex-direction: column; }

/* Settings */
.settings-hero { min-height: 188px; margin-bottom: 14px; padding: 28px 30px; display: grid; grid-template-columns: minmax(300px,.8fr) minmax(520px,1.2fr); align-items: center; gap: 38px; }
.settings-hero h2 { max-width: 560px; margin: 7px 0 8px; font-size: 27px; letter-spacing: -.04em; }
.settings-hero p { max-width: 580px; margin: 0; color: #5c6c84; font-size: 12px; }
.settings-readiness { display: grid; grid-template-columns: 118px repeat(2,minmax(0,1fr)); gap: 10px; }
.settings-readiness > span { min-height: 112px; padding: 14px; border: 1px solid #e3eaf3; border-radius: 15px; display: flex; align-items: flex-start; flex-direction: column; justify-content: center; background: #f8fbff; }
.settings-readiness > span > svg { width: 25px; height: 25px; margin-bottom: 9px; fill: none; stroke: #2563eb; stroke-width: 1.6; }
.settings-readiness strong { font-size: 11px; }
.settings-readiness small { margin-top: 3px; color: #64748b; font-size: 10px; line-height: 1.4; }
.settings-readiness .settings-readiness-score { align-items: center; text-align: center; }
.settings-readiness-score > i { --progress: 0%; position: relative; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#2563eb var(--progress),#dce7f3 0); font-style: normal; }
.settings-readiness-score > i::before { position: absolute; inset: 7px; border-radius: 50%; content: ''; background: #fff; }
.settings-readiness-score b { position: relative; z-index: 1; font-size: 13px; }
.settings-nav { top: 110px; padding: 9px; gap: 3px; }
.settings-nav > span { padding: 11px 12px 8px; color: #64748b; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.settings-nav a { min-height: 43px; padding: 0 11px; display: flex; align-items: center; gap: 9px; }
.settings-nav a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.settings-section { scroll-margin-top: 115px; }
.settings-section .panel-header { min-height: 94px; }
.settings-section .template-card { border-color: #e2e9f2; border-radius: 14px; background: #fbfdff; }
.export-grid > a { min-height: 82px; padding: 13px; display: grid; grid-template-columns: 39px minmax(0,1fr) 20px; align-items: center; gap: 11px; }
.export-grid > a > span { width: 39px; height: 39px; border-radius: 11px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; }
.export-grid > a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.export-grid > a > div { display: flex; flex-direction: column; }
.export-grid > a strong { font-size: 11px; }
.export-grid > a small { color: #64748b; font-size: 10px; }
.export-grid > a > i { color: #94a3b8; }

/* Reminders */
.reminders-hero { min-height: 178px; margin-bottom: 14px; padding: 26px 28px; display: grid; grid-template-columns: minmax(300px,1fr) minmax(300px,.6fr) auto; align-items: center; gap: 28px; }
.reminders-hero h2 { margin: 7px 0 7px; font-size: 25px; letter-spacing: -.04em; }
.reminders-hero p { margin: 0; color: #5c6c84; font-size: 12px; }
.reminders-hero-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.reminders-hero-stats span { min-height: 76px; padding: 10px; border: 1px solid #e3eaf3; border-radius: 13px; display: flex; align-items: center; flex-direction: column; justify-content: center; background: #f8fbff; }
.reminders-hero-stats small { color: #64748b; font-size: 10px; }
.reminders-hero-stats strong { margin-top: 4px; font-size: 20px; }
.reminders-hero-stats .is-danger { color: #b91c1c; background: #fff7f7; }
.reminders-hero .button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.reminder-toolbar { margin-bottom: 14px; align-items: center; }
.toolbar-hint { display: inline-flex; align-items: center; gap: 7px; color: #64748b; font-size: 10px; }
.toolbar-hint svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.reminder-card { border-color: #e2e9f3; }
.reminder-card footer time { display: inline-flex; align-items: center; gap: 6px; }
.reminder-card footer time svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }

/* Shared finishing touches */
.form-card { border-color: #e0e8f2; }
.form-page > .form-card, .settings-content > .form-card { box-shadow: 0 7px 28px rgba(7,18,37,.045); }
.filter-tabs a, .settings-nav a { min-height: 44px; }
.text-link, .row-action, .reminder-actions a, .reminder-actions button { min-height: 44px; display: inline-flex; align-items: center; }
.reminder-actions a, .reminder-actions button { padding-inline: 6px; }
.icon-link { width: 44px; height: 44px; }
.button:active, .row-action:active, .nav-link:active { transform: translateY(1px); }

@media (max-width: 1180px) {
    .auth-layout { grid-template-columns: minmax(360px,445px) minmax(400px,1fr); gap: 55px; }
    .showcase-copy h2 { font-size: 49px; }
    .admin-hero, .settings-hero { grid-template-columns: 1fr; gap: 22px; }
    .reminders-hero { grid-template-columns: 1fr auto; }
    .reminders-hero-stats { grid-row: 2; }
    .client-documents-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
    .guest-main { padding-top: 34px; padding-bottom: 34px; }
    .guest-background > i { display: none; }
    .auth-layout, .auth-state-layout { min-height: auto; grid-template-columns: minmax(0,480px); justify-content: center; }
    .auth-showcase { display: none; }
    .guest-footer { justify-content: center; }
    .guest-footer span:last-child { display: none; }
    .client-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .client-workspace { grid-template-columns: 1fr; }
    .client-sidebar { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .admin-invite-grid { grid-template-columns: 1fr; }
    .admin-safety ul { grid-template-columns: repeat(3,1fr); }
    .access-link-card { grid-template-columns: 48px minmax(0,1fr); }
    .access-link-card .copy-field { grid-column: 1/-1; }
    .settings-readiness { grid-template-columns: 110px repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px), (max-height: 480px) and (max-width: 960px) {
    .guest-main { min-height: calc(100dvh - 48px); padding: 22px 14px 28px; }
    .guest-footer { min-height: 48px; padding: 0 14px; font-size: 10px; }
    .auth-card { margin: 0; padding: 27px 22px 24px; border-radius: 23px; }
    .auth-brand-row { align-items: flex-start; }
    .auth-security { min-height: 32px; padding: 0 10px; font-size: 10px; }
    .auth-card .login-heading { margin: 34px 0 24px; }
    .auth-card .login-heading h1 { font-size: 29px; }
    .auth-card .login-heading p { font-size: 12px; }
    .auth-field input { min-height: 50px; font-size: 16px; }
    .auth-card-footer { align-items: flex-start; flex-direction: column; }
    .demo-entry-card { padding: 14px; }
    .activation-progress > span { width: 78px; }
    .state-page { min-height: 500px; margin: 0; padding: 58px 22px; border-radius: 23px; }
    .state-code { top: 22px; right: 25px; font-size: 44px; }
    .state-actions { width: 100%; align-items: stretch; flex-direction: column; }
    .state-actions .button { width: 100%; }

    .client-hero { align-items: stretch; flex-direction: column; }
    .client-hero-actions { width: 100%; }
    .client-hero-actions .button { flex: 1 1 130px; }
    .client-sidebar { grid-template-columns: 1fr; }
    .client-record-list-compact > a { grid-template-columns: 36px minmax(0,1fr) auto; }
    .client-record-list-compact > a .badge { display: none; }

    .admin-hero, .settings-hero, .reminders-hero { padding: 22px 19px; }
    .admin-hero h2, .settings-hero h2, .reminders-hero h2 { font-size: 23px; }
    .admin-hero-metrics { grid-template-columns: repeat(2,1fr); }
    .admin-safety ul { grid-template-columns: 1fr; }
    .access-link-card { padding: 20px; grid-template-columns: 40px minmax(0,1fr); }
    .access-link-icon { width: 40px; height: 40px; }
    .settings-readiness { grid-template-columns: 1fr; }
    .settings-readiness > span { min-height: 90px; }
    .settings-readiness .settings-readiness-score { min-height: 112px; }
    .settings-nav > span { display: none; }
    .settings-nav a { min-width: max-content; }
    .reminders-hero { grid-template-columns: 1fr; }
    .reminders-hero-stats { grid-row: auto; }
    .reminders-hero .button { width: 100%; }
    .reminder-toolbar { align-items: stretch; flex-direction: column; }
    .toolbar-hint { padding: 0 4px; }
}

@media (max-width: 520px) {
    .auth-security { width: 30px; padding: 0; justify-content: center; overflow: hidden; color: transparent; }
    .auth-security svg { flex: 0 0 auto; }
    .auth-separator span { max-width: 190px; text-align: center; }
    .client-hero-meta { align-items: flex-start; flex-direction: column; gap: 5px; }
    .client-hero-actions { flex-direction: column; }
    .client-hero-actions .button { width: 100%; flex: none; }
    .client-metrics { grid-template-columns: 1fr; }
    .client-metrics article { min-height: 96px; }
    .client-record-list > a { grid-template-columns: 37px minmax(0,1fr) auto; }
    .client-record-list > a > svg { display: none; }
    .client-record-list-compact > a b { display: none; }
    .admin-hero-metrics { grid-template-columns: repeat(2,1fr); }
    .access-link-card { grid-template-columns: 1fr; }
    .access-link-card .copy-field { grid-column: auto; }
    .reminders-hero-stats { grid-template-columns: repeat(3,1fr); gap: 5px; }
    .reminders-hero-stats span { min-height: 68px; padding: 7px 4px; }
}

/* TheoNum Pilot 1.4.3 — system status and release journal */
.app-footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px; }
.app-footer a { min-height: 44px; padding: 2px 10px; border: 1px solid #d9e3ef; border-radius: 99px; display: inline-flex; align-items: center; color: #718198; font-weight: 800; text-decoration: none; transition: color 180ms ease, border-color 180ms ease, background 180ms ease; }
.app-footer a:hover { border-color: #b9c9dc; color: var(--primary); background: #fff; }
.app-footer a:focus-visible { outline: 3px solid rgba(37,99,235,.22); outline-offset: 2px; }

@media (min-width: 761px) and (max-height: 800px) {
    .main-nav { gap: 3px; padding-bottom: 5px; }
    .nav-group-label { display: none; }
}

.system-hero, .changelog-hero { min-height: 178px; margin-bottom: 14px; padding: 28px 30px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 34px; overflow: hidden; }
.system-hero h2, .changelog-hero h2 { max-width: 680px; margin: 7px 0 8px; font-size: 27px; letter-spacing: -.04em; }
.system-hero p, .changelog-hero p { max-width: 680px; margin: 0; color: #5c6c84; font-size: 12px; }
.system-release-link { min-width: 210px; padding: 18px 20px; border: 1px solid #d9e5f3; border-radius: 16px; display: flex; align-items: flex-start; flex-direction: column; color: var(--ink); background: linear-gradient(145deg,#f8fbff,#eef6ff); text-decoration: none; transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.system-release-link:hover { border-color: #abc6ee; box-shadow: 0 14px 35px rgba(37,99,235,.12); transform: translateY(-1px); }
.system-release-link:focus-visible { outline: 3px solid rgba(37,99,235,.24); outline-offset: 3px; }
.system-release-link > span { color: #64748b; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.system-release-link strong { margin: 4px 0 5px; color: var(--primary); font-size: 28px; letter-spacing: -.04em; }
.system-release-link small { display: inline-flex; align-items: center; gap: 6px; color: #334155; font-size: 11px; font-weight: 700; }
.system-release-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.system-alert { margin-bottom: 14px; padding: 14px 17px; border: 1px solid #f3d49a; border-radius: 14px; display: flex; align-items: center; gap: 12px; color: #92400e; background: #fffbeb; }
.system-alert > svg { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.system-alert span { display: flex; flex-direction: column; }
.system-alert strong { font-size: 12px; }
.system-alert small { margin-top: 2px; color: #9a5b17; font-size: 11px; }
.system-alert code { padding: 1px 4px; border-radius: 4px; color: #78350f; background: rgba(255,255,255,.65); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.system-health-grid { margin-bottom: 14px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.system-health-card { min-height: 200px; padding: 18px; display: flex; flex-direction: column; border-top: 3px solid #cbd5e1; }
.system-health-card header { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.system-health-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #475569; background: #f1f5f9; }
.system-health-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.system-state { padding: 4px 7px; border-radius: 99px; color: #526176; background: #f1f5f9; font-size: 9px; font-weight: 800; white-space: nowrap; }
.system-health-card .section-kicker { margin: 0 0 4px; }
.system-health-card h2 { margin: 0; font-size: 17px; line-height: 1.25; letter-spacing: -.025em; }
.system-health-card > p:last-child { margin: auto 0 0; padding-top: 13px; color: #64748b; font-size: 11px; line-height: 1.45; }
.system-health-card.is-success { border-top-color: #10b981; }
.system-health-card.is-success .system-health-icon, .system-health-card.is-success .system-state { color: #047857; background: #ecfdf5; }
.system-health-card.is-warning { border-top-color: #f59e0b; }
.system-health-card.is-warning .system-health-icon, .system-health-card.is-warning .system-state { color: #a65b08; background: #fff7e6; }
.system-health-card.is-danger { border-top-color: #ef4444; }
.system-health-card.is-danger .system-health-icon, .system-health-card.is-danger .system-state { color: #b91c1c; background: #fef2f2; }
.system-health-card.is-info { border-top-color: var(--primary); }
.system-health-card.is-info .system-health-icon, .system-health-card.is-info .system-state { color: var(--primary); background: var(--primary-soft); }

.system-detail-grid { margin-bottom: 14px; display: grid; grid-template-columns: minmax(0,1.3fr) minmax(300px,.7fr); gap: 14px; }
.system-operations, .backup-card, .system-environment { padding: 24px; }
.system-signal-list { margin: 4px 0 0; }
.system-signal-list > div { padding: 15px 0; border-bottom: 1px solid #e8eef5; display: grid; grid-template-columns: minmax(150px,.45fr) minmax(0,1fr); gap: 24px; }
.system-signal-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.system-signal-list dt { color: #64748b; font-size: 11px; font-weight: 750; }
.system-signal-list dd { margin: 0; display: flex; flex-direction: column; }
.system-signal-list dd strong { font-size: 12px; overflow-wrap: anywhere; }
.system-signal-list dd small { margin-top: 3px; color: #64748b; font-size: 11px; overflow-wrap: anywhere; }
.backup-card { display: flex; align-items: flex-start; flex-direction: column; }
.backup-card h2 { margin: 8px 0 6px; font-size: 18px; letter-spacing: -.025em; }
.backup-card > p { margin: 0 0 18px; color: #64748b; font-size: 11px; }
.backup-form { width: 100%; margin-top: auto; display: grid; gap: 12px; }
.backup-form .button { width: 100%; }
.backup-form .button:disabled { cursor: not-allowed; }

.system-environment { margin-bottom: 14px; display: grid; grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr); align-items: center; gap: 30px; }
.system-environment h2 { margin: 6px 0 5px; font-size: 18px; }
.system-environment p { margin: 0; color: #64748b; font-size: 11px; }
.system-environment dl { margin: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.system-environment dl > div { min-height: 68px; padding: 12px; border: 1px solid #e3eaf3; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; background: #f8fbff; }
.system-environment dt { color: #64748b; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.system-environment dd { margin: 3px 0 0; font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }

.changelog-current { min-width: 168px; padding: 18px 20px; border: 1px solid #d7e5f5; border-radius: 16px; display: flex; align-items: flex-start; flex-direction: column; background: linear-gradient(145deg,#f8fbff,#eff6ff); }
.changelog-current small { color: #64748b; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.changelog-current strong { margin: 4px 0; color: var(--primary); font-size: 27px; }
.changelog-current i { color: #047857; font-size: 10px; font-style: normal; font-weight: 800; }
.release-timeline { max-width: 920px; margin: 0 auto; padding-left: 26px; position: relative; display: grid; gap: 12px; }
.release-timeline::before { content: ""; position: absolute; top: 18px; bottom: 18px; left: 7px; width: 2px; border-radius: 2px; background: #dbe6f2; }
.release-entry { padding: 24px 26px; position: relative; }
.release-marker { width: 14px; height: 14px; border: 3px solid var(--canvas); border-radius: 50%; position: absolute; top: 29px; left: -26px; z-index: 1; background: #94a3b8; box-shadow: 0 0 0 2px #dbe6f2; }
.release-entry.is-current { border-color: #bfd5f4; box-shadow: 0 15px 42px rgba(37,99,235,.09); }
.release-entry.is-current .release-marker { background: var(--primary); box-shadow: 0 0 0 2px #a9c7f3; }
.release-entry header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.release-entry header > div { display: flex; align-items: center; gap: 9px; }
.release-version { color: var(--primary); font-size: 12px; font-weight: 850; }
.release-entry time { color: #718198; font-size: 10px; }
.release-current-badge { padding: 4px 8px; border-radius: 99px; color: #047857; background: #ecfdf5; font-size: 9px; font-weight: 800; }
.release-entry h2 { margin: 11px 0 5px; font-size: 18px; letter-spacing: -.025em; }
.release-entry > p { margin: 0; color: #5c6c84; font-size: 12px; }
.release-entry ul { margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid #e8eef5; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; list-style: none; }
.release-entry li { display: flex; align-items: flex-start; gap: 8px; color: #334155; font-size: 11px; }
.release-entry li svg { width: 15px; height: 15px; margin-top: 1px; flex: 0 0 auto; fill: none; stroke: #059669; stroke-width: 2; }

@media (max-width: 1240px) {
    .system-health-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 980px) {
    .system-health-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .system-detail-grid, .system-environment { grid-template-columns: 1fr; }
    .system-environment dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .release-entry ul { grid-template-columns: 1fr; }
}

@media (max-width: 760px), (max-height: 480px) and (max-width: 960px) {
    .system-hero, .changelog-hero { padding: 22px 19px; grid-template-columns: 1fr; gap: 20px; }
    .system-hero h2, .changelog-hero h2 { font-size: 23px; }
    .system-release-link, .changelog-current { width: 100%; min-width: 0; }
    .system-health-grid { grid-template-columns: 1fr; }
    .system-health-card { min-height: 176px; }
    .system-operations, .backup-card, .system-environment { padding: 20px 18px; }
    .system-signal-list > div { grid-template-columns: 1fr; gap: 4px; }
    .system-environment dl { grid-template-columns: 1fr 1fr; }
    .release-timeline { padding-left: 19px; }
    .release-timeline::before { left: 5px; }
    .release-marker { left: -21px; }
    .release-entry { padding: 21px 19px; }
}

@media (max-width: 440px) {
    .system-environment dl { grid-template-columns: 1fr; }
    .release-entry header { align-items: flex-start; flex-direction: column; gap: 7px; }
}

/* TheoNum Pilot 1.4.4 — recherche, filtres et navigation rapide */
.breadcrumbs { min-height: 34px; margin: -5px 30px 3px; display: flex; align-items: center; gap: 7px; color: #8290a4; font-size: 10px; }
.breadcrumbs a { min-height: 32px; display: inline-flex; align-items: center; color: #64748b; font-weight: 700; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs [aria-current="page"] { max-width: 360px; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.advanced-filters { margin-bottom: 10px; padding: 0; overflow: visible; }
.advanced-filters > summary { min-height: 52px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; list-style: none; }
.advanced-filters > summary::-webkit-details-marker { display: none; }
.advanced-filters > summary > span { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; }
.advanced-filters > summary svg { width: 16px; height: 16px; fill: none; stroke: var(--primary); stroke-width: 1.8; }
.advanced-filters > summary small { color: #718198; font-size: 10px; }
.advanced-filters[open] > summary { border-bottom: 1px solid #e8eef5; }
.advanced-filters > form { padding: 16px 18px 18px; }
.filter-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 10px; }
.filter-fields label { display: flex; flex-direction: column; gap: 6px; color: #526176; font-size: 9px; font-weight: 800; }
.filter-fields input, .filter-fields select { width: 100%; min-height: 44px; padding: 0 11px; border: 1px solid #dbe5f2; border-radius: 10px; color: var(--ink); background: #fff; font: inherit; font-size: 11px; }
.filter-fields input:focus, .filter-fields select:focus { border-color: #93b4e8; outline: 3px solid rgba(37,99,235,.12); }
.filter-actions { margin-top: 13px; display: flex; align-items: center; justify-content: flex-end; gap: 13px; }
.filter-actions > a { min-height: 44px; display: inline-flex; align-items: center; color: #64748b; font-size: 10px; font-weight: 750; }

.saved-views { min-height: 44px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.saved-view-list { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.saved-view-list > span:first-child { margin-right: 2px; color: #64748b; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.saved-view-list > small { color: #94a3b8; font-size: 10px; }
.saved-view-chip { min-height: 44px; border: 1px solid #dbe5f2; border-radius: 99px; display: inline-flex; align-items: center; overflow: hidden; background: #fff; }
.saved-view-chip > a { min-height: 44px; padding: 0 4px 0 11px; display: inline-flex; align-items: center; color: #334155; font-size: 10px; font-weight: 750; }
.saved-view-chip form { display: inline-flex; }
.saved-view-chip button { width: 44px; height: 44px; border: 0; color: #94a3b8; background: transparent; cursor: pointer; }
.saved-view-chip button:hover { color: var(--red); background: #fef2f2; }
.save-view-menu { position: relative; flex: 0 0 auto; }
.save-view-menu > summary { min-height: 44px; padding: 0 12px; border: 1px solid #dbe5f2; border-radius: 10px; display: inline-flex; align-items: center; color: var(--primary); background: #fff; cursor: pointer; font-size: 10px; font-weight: 800; list-style: none; }
.save-view-menu > summary::-webkit-details-marker { display: none; }
.save-view-menu > form { width: min(330px,calc(100vw - 36px)); padding: 15px; border: 1px solid #dbe5f2; border-radius: 13px; position: absolute; z-index: 35; top: calc(100% + 7px); right: 0; background: #fff; box-shadow: 0 18px 45px rgba(7,18,37,.16); }
.save-view-menu label { display: block; margin-bottom: 7px; color: #526176; font-size: 9px; font-weight: 800; }
.save-view-menu form > div { display: flex; gap: 7px; }
.save-view-menu input { min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid #dbe5f2; border-radius: 9px; flex: 1; font-size: 11px; }

.sort-link { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; color: inherit; }
.sort-link span { color: #a5b1c1; font-size: 11px; }
th[aria-sort="ascending"] .sort-link, th[aria-sort="descending"] .sort-link { color: var(--primary); }
th[aria-sort="ascending"] .sort-link span, th[aria-sort="descending"] .sort-link span { color: var(--primary); }

.pagination { min-height: 56px; margin-top: 10px; padding: 8px 12px; border: 1px solid #e2eaf3; border-radius: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #64748b; background: #fff; font-size: 10px; }
.pagination > div { display: flex; align-items: center; gap: 4px; }
.pagination a { min-width: 44px; min-height: 44px; padding: 0 9px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #475569; font-weight: 750; }
.pagination a:hover { color: var(--primary); background: var(--primary-soft); }
.pagination a.active { color: #fff; background: var(--primary); }
.pagination i { padding: 0 3px; font-style: normal; }

.favorite-form { display: inline-flex; }
.favorite-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.favorite-button.is-favorite { border-color: #bcd2f9; color: var(--primary); background: var(--primary-soft); }
.detail-utility-row { margin: -3px 0 10px; display: flex; justify-content: flex-end; }

/* Form comfort — v1.4.5 */
.form-actions-rich { flex-wrap: wrap; }
.form-actions-rich .save-state { margin-right: auto; }
.duplicate-warning { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 16px; padding: 18px; border-color: #f5c76b; background: #fffaf0; }
.duplicate-warning-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #9a5b00; background: #ffecbf; }
.duplicate-warning-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.duplicate-warning strong { display: block; color: #6d4300; }
.duplicate-warning p { margin: 4px 0 8px; color: #765f3a; }
.duplicate-warning ul { margin: 0; padding-left: 18px; }
.duplicate-warning a { color: #4f46e5; font-weight: 700; }

.address-field { position: relative; }
.address-suggestions { position: absolute; z-index: 80; top: calc(100% - 2px); left: 0; right: 0; max-height: 245px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; border: 1px solid #d9e0ec; border-radius: 13px; background: #fff; box-shadow: 0 18px 40px rgba(15, 23, 42, .16); }
.address-suggestions[hidden] { display: none; }
.address-suggestions li { padding: 10px 12px; border-radius: 9px; color: #25334d; font-size: 13px; line-height: 1.35; cursor: pointer; }
.address-suggestions li:hover, .address-suggestions li.is-active { color: #312e81; background: #eef0ff; }

.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.data-table .actions-cell:has(.row-actions) { width: 185px; }
.inline-edit { position: relative; text-align: left; }
.inline-edit > summary { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border: 1px solid #dbe2ed; border-radius: 9px; color: #43516a; background: #fff; font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.inline-edit > summary::-webkit-details-marker { display: none; }
.inline-edit[open] > summary { color: #4338ca; border-color: #aeb4ff; background: #f4f4ff; }
.inline-edit form { position: absolute; z-index: 90; top: calc(100% + 7px); right: 0; display: grid; gap: 10px; width: 285px; padding: 14px; border: 1px solid #d9e0ec; border-radius: 14px; background: #fff; box-shadow: 0 18px 42px rgba(15, 23, 42, .17); }
.inline-edit form label { display: grid; gap: 5px; color: #59657a; font-size: 11px; font-weight: 750; }
.inline-edit form input, .inline-edit form select { width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid #d7deea; border-radius: 9px; color: #172036; background: #fff; font: inherit; }
.inline-edit form .button { justify-self: end; }

@media (min-width: 901px) {
    .table-panel .table-wrap { overflow: visible; }
}
@media (max-width: 900px) {
    .form-actions-rich .save-state { margin-right: 0; }
    .row-actions { width: 100%; justify-content: space-between; }
    .inline-edit form { position: fixed; z-index: 220; top: 50%; right: 16px; left: 16px; width: auto; max-width: 440px; margin: auto; transform: translateY(-50%); }
}

.command-card { max-height: min(760px,calc(100dvh - 40px)); overflow-y: auto; overscroll-behavior: contain; }
.command-history { padding: 15px 22px; border-top: 1px solid #e9eff6; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.command-history > span { grid-column: 1/-1; color: #64748b; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.command-history > a { min-height: 44px; padding: 7px 10px; border-radius: 10px; display: flex; align-items: center; gap: 9px; color: #334155; background: #f8fafc; }
.command-history > a:hover { color: var(--primary); background: var(--primary-soft); }
.command-history > a > span { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.command-history strong, .command-history > a > span { overflow: hidden; }
.command-history > a > span { font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.command-history small { margin-top: 2px; color: #8492a6; font-size: 8px; font-weight: 650; }
.command-history svg { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }

@media (max-width: 760px), (max-height: 480px) and (max-width: 960px) {
    .breadcrumbs { margin: -2px 17px 3px; overflow: hidden; }
    .breadcrumbs [aria-current="page"] { max-width: 165px; }
    .advanced-filters > summary { padding: 0 14px; }
    .advanced-filters > summary small { display: none; }
    .advanced-filters > form { padding: 14px; }
    .filter-fields { grid-template-columns: 1fr 1fr; }
    .saved-views { align-items: flex-start; flex-direction: column; }
    .save-view-menu, .save-view-menu > summary { width: 100%; }
    .save-view-menu > summary { justify-content: center; }
    .save-view-menu > form { right: auto; left: 0; }
    .pagination { align-items: flex-start; flex-direction: column; overflow: hidden; }
    .pagination > div { width: 100%; overflow-x: auto; }
    .pagination a { flex: 0 0 auto; }
    .command-history { padding-inline: 17px; grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
    .filter-fields { grid-template-columns: 1fr; }
    .filter-actions { align-items: stretch; flex-direction: column-reverse; }
    .filter-actions > a, .filter-actions .button { width: 100%; justify-content: center; }
}

/* TheoNum Pilot 1.4.6 — corbeille et archivage */
.archive-bar { min-height: 58px; margin-bottom: 8px; padding: 7px 9px; border: 1px solid #e0e8f2; border-radius: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; }
.archive-switch { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: 10px; background: #f1f5f9; }
.archive-switch a { min-height: 42px; padding: 0 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; color: #64748b; font-size: 10px; font-weight: 800; }
.archive-switch a.active { color: #1d4ed8; background: #fff; box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.archive-switch svg, .bulk-actions svg, .bulk-hint svg, .archive-view-label svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bulk-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: #7a8799; font-size: 10px; }
.bulk-actions.has-selection { color: #334155; }
.bulk-select-all { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 750; }
.bulk-select-all input, [data-bulk-item] { width: 19px; height: 19px; accent-color: var(--primary); cursor: pointer; }
.bulk-actions [data-selected-count] { min-width: 74px; font-variant-numeric: tabular-nums; }
.bulk-actions .button[disabled] { opacity: .45; cursor: not-allowed; }
.bulk-hint { margin: 0 2px 12px; display: flex; align-items: center; gap: 7px; color: #64748b; font-size: 10px; }
.bulk-hint svg { flex: 0 0 auto; color: #4f6f99; }
.selection-cell { width: 45px; padding-inline: 10px !important; text-align: center; }
.selection-cell input { vertical-align: middle; }
.archive-view-label { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; color: #475569; font-size: 11px; font-weight: 800; }

.prospect-card-shell { position: relative; }
.prospect-card-shell .prospect-card { padding-left: 43px; }
.prospect-card-shell .card-selector { position: absolute; z-index: 2; top: 13px; left: 13px; }
.card-selector { accent-color: var(--primary); }

.reminder-card { grid-template-columns: 28px 30px minmax(0,1fr); }
.reminder-selector { align-self: start; margin-top: 3px; }
.archived-check { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: #64748b; background: #eef2f7; }
.archived-check svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.flash-with-action { width: min(470px,calc(100vw - 30px)); }
.flash-with-action > span { flex: 1; }
.flash-with-action form { display: inline-flex; }

.constraint-note { margin-bottom: 12px; padding: 15px 17px; border: 1px solid #d8e4f2; border-radius: 14px; display: flex; align-items: flex-start; gap: 11px; color: #42516a; background: #f7faff; }
.constraint-note > svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: #2563eb; stroke-width: 1.8; }
.constraint-note span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.constraint-note strong { color: #21314a; font-size: 11px; }
.constraint-note small { color: #64748b; font-size: 10px; line-height: 1.55; }

.trash-hero { margin-bottom: 12px; padding: 25px 27px; display: flex; align-items: center; justify-content: space-between; gap: 22px; background: linear-gradient(145deg,#fff,#f5f9ff); }
.trash-hero h2 { margin: 5px 0 7px; font-size: 23px; }
.trash-hero p { max-width: 620px; margin: 0; color: #64748b; font-size: 11px; line-height: 1.6; }
.trash-retention { min-width: 180px; padding: 15px 17px; border: 1px solid #dce7f4; border-radius: 14px; display: grid; grid-template-columns: 34px 1fr; align-items: center; column-gap: 10px; background: #fff; }
.trash-retention svg { width: 28px; height: 28px; grid-row: 1/3; fill: none; stroke: #2563eb; stroke-width: 1.6; }
.trash-retention strong { color: #1e3a5f; font-size: 16px; }
.trash-retention small { color: #718198; font-size: 9px; }
.trash-table td:first-child strong { display: block; }
.trash-table td:first-child small { display: block; margin-top: 3px; color: #64748b; font-size: 9px; }
.trash-table .row-actions form { display: inline-flex; }

@media (max-width: 900px) {
    .archive-bar { align-items: stretch; flex-direction: column; }
    .archive-switch { align-self: flex-start; }
    .bulk-actions { justify-content: space-between; flex-wrap: wrap; }
    .trash-hero { align-items: stretch; flex-direction: column; }
    .trash-retention { min-width: 0; }
}

@media (max-width: 760px), (max-height: 480px) and (max-width: 960px) {
    .archive-switch { width: 100%; }
    .archive-switch a { flex: 1; justify-content: center; }
    .bulk-select-all { flex: 1; }
    .bulk-actions [data-selected-count] { order: 3; width: 100%; }
    .bulk-actions .button { min-height: 44px; }
    .data-table tr { position: relative; padding-top: 40px; }
    .data-table .selection-cell { width: 44px !important; min-height: 36px !important; padding: 7px !important; border: 0; position: absolute; top: 4px; right: 7px; display: flex !important; align-items: center; justify-content: center; }
    .data-table .selection-cell::before { display: none; }
    .data-table td:nth-child(2) { min-height: 54px; }
    .reminder-card { grid-template-columns: 28px 30px minmax(0,1fr); padding: 17px 14px; gap: 9px; }
    .trash-hero { padding: 21px 19px; }
    .trash-table .row-actions { align-items: stretch; flex-direction: column; }
    .trash-table .row-actions form, .trash-table .row-actions .button { width: 100%; }
}

@media (max-width: 440px) {
    .bulk-actions .button { width: 100%; justify-content: center; order: 4; }
    .constraint-note { padding: 14px; }
    .reminder-card { grid-template-columns: 26px minmax(0,1fr); }
    .reminder-card .reminder-check { display: none; }
    .reminder-card .reminder-body { grid-column: 2; }
}

/* TheoNum Pilot 1.4.7 — personnalisation, thème et PWA */
:root { --primary-rgb: 37,99,235; }
html[data-accent="indigo"] { --primary: #4f46e5; --primary-dark: #4338ca; --primary-soft: #eef2ff; --primary-rgb: 79,70,229; }
html[data-accent="cyan"] { --primary: #0369a1; --primary-dark: #075985; --primary-soft: #ecfeff; --primary-rgb: 3,105,161; }
html[data-accent="teal"] { --primary: #0f766e; --primary-dark: #115e59; --primary-soft: #f0fdfa; --primary-rgb: 15,118,110; }
html[data-accent="violet"] { --primary: #7c3aed; --primary-dark: #6d28d9; --primary-soft: #f5f3ff; --primary-rgb: 124,58,237; }
html[data-accent="rose"] { --primary: #e11d48; --primary-dark: #be123c; --primary-soft: #fff1f2; --primary-rgb: 225,29,72; }

.button-primary { background: linear-gradient(145deg,var(--primary),var(--primary-dark)); box-shadow: 0 7px 18px rgba(var(--primary-rgb),.2); }
.button-primary:hover { box-shadow: 0 10px 25px rgba(var(--primary-rgb),.28); }
.dashboard-metrics .metric-featured { background: linear-gradient(145deg,var(--primary-dark),var(--primary) 64%,#0ea5e9 155%); }
.chart-column i { background: linear-gradient(180deg,color-mix(in srgb,var(--primary) 60%,white),var(--primary)); }
.avatar { background: linear-gradient(145deg,var(--primary-dark),#0891b2); }

.dashboard-tools { min-height: 36px; margin: -5px 0 10px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--muted); font-size: 10px; }
.dashboard-tools a { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; gap: 7px; color: var(--primary); background: var(--surface); font-weight: 800; }
.dashboard-tools svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.dashboard-composer { margin-bottom: 18px; display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 18px; align-items: start; }
.dashboard-composer .dashboard-widget-wide { grid-column: 1/-1; margin-bottom: 0; }
.dashboard-widget { min-width: 0; height: 100%; overflow: hidden; }
.dashboard-widget-chart { grid-column: span 8; }
.dashboard-widget-reminders { grid-column: span 4; }
.dashboard-widget-invoices { grid-column: span 7; }
.dashboard-widget-projects { grid-column: span 5; }
.metric-comparison { z-index: 1; margin-top: 8px; display: flex !important; align-items: flex-start; gap: 6px; color: var(--muted) !important; font-size: 9px !important; line-height: 1.35; }
.metric-comparison > svg { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; }
.metric-comparison > span { min-width: 0; display: flex; flex-direction: column; }
.metric-comparison b { font-size: 9px; }
.metric-comparison small { margin-top: 1px; color: inherit !important; font-size: 8px !important; }
.metric-comparison-up { color: var(--green) !important; }
.metric-comparison-down { color: var(--red) !important; }
.metric-featured .metric-comparison { color: #e0e7ff !important; }
.metric-card:has(.metric-comparison) .metric-link { display: none; }
.dashboard-metrics:has(.metric-comparison) .metric-card { min-height: 184px; }

.preference-form { display: grid; gap: 0; }
.personalization-section { padding-bottom: 0; overflow: hidden; }
.personalization-section > .panel-header { border-bottom: 1px solid var(--line-soft); }
.preference-block { padding: 24px 22px; border-bottom: 1px solid var(--line-soft); }
.preference-block:last-child { border-bottom: 0; }
.preference-heading { margin-bottom: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.preference-heading h3, .install-card h3 { margin: 0; color: var(--ink); font-size: 14px; }
.preference-heading p, .install-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.choice-card-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; }
.choice-card { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 13px; position: relative; display: flex; flex-direction: column; gap: 5px; background: var(--surface); cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.1); }
.choice-card > input { position: absolute; top: 13px; right: 13px; width: 18px; height: 18px; accent-color: var(--primary); }
.choice-card > strong { font-size: 11px; }
.choice-card > small { color: var(--muted); font-size: 9px; }
.choice-preview, .density-preview { height: 72px; margin-bottom: 4px; padding: 9px; border: 1px solid #dce5f0; border-radius: 9px; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: repeat(2,1fr); gap: 6px; overflow: hidden; }
.choice-preview i, .density-preview i { border-radius: 4px; background: #dbe5f2; }
.choice-preview i:first-child { grid-row: 1/-1; background: #172036; }
.choice-preview i:nth-child(2) { background: #fff; box-shadow: 0 0 0 1px #e2e8f0; }
.theme-preview-light { background: #f4f7fb; }
.theme-preview-dark { border-color: #263449; background: #0b1220; }
.theme-preview-dark i:first-child { background: #050b16; }
.theme-preview-dark i:nth-child(2), .theme-preview-dark i:nth-child(3) { background: #172235; box-shadow: none; }
.density-preview { grid-template-columns: 1fr; grid-template-rows: repeat(4,1fr); background: #f8fafc; }
.density-preview i { background: #d7e3f2; }
.density-preview-comfortable { padding-block: 12px; gap: 8px; }
.density-preview-comfortable i:last-child { display: none; }
.density-preview-compact { gap: 3px; }
.accent-fieldset { margin: 22px 0 0; padding: 0; border: 0; }
.accent-fieldset legend { margin-bottom: 10px; color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.accent-fieldset > small { margin-top: 9px; display: block; color: var(--muted); font-size: 9px; }
.accent-options { display: flex; flex-wrap: wrap; gap: 8px; }
.accent-option { min-height: 44px; padding: 6px 10px 6px 7px; border: 1px solid var(--line); border-radius: 99px; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.accent-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(var(--primary-rgb),.09); }
.accent-option:has(input:focus-visible), .choice-card:has(input:focus-visible) { outline: 3px solid rgba(var(--primary-rgb),.3); outline-offset: 3px; }
.accent-option input { position: absolute; opacity: 0; pointer-events: none; }
.accent-option > span { width: 25px; height: 25px; border: 3px solid #fff; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #cbd5e1; }
.accent-option strong { font-size: 10px; }
.accent-option[data-accent-name="blue"] { --swatch:#2563eb; }
.accent-option[data-accent-name="indigo"] { --swatch:#4f46e5; }
.accent-option[data-accent-name="cyan"] { --swatch:#0369a1; }
.accent-option[data-accent-name="teal"] { --swatch:#0f766e; }
.accent-option[data-accent-name="violet"] { --swatch:#7c3aed; }
.accent-option[data-accent-name="rose"] { --swatch:#e11d48; }
.preference-block-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,.8fr); gap: 28px; }
.install-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 12px; background: var(--canvas); }
.install-card > span { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.install-card svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.install-card .button { min-height: 44px; margin-top: 10px; }
.install-card small { margin-top: 7px; display: block; color: var(--muted); font-size: 9px; }
.column-preference-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.column-preference-grid fieldset { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.column-preference-grid legend { padding: 0 5px; color: var(--ink); font-size: 11px; font-weight: 850; }
.check-row { min-height: 44px; display: flex; align-items: center; gap: 9px; color: var(--ink-soft); cursor: pointer; font-size: 10px; }
.check-row input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary); }
.widget-preference-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.widget-preference { min-height: 64px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); }
.widget-preference .check-row { flex: 1; }
.widget-preference .check-row > span { display: flex; flex-direction: column; }
.widget-preference strong { color: var(--ink); font-size: 10px; }
.widget-preference small { color: var(--muted); font-size: 8px; }
.widget-preference select { min-height: 44px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font-size: 9px; }
.preference-actions { position: sticky; z-index: 6; bottom: 12px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb,var(--surface) 92%,transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow-raised); }
.preference-actions .save-state { margin-right: auto; color: var(--muted); font-size: 10px; }

.network-banner { position: fixed; z-index: 1200; right: 18px; bottom: 18px; width: min(430px,calc(100vw - 36px)); min-height: 48px; padding: 11px 14px; border: 1px solid #f59e0b; border-radius: 13px; display: flex; align-items: center; gap: 9px; color: #78350f; background: #fffbeb; box-shadow: 0 16px 42px rgba(15,23,42,.17); font-size: 11px; font-weight: 700; }
.network-banner[hidden] { display: none; }
.network-banner.is-online { border-color: #34d399; color: #065f46; background: #ecfdf5; }
.network-banner svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }

html[data-density="compact"] { --radius: 15px; --radius-sm: 10px; }
html[data-density="compact"] .page-content { padding-inline: 26px; padding-bottom: 34px; }
html[data-density="compact"] .topbar { height: 82px; padding-inline: 26px; }
html[data-density="compact"] .panel-header { min-height: 58px; padding: 15px 17px; }
html[data-density="compact"] .dashboard-composer { gap: 12px; }
html[data-density="compact"] .dashboard-welcome { min-height: 158px; padding: 24px 27px; }
html[data-density="compact"] .dashboard-metrics { gap: 9px; }
html[data-density="compact"] .dashboard-metrics .metric-card { min-height: 126px; padding: 16px; }
html[data-density="compact"] .dashboard-metrics:has(.metric-comparison) .metric-card { min-height: 164px; }
html[data-density="compact"] th { padding: 7px 13px; }
html[data-density="compact"] td { padding: 9px 13px; }
html[data-density="compact"] .form-grid { gap: 12px 15px; }
html[data-density="compact"] .form-card { margin-bottom: 12px; padding-bottom: 17px; }
html[data-density="compact"] .reminder-item, html[data-density="compact"] .project-row { min-height: 52px; padding-block: 8px; }

html[data-theme="dark"] { color-scheme: dark; --ink:#eef4ff; --ink-soft:#d7e2f2; --muted:#a3b2c7; --muted-light:#91a2b9; --line:#314158; --line-soft:#223047; --surface:#111b2b; --canvas:#0b1220; --primary-soft:color-mix(in srgb,var(--primary) 18%,#111b2b); --green:#34d399; --green-soft:#0d2b28; --amber:#fbbf24; --amber-soft:#302510; --red:#fb7185; --red-soft:#32151c; --shadow:0 1px 2px rgba(0,0,0,.22),0 15px 40px rgba(0,0,0,.18); --shadow-raised:0 20px 60px rgba(0,0,0,.38); }
html[data-theme="dark"] body { background: var(--canvas); }
html[data-theme="dark"] .topbar { background: rgba(11,18,32,.86); }
html[data-theme="dark"] :is(.quick-add,.quick-create-menu,.button-secondary,.filter-tabs,.search-form input,.search-form button,.flash,.metric-card,.field input,.field textarea,.field select,.status-form select,.sticky-actions,.command-card,.confirm-card,.global-search-form input,.saved-view-chip,.save-view-menu>summary,.save-view-menu>form,.filter-fields input,.filter-fields select,.pagination,.inline-edit>summary,.inline-edit form,.inline-edit form input,.inline-edit form select,.archive-bar,.archive-switch a.active,.trash-retention,.address-suggestions) { color: var(--ink-soft); border-color: var(--line); background: var(--surface); }
html[data-theme="dark"] :is(.settings-nav,.line-item textarea,.line-item input,.reminder-check button,.onboarding-card,.project-progress li>span,.document-lifecycle li>span,.project-metric,.client-metrics article,.copy-field input) { color: var(--ink-soft); border-color: var(--line); background: var(--surface); }
html[data-theme="dark"] :is(.list-insights>span,.settings-readiness>span,.settings-section .template-card,.export-grid>a,.toggle-field,.notification-help>span,.notification-disabled,.notification-sent-state,.admin-hero-metrics>span,.admin-safety li,.reminders-hero-stats span,.system-environment dl>div,.line-item) { border-color: var(--line); background: #152237; }
html[data-theme="dark"] :is(th,.command-card>footer) { color: var(--muted); border-color: var(--line-soft); background: #0e1828; }
html[data-theme="dark"] :is(tbody tr:hover td,.search-result-list a:hover,.command-shortcuts a:hover) { background: #152237; }
html[data-theme="dark"] :is(.button-secondary:hover,.filter-tabs a:hover,.filter-tabs a.active,.quick-create-menu a:hover,.client-contact-actions>a:hover,.client-record-list>a:hover,.address-suggestions li:hover,.address-suggestions li.is-active) { color: var(--primary); border-color: var(--line); background: var(--primary-soft); }
html[data-theme="dark"] :is(.command-shortcuts a,.command-history,.command-card>footer,.search-result-group>header,.search-result-list a,.panel-footer-link,.advanced-filters[open]>summary,.personalization-section>.panel-header,.preference-block) { border-color: var(--line-soft); }
html[data-theme="dark"] .command-history>a { color: var(--ink-soft); background: #162235; }
html[data-theme="dark"] .command-card .icon-button:hover { background: #1b293d; }
html[data-theme="dark"] .badge-neutral, html[data-theme="dark"] .badge { color: #c8d4e5; background: #243248; }
html[data-theme="dark"] .badge-success { color: #6ee7b7; background: #12362f; }
html[data-theme="dark"] .badge-danger { color: #fda4af; background: #3a1921; }
html[data-theme="dark"] .badge-warning { color: #fcd34d; background: #3a2b12; }
html[data-theme="dark"] .badge-info { color: #7dd3fc; background: #123248; }
html[data-theme="dark"] .metric-heading>i { background: var(--primary-soft); }
html[data-theme="dark"] .chart-column::before { border-color: var(--line-soft); }
html[data-theme="dark"] .pipeline-cards { border-color: var(--line); background: #0d1726; }
html[data-theme="dark"] .prospect-card { background: var(--surface); }
html[data-theme="dark"] :is(.profile-card,.internal-note,.constraint-note,.trash-hero,.duplicate-warning,.inline-message-warning,.client-note-card,.system-alert,.setup-banner) { border-color: var(--line); background: #172235; }
html[data-theme="dark"] :is(td,.field>span:first-child,.preference-heading h3,.install-card h3,.widget-preference strong,.column-preference-grid legend) { color: var(--ink-soft); }
html[data-theme="dark"] :is(.settings-hero p,.reminders-hero p,.admin-hero p,.trash-hero p,.constraint-note small,.constraint-note strong,.client-note-card p,.client-note-card strong,.panel-header p) { color: var(--muted); }
html[data-theme="dark"] .settings-readiness-score>i::before { background: var(--surface); }
html[data-theme="dark"] .archive-switch { background: #0d1726; }
html[data-theme="dark"] .app-footer a:hover { border-color: var(--line); color: var(--primary); background: var(--surface); }
html[data-theme="dark"] .field.has-error :is(input,textarea,select) { border-color: var(--red); background: var(--red-soft); }
html[data-theme="dark"] .document-paper { color: #172036; background: #fff; }
html[data-theme="dark"] .accent-option>span { border-color: #dbeafe; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #718198; }
html[data-theme="dark"] .network-banner { color: #fde68a; background: #302510; }
html[data-theme="dark"] .network-banner.is-online { color: #a7f3d0; background: #0d2b28; }

@media (max-width: 1040px) {
    .choice-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-widget-chart, .dashboard-widget-reminders, .dashboard-widget-invoices, .dashboard-widget-projects { grid-column: 1/-1; }
}

@media (max-width: 760px), (max-height: 480px) and (max-width: 960px) {
    .dashboard-tools { margin-top: 0; justify-content: space-between; }
    .dashboard-composer { grid-template-columns: 1fr; gap: 14px; }
    .dashboard-composer > * { grid-column: 1 !important; }
    .preference-block { padding: 20px 17px; }
    .preference-block-split, .column-preference-grid, .widget-preference-list { grid-template-columns: 1fr; }
    .preference-form .choice-card-grid { grid-template-columns: 1fr 1fr; }
    .preference-actions { align-items: stretch; flex-direction: column; }
    .preference-actions .save-state { margin: 0; }
    .preference-actions .button { width: 100%; }
    html[data-density="compact"] .page-content { padding-inline: 17px; }
    html[data-density="compact"] .topbar { padding-inline: 17px; }
    html[data-theme="dark"] .data-table tr { border-color: var(--line); background: var(--surface); }
    html[data-theme="dark"] .data-table td { border-color: var(--line-soft); }
}

@media (max-width: 440px) {
    .preference-form .choice-card-grid { grid-template-columns: 1fr; }
    .accent-options { display: grid; grid-template-columns: 1fr 1fr; }
    .accent-option { border-radius: 11px; }
    .widget-preference { align-items: stretch; flex-direction: column; }
    .widget-preference select { width: 100%; }
}

/* Correctif mobile 1.4.7 : composants contenus, cibles tactiles et zones sûres. */
@media (max-width: 760px), (max-height: 480px) and (max-width: 960px) {
    html, body { max-width: 100%; overflow-x: clip; }
    .main-area, .page-content, .topbar, .topbar-heading, .topbar-tools,
    .page-toolbar, .page-toolbar > *, .toolbar-actions, .list-context,
    .list-context > *, .panel, .panel-header > *, .form-grid, .form-actions,
    .settings-content, .document-detail-hero, .project-hero, .client-hero { min-width: 0; max-width: 100%; }

    .topbar {
        gap: 8px;
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
    }
    .sidebar {
        padding-top: env(safe-area-inset-top);
        padding-left: max(18px, env(safe-area-inset-left));
    }
    body.is-demo .demo-banner {
        min-height: calc(78px + env(safe-area-inset-top));
        padding-top: max(8px, env(safe-area-inset-top));
    }
    body:not(.is-demo) .topbar {
        height: calc(80px + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
    }
    body:not(.is-demo) .setup-banner {
        padding-top: max(10px, env(safe-area-inset-top));
    }
    body:not(.is-demo) .setup-banner + .topbar {
        height: 80px;
        padding-top: 0;
    }
    .topbar-heading h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-content {
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
    }
    .demo-banner, .setup-banner {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    .app-footer {
        padding-left: max(18px, env(safe-area-inset-left));
        padding-right: max(18px, env(safe-area-inset-right));
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
    .flash-stack {
        right: max(12px, env(safe-area-inset-right));
        left: max(12px, env(safe-area-inset-left));
        width: auto;
    }
    .network-banner {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        left: max(12px, env(safe-area-inset-left));
        width: auto;
    }
    .command-dialog, .confirm-dialog {
        padding-right: max(10px, env(safe-area-inset-right));
        padding-bottom: max(18px, env(safe-area-inset-bottom));
        padding-left: max(10px, env(safe-area-inset-left));
    }
    .guest-main {
        padding-top: max(22px, env(safe-area-inset-top));
        padding-right: max(14px, env(safe-area-inset-right));
        padding-bottom: max(28px, env(safe-area-inset-bottom));
        padding-left: max(14px, env(safe-area-inset-left));
    }

    .quick-create-menu {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        width: min(330px, calc(100vw - 28px));
        max-height: calc(100dvh - 104px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .filter-tabs {
        flex-wrap: wrap;
        overflow-x: visible;
        scroll-snap-type: none;
    }
    .filter-tabs a {
        min-height: 44px;
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }

    .settings-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        overflow: visible;
        scroll-snap-type: none;
    }
    .settings-nav a {
        min-width: 0;
        min-height: 44px;
        line-height: 1.25;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .button-small, .archive-switch a, .breadcrumbs a, .back-row a,
    .global-search-form .button, .command-form button,
    .inline-edit > summary, .data-table .row-action, .table-main {
        min-height: 44px;
    }
    .global-search-form .button, .command-form button { width: 44px; }
    .line-actions button { width: 44px; height: 44px; }
    .table-main { display: inline-flex; align-items: center; }
    .row-actions { flex-wrap: wrap; gap: 8px; }
    .data-table .actions-cell { min-height: 52px; }
    .data-table .selection-cell { min-height: 44px !important; }

    .pagination > div {
        padding-bottom: 2px;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }
    .pagination a { min-width: 44px; min-height: 44px; }
}

@media (max-width: 360px) {
    .quick-create-menu {
        width: min(292px, calc(100vw - 20px));
        grid-template-columns: 1fr;
    }
    .quick-create-menu a { min-height: 56px; }
    .settings-nav { grid-template-columns: 1fr; }
    .data-table td {
        grid-template-columns: minmax(82px, .4fr) minmax(0, 1fr);
        gap: 10px;
    }
}

@media (orientation: landscape) and (max-height: 480px) and (max-width: 960px) {
    .quick-create-menu { max-height: calc(100dvh - 92px); }
    .settings-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .choice-card, .accent-option, .network-banner { transition: none !important; }
}
