:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --text: #171927;
    --muted: #6e7388;
    --line: #e7e9f1;
    --primary: #5957df;
    --primary-dark: #4643c7;
    --primary-soft: #eeedff;
    --green: #16835c;
    --green-soft: #e9f8f2;
    --amber: #b8680b;
    --amber-soft: #fff4df;
    --red: #c23b4c;
    --red-soft: #fff0f2;
    --shadow: 0 12px 40px rgba(28, 31, 56, .06);
    --radius: 18px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
    position: sticky; top: 0; height: 100vh; padding: 24px 18px;
    display: flex; flex-direction: column; color: #dfe2f5;
    background: linear-gradient(180deg, #17182c 0%, #20213b 100%);
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 30px; color: white; }
.brand-logo { width: 40px; height: 40px; flex: 0 0 auto; display: block; filter: drop-shadow(0 8px 16px rgba(91, 87, 223, .2)); }
.brand strong, .brand small, .user-chip strong, .user-chip small, .sidebar-footer strong, .sidebar-footer small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .01em; }
.brand small { color: #9499b8; font-size: 11px; margin-top: 2px; }
.nav-stack { display: grid; gap: 7px; }
.nav-stack a { display: flex; gap: 12px; align-items: center; color: #aeb2cc; padding: 11px 13px; border-radius: 11px; font-weight: 500; transition: .18s ease; }
.nav-stack a:hover { color: white; background: rgba(255,255,255,.06); }
.nav-stack a.active { color: white; background: linear-gradient(90deg, rgba(111,108,255,.26), rgba(111,108,255,.10)); box-shadow: inset 3px 0 #8583ff; }
.nav-glyph { width: 20px; text-align: center; font-size: 18px; }
.sidebar-footer { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid rgba(255,255,255,.08); display: flex; gap: 10px; align-items: center; }
.sidebar-footer strong { color: #dfe2f5; font-size: 11px; }
.sidebar-footer small { color: #7f84a3; font-size: 10px; margin-top: 2px; }
.environment-dot { width: 9px; height: 9px; border-radius: 50%; background: #42d39a; box-shadow: 0 0 0 4px rgba(66,211,154,.12); }
.content-shell { min-width: 0; }
.topbar { height: 70px; padding: 0 38px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.84); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.user-chip { display: flex; gap: 10px; align-items: center; }
.user-chip strong { font-size: 12px; }
.user-chip small { font-size: 10px; color: var(--muted); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 700; }
.page-container { padding: 34px 38px 60px; max-width: 1600px; margin: 0 auto; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 { margin: 5px 0 7px; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; letter-spacing: -.035em; font-weight: 700; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.heading-with-action { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.eyebrow { color: var(--primary); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 700; }
.btn { border-radius: 10px; font-weight: 600; font-size: 13px; padding: 9px 15px; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, #625fe8, #514ed2); border-color: transparent; box-shadow: 0 8px 20px rgba(89,87,223,.18); }
.btn-primary:hover { background: linear-gradient(135deg, #5653dc, #4542c2); border-color: transparent; }
.btn-lg { padding: 12px 18px; font-size: 13px; }
.btn-soft { color: #45475a; background: #f3f4f8; border: 1px solid var(--line); }
.button-group { display: flex; gap: 9px; flex-wrap: wrap; }
.surface-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { position: relative; overflow: hidden; padding: 19px 20px; min-height: 136px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.metric-card > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-card > strong { font-size: 29px; letter-spacing: -.04em; margin-top: auto; line-height: 1.1; }
.metric-card > small { color: var(--muted); font-size: 10px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-accent { position: absolute; left: 0; top: 18px; width: 3px; height: 30px; border-radius: 0 3px 3px 0; background: var(--primary); }
.metric-card.green .metric-accent { background: var(--green); }
.metric-card.amber .metric-accent { background: #e39b2d; }
.metric-card.slate .metric-accent { background: #6b7280; }
.two-column-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr); gap: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 21px 22px 17px; }
.section-heading h2 { margin: 3px 0 0; font-size: 17px; letter-spacing: -.02em; }
.text-link { color: var(--primary); font-size: 11px; font-weight: 600; }
.run-list { padding: 0 10px 10px; }
.run-row { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto 70px auto; align-items: center; gap: 12px; padding: 12px; border-top: 1px solid var(--line); transition: .15s ease; }
.run-row:hover { border-radius: 12px; background: var(--surface-2); }
.file-icon { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #087b53; background: #e7f7f0; font-size: 9px; font-weight: 800; }
.file-icon.large { width: 54px; height: 54px; border-radius: 15px; font-size: 13px; }
.run-primary strong, .run-primary small, .run-stat strong, .run-stat small { display: block; }
.run-primary strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-primary small, .run-stat small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.run-stat strong { font-size: 12px; }
.chevron { color: #a5a8b6; font-size: 22px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; background: #eef0f6; color: #5c6073; }
.status-badge > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.success { color: var(--green); background: var(--green-soft); }
.status-badge.warning { color: var(--amber); background: var(--amber-soft); }
.status-badge.danger { color: var(--red); background: var(--red-soft); }
.status-badge.processing { color: var(--primary); background: var(--primary-soft); }
.rules-preview { padding-bottom: 17px; }
.priority-step { margin: 0 20px; padding: 13px 0; display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid var(--line); }
.priority-step > span { flex: 0 0 auto; width: 31px; height: 24px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 7px; font-size: 9px; font-weight: 800; }
.priority-step strong, .priority-step small { display: block; }
.priority-step strong { font-size: 11px; }
.priority-step small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.rules-preview .btn { margin-left: 20px; width: calc(100% - 40px) !important; }
.empty-compact { min-height: 170px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-compact strong, .empty-compact span { display: block; }
.empty-compact strong { color: var(--text); font-size: 13px; }
.empty-compact span { font-size: 11px; margin-top: 4px; }
.empty-state, .page-loading { min-height: 60vh; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-state h1 { color: var(--text); font-size: 26px; }
.empty-icon { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 20px; color: var(--primary); background: var(--primary-soft); font-size: 20px; font-weight: 800; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skeleton-card { height: 136px; border-radius: 16px; background: linear-gradient(100deg, #eceef4 30%, #f8f9fb 50%, #eceef4 70%); background-size: 220% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }
.process-steps { max-width: 850px; display: flex; align-items: center; margin-bottom: 24px; }
.process-step { display: flex; align-items: center; gap: 9px; color: #969aac; opacity: .72; }
.process-step > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #e5e7ee; font-size: 10px; font-weight: 700; }
.process-step strong, .process-step small { display: block; white-space: nowrap; }
.process-step strong { font-size: 10px; }
.process-step small { font-size: 8px; margin-top: 2px; }
.process-step.active { color: var(--text); opacity: 1; }
.process-step.active > span { color: white; background: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
.step-line { flex: 1; height: 1px; margin: 0 14px; background: var(--line); }
.upload-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .65fr); gap: 20px; }
.upload-card { padding: 20px; min-height: 520px; display: flex; flex-direction: column; }
.drop-zone { min-height: 355px; padding: 40px; border: 1.5px dashed #c9ccdc; border-radius: 15px; background: linear-gradient(180deg, #fbfbfe, #f7f8fc); display: grid; place-content: center; justify-items: center; cursor: pointer; text-align: center; transition: .2s ease; }
.drop-zone:hover, .drop-zone.has-file { border-color: #8a87ec; background: var(--primary-soft); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone h2 { margin: 15px 0 5px; font-size: 17px; }
.drop-zone p { color: var(--muted); margin: 0; font-size: 11px; }
.upload-icon { width: 54px; height: 54px; display: grid; place-items: center; color: var(--primary); background: white; border: 1px solid #dedffa; border-radius: 15px; box-shadow: 0 8px 24px rgba(89,87,223,.12); font-size: 23px; }
.upload-hint { margin-top: 18px; color: #999daf; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.action-bar { margin-top: auto; padding: 18px 4px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.action-bar strong, .action-bar span { display: block; }
.action-bar strong { font-size: 10px; }
.action-bar span { color: var(--muted); font-size: 9px; margin-top: 3px; }
.validation-guide { padding: 24px; }
.validation-guide h2 { font-size: 17px; margin: 5px 0 19px; }
.check-item { display: flex; gap: 10px; margin: 15px 0; }
.check-item > span { flex: 0 0 auto; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 700; }
.check-item strong, .check-item small { display: block; }
.check-item strong { font-size: 10px; }
.check-item small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.validation-guide hr { border-color: var(--line); margin: 22px 0; }
.muted-copy { color: var(--muted); font-size: 10px; line-height: 1.6; }
.processing-state { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; }
.processing-state h2 { font-size: 20px; margin: 12px 0 7px; }
.processing-state p { max-width: 480px; color: var(--muted); font-size: 11px; }
.processing-state small { color: var(--muted); font-size: 9px; }
.orbit-loader { position: relative; width: 62px; height: 62px; margin-bottom: 20px; border: 2px solid #deddfa; border-radius: 50%; animation: spin 1.2s linear infinite; }
.orbit-loader span { position: absolute; top: 4px; left: 7px; width: 11px; height: 11px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 14px rgba(89,87,223,.6); }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { width: min(420px, 80vw); height: 5px; overflow: hidden; margin: 18px 0 10px; background: #ebeaf8; border-radius: 10px; }
.progress-track span { display: block; width: 45%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #9a73f2); animation: progress 1.4s ease-in-out infinite alternate; }
@keyframes progress { from { transform: translateX(-80%); } to { transform: translateX(200%); } }
.alert-panel { margin: 16px 0 0; padding: 13px 15px; display: flex; gap: 8px; flex-direction: column; border-radius: 11px; font-size: 10px; }
.alert-panel.danger { color: #9d2d3c; background: var(--red-soft); border: 1px solid #f7d6db; }
.alert-panel.success { color: #126c4d; background: var(--green-soft); border: 1px solid #cfecdf; }
.data-surface { overflow: hidden; }
.toolbar { padding: 16px 18px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.toolbar.inline { padding: 0; border: 0; }
.search-box { min-width: 250px; display: flex; align-items: center; gap: 8px; padding: 8px 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; }
.search-box span { color: #9195a7; font-size: 16px; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 10px; }
.compact-select { width: auto; min-width: 150px; padding: 8px 30px 8px 10px; border-color: var(--line); border-radius: 9px; color: #55596b; font-size: 10px; }
.result-count { margin-left: auto; color: var(--muted); font-size: 10px; }
.enterprise-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.enterprise-table th { padding: 11px 15px; color: #7e8296; background: #fafafe; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .06em; font-size: 8px; font-weight: 700; white-space: nowrap; }
.enterprise-table td { padding: 12px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 10px; }
.enterprise-table tbody tr { transition: background .12s ease; }
.enterprise-table tbody tr:hover { background: #fafafe; }
.enterprise-table tbody tr:last-child td { border-bottom: 0; }
.enterprise-table.compact td { padding-top: 9px; padding-bottom: 9px; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.file-cell { min-width: 230px; display: flex; align-items: center; gap: 10px; }
.file-cell strong, .file-cell small, .cell-subtitle { display: block; }
.file-cell small, .cell-subtitle { color: var(--muted); font-size: 8px; margin-top: 3px; }
.icon-button { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: #f4f5f9; color: #777b90; font-size: 18px; }
.table-loading { min-height: 250px; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.back-link { display: inline-block; color: var(--primary); font-size: 10px; margin-bottom: 9px; }
.title-status { display: flex; align-items: center; gap: 12px; }
.title-status h1 { margin: 0; }
.result-header { align-items: flex-end; }
.result-summary-strip { padding: 10px 22px; display: flex; gap: 28px; color: var(--muted); background: #fafafe; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 9px; }
.result-summary-strip strong { color: var(--text); margin-right: 4px; }
.result-table-wrap { max-height: 620px; overflow: auto; }
.result-table-wrap thead { position: sticky; top: 0; z-index: 1; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.record-outcome { display: inline-block; padding: 4px 7px; border-radius: 6px; background: #f1f2f6; color: #606477; font-size: 8px; font-weight: 700; }
.record-outcome.optimized { color: var(--green); background: var(--green-soft); }
.record-outcome.relaxedconstraint { color: var(--amber); background: var(--amber-soft); }
.record-outcome.invalidinput { color: var(--red); background: var(--red-soft); }
.warning-text { max-width: 260px; color: var(--amber); white-space: normal; }
.table-limit-note { padding: 11px; text-align: center; color: var(--muted); background: #fafafe; border-top: 1px solid var(--line); font-size: 9px; }
.rules-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: 20px; align-items: start; }
.rule-flow { padding-bottom: 25px; }
.flow-node { width: calc(100% - 80px); max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fbfbfe; }
.flow-node span, .flow-node strong, .flow-node small { display: block; }
.flow-node span { color: var(--primary); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.flow-node strong { font-size: 12px; margin-top: 4px; }
.flow-node small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.flow-node.input-node, .flow-node.output-node { color: white; background: linear-gradient(135deg, #5f5ce3, #4c49c8); border-color: transparent; }
.flow-node.input-node span, .flow-node.input-node small, .flow-node.output-node span, .flow-node.output-node small { color: #dcddff; }
.flow-connector { height: 27px; display: grid; place-items: center; color: #a7a9b9; font-size: 13px; }
.version-list { padding: 0 13px 13px; }
.version-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: start; padding: 13px 10px; border-top: 1px solid var(--line); }
.version-row:has(.btn) { grid-template-columns: auto minmax(0,1fr) auto auto; }
.version-number { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 9px; font-weight: 800; }
.version-row strong, .version-row small { display: block; }
.version-row strong { font-size: 10px; }
.version-row small { color: var(--muted); font-size: 8px; margin-top: 3px; }
.version-state { padding: 4px 7px; border-radius: 6px; color: #666a7c; background: #f0f1f5; font-size: 8px; font-weight: 700; }
.version-state.published { color: var(--green); background: var(--green-soft); }
.version-state.draft { color: var(--amber); background: var(--amber-soft); }
.modal-backdrop-custom { position: fixed; z-index: 1000; inset: 0; padding: 30px; display: grid; place-items: center; background: rgba(19,20,36,.5); backdrop-filter: blur(5px); }
.rule-editor { width: min(680px, 100%); max-height: 90vh; overflow: auto; padding: 0 22px 22px; background: white; border-radius: 18px; box-shadow: 0 30px 90px rgba(10,12,30,.28); }
.rule-editor .section-heading { padding-left: 0; padding-right: 0; }
.close-button { border: 0; background: transparent; color: #8a8da0; font-size: 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label > span, .field-label { display: block; color: #5f6376; font-size: 9px; font-weight: 600; margin-bottom: 5px; }
.form-control { border-color: var(--line); border-radius: 9px; font-size: 11px; padding: 9px 10px; }
.form-control:focus { border-color: #9895ee; box-shadow: 0 0 0 3px var(--primary-soft); }
.toggle-row { margin-top: 18px; padding: 13px; display: flex; gap: 10px; align-items: flex-start; background: #fafafe; border: 1px solid var(--line); border-radius: 11px; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 10px; }
.toggle-row small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

/* DevExpress data surfaces */
.stockflow-grid { width: 100%; border: 0 !important; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; font-family: inherit; font-size: 11px; }
.stockflow-grid .dxbl-grid-header-row { color: #65697d; background: #fafafe; text-transform: uppercase; letter-spacing: .045em; font-size: 9px; font-weight: 700; }
.stockflow-grid .dxbl-grid-table > tbody > tr { transition: background .12s ease; }
.stockflow-grid .dxbl-grid-table > tbody > tr:hover { background: #fafafe; }
.stockflow-grid .dxbl-grid-search-box { max-width: 410px; }
.stockflow-grid .dxbl-grid-toolbar-container { padding: 13px 16px; border-bottom: 1px solid var(--line); background: white; }
.stockflow-grid .dxbl-pager { border-top: 1px solid var(--line); background: #fafafe; }
.stockflow-grid .file-cell { min-width: 0; }
.grid-detail { padding: 14px 17px; display: grid; gap: 10px; color: #55596b; background: #fafafe; border-radius: 10px; }
.grid-detail > div { display: grid; gap: 4px; }
.grid-detail span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.grid-detail strong { font-size: 10px; font-weight: 500; line-height: 1.5; }
.grid-detail .danger strong { color: var(--red); }
.grid-user { min-width: 0; display: flex; gap: 11px; align-items: center; }
.audit-result { display: inline-flex; gap: 6px; align-items: center; font-size: 9px; font-weight: 700; }
.audit-result i { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 7px; font-style: normal; }
.audit-result.success { color: var(--green); }
.audit-result.success i { background: var(--green-soft); }
.audit-result.danger { color: var(--red); }
.audit-result.danger i { background: var(--red-soft); }
.audit-description { display: block; color: #55596b; line-height: 1.45; }
.audit-grid time strong { font-size: 9px; }


/* Authentication */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(500px, 1.08fr) minmax(440px, .92fr); background: white; }
.login-visual { position: relative; overflow: hidden; min-height: 100vh; color: white; background: linear-gradient(145deg, #17182e 0%, #272858 52%, #433f9c 100%); }
.login-visual-inner { position: relative; z-index: 1; width: min(720px, 100%); min-height: 100%; margin: auto; padding: 46px clamp(42px, 6vw, 86px); display: flex; flex-direction: column; }
.login-brand { position: relative; z-index: 3; display: inline-flex; width: max-content; gap: 13px; align-items: center; color: white; }
.login-brand .brand-logo { width: 44px; height: 44px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 16px; }
.login-brand small { margin-top: 2px; color: #b9bcec; font-size: 10px; }
.login-story { position: relative; z-index: 2; margin: auto 0; padding: 72px 0 62px; }
.login-kicker { display: inline-flex; gap: 9px; align-items: center; color: #d8d9ff; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.login-kicker i { width: 7px; height: 7px; border-radius: 50%; background: #55dfaa; box-shadow: 0 0 0 5px rgba(85,223,170,.12); }
.login-story h1 { max-width: 650px; margin: 22px 0 20px; font-size: clamp(42px, 5.1vw, 72px); line-height: .99; letter-spacing: -.055em; font-weight: 700; }
.login-story > p { max-width: 590px; margin: 0; color: #c2c5e8; font-size: 15px; line-height: 1.75; }
.login-proof-grid { max-width: 620px; margin-top: 52px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.login-proof-grid > div { padding: 17px 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.055); backdrop-filter: blur(12px); }
.login-proof-grid span, .login-proof-grid strong, .login-proof-grid small { display: block; }
.login-proof-grid span { color: #9295f4; font-size: 9px; font-weight: 800; }
.login-proof-grid strong { margin-top: 16px; font-size: 11px; }
.login-proof-grid small { margin-top: 6px; color: #aeb2d7; font-size: 9px; line-height: 1.5; }
.login-security-note { position: relative; z-index: 2; display: flex; gap: 11px; align-items: center; color: #dfe1fa; }
.login-security-note > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: #50dba6; background: rgba(80,219,166,.1); font-weight: 800; }
.login-security-note p, .login-security-note strong, .login-security-note small { margin: 0; display: block; }
.login-security-note strong { font-size: 10px; }
.login-security-note small { margin-top: 2px; color: #9297c0; font-size: 9px; }
.visual-orb { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.orb-one { width: 420px; height: 420px; right: -190px; top: -150px; background: radial-gradient(circle at 35% 35%, rgba(159,153,255,.38), rgba(87,81,216,.05) 65%); }
.orb-two { width: 360px; height: 360px; left: -220px; bottom: -150px; background: radial-gradient(circle at 65% 35%, rgba(63,219,174,.16), transparent 66%); }
.grid-glow { position: absolute; inset: 0; opacity: .2; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, black, transparent 72%); }
.login-form-side { min-height: 100vh; padding: 48px clamp(38px, 7vw, 96px); display: grid; place-items: center; background: radial-gradient(circle at 100% 0, #f1f0ff, transparent 35%), white; }
.login-form-wrap { width: min(430px, 100%); }
.login-form-wrap h2 { margin: 10px 0 8px; font-size: clamp(31px, 3vw, 40px); letter-spacing: -.045em; }
.login-subtitle { margin: 0 0 30px; color: var(--muted); font-size: 13px; }
.login-alert { margin-bottom: 18px; padding: 12px 13px; display: flex; gap: 10px; align-items: flex-start; border-radius: 11px; font-size: 10px; }
.login-alert > span { flex: 0 0 auto; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 7px; font-weight: 800; }
.login-alert strong, .login-alert small { display: block; }
.login-alert small { margin-top: 3px; line-height: 1.45; }
.login-alert.success { color: #126c4d; background: var(--green-soft); border: 1px solid #cfecdf; }
.login-alert.success > span { background: #d4f1e4; }
.login-alert.danger { color: #9d2d3c; background: var(--red-soft); border: 1px solid #f7d6db; }
.login-alert.danger > span { background: #f8dce1; }
.login-form { display: grid; gap: 18px; }
.login-form label > span { display: block; margin-bottom: 7px; color: #4d5062; font-size: 10px; font-weight: 700; }
.login-input { height: 49px; padding: 0 14px; display: flex; gap: 11px; align-items: center; border: 1px solid #dfe2ec; border-radius: 12px; background: white; transition: border .15s, box-shadow .15s; }
.login-input:focus-within { border-color: #8682ed; box-shadow: 0 0 0 4px var(--primary-soft); }
.login-input i { width: 17px; color: #999daf; font-size: 14px; font-style: normal; text-align: center; }
.login-input input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.login-input input::placeholder { color: #adb0bd; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.remember-check { display: flex !important; gap: 7px; align-items: center; color: var(--muted); font-size: 10px; cursor: pointer; }
.remember-check input { accent-color: var(--primary); }
.remember-check span { margin: 0 !important; color: inherit !important; font-weight: 500 !important; }
.support-note { color: #898d9e; font-size: 9px; }
.login-submit { height: 50px; margin-top: 2px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; font-size: 12px; }
.login-submit b { font-size: 18px; font-weight: 400; }
.login-footer { margin-top: 28px; padding-top: 21px; color: #9295a4; border-top: 1px solid var(--line); font-size: 9px; text-align: center; }
.lock-dot { margin-right: 5px; color: var(--green); font-size: 7px; }
.public-shell { min-height: 100vh; padding: 32px; display: grid; place-items: center; background: radial-gradient(circle at 15% 10%, #eeedff, transparent 32%), var(--bg); }
.public-error-card { width: min(490px, 100%); padding: 34px; text-align: center; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 70px rgba(28,31,56,.1); }
.public-error-card .login-brand { margin: 0 auto 42px; }
.login-brand.dark { color: var(--text); }
.login-brand.dark small { color: var(--muted); }
.public-error-card .empty-icon { margin: 0 auto 20px; }
.public-error-card h1 { margin: 0; font-size: 28px; letter-spacing: -.035em; }
.public-error-card p { margin: 10px auto 24px; max-width: 370px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.logout-form { margin: 0 0 0 3px; }
.logout-button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #777b90; background: #f3f4f8; font-size: 15px; cursor: pointer; transition: .15s; }
.logout-button:hover { color: var(--red); background: var(--red-soft); }

/* Audit and access management */
.audit-metrics { margin-top: 4px; }
.audit-timeline { padding: 0 14px 14px; }
.audit-row { display: grid; grid-template-columns: auto minmax(260px, 1fr) minmax(180px, .38fr) 96px; gap: 14px; align-items: center; padding: 15px 8px; border-top: 1px solid var(--line); }
.audit-marker { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; font-size: 10px; font-weight: 800; }
.audit-marker.success { color: var(--green); background: var(--green-soft); }
.audit-marker.danger { color: var(--red); background: var(--red-soft); }
.audit-main > div { display: flex; gap: 8px; align-items: center; }
.audit-main strong { font-size: 11px; }
.audit-main p { margin: 4px 0; color: #575b6e; font-size: 10px; line-height: 1.45; }
.audit-main small { display: flex; gap: 12px; color: #9699a8; font-size: 8px; }
.audit-entity { padding: 3px 6px; border-radius: 5px; color: #65697a; background: #f1f2f6; font-size: 8px; font-weight: 700; }
.audit-actor { min-width: 0; display: flex; gap: 9px; align-items: center; }
.avatar.small { flex: 0 0 auto; width: 29px; height: 29px; border-radius: 8px; font-size: 9px; }
.audit-actor strong, .audit-actor small, .audit-row time strong, .audit-row time small { display: block; }
.audit-actor strong { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audit-actor small { margin-top: 2px; color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audit-row time { text-align: right; font-style: normal; }
.audit-row time strong { font-size: 9px; }
.audit-row time small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.equal-permission-note { padding: 15px 17px; display: flex; gap: 12px; align-items: flex-start; color: #494b82; border: 1px solid #dcdcff; border-radius: 13px; background: #f4f3ff; }
.equal-permission-note > span { flex: 0 0 auto; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; color: white; background: var(--primary); font-size: 10px; font-weight: 800; }
.equal-permission-note strong { display: block; font-size: 11px; }
.equal-permission-note p { margin: 4px 0 0; color: #696c91; font-size: 10px; }
.user-directory { padding: 0 14px 14px; }
.user-row { display: grid; grid-template-columns: auto minmax(190px, 1fr) minmax(125px, .35fr) minmax(100px, .25fr) 76px 92px; gap: 14px; align-items: center; padding: 14px 8px; border-top: 1px solid var(--line); }
.user-avatar { width: 38px; height: 38px; border-radius: 11px; }
.user-identity { min-width: 0; }
.user-identity strong, .user-identity small, .user-meta span, .user-meta strong { display: block; }
.user-identity strong { font-size: 11px; }
.user-identity small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.you-badge { margin-left: 5px; padding: 2px 5px; border-radius: 5px; color: var(--primary); background: var(--primary-soft); font-size: 7px; text-transform: uppercase; }
.managed-badge { margin-left: 5px; padding: 2px 5px; border-radius: 5px; color: #126c4d; background: var(--green-soft); font-size: 7px; text-transform: uppercase; }
.user-meta span { color: var(--muted); font-size: 8px; }
.user-meta strong { margin-top: 3px; color: #4f5264; font-size: 9px; }
.account-status { display: inline-flex; gap: 6px; align-items: center; font-size: 9px; font-weight: 700; }
.account-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.account-status.active { color: var(--green); }
.account-status.inactive { color: #9699a8; }
.btn-danger-soft { color: var(--red); background: var(--red-soft); border: 1px solid #f5d8dd; }
.btn:disabled { transform: none; opacity: .5; cursor: not-allowed; }
.user-editor { width: min(570px, 100%); }
.account-form { display: grid; gap: 14px; }
.account-form label > span { display: block; margin-bottom: 6px; color: #5f6376; font-size: 9px; font-weight: 600; }
.password-requirements { margin-top: 13px; padding: 11px 12px; border-radius: 9px; color: #62667a; background: #f7f8fb; font-size: 9px; }
.password-requirements strong, .password-requirements span { display: block; }
.password-requirements span { margin-top: 3px; color: var(--muted); }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .two-column-grid, .upload-layout, .rules-layout { grid-template-columns: 1fr; }
    .validation-guide { order: -1; }
    .login-shell { grid-template-columns: minmax(400px, .9fr) minmax(400px, 1.1fr); }
    .login-proof-grid { grid-template-columns: 1fr; max-width: 420px; gap: 9px; }
    .login-proof-grid > div { padding: 11px 13px; }
    .login-proof-grid strong { margin-top: 5px; }
    .login-proof-grid small { display: none; }
    .audit-row { grid-template-columns: auto minmax(230px, 1fr) minmax(160px, .4fr) 90px; }
    .user-row { grid-template-columns: auto minmax(190px, 1fr) minmax(120px, .5fr) 75px 92px; }
    .user-row .user-meta:nth-of-type(3) { display: none; }
}
@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { position: static; width: 100%; height: auto; padding: 14px; }
    .brand { padding-bottom: 14px; }
    .nav-stack { grid-template-columns: repeat(4, 1fr); overflow-x: auto; }
    .nav-stack a { min-width: 90px; justify-content: center; padding: 9px; }
    .nav-stack a span:last-child { display: none; }
    .sidebar-footer, .topbar { display: none; }
    .page-container { padding: 22px 16px 45px; }
    .heading-with-action { align-items: flex-start; flex-direction: column; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .process-steps { overflow-x: auto; padding: 5px; }
    .step-line { min-width: 24px; }
    .drop-zone { min-height: 300px; padding: 25px; }
    .action-bar, .result-header { align-items: stretch; flex-direction: column; }
    .toolbar, .toolbar.inline { flex-wrap: wrap; }
    .search-box { width: 100%; min-width: 0; }
    .compact-select { flex: 1; min-width: 130px; }
    .form-grid { grid-template-columns: 1fr; }
    .flow-node { width: calc(100% - 30px); }
    .login-shell { display: block; background: white; }
    .login-visual { min-height: auto; }
    .login-visual-inner { min-height: auto; padding: 25px 22px 34px; }
    .login-story { padding: 54px 0 10px; }
    .login-story h1 { margin: 15px 0 13px; font-size: 39px; }
    .login-story > p { font-size: 12px; line-height: 1.6; }
    .login-proof-grid, .login-security-note { display: none; }
    .login-form-side { min-height: auto; padding: 42px 22px 55px; }
    .login-options { align-items: flex-start; flex-direction: column; gap: 8px; }
    .audit-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
    .audit-actor { grid-column: 2; }
    .audit-row time { grid-column: 2; text-align: left; display: flex; gap: 6px; }
    .audit-row time strong, .audit-row time small { display: inline; margin: 0; }
    .user-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .user-row .user-meta { display: none; }
    .user-row .account-status { grid-column: 2; }
    .user-row .btn { grid-column: 3; grid-row: 1 / span 2; }
    .stockflow-grid { border-radius: 0 0 14px 14px; }
    .stockflow-grid .dxbl-grid-search-box { max-width: none; width: 100%; }
}
