:root {
    --navy-950: #07111f;
    --navy-900: #0b1728;
    --navy-800: #13233a;
    --navy-700: #1c3454;
    --blue-600: #1478c9;
    --cyan-500: #18b9cf;
    --cyan-100: #dff7fa;
    --green-600: #15805d;
    --green-100: #dcf5ea;
    --amber-600: #a86609;
    --amber-100: #fff0cd;
    --red-600: #b23838;
    --red-100: #fde8e8;
    --surface: #ffffff;
    --surface-soft: #f5f7fa;
    --surface-muted: #edf1f5;
    --line: #dce3eb;
    --line-strong: #cbd5e1;
    --text: #172235;
    --text-soft: #627086;
    --danger: #b23838;
    --blue-700: #105f9c;
    --blue-100: #e1f1fb;
    --green-700: #116849;
    --shadow: 0 12px 32px rgba(15, 31, 51, .08);
    --sidebar-width: 252px;
    color-scheme: light;
}

html[data-theme="dark"] {
    --surface: #111b2b;
    --surface-soft: #0b1422;
    --surface-muted: #19263a;
    --line: #2b3b51;
    --line-strong: #3b4d66;
    --text: #edf4fc;
    --text-soft: #9fb0c6;
    --shadow: 0 12px 32px rgba(0, 0, 0, .24);
    color-scheme: dark;
}

/* Project management module */
.module-card-projects .module-card-icon,
.project-kpi-icon-violet {
    color: #a98cff;
    background: color-mix(in srgb, #7144dd 24%, var(--surface));
}

.project-page-heading {
    max-width: none;
}

.project-kpi-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.project-kpi-strip > div {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.project-kpi-strip > div > span:last-child {
    display: grid;
}

.project-kpi-strip strong {
    font-size: 16px;
}

.project-kpi-strip small {
    color: var(--text-soft);
    font-size: 11px;
}

.project-kpi-icon,
.project-document-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    color: var(--blue-600);
    background: var(--blue-100);
    border-radius: 7px;
}

.project-kpi-icon-green {
    color: var(--green-600);
    background: var(--green-100);
}

.project-filter {
    margin-bottom: 22px;
}

.project-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.project-list-card {
    position: relative;
    min-width: 0;
    padding: 20px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: var(--shadow);
}

.project-card-top,
.project-card-actions,
.rack-panel-heading,
.rack-sheet-head,
.rack-frame-cap,
.rack-sheet-foot,
.equipment-admin-card,
.equipment-admin-copy > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-number,
.equipment-type,
.equipment-native {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 780;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.project-rack-mini {
    position: relative;
    display: grid;
    gap: 3px;
    height: 64px;
    margin: 18px 0;
    padding: 8px 22px;
    background: #0a111c;
    border: 5px solid #344156;
    border-radius: 5px;
}

.project-rack-mini span {
    background: linear-gradient(90deg, #1d2939, #657083 45%, #1d2939);
    border: 1px solid #788497;
    border-radius: 1px;
}

.project-rack-mini strong {
    position: absolute;
    right: 8px;
    bottom: 5px;
    padding: 2px 5px;
    color: #dce7f5;
    background: rgba(5, 11, 20, .86);
    border-radius: 3px;
    font-size: 9px;
}

.project-list-card h2 {
    margin: 0 0 8px;
    overflow: hidden;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-list-card > p {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 18px;
    overflow: hidden;
    color: var(--text-soft);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-list-card > p svg {
    width: 14px;
    height: 14px;
}

.project-card-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 0 0 18px;
    padding: 13px 0;
    border-block: 1px solid var(--line);
}

.project-card-stats div {
    display: grid;
    gap: 3px;
    padding-inline: 10px;
    border-right: 1px solid var(--line);
}

.project-card-stats div:first-child { padding-left: 0; }
.project-card-stats div:last-child { padding-right: 0; border-right: 0; }
.project-card-stats dt { color: var(--text-soft); font-size: 9px; text-transform: uppercase; }
.project-card-stats dd { margin: 0; font-size: 11px; font-weight: 700; }
.project-card-actions { justify-content: flex-end; }
.project-card-actions .portal-secondary { min-height: 38px; padding-inline: 13px; font-size: 11px; }
.project-empty { min-height: 330px; }

.project-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, .7fr);
    gap: 20px;
    margin-bottom: 20px;
}

.project-detail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-notes {
    margin-top: 20px;
    padding: 16px;
    background: var(--surface-soft);
    border-radius: 7px;
}

.project-notes p { margin: 6px 0 0; color: var(--text-soft); white-space: pre-line; }
.project-document-card { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.project-document-card h2 { margin: 18px 0 8px; font-size: 18px; }
.project-document-card p { margin: 0 0 18px; color: var(--text-soft); font-size: 12px; }
.project-document-card small { margin-top: 10px; color: var(--text-soft); }
.project-bom-card { margin-bottom: 20px; }
.project-bom-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; }
.project-bom-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px; background: var(--surface-soft); border-radius: 5px; font-size: 12px; }

.main-content.main-content-rack-editor {
    width: 100%;
    max-width: none;
    padding: 22px clamp(12px, 1.25vw, 24px) 44px;
}

.rack-editor-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.rack-editor-heading h1 { margin: 8px 0 3px; font-size: 25px; }
.rack-editor-heading p { margin: 0; color: var(--text-soft); font-size: 12px; }
.project-back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-soft); font-size: 11px; font-weight: 700; text-decoration: none; }
.project-back-link svg { width: 14px; height: 14px; }

.rack-project-fields {
    display: grid;
    grid-template-columns: 1.2fr 1.35fr .76fr .48fr .52fr;
    gap: 12px;
    margin-bottom: 16px;
    padding: 15px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.rack-project-fields .form-field { gap: 5px; }
.rack-project-fields input,
.rack-project-fields select { min-height: 39px; }

.rack-editor-grid {
    display: grid;
    grid-template-columns: minmax(270px, .72fr) minmax(600px, 2.25fr) minmax(270px, .76fr);
    align-items: start;
    gap: clamp(12px, 1vw, 18px);
}

.rack-catalog-panel,
.rack-summary-panel,
.rack-canvas-panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.rack-catalog-panel,
.rack-summary-panel { position: sticky; top: 16px; padding: 15px; }
.rack-panel-heading { margin-bottom: 13px; }
.rack-panel-heading > div { display: grid; }
.rack-panel-heading span { color: var(--text-soft); font-size: 9px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.rack-panel-heading h2 { margin: 1px 0 0; font-size: 15px; }
.rack-panel-heading .rack-count { display: grid; place-items: center; width: 28px; height: 28px; color: #835eff; background: color-mix(in srgb, #7144dd 14%, var(--surface)); border-radius: 50%; font-size: 10px; }

.rack-catalog-search { position: relative; margin-bottom: 10px; }
.rack-catalog-search svg { position: absolute; top: 11px; left: 10px; width: 14px; height: 14px; color: var(--text-soft); }
.rack-catalog-search input { width: 100%; min-height: 37px; padding: 7px 9px 7px 31px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; color: var(--text); font-size: 11px; }
.rack-catalog-list { display: grid; gap: 8px; max-height: calc(100vh - 310px); overflow: auto; padding-right: 3px; }
.rack-catalog-item { padding: 10px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; cursor: grab; transition: border-color .15s ease, transform .15s ease; }
.rack-catalog-item:hover { border-color: #8b6be5; transform: translateY(-1px); }
.rack-catalog-item > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
.rack-catalog-item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rack-catalog-item > div:first-child span { flex: 0 0 auto; color: #8d6ee5; font-size: 9px; font-weight: 800; }
.rack-catalog-item > small { display: block; margin: 2px 0 8px; overflow: hidden; color: var(--text-soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.rack-catalog-preview { height: 29px; }
.rack-help { margin: 12px 0 0; color: var(--text-soft); font-size: 9px; line-height: 1.45; }

.rack-canvas-panel { overflow: hidden; }
.rack-sheet-head { padding: 13px 16px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.rack-sheet-head > div { display: grid; min-width: 0; }
.rack-sheet-head > div:last-child { text-align: right; }
.rack-sheet-head span { color: var(--text-soft); font-size: 9px; }
.rack-sheet-head strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.rack-stage { min-height: 520px; padding: clamp(14px, 1.4vw, 22px); overflow: auto; background: radial-gradient(circle at 50% 0, color-mix(in srgb, #7756e1 8%, var(--surface-soft)), var(--surface-soft) 56%); }
.rack-frame { width: min(100%, 680px); min-width: 620px; margin: 0 auto; padding: 10px; background: linear-gradient(100deg, #313b4a, #687485 48%, #293342); border: 1px solid #8a95a3; border-radius: 5px; box-shadow: 0 18px 34px rgba(4, 12, 22, .22), inset 0 1px rgba(255,255,255,.18); }
.rack-frame.rack-color-gray { background: linear-gradient(100deg, #737d88, #a4abb3 48%, #68727e); border-color: #bbc2ca; }
.rack-frame.rack-color-gray .rack-grid { background: #5b636e; border-color: #9ba4ae; }
.rack-frame.rack-color-gray .rack-unit-slot { border-bottom-color: #7d8793; }
.rack-frame.rack-color-gray .rack-unit-slot > span { color: #e1e6ec; }
.rack-frame-cap { padding: 2px 5px 8px; color: #eef3fa; font-size: 9px; letter-spacing: .08em; }
.rack-grid { position: relative; overflow: hidden; background: #080d14; border: 1px solid #111a27; }
.rack-unit-slot { position: absolute; right: 0; left: 0; border-bottom: 1px solid #273342; transition: background .12s ease; }
.rack-unit-slot::before,
.rack-unit-slot::after { position: absolute; top: 24%; width: 5px; height: 52%; content: ""; background: radial-gradient(circle, #05080c 0 35%, #9aa4b0 38% 52%, #323b48 55%); background-size: 5px 9px; }
.rack-unit-slot::before { left: 5px; }
.rack-unit-slot::after { right: 5px; }
.rack-unit-slot > span { position: absolute; top: 2px; left: 13px; color: #607087; font-size: 7px; }
.rack-unit-slot.drag-over { background: rgba(72, 128, 241, .18); box-shadow: inset 0 0 0 1px #5792ff; }
.rack-placed-device { position: absolute; right: 22px; left: 22px; z-index: 2; min-height: 17px; cursor: grab; }
.rack-placed-device.is-dragging { opacity: .35; }
.rack-device-actions { position: absolute; top: 50%; right: 6px; z-index: 3; display: flex; gap: 3px; opacity: 0; transform: translateY(-50%); transition: opacity .15s ease; }
.rack-placed-device:hover .rack-device-actions { opacity: 1; }
.rack-device-actions button { display: grid; place-items: center; width: 23px; height: 23px; padding: 0; color: #dce6f3; background: rgba(6, 13, 23, .88); border: 1px solid #536075; border-radius: 4px; }
.rack-device-actions button.is-remove { color: #ff9a9a; }
.rack-device-actions svg { width: 12px; height: 12px; }
.rack-sheet-foot { padding: 10px 15px; color: var(--text-soft); background: var(--surface-soft); border-top: 1px solid var(--line); font-size: 9px; }
.rack-sheet-foot button { padding: 0; color: var(--danger); background: transparent; border: 0; font-size: 10px; font-weight: 700; }

.rack-device-face { position: relative; display: grid; grid-template-columns: 11px minmax(0, 1fr) 11px; width: 100%; height: 100%; min-height: 23px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--device-body) 65%, #c5cfda); border-radius: 2px; box-shadow: inset 0 1px rgba(255,255,255,.13), inset 0 -5px 10px rgba(0,0,0,.17); }
.device-ear { position: relative; background: color-mix(in srgb, var(--device-body) 70%, #8994a3); }
.device-ear::before,
.device-ear::after { position: absolute; left: 50%; width: 4px; height: 4px; content: ""; background: #111820; border: 1px solid #8792a0; border-radius: 50%; transform: translateX(-50%); }
.device-ear::before { top: 3px; }
.device-ear::after { bottom: 3px; }
.device-face-body { position: relative; min-width: 0; padding: 4px 31px 3px 7px; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--device-body) 82%, #fff), var(--device-body)); }
.device-face-label { position: absolute; top: 3px; left: 6px; z-index: 1; max-width: 31%; overflow: hidden; color: color-mix(in srgb, var(--device-body) 15%, white); font-size: 7px; font-weight: 800; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.device-face-visual { display: flex; align-content: center; align-items: center; justify-content: center; gap: 2px; width: 72%; height: 100%; min-height: 15px; margin: auto; overflow: hidden; }
.face-switch .device-face-body { padding-right: 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--device-body) 72%, #fff), color-mix(in srgb, var(--device-body) 94%, #aab4c0)); }
.face-switch .device-face-label { left: 31px; max-width: 22%; color: color-mix(in srgb, var(--device-body) 30%, #26313e); }
.face-switch .device-face-spec { color: color-mix(in srgb, var(--device-body) 35%, #1d2835); }
.face-switch .device-face-visual,
.face-patch .device-face-visual { width: 100%; min-height: 17px; margin: 0; }
.switch-face-layout { display: grid; align-items: center; justify-content: stretch; gap: 3px; }
.switch-layout-24 { grid-template-columns: minmax(46px, .9fr) minmax(262px, 1.25fr) 18px; padding-left: 2px; }
.switch-layout-48 { grid-template-columns: 18px minmax(525px, 1fr) 34px; }
.switch-control-block { position: relative; display: grid; grid-template-columns: repeat(2, 3px); grid-template-rows: repeat(2, 3px); place-content: center; gap: 2px; width: 17px; height: 15px; justify-self: start; background: #111923; border: 1px solid #606b79; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.switch-control-block::before { position: absolute; top: 2px; left: 2px; width: 4px; height: 4px; content: ""; border: 1px solid #8290a0; border-radius: 50%; }
.switch-control-block i { width: 2px; height: 2px; background: #728092; border-radius: 50%; }
.switch-control-block i:first-child { background: #59d791; box-shadow: 0 0 2px #59d791; }
.device-port-bank { --device-port-width: 19px; display: grid; grid-template-columns: repeat(var(--port-columns), var(--device-port-width)); align-content: center; justify-content: center; min-width: 0; }
.switch-port-bank { grid-template-rows: repeat(2, 13px); gap: 4px 3px; height: 30px; }
.rack-port { position: relative; display: block; min-width: 0; min-height: 0; background: #111922; border: 1px solid #697484; border-radius: 1px; box-shadow: inset 0 2px #232e3b; }
.switch-port::before { position: absolute; right: 18%; bottom: 1px; left: 18%; height: 2px; content: ""; background: #010407; }
.switch-port::after { position: absolute; top: -2px; right: 0; width: 2px; height: 2px; content: ""; background: #738091; border-radius: 50%; }
.switch-port.is-active::after { background: #4dde91; box-shadow: 0 0 3px #4dde91; }
.device-uplink-bank { display: grid; grid-template-columns: repeat(2, 15px); grid-template-rows: repeat(2, 15px); align-content: center; justify-content: center; gap: 3px; min-width: 0; }
.device-uplink-bank.uplink-bank-pair { grid-template-columns: 15px; }
.rack-uplink { display: block; min-width: 0; min-height: 0; background: #070c12; border: 1px solid var(--device-accent); border-radius: 1px; box-shadow: inset 0 0 0 1px #1d2834; }
.patch-face-layout { padding: 1px 10px; }
.patch-port-bank { width: 100%; gap: 2px 3px; }
.patch-layout-24 .patch-port-bank { grid-template-rows: 14px; height: 16px; align-content: center; }
.patch-layout-48 .patch-port-bank { grid-template-rows: repeat(2, 14px); height: 30px; gap: 2px 3px; }
.patch-port { background: #05090d; border-color: #7b8794; box-shadow: inset 0 2px #1b242d, 0 -2px rgba(235,240,246,.12); }
.patch-port::before { position: absolute; top: -2px; right: 5%; left: 5%; height: 1px; content: ""; background: #aeb7c1; opacity: .75; }
.patch-port.is-group-end { margin-right: 0; }
.cable-guide { display: block; width: 14%; height: 64%; background: #121923; border: 2px solid var(--device-accent); border-block-width: 1px; border-radius: 2px; }
.rack-vent { display: block; width: 8px; height: 4px; background: #080d13; border: 1px solid color-mix(in srgb, var(--device-accent) 55%, #2e3947); border-radius: 5px; }
.face-vented .device-face-visual { flex-wrap: wrap; gap: 2px 5px; }
.solid-panel-line { display: block; width: 78%; height: 1px; background: color-mix(in srgb, var(--device-accent) 50%, transparent); box-shadow: 0 5px rgba(0,0,0,.25); }
.server-bay { display: block; width: 9%; height: 62%; background: #111820; border: 1px solid #526174; border-radius: 2px; }
.ups-display { display: block; width: 24px; height: 12px; flex: 0 0 auto; background: #071a20; border: 1px solid var(--device-accent); border-radius: 2px; box-shadow: inset 0 0 5px var(--device-accent); }
.face-firewall,
.face-recorder { background: transparent; border-color: transparent; box-shadow: none; }
.face-firewall .device-ear,
.face-recorder .device-ear { background: transparent; }
.face-firewall .device-ear::before,
.face-firewall .device-ear::after,
.face-recorder .device-ear::before,
.face-recorder .device-ear::after { display: none; }
.face-firewall .device-face-body,
.face-recorder .device-face-body { padding: 0; background: transparent; }
.face-firewall .device-face-label,
.face-recorder .device-face-label { left: 8.2%; max-width: 26%; }
.face-firewall .device-face-label { color: #3b4654; }
.face-firewall .device-face-spec { right: 8.2%; color: #46515e; }
.face-recorder .device-face-spec { right: 8.2%; }
.compact-appliance-layout { width: 86%; min-height: 0; margin: 0 auto; }
.firewall-chassis,
.recorder-chassis { position: relative; display: block; width: 100%; height: 76%; overflow: hidden; border-radius: 2px; box-shadow: 0 2px 3px rgba(2,8,15,.35), inset 0 1px rgba(255,255,255,.25); }
.firewall-chassis { background: linear-gradient(#fbfbfc, #d7dbe0); border: 1px solid #b5bbc3; }
.firewall-brand { position: absolute; top: 45%; left: 3%; color: #3b424b; font-size: 6px; letter-spacing: .08em; }
.firewall-brand::before { color: #d34c3f; content: "FW "; }
.firewall-status { position: absolute; top: 42%; left: 42%; display: flex; gap: 4px; }
.firewall-status i { display: block; width: 3px; height: 3px; background: #39b875; border-radius: 50%; box-shadow: 0 0 2px #39b875; }
.firewall-ports { position: absolute; top: 27%; right: 3%; display: flex; gap: 3px; }
.firewall-ports i { display: block; width: 17px; height: 16px; background: #121a22; border: 1px solid #737e89; border-radius: 1px; box-shadow: inset 0 3px #293641; }
.recorder-chassis { background: linear-gradient(#22272c, #090b0e); border: 1px solid #343b43; }
.recorder-front-line { position: absolute; top: 31%; right: 2%; left: 2%; height: 1px; background: #464d55; box-shadow: 0 5px #0a0c0f; }
.recorder-leds { position: absolute; top: 35%; right: 15%; display: flex; gap: 8px; }
.recorder-leds i { display: block; width: 2px; height: 2px; background: #9aa2a9; border-radius: 50%; }
.recorder-leds i:first-child { background: #5ac07c; box-shadow: 0 0 2px #5ac07c; }
.recorder-usb { position: absolute; right: 4%; bottom: 18%; width: 13px; height: 6px; background: #050608; border: 1px solid #69727b; border-radius: 1px; }
.face-shelf .device-face-label,
.face-power_strip .device-face-label { color: #dce3ea; }
.face-power_strip { border-color: #46505b; }
.face-shelf .device-face-visual,
.face-power_strip .device-face-visual { width: 94%; }
.rack-shelf-tray { position: relative; display: block; width: 90%; height: 66%; background: linear-gradient(155deg, #333940 0 56%, #171b20 57%); border: 1px solid #0d1014; border-top-color: #616a74; box-shadow: inset 0 5px 8px rgba(255,255,255,.05); transform: perspective(170px) rotateX(9deg); }
.rack-shelf-tray i:first-child { position: absolute; right: 0; bottom: 0; left: 0; height: 4px; background: #11151a; border-top: 1px solid #68717b; }
.rack-shelf-tray i:last-child { position: absolute; top: 4px; right: 5%; left: 5%; height: 1px; background: rgba(255,255,255,.08); }
.power-strip-chassis { display: flex; align-items: center; justify-content: center; gap: 10px; width: 96%; height: 55%; padding: 2px 10px; background: linear-gradient(#2a2f35, #101318); border: 1px solid #07090c; border-radius: 2px; box-shadow: inset 0 1px #59616a; }
.power-rocker { width: 11px; height: 14px; flex: 0 0 auto; background: #bd282f; border: 1px solid #61151a; border-radius: 2px; box-shadow: inset 0 2px rgba(255,255,255,.25); }
.power-outlet { position: relative; display: block; width: 32px; height: 19px; flex: 0 0 auto; background: #080a0d; border: 1px solid #394149; border-radius: 3px; box-shadow: inset 0 0 0 2px #171b20; }
.power-outlet i { position: absolute; top: 5px; width: 4px; height: 7px; background: #010203; border-radius: 3px; transform: rotate(12deg); }
.power-outlet i:first-child { left: 7px; }
.power-outlet i:nth-child(2) { right: 7px; transform: rotate(-12deg); }
.power-outlet i:last-child { top: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; transform: none; }

.face-unas_pro,
.face-udm_pro,
.face-unvr { border-color: color-mix(in srgb, var(--device-body) 62%, #8793a1); }
.face-unas_pro .device-ear,
.face-udm_pro .device-ear,
.face-unvr .device-ear { background: var(--device-body); border-inline: 1px solid color-mix(in srgb, var(--device-body) 67%, #7d8895); }
.face-unas_pro .device-ear::before,
.face-unas_pro .device-ear::after,
.face-udm_pro .device-ear::before,
.face-unvr .device-ear::before { width: 5px; height: 9px; background: #46515d; border-color: #9aa5b1; border-radius: 5px; }
.face-udm_pro .device-ear::after,
.face-unvr .device-ear::after { display: none; }
.face-udm_pro .device-ear::before,
.face-unvr .device-ear::before { top: 50%; transform: translate(-50%, -50%); }
.face-unas_pro .device-face-body,
.face-udm_pro .device-face-body,
.face-unvr .device-face-body { padding: 3px 9px; background: linear-gradient(180deg, color-mix(in srgb, var(--device-body) 72%, #fff), color-mix(in srgb, var(--device-body) 94%, #aab4c0)); }
.face-unas_pro .device-face-label,
.face-udm_pro .device-face-label,
.face-unvr .device-face-label { left: 7px; max-width: 24%; color: #33404e; }
.face-unas_pro .device-face-spec,
.face-udm_pro .device-face-spec,
.face-unvr .device-face-spec { color: #46515e; }
.face-unas_pro .device-face-visual,
.face-udm_pro .device-face-visual,
.face-unvr .device-face-visual { width: 100%; min-height: 0; margin: 0; }

.unifi-storage-face-layout { position: relative; display: block; padding: 12px 28px 5px; }
.unifi-touchscreen { position: relative; display: block; width: 18px; height: 20px; align-self: center; background: #101821; border: 1px solid #6b7683; border-radius: 2px; box-shadow: inset 0 0 0 1px #26323e; }
.unifi-touchscreen::before { position: absolute; top: 3px; left: 3px; width: 4px; height: 4px; content: ""; background: #4487db; border-radius: 50%; box-shadow: 0 0 3px #4487db; }
.unifi-storage-face-layout > .unifi-touchscreen { position: absolute; top: 14%; left: 2.5%; z-index: 2; height: 34%; }
.unifi-seven-bays { position: absolute; top: 14%; right: 2.5%; bottom: 8%; left: 2.5%; display: block; height: auto; }
.unifi-seven-bays i { position: absolute; display: block; height: 43%; background: linear-gradient(#d0d4d9, #bcc2c9); border: 1px solid #939ca6; border-radius: 2px; box-shadow: inset 0 2px rgba(255,255,255,.32), inset 0 -2px rgba(91,101,112,.18); }
.unifi-seven-bays i:nth-child(1) { top: 0; left: 7%; width: 24%; }
.unifi-seven-bays i:nth-child(2) { top: 0; left: 32.3%; width: 24%; }
.unifi-seven-bays i:nth-child(3) { top: 0; left: 57.6%; width: 24%; }
.unifi-seven-bays i:nth-child(4) { bottom: 0; left: 0; width: 24%; }
.unifi-seven-bays i:nth-child(5) { bottom: 0; left: 25.3%; width: 24%; }
.unifi-seven-bays i:nth-child(6) { right: 25.3%; bottom: 0; width: 24%; }
.unifi-seven-bays i:nth-child(7) { right: 0; bottom: 0; width: 24%; }
.unifi-storage-interfaces { position: absolute; top: 14%; right: 2.5%; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 4px; height: 34%; }
.unifi-storage-interfaces i { display: block; width: 12px; height: 11px; background: #111923; border: 1px solid #6d7885; border-radius: 1px; box-shadow: inset 0 2px #273440; }
.unifi-storage-interfaces i:last-child { width: 13px; height: 13px; border-color: var(--device-accent); }

.udm-pro-face-layout { display: grid; grid-template-columns: 20px minmax(50px, 1fr) 98px 58px 14px 31px; align-items: center; gap: 8px; padding: 8px 24px 3px; }
.udm-vent-line { display: block; height: 2px; background: #8f98a2; border-radius: 2px; box-shadow: 22px 0 #8f98a2, 44px 0 #8f98a2; }
.udm-drive-bay { display: block; height: 25px; background: linear-gradient(#d5d9de, #c0c6cd); border: 1px solid #9ca5af; border-radius: 2px; box-shadow: inset 0 2px rgba(255,255,255,.35); }
.udm-network-bank { display: grid; grid-template-columns: repeat(4, 12px); grid-template-rows: repeat(2, 10px); gap: 3px; }
.udm-network-bank i,
.udm-wan-port { display: block; background: #111923; border: 1px solid #6e7986; border-radius: 1px; box-shadow: inset 0 2px #293541; }
.udm-wan-port { width: 13px; height: 13px; }
.udm-sfp-bank { display: grid; grid-template-columns: repeat(2, 13px); gap: 3px; }
.udm-sfp-bank i { display: block; width: 13px; height: 13px; background: #080e15; border: 1px solid var(--device-accent); border-radius: 1px; }

.unvr-face-layout { position: relative; display: block; padding: 0; }
.unvr-status { position: absolute; top: 12%; left: 2.5%; z-index: 2; display: block; width: 14px; height: 3px; background: #43a8dc; border-radius: 3px; box-shadow: 0 0 3px #43a8dc; }
.unvr-four-bays { position: absolute; top: 20%; right: 2.5%; bottom: 12%; left: 2.5%; display: block; height: auto; }
.unvr-four-bays i { position: absolute; top: 0; bottom: 0; display: block; width: 24%; background: linear-gradient(#d5d9de, #bcc2c9); border: 1px solid #929ca7; border-radius: 2px; box-shadow: inset 0 2px rgba(255,255,255,.33); }
.unvr-four-bays i:nth-child(1) { left: 0; }
.unvr-four-bays i:nth-child(2) { left: 25.3%; }
.unvr-four-bays i:nth-child(3) { right: 25.3%; }
.unvr-four-bays i:nth-child(4) { right: 0; }
.unvr-reset { position: absolute; top: 50%; right: 2.5%; z-index: 2; display: block; width: 4px; height: 4px; background: #707b86; border-radius: 50%; }

.device-face-spec { position: absolute; right: 6px; bottom: 3px; color: color-mix(in srgb, var(--device-body) 12%, white); font-size: 6px; font-weight: 800; }
.rack-device-face.is-compact .device-face-label { display: none; }
.rack-device-face.is-compact .device-face-body { padding: 2px 5px; }
.rack-device-face.is-compact .device-face-spec { display: none; }
.rack-device-face.is-compact .device-face-visual { width: 90%; }
.rack-device-face.is-compact.face-switch .device-face-visual,
.rack-device-face.is-compact.face-patch .device-face-visual { width: 100%; }
.rack-device-face.is-compact .switch-face-layout { gap: 3px; }
.rack-device-face.is-compact .switch-layout-24 { grid-template-columns: minmax(22px, .55fr) minmax(0, 1.45fr) 15px; }
.rack-device-face.is-compact .switch-layout-48 { grid-template-columns: 14px minmax(0, 1fr) 25px; }
.rack-device-face.is-compact .switch-control-block { width: 11px; height: 11px; grid-template-columns: repeat(2, 2px); grid-template-rows: repeat(2, 2px); gap: 1px; }
.rack-device-face.is-compact .switch-control-block::before { display: none; }
.rack-device-face.is-compact .device-port-bank { --device-port-width: 9px; }
.rack-device-face.is-compact .switch-port-bank { grid-template-rows: repeat(2, 6px); height: 14px; gap: 2px 1px; }
.rack-device-face.is-compact .device-uplink-bank { grid-template-columns: repeat(2, 7px); grid-template-rows: repeat(2, 7px); gap: 1px; }
.rack-device-face.is-compact .device-uplink-bank.uplink-bank-pair { grid-template-columns: 7px; }
.rack-device-face.is-compact .patch-face-layout { padding: 1px 5px; }
.rack-device-face.is-compact .patch-port-bank { gap: 1px; }
.rack-device-face.is-compact .patch-layout-24 .patch-port-bank { grid-template-rows: 7px; height: 9px; }
.rack-device-face.is-compact .patch-layout-48 .patch-port-bank { grid-template-rows: repeat(2, 7px); height: 15px; }
.rack-device-face.is-compact .compact-appliance-layout { width: 88%; }
.rack-device-face.is-compact .firewall-chassis,
.rack-device-face.is-compact .recorder-chassis { height: 82%; }
.rack-device-face.is-compact .firewall-brand { display: none; }
.rack-device-face.is-compact .firewall-status { left: 17%; }
.rack-device-face.is-compact .firewall-ports i { width: 7px; height: 8px; }
.rack-device-face.is-compact .power-strip-chassis { gap: 3px; padding: 1px 3px; }
.rack-device-face.is-compact .power-rocker { width: 5px; height: 8px; }
.rack-device-face.is-compact .power-outlet { width: 12px; height: 9px; }
.rack-device-face.is-compact .power-outlet i { display: none; }
.rack-device-face.is-compact .unifi-storage-face-layout { padding: 3px 5px; }
.rack-device-face.is-compact .unifi-touchscreen { width: 8px; height: 9px; }
.rack-device-face.is-compact .unifi-touchscreen::before { top: 2px; left: 2px; width: 2px; height: 2px; }
.rack-device-face.is-compact .unifi-seven-bays { gap: 1px; }
.rack-device-face.is-compact .unifi-storage-interfaces { gap: 1px; }
.rack-device-face.is-compact .unifi-storage-interfaces i,
.rack-device-face.is-compact .unifi-storage-interfaces i:last-child { width: 5px; height: 5px; }
.rack-device-face.is-compact .udm-pro-face-layout { grid-template-columns: 8px minmax(8px, 1fr) 24px 24px 5px 10px; gap: 2px; padding: 3px 5px; }
.rack-device-face.is-compact .udm-drive-bay { height: 9px; }
.rack-device-face.is-compact .udm-network-bank { grid-template-columns: repeat(4, 5px); grid-template-rows: repeat(2, 4px); gap: 1px; }
.rack-device-face.is-compact .udm-wan-port { width: 5px; height: 5px; }
.rack-device-face.is-compact .udm-sfp-bank { grid-template-columns: repeat(2, 4px); gap: 1px; }
.rack-device-face.is-compact .udm-sfp-bank i { width: 4px; height: 5px; }
.rack-device-face.is-compact .unvr-face-layout { padding: 0; }

.face-switch-standard .device-ear {
    background: var(--device-body);
    border-inline: 1px solid color-mix(in srgb, var(--device-body) 68%, #7d8895);
}

.face-switch-standard .device-ear::before,
.face-switch-standard .device-ear::after {
    width: 5px;
    height: 9px;
    background: #46515d;
    border-color: #9aa5b1;
    border-radius: 5px;
}

.face-switch-compact {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.face-switch-compact .device-ear {
    background: transparent;
}

.face-switch-compact .device-ear::before,
.face-switch-compact .device-ear::after {
    display: none;
}

.face-switch-compact .device-face-body {
    padding: 0;
    background: transparent;
}

.face-switch-compact .device-face-label {
    top: 5px;
    left: 29%;
    max-width: 22%;
    color: #34404e;
}

.face-switch-compact .device-face-spec {
    right: 8.8%;
    bottom: 5px;
    color: #46515e;
}

.face-switch-compact .device-face-visual {
    width: 66%;
    min-height: 0;
    margin: 0 7% 0 auto;
}

.switch-layout-compact {
    grid-template-columns: 17px max-content 15px;
    justify-content: center;
    gap: 7px;
    height: 76%;
    padding: 0 14px;
    background: linear-gradient(#fbfbfc, #d7dbe0);
    border: 1px solid #b5bbc3;
    border-radius: 2px;
    box-shadow: 0 2px 3px rgba(2,8,15,.35), inset 0 1px rgba(255,255,255,.25);
}

.switch-compact-8 .switch-port-bank {
    grid-template-rows: 13px;
    height: 13px;
}

.rack-device-face.is-compact.face-switch-compact .device-face-body {
    padding: 0;
}

.rack-device-face.is-compact.face-switch-compact .device-face-visual {
    width: 66%;
    margin: 0 7% 0 auto;
}

.rack-device-face.is-compact .switch-layout-compact {
    grid-template-columns: 11px max-content 7px;
    gap: 3px;
    height: 82%;
    padding: 0 5px;
}

.rack-device-face.is-compact .switch-compact-8 .switch-port-bank {
    grid-template-rows: 6px;
    height: 6px;
}

.rack-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.rack-stat-grid > div { display: grid; padding: 11px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; }
.rack-stat-grid strong { font-size: 16px; }
.rack-stat-grid span { color: var(--text-soft); font-size: 8px; text-transform: uppercase; }
.rack-bom { margin-top: 17px; }
.rack-bom h3 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; }
.rack-bom > div { display: grid; gap: 5px; max-height: 190px; overflow: auto; }
.rack-bom > div > div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; background: var(--surface-soft); border-radius: 4px; font-size: 9px; }
.rack-notes-field { margin-top: 17px; }
.rack-notes-field textarea { resize: vertical; }

.equipment-catalog-admin { display: grid; gap: 10px; }
.equipment-admin-card { padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.equipment-face-preview { width: 280px; height: 38px; flex: 0 0 auto; }
.equipment-admin-copy { min-width: 0; flex: 1; }
.equipment-admin-copy > div { justify-content: flex-start; }
.equipment-native { padding: 2px 6px; color: #7050cf; background: color-mix(in srgb, #7652de 12%, var(--surface)); border-radius: 3px; }
.equipment-admin-copy h2 { margin: 4px 0 2px; font-size: 14px; }
.equipment-admin-copy p { margin: 0; color: var(--text-soft); font-size: 11px; }
.equipment-admin-copy > small { color: var(--text-soft); font-size: 9px; }

.equipment-builder { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 20px; align-items: start; }
.equipment-builder-fields { min-width: 0; }
.equipment-visual-heading { margin-top: 28px; }
.color-field input[type="color"] { width: 100%; height: 44px; padding: 4px; }
.equipment-builder-preview { position: sticky; top: 16px; min-height: 310px; }
.equipment-preview-rack { margin: 22px 0; padding: 14px; background: #0a111b; border: 8px solid #4d5969; border-radius: 5px; }
.equipment-preview-rack > span { display: block; margin-bottom: 8px; color: #9aa7b7; font-size: 9px; text-align: center; }
.equipment-preview-rack [data-builder-preview] { height: 58px; }
.equipment-preview-meta { display: grid; }
.equipment-preview-meta strong { font-size: 14px; }
.equipment-preview-meta small,
.equipment-builder-preview > p { color: var(--text-soft); font-size: 10px; }
.equipment-builder-actions { grid-column: 1 / -1; }

@media (min-width: 1180px) {
    .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .module-admin-section .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1450px) {
    .rack-editor-grid { grid-template-columns: 230px minmax(430px, 1fr); }
    .rack-summary-panel { position: static; grid-column: 1 / -1; }
    .rack-summary-panel { display: grid; grid-template-columns: 180px 1fr 1fr; gap: 14px; align-items: start; }
    .rack-summary-panel .rack-panel-heading { grid-column: 1 / -1; }
}

@media (max-width: 1020px) {
    .project-card-grid,
    .project-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rack-project-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rack-editor-grid { grid-template-columns: 1fr; }
    .rack-catalog-panel,
    .rack-summary-panel { position: static; }
    .rack-summary-panel { display: block; grid-column: auto; }
    .rack-catalog-list { max-height: 330px; }
    .equipment-builder { grid-template-columns: 1fr; }
    .equipment-builder-preview { position: static; }
}

@media (max-width: 620px) {
    .rack-editor-heading { align-items: flex-start; flex-direction: column; }
    .rack-project-fields,
    .project-card-grid,
    .project-kpi-strip,
    .project-detail-grid,
    .project-detail-list,
    .project-bom-list { grid-template-columns: 1fr; }
    .rack-stage { padding: 12px; }
    .rack-frame { min-width: 360px; }
    .equipment-admin-card { align-items: flex-start; flex-wrap: wrap; }
    .equipment-face-preview { width: 100%; }
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--surface-soft);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

svg {
    width: 19px;
    height: 19px;
    stroke-width: 1.8;
}

.auth-body {
    background: #02060d;
}

.auth-shell {
    position: relative;
    min-height: 100svh;
    isolation: isolate;
}

.auth-panel {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 100svh;
    min-width: 0;
    padding: 24px 20px;
}

.auth-panel-stage {
    position: relative;
    width: min(100%, 446px);
}

.auth-panel-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 24px 26px 26px;
    overflow: hidden;
    color: #f5f9ff;
    background: rgba(2, 10, 24, .72);
    border: 1px solid rgba(89, 215, 247, .48);
    border-radius: 8px;
    box-shadow:
        0 0 0 1px rgba(58, 149, 220, .08),
        0 0 28px rgba(42, 185, 235, .14),
        0 26px 72px rgba(0, 0, 0, .58),
        inset 0 1px 0 rgba(255, 255, 255, .1),
        inset 0 0 28px rgba(24, 139, 204, .055);
    backdrop-filter: blur(22px) saturate(132%);
}

.auth-panel-inner::before {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 2;
    width: 76px;
    height: 2px;
    content: "";
    background: #49c7ef;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 0 8px rgba(73, 199, 239, .9), 0 0 24px rgba(73, 199, 239, .74);
    transform: translateX(-50%);
    animation: auth-neon-line 3.8s ease-in-out infinite;
}

.auth-panel-inner::after {
    position: absolute;
    z-index: 0;
    inset: 7px;
    content: "";
    border: 1px solid rgba(97, 210, 244, .09);
    border-radius: 5px;
    box-shadow: inset 0 0 22px rgba(43, 178, 229, .045);
    pointer-events: none;
}

.auth-panel-inner > * {
    position: relative;
    z-index: 1;
}

.auth-brand,
.sidebar-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    width: fit-content;
    text-decoration: none;
}

.brand-name {
    color: var(--navy-950);
    font-size: 26px;
    font-weight: 760;
}

html[data-theme="dark"] .brand-name {
    color: #ffffff;
}

.brand-product {
    color: var(--cyan-500);
    font-size: 18px;
    font-weight: 720;
}

.auth-copy {
    margin-bottom: 18px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--blue-600);
    font-size: 12px;
    font-weight: 760;
    text-transform: uppercase;
}

.auth-copy h1,
.page-heading h1 {
    margin: 0;
    color: var(--text);
    font-size: 32px;
    font-weight: 740;
    line-height: 1.18;
}

.auth-copy h1 {
    color: #ffffff;
    font-size: 23px;
    font-weight: 690;
}

.auth-copy p:last-child,
.page-heading p:last-child,
.section-heading p {
    margin: 10px 0 0;
    color: var(--text-soft);
}

.auth-copy p:last-child {
    margin-top: 7px;
    color: rgba(224, 238, 252, .76);
    font-size: 12px;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.form-field {
    display: grid;
    gap: 5px;
}

.form-field label {
    color: var(--text);
    font-size: 13px;
    font-weight: 680;
}

.auth-panel-inner .form-field label {
    color: rgba(241, 247, 255, .9);
    font-size: 12px;
    font-weight: 620;
}

.input-wrap {
    position: relative;
}

.input-wrap > svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-soft);
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 42px;
    padding: 0 46px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.auth-panel-inner .input-wrap input {
    height: 44px;
    color: #ffffff;
    background: rgba(3, 12, 27, .58);
    border-color: rgba(160, 199, 226, .34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.auth-panel-inner .input-wrap > svg {
    color: rgba(137, 213, 244, .82);
}

.auth-panel-inner .input-wrap input:focus {
    border-color: rgba(73, 199, 239, .85);
    box-shadow: 0 0 0 3px rgba(73, 199, 239, .12), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.auth-panel-inner .password-toggle {
    color: rgba(199, 222, 241, .72);
}

.auth-panel-inner .password-toggle:hover,
.auth-panel-inner .password-toggle:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, .08);
}

.input-wrap input:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(20, 120, 201, .13);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--text-soft);
    background: transparent;
    border: 0;
    border-radius: 5px;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--text);
    background: var(--surface-muted);
}

.remember-option {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-soft);
    font-size: 13px;
    cursor: pointer;
}

.auth-panel-inner .remember-option {
    color: rgba(218, 233, 247, .76);
    font-size: 12px;
}

.remember-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue-600);
}

.auth-panel-inner .portal-primary {
    min-height: 44px;
    color: #061426;
    background: #55c9ee;
    border-color: #55c9ee;
    box-shadow: 0 8px 26px rgba(16, 139, 190, .3), 0 0 18px rgba(85, 201, 238, .16);
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.auth-panel-inner .portal-primary:hover,
.auth-panel-inner .portal-primary:focus-visible {
    color: #03101f;
    background: #76d7f4;
    border-color: #76d7f4;
    box-shadow: 0 12px 30px rgba(16, 139, 190, .38), 0 0 26px rgba(85, 201, 238, .28);
    transform: translateY(-1px);
}

.auth-panel-inner .portal-alert {
    color: #ffd9d9;
    background: rgba(116, 20, 31, .66);
    border-color: rgba(255, 132, 145, .35);
}

.portal-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 43px;
    padding-inline: 20px;
    color: #ffffff;
    background: var(--blue-600);
    border-color: var(--blue-600);
    border-radius: 6px;
    font-weight: 700;
}

.portal-primary:hover,
.portal-primary:focus-visible {
    color: #ffffff;
    background: #0f68af;
    border-color: #0f68af;
}

.portal-alert,
.portal-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 6px;
}

.portal-alert {
    margin-bottom: 18px;
    color: var(--red-600);
    background: var(--red-100);
    border-color: #f4c3c3;
    font-size: 13px;
}

.portal-alert svg,
.portal-notice svg {
    flex: 0 0 auto;
    margin-top: 1px;
}

.password-rules {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    color: var(--text-soft);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 12px;
}

.password-rules span::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin: 0 8px 2px 0;
    background: var(--cyan-500);
    border-radius: 50%;
}

.auth-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 32px;
    color: var(--text-soft);
    border-top: 1px solid var(--line);
    font-size: 12px;
}

.auth-visual {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: #02060d;
}

.auth-visual > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.auth-visual-caption {
    position: absolute;
    right: 34px;
    bottom: 28px;
    left: 34px;
    display: flex;
    justify-content: center;
    gap: 30px;
    color: rgba(255, 255, 255, .74);
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
}

.auth-visual-caption span + span::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 30px 2px 0;
    background: var(--cyan-500);
    border-radius: 50%;
}

.auth-shell .auth-brand,
.auth-shell .auth-footer,
.auth-shell .auth-visual-caption {
    display: none;
}

.portal-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    background: rgba(245, 247, 250, .84);
}

.portal-body,
.module-body {
    min-height: 100vh;
    background-color: #061329;
    background-image: url("../images/vynex-system-background.jpg");
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

html[data-theme="dark"] .portal-shell {
    background: rgba(5, 12, 23, .88);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    color: #d8e5f4;
    background: var(--navy-950);
    border-right: 1px solid #172942;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 0 20px;
    border-bottom: 1px solid #1a2a40;
}

.sidebar-brand .brand-name {
    color: #ffffff;
    font-size: 20px;
}

.sidebar-brand .brand-product {
    font-size: 14px;
}

.sidebar-close {
    display: none !important;
}

.company-context {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 18px 14px 12px;
    padding: 11px;
    background: #101f33;
    border: 1px solid #233955;
    border-radius: 6px;
}

.company-mark,
.user-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #07111f;
    background: var(--cyan-500);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
}

.company-context > span:last-child {
    display: grid;
    min-width: 0;
}

.company-context small,
.sidebar-foot small {
    color: #7f96b2;
    font-size: 10px;
}

.company-context strong {
    overflow: hidden;
    color: #ffffff;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px 20px;
    overflow-y: auto;
}

.nav-group-label {
    margin: 22px 10px 8px;
    color: #6f87a5;
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
}

.nav-item {
    display: grid;
    grid-template-columns: 21px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 11px;
    color: #aebed1;
    border-radius: 6px;
    text-decoration: none;
}

.nav-item + .nav-item {
    margin-top: 3px;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active {
    color: #ffffff;
    background: #142a44;
}

.nav-item.active {
    box-shadow: inset 3px 0 0 var(--cyan-500);
}

.nav-item small {
    color: #6f87a5;
    font-size: 9px;
}

.nav-item-disabled {
    cursor: default;
}

.sidebar-foot {
    display: grid;
    gap: 7px;
    padding: 16px 20px 20px;
    border-top: 1px solid #1a2a40;
}

.service-status {
    color: #b6c7d8;
    font-size: 11px;
}

.service-status i,
.online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    background: #2cc38a;
    border-radius: 50%;
}

.portal-content {
    grid-column: 2;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    min-height: 70px;
    padding: 0 clamp(20px, 3vw, 42px);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.menu-button {
    display: none !important;
}

.topbar-context {
    color: var(--text-soft);
    font-size: 12px;
    text-transform: capitalize;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--text-soft);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.icon-button:hover,
.icon-button:focus-visible {
    color: var(--text);
    background: var(--surface-muted);
    border-color: var(--line-strong);
}

.user-summary {
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0 6px;
    text-align: right;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.user-copy {
    display: grid;
    max-width: 170px;
    justify-items: end;
}

.user-copy strong,
.user-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy strong {
    font-size: 12px;
}

.user-copy small {
    color: var(--text-soft);
    font-size: 10px;
}

.main-content {
    width: min(100%, 1500px);
    margin: 0 auto;
    padding: 34px clamp(20px, 3vw, 42px) 56px;
}

.portal-notice {
    margin-bottom: 22px;
    padding: 12px 14px;
    color: var(--green-600);
    background: var(--green-100);
    border: 1px solid #b8e7d2;
    opacity: 1;
    transform: translateY(0);
    transition: opacity .2s ease, transform .2s ease;
}

.portal-notice > span {
    flex: 1 1 auto;
}

.portal-notice.is-dismissing {
    opacity: 0;
    transform: translateY(-6px);
}

.portal-notice-close {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 28px;
    height: 28px;
    margin: -5px -7px -5px 4px;
    padding: 0;
    color: currentColor;
    background: transparent;
    border: 0;
    border-radius: 5px;
}

.portal-notice-close:hover,
.portal-notice-close:focus-visible {
    background: rgba(0, 0, 0, .08);
}

.portal-notice-close svg {
    width: 16px;
    height: 16px;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-heading h1 {
    font-size: 27px;
}

.global-access-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 10px;
    color: var(--green-600);
    background: var(--green-100);
    border: 1px solid #b8e7d2;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.global-access-badge svg {
    width: 16px;
    height: 16px;
}

.brand-strip {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 126px;
    margin-bottom: 22px;
    padding: 26px 32px;
    overflow: hidden;
    color: #ffffff;
    background: var(--navy-900);
    border: 1px solid #203a59;
    border-radius: 8px;
}

.brand-strip-copy {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 5px;
}

.brand-strip-copy span {
    color: #81ddea;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.brand-strip-copy strong {
    max-width: 540px;
    font-size: 21px;
    font-weight: 680;
}

.brand-strip img {
    position: absolute;
    top: 50%;
    right: -20px;
    width: min(330px, 38%);
    height: auto;
    opacity: .45;
    transform: translateY(-50%);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.metric-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    min-height: 134px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(15, 31, 51, .03);
}

.metric-card > div {
    display: grid;
    min-width: 0;
}

.metric-card small,
.metric-card span:last-child {
    overflow: hidden;
    color: var(--text-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-card small {
    font-size: 11px;
    font-weight: 680;
    text-transform: uppercase;
}

.metric-card strong {
    margin: 5px 0 2px;
    font-size: 29px;
    font-weight: 750;
    line-height: 1.1;
}

.metric-card strong.metric-money {
    font-size: 22px;
}

.metric-card span:last-child {
    font-size: 11px;
}

.metric-icon,
.module-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
}

.metric-icon-blue {
    color: #1766a5;
    background: #e2f0fb;
}

.metric-icon-green {
    color: var(--green-600);
    background: var(--green-100);
}

.metric-icon-amber {
    color: var(--amber-600);
    background: var(--amber-100);
}

.metric-icon-cyan {
    color: #06768a;
    background: var(--cyan-100);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr);
    gap: 18px;
}

.workspace-section {
    min-width: 0;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 720;
}

.section-heading p {
    font-size: 12px;
}

.module-list {
    border-top: 1px solid var(--line);
}

.module-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 70px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.module-row:last-child {
    border-bottom: 0;
}

.module-icon {
    color: var(--navy-700);
    background: var(--surface-muted);
}

html[data-theme="dark"] .module-icon {
    color: #bcd1e9;
}

.module-copy {
    display: grid;
    min-width: 0;
}

.module-copy strong {
    font-size: 13px;
}

.module-copy small {
    color: var(--text-soft);
    font-size: 11px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.status-planned {
    color: #59687b;
    background: var(--surface-muted);
    border: 1px solid var(--line);
}

.environment-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.environment-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 47px;
    border-top: 1px solid var(--line);
}

.environment-list dt,
.environment-list dd {
    margin: 0;
    font-size: 11px;
}

.environment-list dt {
    color: var(--text-soft);
    font-weight: 550;
}

.environment-list dd {
    max-width: 58%;
    overflow: hidden;
    font-weight: 680;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-backdrop {
    display: none;
}

.topbar-context {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.topbar-context strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 720;
    text-transform: none;
}

.portal-notice-error {
    color: var(--red-600);
    background: var(--red-100);
    border-color: #f4c3c3;
}

.workspace-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 7px 11px;
    color: #1766a5;
    background: #e2f0fb;
    border: 1px solid #c4def1;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 720;
    white-space: nowrap;
}

.workspace-badge svg {
    width: 16px;
    height: 16px;
}

.metrics-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-workspace {
    max-width: 980px;
}

.status-next,
.status-active {
    color: var(--green-600);
    background: var(--green-100);
    border: 1px solid #b8e7d2;
}

.status-inactive {
    color: var(--red-600);
    background: var(--red-100);
    border: 1px solid #f4c3c3;
}

.module-body {
    min-height: 100vh;
}

.module-shell {
    min-height: 100vh;
    background: rgba(245, 247, 250, .78);
}

html[data-theme="dark"] .module-shell {
    background: rgba(5, 12, 23, .80);
}

.module-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    min-height: 72px;
    padding: 0 clamp(20px, 4vw, 54px);
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.module-brand-zone {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
}

.module-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
}

.module-brand .brand-name {
    font-size: 25px;
}

.module-brand .brand-product {
    font-size: 17px;
}

.module-theme-toggle {
    flex: 0 0 auto;
}

.module-topbar .topbar-actions {
    grid-column: 3;
    justify-self: end;
    min-width: 0;
    margin-left: 0;
}

.module-topbar .user-copy {
    width: min(19vw, 210px);
}

.module-main {
    width: min(100%, 1260px);
    margin: 0 auto;
    padding: 62px clamp(20px, 4vw, 54px) 76px;
}

.module-intro {
    margin-bottom: 38px;
}

.module-intro h1 {
    margin: 0;
    color: var(--text);
    font-size: 30px;
    font-weight: 740;
    line-height: 1.2;
}

.module-intro > p:last-child {
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

.module-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.module-section-heading h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 740;
    text-transform: uppercase;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.module-card {
    --module-accent-rgb: 20, 120, 201;
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 22px;
    min-width: 0;
    min-height: 246px;
    padding: 30px;
    overflow: hidden;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid rgba(var(--module-accent-rgb), .30);
    border-radius: 8px;
    box-shadow: 0 9px 26px rgba(7, 17, 31, .08);
    backdrop-filter: blur(13px) saturate(110%);
    text-decoration: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.module-card-tickets {
    --module-accent-rgb: 24, 185, 207;
}

.module-card-users {
    --module-accent-rgb: 21, 128, 93;
}

a.module-card:hover,
a.module-card:focus-visible {
    color: var(--text);
    border-color: rgba(var(--module-accent-rgb), .96);
    box-shadow:
        0 0 0 1px rgba(var(--module-accent-rgb), .22),
        0 0 30px rgba(var(--module-accent-rgb), .30),
        0 18px 42px rgba(7, 17, 31, .18);
    transform: translateY(-4px);
}

.module-card::after {
    position: absolute;
    right: 30px;
    bottom: 25px;
    left: 30px;
    height: 4px;
    content: "";
    background: rgb(var(--module-accent-rgb));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(var(--module-accent-rgb), .45);
    opacity: .72;
    transition: box-shadow .2s ease, opacity .2s ease;
}

a.module-card:hover::after,
a.module-card:focus-visible::after {
    box-shadow: 0 0 18px rgba(var(--module-accent-rgb), .92);
    opacity: 1;
}

.module-card-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    color: #1766a5;
    background: #e2f0fb;
    border-radius: 7px;
}

.module-card-icon svg {
    width: 24px;
    height: 24px;
}

.module-card-tickets .module-card-icon {
    color: #06768a;
    background: var(--cyan-100);
}

.module-card-users .module-card-icon {
    color: var(--green-600);
    background: var(--green-100);
}

.module-card-copy {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding-top: 3px;
}

.module-card-copy strong {
    font-size: 21px;
    font-weight: 720;
}

.module-card-copy small {
    max-width: 380px;
    color: var(--text-soft);
    font-size: 13px;
}

.module-card-action {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--text-soft);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.module-card-action svg {
    width: 16px;
    height: 16px;
}

.module-card-disabled {
    opacity: .78;
}

.module-card-disabled:hover {
    border-color: rgba(var(--module-accent-rgb), .52);
    box-shadow: 0 0 22px rgba(var(--module-accent-rgb), .13);
}

.module-card-disabled .status-pill {
    align-self: start;
}

.module-admin-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}

.module-admin-section .module-grid {
    grid-template-columns: minmax(0, calc(50% - 11px));
}

.module-empty {
    display: grid;
    justify-items: center;
    max-width: 580px;
    margin: 70px auto;
    padding: 42px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.module-empty > svg {
    width: 36px;
    height: 36px;
    margin-bottom: 18px;
    color: var(--text-soft);
}

.module-empty h2 {
    margin: 0;
    font-size: 18px;
}

.module-empty p {
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.page-heading-actions {
    align-items: end;
}

.compact-heading {
    max-width: 920px;
}

.portal-action-button {
    flex: 0 0 auto;
    text-decoration: none;
}

.portal-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 0 18px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-weight: 680;
    text-decoration: none;
}

.portal-secondary:hover,
.portal-secondary:focus-visible {
    color: var(--text);
    background: var(--surface-muted);
}

.data-section {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.portal-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.portal-table th,
.portal-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.portal-table th {
    color: var(--text-soft);
    background: var(--surface-soft);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
    white-space: nowrap;
}

.portal-table td {
    font-size: 12px;
}

.portal-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-user {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 210px;
}

.table-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 35px;
    height: 35px;
    color: #1766a5;
    background: #e2f0fb;
    border-radius: 6px;
    font-weight: 760;
}

.table-user > span:last-child {
    display: grid;
    min-width: 0;
}

.table-user strong,
.table-user small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-user strong {
    font-size: 12px;
}

.table-user small {
    color: var(--text-soft);
    font-size: 10px;
}

.module-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.module-tag {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    color: #1766a5;
    background: #e2f0fb;
    border: 1px solid #c4def1;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 680;
    white-space: nowrap;
}

.module-tag-cyan {
    color: #06768a;
    background: var(--cyan-100);
    border-color: #b8e7ed;
}

.table-action {
    width: 64px;
    text-align: right;
}

.management-form {
    display: grid;
    gap: 18px;
    max-width: 920px;
}

.form-section {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.form-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.form-section-heading h2,
.form-section-heading p {
    margin: 0;
}

.form-section-heading h2 {
    font-size: 16px;
    font-weight: 720;
}

.form-section-heading p {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 11px;
}

.form-section-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #1766a5;
    background: #e2f0fb;
    border-radius: 6px;
}

.form-section-icon-green {
    color: var(--green-600);
    background: var(--green-100);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.form-grid > .form-field {
    align-self: start;
    align-content: start;
    width: 100%;
}

.form-grid > .form-field > label {
    min-height: 20px;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.management-form .form-field input,
.management-form .form-field select {
    width: 100%;
    min-height: 43px;
    padding: 9px 12px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
}

.management-form .form-field input:focus,
.management-form .form-field select:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(20, 120, 201, .13);
}

.management-form .form-field > small:not(.field-error) {
    color: var(--text-soft);
    font-size: 10px;
}

.deadline-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 8px;
}

.field-error {
    color: var(--red-600);
    font-size: 11px;
    font-weight: 650;
}

.module-access-fieldset {
    margin: 22px 0 0;
    padding: 0;
    border: 0;
}

.module-access-fieldset legend {
    margin-bottom: 9px;
    color: var(--text);
    font-size: 13px;
    font-weight: 680;
}

.access-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.access-option {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 7px;
    cursor: pointer;
}

.access-option:has(input:checked) {
    background: color-mix(in srgb, #e2f0fb 72%, var(--surface));
    border-color: #8fb9d8;
}

.access-option input {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 16px;
    height: 16px;
    accent-color: var(--blue-600);
}

.access-option-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #1766a5;
    background: #e2f0fb;
    border-radius: 6px;
}

.access-option-icon-cyan {
    color: #06768a;
    background: var(--cyan-100);
}

.access-option > span:last-child,
.active-option > span,
.protected-access > span {
    display: grid;
    min-width: 0;
}

.access-option strong,
.active-option strong,
.protected-access strong {
    font-size: 12px;
}

.access-option small,
.active-option small,
.protected-access small {
    color: var(--text-soft);
    font-size: 10px;
}

.active-option,
.protected-access {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 16px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.active-option {
    cursor: pointer;
}

.active-option input {
    width: 17px;
    height: 17px;
    accent-color: var(--green-600);
}

.protected-access {
    color: var(--green-600);
    background: var(--green-100);
    border-color: #b8e7d2;
}

.protected-access > svg {
    flex: 0 0 auto;
}

.protected-access small {
    color: #447261;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 18px;
    padding: 14px;
    color: var(--blue-600);
    background: color-mix(in srgb, var(--surface-soft) 92%, #d8ecfb);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.profile-summary > svg {
    flex: 0 0 auto;
}

.profile-summary > span {
    display: grid;
    min-width: 0;
}

.profile-summary strong {
    color: var(--text);
    font-size: 12px;
}

.profile-summary small {
    color: var(--text-soft);
    font-size: 10px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

html[data-theme="dark"] .metric-icon-blue,
html[data-theme="dark"] .workspace-badge,
html[data-theme="dark"] .table-avatar,
html[data-theme="dark"] .module-tag,
html[data-theme="dark"] .module-card-icon,
html[data-theme="dark"] .form-section-icon,
html[data-theme="dark"] .access-option-icon {
    color: #82c8f4;
    background: #18344c;
    border-color: #285271;
}

html[data-theme="dark"] .metric-icon-green,
html[data-theme="dark"] .module-card-users .module-card-icon,
html[data-theme="dark"] .form-section-icon-green {
    color: #79d5b3;
    background: #14382e;
}

html[data-theme="dark"] .metric-icon-amber {
    color: #f0c167;
    background: #3b2d16;
}

html[data-theme="dark"] .metric-icon-cyan,
html[data-theme="dark"] .module-card-tickets .module-card-icon,
html[data-theme="dark"] .module-tag-cyan,
html[data-theme="dark"] .access-option-icon-cyan {
    color: #75dbe8;
    background: #12363c;
    border-color: #27545c;
}

@media (max-width: 760px) {
    .module-topbar {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
        min-height: 64px;
        padding: 0 14px;
    }

    .module-brand-zone {
        grid-column: 1;
        justify-content: flex-start;
        gap: 7px;
    }

    .module-brand {
        gap: 5px;
    }

    .module-brand .brand-name {
        font-size: 18px;
    }

    .module-brand .brand-product {
        font-size: 13px;
    }

    .module-theme-toggle {
        width: 34px;
        height: 34px;
    }

    .module-topbar .topbar-actions {
        grid-column: 2;
        justify-self: end;
        gap: 7px;
    }

    .module-topbar .user-copy {
        width: min(24vw, 104px);
    }

    .module-main {
        padding: 34px 14px 50px;
    }

    .module-intro {
        margin-bottom: 28px;
    }

    .module-intro h1 {
        font-size: 25px;
    }

    .module-grid,
    .module-admin-section .module-grid,
    .access-options,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 210px;
        padding: 22px;
    }

    .module-card::after {
        right: 22px;
        bottom: 19px;
        left: 22px;
    }

    .module-card-copy strong {
        font-size: 18px;
    }

    .module-card-disabled {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .module-card-disabled .status-pill {
        grid-column: 2;
        width: fit-content;
    }

    .form-field-wide {
        grid-column: auto;
    }

    .form-section {
        padding: 18px;
    }

    .form-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1180px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .auth-visual {
        position: fixed;
    }

    .auth-visual > img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }

    .auth-panel {
        align-items: flex-end;
        padding: 20px 14px;
    }

    .portal-shell {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-close,
    .menu-button {
        display: inline-grid !important;
    }

    .sidebar-close {
        color: #9db0c6;
        border-color: #263a55;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(2, 9, 18, .56);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .portal-content {
        grid-column: auto;
    }

    .topbar {
        gap: 12px;
    }

    .topbar-context {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid-three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .auth-visual > img {
        position: absolute;
        top: 0;
        left: 50%;
        width: auto;
        height: clamp(400px, 114vw, 500px);
        object-fit: contain;
        object-position: center top;
        transform: translateX(-50%);
    }

    .auth-panel {
        align-items: flex-end;
        padding: 14px;
    }

    .auth-panel-inner {
        width: 100%;
        min-height: 0;
        padding: 20px 18px;
    }

    .auth-copy h1 {
        font-size: 21px;
    }

    .topbar {
        min-height: 62px;
        padding: 0 14px;
    }

    .topbar .user-copy {
        max-width: 104px;
    }

    .main-content {
        padding: 24px 14px 44px;
    }

    .page-heading {
        display: grid;
    }

    .global-access-badge {
        width: fit-content;
    }

    .brand-strip {
        min-height: 112px;
        padding: 22px;
    }

    .brand-strip-copy strong {
        max-width: 230px;
        font-size: 17px;
    }

    .brand-strip img {
        right: -45px;
        width: 210px;
        opacity: .3;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid-three {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 112px;
    }

    .module-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .module-row .status-pill {
        grid-column: 2;
        width: fit-content;
    }
}

/* Login form inspired by the 21st.dev animated sign-in pattern. */
.auth-panel-stage {
    width: min(100%, 420px);
}

.auth-panel-inner {
    padding: 26px 28px 27px;
    background: rgba(2, 9, 22, .78);
    border-color: rgba(119, 213, 247, .42);
    box-shadow:
        0 0 0 1px rgba(72, 151, 211, .08),
        0 20px 70px rgba(0, 0, 0, .58),
        0 0 34px rgba(55, 186, 231, .12),
        inset 0 1px 0 rgba(255, 255, 255, .09);
    backdrop-filter: blur(24px) saturate(135%);
}

.auth-copy {
    margin-bottom: 22px;
}

.auth-copy h1 {
    font-size: 26px;
    line-height: 1.15;
}

.auth-copy p:last-child {
    margin-top: 9px;
    font-size: 13px;
    line-height: 1.5;
}

.auth-form {
    gap: 15px;
}

.auth-panel-inner .form-field {
    gap: 7px;
}

.auth-panel-inner .form-field label {
    font-size: 13px;
}

.auth-input-glow {
    --auth-glow-x: 50%;
    --auth-glow-y: 50%;
    isolation: isolate;
    padding: 1px;
    border-radius: 7px;
}

.auth-input-glow::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    content: "";
    background: radial-gradient(
        110px circle at var(--auth-glow-x) var(--auth-glow-y),
        rgba(81, 202, 243, .98),
        rgba(75, 105, 236, .62) 35%,
        transparent 78%
    );
    border-radius: inherit;
    opacity: 0;
    transition: opacity .24s ease;
    pointer-events: none;
}

.auth-input-glow.is-spotlit::before,
.auth-input-glow:focus-within::before {
    opacity: 1;
}

.auth-panel-inner .auth-input-glow input {
    position: relative;
    z-index: 1;
    height: 46px;
    padding-left: 45px;
    background: rgba(3, 12, 27, .92);
    border: 0;
    border-radius: 6px;
    box-shadow:
        0 0 0 1px rgba(135, 180, 214, .28),
        inset 0 1px 0 rgba(255, 255, 255, .04);
}

.auth-panel-inner .auth-input-glow input:focus {
    box-shadow:
        0 0 0 1px rgba(102, 211, 245, .48),
        inset 0 1px 0 rgba(255, 255, 255, .06);
}

.auth-input-glow > svg,
.auth-input-glow .password-toggle {
    z-index: 2;
}

.auth-panel-inner .auth-submit {
    position: relative;
    min-height: 46px;
    margin-top: 2px;
    overflow: hidden;
    color: #eef9ff;
    background: rgba(9, 24, 44, .96);
    border-color: rgba(129, 187, 224, .34);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .09),
        inset 0 -1px 0 rgba(78, 183, 229, .15),
        0 10px 30px rgba(0, 0, 0, .24);
}

.auth-panel-inner .auth-submit:hover,
.auth-panel-inner .auth-submit:focus-visible {
    color: #ffffff;
    background: rgba(12, 34, 59, .98);
    border-color: rgba(106, 215, 248, .55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .12),
        0 0 22px rgba(62, 192, 236, .15),
        0 14px 32px rgba(0, 0, 0, .32);
}

.auth-submit > span:not(.auth-submit-glow),
.auth-submit > svg {
    position: relative;
    z-index: 2;
}

.auth-submit-glow {
    position: absolute;
    z-index: 1;
    right: 14%;
    bottom: -1px;
    left: 14%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #58d3f4 40%, #7b72f2 62%, transparent);
    box-shadow: 0 0 9px rgba(88, 211, 244, .8);
    opacity: .45;
    transition: right .3s ease, left .3s ease, opacity .3s ease;
}

.auth-submit:hover .auth-submit-glow,
.auth-submit:focus-visible .auth-submit-glow {
    right: 4%;
    left: 4%;
    opacity: 1;
}

.vynex-motion-ready .auth-reveal {
    position: relative;
    animation: auth-content-reveal .42s cubic-bezier(.2, .75, .2, 1) var(--reveal-delay, 0s) both;
}

@keyframes auth-content-reveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-access-request {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 24px;
    margin-top: 1px;
    color: rgba(208, 225, 240, .7);
    font-size: 12px;
}

.auth-access-request a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #69d7ef;
    font-weight: 680;
    text-decoration: none;
    transition: color .18s ease, text-shadow .18s ease;
}

.auth-access-request a:hover,
.auth-access-request a:focus-visible {
    color: #a2efff;
    text-shadow: 0 0 12px rgba(82, 208, 239, .48);
}

.auth-access-request svg {
    width: 15px;
    height: 15px;
}

@media (max-width: 820px) {
    .auth-panel-inner {
        padding: 24px 20px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-reveal {
        animation: none !important;
    }
}

/* Ticket management */
.page-heading-buttons,
.ticket-reply-actions,
.ticket-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ticket-page-heading {
    margin-bottom: 20px;
}

.ticket-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.ticket-metric {
    display: flex;
    align-items: center;
    min-height: 102px;
    gap: 14px;
    padding: 18px;
    overflow: hidden;
    background: color-mix(in srgb, var(--surface) 93%, transparent);
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.ticket-metric:hover {
    border-color: color-mix(in srgb, var(--metric-color) 55%, var(--line));
    box-shadow: 0 15px 36px color-mix(in srgb, var(--metric-color) 14%, transparent);
    transform: translateY(-2px);
}

.ticket-metric > span {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    color: var(--metric-color);
    background: color-mix(in srgb, var(--metric-color) 13%, transparent);
    border-radius: 6px;
    place-items: center;
}

.ticket-metric small,
.ticket-metric strong {
    display: block;
}

.ticket-metric small {
    color: var(--text-soft);
    font-size: 13px;
}

.ticket-metric strong {
    margin-top: 2px;
    font-size: 29px;
    font-weight: 650;
    line-height: 1;
}

.metric-open { --metric-color: #278bd1; }
.metric-progress { --metric-color: #12a9be; }
.metric-waiting { --metric-color: #b97816; }
.metric-resolved { --metric-color: #249066; }

.ticket-list-section {
    overflow: hidden;
}

.ticket-list-section .table-responsive {
    overflow-x: auto;
    scrollbar-color: color-mix(in srgb, var(--cyan-500) 35%, var(--line)) transparent;
}

.ticket-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, .75fr)) auto auto;
    gap: 10px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.ticket-filter-bar select,
.filter-search {
    min-height: 43px;
}

.filter-search {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-search svg {
    position: absolute;
    left: 13px;
    color: var(--text-soft);
}

.filter-search input {
    width: 100%;
    padding-left: 42px;
}

.ticket-table th,
.ticket-table td {
    padding-top: 15px;
    padding-bottom: 15px;
}

.ticket-table {
    min-width: 860px;
}

.ticket-row td:first-child {
    border-left: 3px solid transparent;
}

.ticket-row.priority-high td:first-child { border-left-color: #d58a1c; }
.ticket-row.priority-urgent td:first-child { border-left-color: #d44c4c; }

.ticket-subject-link {
    display: grid;
    min-width: 220px;
    text-decoration: none;
}

.ticket-subject-link strong {
    font-weight: 600;
}

.ticket-subject-link small,
.ticket-date small,
.table-subline {
    display: block;
    color: var(--text-soft);
    font-size: 12px;
}

.ticket-status,
.ticket-priority {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    gap: 7px;
    padding: 4px 9px;
    white-space: nowrap;
    border-radius: 999px;
    font-size: 12px;
}

.ticket-status i {
    width: 7px;
    height: 7px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.status-open { color: #1778b8; background: rgba(23,120,184,.12); }
.status-in_progress { color: #058b9d; background: rgba(5,139,157,.13); }
.status-waiting_customer,
.status-paused { color: #a86408; background: rgba(168,100,8,.13); }
.status-resolved,
.status-closed { color: #167b59; background: rgba(22,123,89,.13); }
.priority-low { color: #63748a; background: rgba(99,116,138,.12); }
.priority-normal { color: #1679b4; background: rgba(22,121,180,.11); }
.priority-high { color: #a86408; background: rgba(168,100,8,.12); }
.priority-urgent { color: #b7333d; background: rgba(183,51,61,.12); }

.ticket-empty {
    display: grid;
    justify-items: center;
    padding: 58px 20px;
    text-align: center;
}

.ticket-empty > span {
    display: grid;
    width: 58px;
    height: 58px;
    color: var(--cyan-500);
    background: rgba(24,185,207,.11);
    border-radius: 50%;
    place-items: center;
}

.ticket-empty h2 { margin: 14px 0 3px; font-size: 18px; }
.ticket-empty p { margin: 0; color: var(--text-soft); }

.ticket-file-field { margin-top: 18px; }
.ticket-file-field input { padding: 10px; }

.ticket-detail-header {
    margin-bottom: 18px;
    padding: 2px 2px 18px;
    border-bottom: 1px solid var(--line);
}

.ticket-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
    color: var(--text-soft);
    text-decoration: none;
}

.ticket-detail-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.ticket-detail-title h1 {
    max-width: 920px;
    margin: 3px 0 12px;
    font-size: 28px;
    font-weight: 650;
    line-height: 1.2;
}

.ticket-protocol {
    color: var(--cyan-500);
    font-size: 12px;
    text-transform: uppercase;
}

.ticket-detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    font-size: 13px;
}

.ticket-detail-meta svg { width: 16px; height: 16px; }

.ticket-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 18px;
}

.ticket-conversation-column,
.ticket-side-column {
    display: grid;
    min-width: 0;
    gap: 16px;
}

.ticket-conversation,
.ticket-reply-panel,
.ticket-info-panel,
.ticket-actions-panel,
.ticket-status-log,
.ticket-service-order {
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: var(--shadow);
}

.ticket-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 19px;
    border-bottom: 1px solid var(--line);
}

.ticket-section-heading h2 { margin: 0; font-size: 16px; font-weight: 620; }
.ticket-section-heading p { margin: 2px 0 0; color: var(--text-soft); font-size: 12px; }
.ticket-section-heading > span { color: var(--text-soft); font-size: 12px; }

.ticket-timeline { padding: 19px; }

.ticket-message {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
}

.ticket-message + .ticket-message { margin-top: 22px; }

.ticket-message-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    color: #fff;
    background: #1778b8;
    border-radius: 50%;
    font-size: 12px;
    place-items: center;
}

.ticket-message.is-own .ticket-message-avatar { background: #14876d; }
.ticket-message.is-internal .ticket-message-avatar { background: #9b6611; }

.ticket-message-content {
    min-width: 0;
    padding: 14px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 0 7px 7px 7px;
}

.ticket-message.is-internal .ticket-message-content {
    background: color-mix(in srgb, #f0a323 9%, var(--surface));
    border-color: color-mix(in srgb, #f0a323 38%, var(--line));
}

.ticket-message-content header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.ticket-message-content header strong { font-weight: 620; }
.ticket-message-content time { color: var(--text-soft); font-size: 11px; white-space: nowrap; }
.ticket-message-body { overflow-wrap: anywhere; }

.internal-note-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    color: #9b6611;
    font-size: 10px;
    text-transform: uppercase;
}
.internal-note-label svg { width: 12px; height: 12px; }

.ticket-attachments { display: grid; gap: 6px; margin-top: 12px; }
.ticket-attachments a { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 8px 10px; color: var(--blue-600); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; text-decoration: none; }
.ticket-attachments small { color: var(--text-soft); }

.ticket-reply-panel form { padding: 18px; }
.ticket-reply-actions { justify-content: flex-end; margin-top: 12px; }
.ticket-attach-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ticket-attach-button,
.ticket-internal-toggle span { display: inline-flex; align-items: center; min-height: 40px; gap: 7px; padding: 8px 11px; color: var(--text-soft); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.ticket-internal-toggle input { position: absolute; opacity: 0; }
.ticket-internal-toggle input:checked + span { color: #9b6611; background: rgba(240,163,35,.1); border-color: rgba(240,163,35,.45); }

.ticket-info-list { margin: 0; padding: 10px 18px 16px; }
.ticket-info-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ticket-info-list > div:last-child { border-bottom: 0; }
.ticket-info-list dt { color: var(--text-soft); font-size: 12px; }
.ticket-info-list dd { margin: 0; text-align: right; font-size: 13px; }

.ticket-workflow-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; }
.ticket-workflow-actions form { min-width: 0; }
.ticket-action { display: flex; align-items: center; width: 100%; min-height: 64px; gap: 9px; padding: 10px; color: var(--text); text-align: left; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; transition: border-color .2s ease, transform .2s ease; }
.ticket-action:hover { border-color: var(--cyan-500); transform: translateY(-1px); }
.ticket-action.primary { grid-column: 1/-1; color: #087598; background: rgba(24,185,207,.1); border-color: rgba(24,185,207,.35); }
.ticket-action strong,.ticket-action small { display:block; }
.ticket-action strong { font-size: 12px; font-weight: 620; }
.ticket-action small { color: var(--text-soft); font-size: 10px; }
.ticket-resolve-trigger { display: flex; align-items: center; justify-content: center; width: calc(100% - 28px); min-height: 42px; gap: 8px; margin: 0 14px 14px; color: #fff; background: #16805c; border: 0; border-radius: 5px; cursor: pointer; }

.ticket-service-order { display: grid; grid-template-columns: 42px minmax(0,1fr) 38px; align-items: center; gap: 10px; padding: 14px; }
.ticket-service-order > span { display:grid;width:42px;height:42px;color:#16805c;background:rgba(22,128,92,.11);border-radius:6px;place-items:center; }
.ticket-service-order small,.ticket-service-order strong { display:block; }
.ticket-service-order small { color:var(--text-soft);font-size:10px;text-transform:uppercase; }
.ticket-service-order strong { overflow:hidden;text-overflow:ellipsis;font-size:12px; }

.status-history-list { padding: 15px 17px; }
.status-history-list > div { position:relative;display:grid;grid-template-columns:12px minmax(0,1fr);gap:9px;padding-bottom:15px; }
.status-history-list > div:last-child { padding-bottom:0; }
.status-history-list > div::before { position:absolute;top:8px;bottom:0;left:4px;width:1px;content:"";background:var(--line); }
.status-history-list > div:last-child::before { display:none; }
.status-history-list > div > span { z-index:1;width:9px;height:9px;margin-top:4px;background:var(--cyan-500);border:2px solid var(--surface);border-radius:50%;box-shadow:0 0 0 1px var(--cyan-500); }
.status-history-list p { margin:0; }
.status-history-list strong,.status-history-list small { display:block; }
.status-history-list strong { font-size:11px;font-weight:600; }
.status-history-list small { color:var(--text-soft);font-size:10px; }

.ticket-sidebar-contact { display:flex;align-items:center;gap:9px;margin:14px 10px;padding:12px;color:#9cc8df;background:rgba(24,185,207,.07);border:1px solid rgba(24,185,207,.16);border-radius:6px; }
.ticket-sidebar-contact small,.ticket-sidebar-contact strong { display:block; }
.ticket-sidebar-contact small { font-size:9px;text-transform:uppercase; }
.ticket-sidebar-contact strong { font-size:11px;font-weight:550;overflow-wrap:anywhere; }

.ticket-resolve-backdrop { position:fixed;z-index:1200;inset:0;display:grid;padding:20px;background:rgba(2,8,17,.7);backdrop-filter:blur(8px);place-items:center; }
.ticket-resolve-backdrop[hidden] { display:none; }
.ticket-resolve-dialog { position:relative;width:min(100%,620px);padding:25px;background:var(--surface);border:1px solid var(--line-strong);border-radius:8px;box-shadow:0 28px 80px rgba(0,0,0,.35);animation:system-confirm-in .2s ease both; }
.ticket-resolve-dialog > .icon-button { position:absolute;top:14px;right:14px; }
.ticket-resolve-icon { display:grid;width:48px;height:48px;color:#16805c;background:rgba(22,128,92,.11);border-radius:7px;place-items:center; }
.ticket-resolve-dialog h2 { margin:14px 0 4px;font-size:21px; }
.ticket-resolve-dialog > p { margin:0 0 18px;color:var(--text-soft); }

@media (max-width: 1180px) {
    .ticket-filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ticket-detail-grid { grid-template-columns:minmax(0,1fr) 300px; }
}

@media (max-width: 1320px) {
    .ticket-table .ticket-col-category { display: none; }
    .ticket-table { min-width: 720px; }
    .ticket-subject-link { min-width: 175px; }
    .ticket-table .table-user { min-width: 150px; }
}

@media (max-width: 900px) {
    .ticket-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .ticket-detail-grid { grid-template-columns:1fr; }
    .ticket-side-column { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .ticket-status-log,.ticket-service-order { grid-column:1/-1; }
}

@media (max-width: 640px) {
    .ticket-metrics,.ticket-filter-bar,.ticket-side-column { grid-template-columns:1fr; }
    .ticket-detail-title { align-items:flex-start;flex-direction:column; }
    .ticket-detail-title h1 { font-size:22px; }
    .ticket-message { grid-template-columns:30px minmax(0,1fr); }
    .ticket-message-avatar { width:30px;height:30px; }
    .ticket-message-content header { align-items:flex-start;flex-direction:column; }
    .ticket-reply-actions { align-items:stretch;flex-direction:column; }
    .ticket-reply-actions > * { width:100%;justify-content:center; }
    .ticket-workflow-actions { grid-template-columns:1fr; }
    .ticket-action.primary { grid-column:auto; }
    .ticket-list-section { overflow: visible; background: transparent; border: 0; box-shadow: none; }
    .ticket-list-section .table-responsive { overflow: visible; }
    .ticket-table { display: block; min-width: 0; }
    .ticket-table thead { display: none; }
    .ticket-table tbody { display: grid; gap: 12px; }
    .ticket-table tr { display: grid; padding: 15px; background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
    .ticket-table td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); }
    .ticket-table td::before { flex: 0 0 auto; color: var(--text-soft); content: attr(data-label); font-size: 11px; }
    .ticket-table td:first-child { display: block; padding: 0 0 13px 11px; border-bottom: 1px solid var(--line); border-left-width: 3px; }
    .ticket-table td:first-child::before,
    .ticket-table .ticket-col-category { display: none; }
    .ticket-table td:last-child { justify-content: flex-end; padding-bottom: 0; border-bottom: 0; }
    .ticket-subject-link,
    .ticket-table .table-user { min-width: 0; }
    .ticket-table .ticket-date { text-align: right; }
}

/* VYNEX motion system */
.vynex-auth-cards,
.vynex-circuit-flow {
    position: fixed;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.vynex-auth-cards {
    z-index: 2;
}

.vynex-circuit-flow {
    z-index: 0;
    opacity: .86;
    mix-blend-mode: screen;
}

.auth-visual > .auth-visual-background {
    position: relative;
    z-index: 0;
    object-position: center bottom;
}

@media (max-width: 640px) {
    .auth-visual > .auth-visual-background {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: min(52vh, 440px);
        object-fit: contain;
        object-position: center center;
        background: #01050b;
        transform: none;
    }
}

.auth-visual::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    content: "";
    background: rgba(1, 7, 17, .18);
    pointer-events: none;
}

.auth-panel {
    position: relative;
    z-index: 3;
}

.portal-shell,
.module-shell {
    position: relative;
    z-index: 1;
}

.portal-shell {
    background: rgba(245, 247, 250, .78);
}

html[data-theme="dark"] .portal-shell {
    background: rgba(5, 12, 23, .80);
}

.module-shell {
    background: rgba(245, 247, 250, .72);
}

html[data-theme="dark"] .module-shell {
    background: rgba(5, 12, 23, .75);
}

.module-topbar {
    box-shadow: 0 8px 28px rgba(7, 17, 31, .06);
}

.module-card {
    transform-style: preserve-3d;
    transform-origin: center center;
    will-change: transform;
}

.module-card > * {
    position: relative;
    z-index: 1;
    transform: translateZ(18px);
}

.module-card::before {
    position: absolute;
    z-index: 0;
    top: -1px;
    right: -1px;
    width: 72px;
    height: 72px;
    content: "";
    border-top: 2px solid rgba(var(--module-accent-rgb), .8);
    border-right: 2px solid rgba(var(--module-accent-rgb), .8);
    opacity: .5;
    transition: width .24s ease, height .24s ease, opacity .24s ease;
}

a.module-card:hover::before,
a.module-card:focus-visible::before {
    width: 104px;
    height: 104px;
    opacity: 1;
}

a.module-card.is-tilting {
    transform: perspective(1100px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(-5px);
    transition-duration: .08s;
}

.vynex-motion-ready .auth-panel-inner {
    animation:
        vynex-panel-enter .55s cubic-bezier(.2, .75, .2, 1) both,
        auth-neon-breathe 4.8s ease-in-out .65s infinite;
}

.vynex-motion-ready .module-main > section,
.vynex-motion-ready .main-content > * {
    animation: vynex-content-enter .38s cubic-bezier(.2, .7, .2, 1) both;
}

.vynex-motion-ready .module-main > section:nth-child(2),
.vynex-motion-ready .main-content > *:nth-child(2) {
    animation-delay: .045s;
}

.vynex-motion-ready .module-main > section:nth-child(3),
.vynex-motion-ready .main-content > *:nth-child(3) {
    animation-delay: .08s;
}

.portal-primary:active,
.portal-secondary:active,
.portal-danger:active,
.icon-button:active {
    transform: translateY(1px) scale(.985);
}

@keyframes vynex-panel-enter {
    from {
        opacity: .2;
        transform: translateY(14px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes vynex-content-enter {
    from {
        opacity: .35;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-neon-line {
    0%, 100% {
        width: 76px;
        opacity: .72;
    }
    50% {
        width: 132px;
        opacity: 1;
    }
}

@keyframes auth-neon-breathe {
    0%, 100% {
        border-color: rgba(89, 215, 247, .42);
        box-shadow:
            0 0 0 1px rgba(58, 149, 220, .08),
            0 0 24px rgba(42, 185, 235, .12),
            0 26px 72px rgba(0, 0, 0, .58),
            inset 0 1px 0 rgba(255, 255, 255, .1),
            inset 0 0 28px rgba(24, 139, 204, .05);
    }
    50% {
        border-color: rgba(107, 226, 252, .64);
        box-shadow:
            0 0 0 1px rgba(58, 149, 220, .12),
            0 0 34px rgba(42, 185, 235, .2),
            0 28px 76px rgba(0, 0, 0, .62),
            inset 0 1px 0 rgba(255, 255, 255, .12),
            inset 0 0 32px rgba(24, 139, 204, .08);
    }
}

@media (max-width: 1180px) {
    .vynex-auth-cards {
        display: none;
    }

}

@media (max-aspect-ratio: 3 / 2) {
    .vynex-auth-cards {
        display: none;
    }
}

@media (max-width: 820px) {
    .auth-panel-inner {
        width: min(100%, 430px);
        padding: 22px 18px 20px;
    }
}

@media (max-width: 760px) {

    .vynex-circuit-flow {
        opacity: .58;
    }

    .module-card,
    .module-card > * {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vynex-circuit-flow {
        display: none;
    }

    .module-card,
    .module-card > * {
        transform: none !important;
        will-change: auto;
    }

    .auth-panel-inner,
    .auth-panel-inner::before {
        animation: none !important;
    }
}

/* Financial and user workspace legibility */
.portal-body {
    font-size: 16px;
}

.sidebar {
    font-size: 14px;
}

.nav-group-label {
    font-size: 11px;
}

.nav-item {
    min-height: 44px;
    font-size: 14px;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.nav-item:hover,
.nav-item:focus-visible {
    transform: translateX(2px);
}

.topbar {
    min-height: 78px;
}

.topbar-context {
    display: grid;
    gap: 1px;
    text-transform: none;
}

.topbar-greeting {
    color: var(--text-soft);
    font-size: 13px;
}

.topbar-date {
    color: var(--text);
    font-size: 21px;
    line-height: 1.2;
}

.user-copy strong {
    font-size: 13px;
}

.user-copy small {
    font-size: 11px;
}

.page-heading h1 {
    font-size: 31px;
}

.page-heading p:last-child {
    font-size: 15px;
}

.eyebrow {
    font-size: 12px;
}

.metric-card,
.access-option,
.active-option,
.profile-summary,
.form-section,
.workspace-section {
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background-color .2s ease;
}

.metric-card:hover,
.access-option:hover,
.active-option:hover {
    border-color: color-mix(in srgb, var(--blue-600) 48%, var(--line));
    box-shadow: 0 12px 28px rgba(15, 31, 51, .09);
    transform: translateY(-2px);
}

.metric-card small {
    font-size: 12px;
}

.metric-card strong.metric-money {
    font-size: 24px;
}

.metric-card span:last-child {
    font-size: 13px;
}

.section-heading h2 {
    font-size: 19px;
}

.section-heading p {
    font-size: 14px;
}

.section-link {
    font-size: 13px;
}

.portal-table th {
    font-size: 12px;
}

.portal-table td {
    font-size: 14px;
}

.portal-table tbody tr {
    transition: background-color .16s ease;
}

.portal-table tbody tr:hover {
    background: color-mix(in srgb, var(--surface-muted) 62%, transparent);
}

.table-user strong,
.activity-list strong,
.table-stack strong,
.table-entity strong {
    font-size: 14px;
}

.table-user small,
.activity-list small,
.table-stack small,
.table-entity small {
    font-size: 12px;
}

.module-tag,
.status-pill,
.validation-chip {
    font-size: 12px;
}

.status-pill {
    min-height: 29px;
    padding: 5px 9px;
}

.status-finished {
    color: #4f5d70;
    background: #e9eef4;
    border: 1px solid #cbd5e1;
}

.form-section-heading h2 {
    font-size: 18px;
}

.form-section-heading p,
.management-form .form-field > small:not(.field-error),
.form-callout small,
.access-option small,
.active-option small,
.protected-access small,
.profile-summary small {
    font-size: 12px;
}

.form-field label,
.module-access-fieldset legend,
.access-option strong,
.active-option strong,
.protected-access strong,
.profile-summary strong,
.form-callout strong {
    font-size: 14px;
}

.management-form .form-field input,
.management-form .form-field select,
.management-form .form-field textarea,
.filter-bar input,
.filter-bar select,
.receipt-form input,
.receipt-form select,
.receipt-form textarea {
    font-size: 15px;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.management-form .form-field input:disabled,
.management-form .form-field select:disabled {
    color: var(--text-soft);
    background: var(--surface-muted);
    cursor: not-allowed;
    opacity: .88;
}

.filter-bar {
    transition: border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.filter-bar:focus-within {
    border-color: color-mix(in srgb, var(--blue-600) 46%, var(--line));
    box-shadow: 0 9px 24px rgba(15, 31, 51, .07);
}

.filter-bar.is-submitting {
    opacity: .76;
    pointer-events: none;
}

.filter-bar.is-submitting .filter-button svg {
    animation: filter-spin .7s linear infinite;
}

.filter-clear,
.invoice-tabs a,
.automation-status small,
.automation-status strong,
.last-test-line,
.automation-section strong,
.automation-section small,
.smtp-test-grid strong,
.smtp-test-grid small,
.inline-error {
    font-size: 12px;
}

.invoice-tabs a {
    min-height: 42px;
    font-size: 13px;
}

.detail-list dt,
.detail-list dd,
.summary-values small,
.detail-text,
.internal-note p,
.activation-panel small,
.reminder-timeline small {
    font-size: 14px;
}

.summary-values strong,
.activation-panel strong,
.internal-note strong,
.reminder-timeline strong {
    font-size: 15px;
}

.portal-primary,
.portal-secondary,
.portal-danger {
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.portal-primary:hover,
.portal-secondary:hover,
.portal-danger:hover {
    transform: translateY(-1px);
}

.portal-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 43px;
    padding: 0 18px;
    color: var(--red-600);
    background: var(--red-100);
    border: 1px solid #e8aaaa;
    border-radius: 6px;
}

.portal-danger:hover,
.portal-danger:focus-visible {
    color: #8f2626;
    background: #f9dada;
    border-color: #d98989;
}

.contract-reference {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding-top: 14px;
    color: var(--text-soft);
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.contract-reference a {
    color: var(--blue-600);
    text-decoration: none;
}

.contract-reference-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.contract-cancelled-note {
    color: var(--red-600);
    background: color-mix(in srgb, var(--red-100) 72%, var(--surface));
    border-color: #f0bebe;
}

.contract-action-panel {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.contract-action-panel[open] {
    box-shadow: 0 12px 28px rgba(15, 31, 51, .08);
}

.contract-action-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}

.contract-action-panel > summary::-webkit-details-marker {
    display: none;
}

.contract-action-panel > summary > span {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contract-action-panel > summary > span > span {
    display: grid;
}

.contract-action-panel > summary strong {
    font-size: 15px;
}

.contract-action-panel > summary small {
    color: var(--text-soft);
    font-size: 13px;
}

.contract-action-panel > summary > svg:last-child {
    transition: transform .18s ease;
}

.contract-action-panel[open] > summary > svg:last-child {
    transform: rotate(180deg);
}

.contract-danger-panel > summary > span > svg {
    color: var(--red-600);
}

.contract-renew-panel > summary > span > svg {
    color: var(--green-600);
}

.contract-inline-form,
.contract-renew-form {
    display: grid;
    gap: 14px;
    padding: 20px;
    background: var(--surface-soft);
    border-top: 1px solid var(--line);
}

.contract-inline-form {
    grid-template-columns: minmax(180px, .4fr) minmax(280px, 1fr) auto;
    align-items: end;
}

.contract-renew-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contract-inline-form .form-field-grow,
.contract-renew-form button {
    min-width: 0;
}

.contract-inline-form input,
.contract-inline-form textarea,
.contract-renew-form input,
.contract-renew-form select {
    width: 100%;
    min-height: 43px;
    padding: 9px 12px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
}

.contract-inline-form textarea {
    resize: vertical;
}

.contract-renew-form button {
    grid-column: 1 / -1;
    width: fit-content;
}

.audit-filter-bar {
    flex-wrap: wrap;
}

.audit-filter-bar .filter-search {
    flex-basis: 340px;
}

.audit-filter-bar input[type="date"] {
    width: 150px;
}

.audit-log-table {
    min-width: 1240px;
}

.audit-log-table th:nth-child(6),
.audit-log-table td:nth-child(6) {
    min-width: 300px;
}

.audit-area {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: inherit;
}

.audit-area .section-header,
.audit-area .audit-filter-bar {
    width: auto;
    margin-right: 18px;
    margin-left: 18px;
}

.audit-area .section-header {
    margin-top: 18px;
}

.audit-area .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.audit-details-cell {
    color: var(--text-soft);
}

.audit-changes {
    margin-top: 7px;
}

.audit-changes summary {
    width: fit-content;
    color: var(--blue-600);
    cursor: pointer;
    font-size: 12px;
}

.audit-changes dl {
    display: grid;
    gap: 8px;
    margin: 10px 0 0;
    padding: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.audit-changes dl > div {
    display: grid;
    gap: 3px;
}

.audit-changes dt {
    color: var(--text-soft);
    font-size: 11px;
}

.audit-changes dd {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--text);
    font-size: 12px;
}

.audit-changes dd svg {
    width: 14px;
    height: 14px;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 18px;
    color: var(--text-soft);
    font-size: 13px;
}

.pagination-bar .is-disabled {
    opacity: .48;
    pointer-events: none;
}

html[data-theme="dark"] .status-finished {
    color: #c3cfdd;
    background: #263448;
    border-color: #43536b;
}

html[data-theme="dark"] .audit-area {
    color: var(--text);
    background: var(--surface);
    border-color: var(--line);
}

html[data-theme="dark"] .portal-danger {
    color: #ffb3b3;
    background: #351c24;
    border-color: #65313d;
}

@keyframes filter-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1050px) {
    .contract-inline-form,
    .contract-renew-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contract-inline-form .form-field-grow,
    .contract-inline-form button,
    .contract-renew-form button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .topbar-context {
        display: grid;
    }

    .topbar-date {
        font-size: 18px;
    }
}

@media (max-width: 640px) {
    .topbar {
        gap: 10px;
    }

    .topbar-context {
        min-width: 0;
        margin-right: auto;
    }

    .topbar-greeting {
        max-width: 150px;
        overflow: hidden;
        font-size: 11px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-date {
        font-size: 16px;
    }

    .topbar .user-summary {
        display: none;
    }

    .topbar-actions {
        gap: 6px;
    }

    .page-heading h1 {
        font-size: 27px;
    }

    .portal-table th,
    .portal-table td {
        padding: 13px 14px;
    }

    .contract-inline-form,
    .contract-renew-form {
        grid-template-columns: 1fr;
    }

    .contract-inline-form .form-field-grow,
    .contract-inline-form button,
    .contract-renew-form button {
        grid-column: auto;
        width: 100%;
    }

    .contract-action-panel > summary {
        align-items: flex-start;
    }

    .pagination-bar {
        justify-content: space-between;
    }
}

/* Financial management workspace */
.heading-actions,
.filter-bar,
.filter-search,
.section-link,
.table-entity,
.table-stack,
.form-callout,
.activation-panel > div,
.integration-notice,
.integration-notice > span,
.receipt-form,
.template-grid > div,
.activity-list a {
    min-width: 0;
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.heading-actions .portal-primary,
.heading-actions .portal-secondary,
.section-heading .section-link {
    text-decoration: none;
}

.section-link {
    color: var(--blue-600);
    font-size: 11px;
    font-weight: 720;
    white-space: nowrap;
}

.section-link:hover,
.section-link:focus-visible,
.table-main-link:hover,
.table-main-link:focus-visible {
    color: #0c5d9e;
}

.finance-dashboard-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr);
}

.compact-table th,
.compact-table td {
    padding: 12px 13px;
}

.compact-empty,
.empty-state {
    display: grid;
    place-items: center;
    color: var(--text-soft);
    text-align: center;
}

.compact-empty {
    min-height: 110px;
    gap: 8px;
    border-top: 1px solid var(--line);
    font-size: 12px;
}

.compact-empty svg {
    width: 24px;
    height: 24px;
}

.empty-state {
    min-height: 300px;
    padding: 38px;
}

.empty-state > svg {
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
}

.empty-state h2 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
}

.empty-state p {
    margin: 7px 0 0;
    font-size: 12px;
}

.activity-list {
    display: grid;
    border-top: 1px solid var(--line);
}

.activity-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 62px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}

.activity-list a:hover strong {
    color: var(--blue-600);
}

.activity-list a > span:first-child,
.table-stack,
.table-entity {
    display: grid;
}

.activity-list strong,
.table-stack strong,
.table-entity strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-list small,
.table-stack small,
.table-entity small {
    overflow: hidden;
    color: var(--text-soft);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-entity,
.table-main-link {
    color: var(--text);
    font-weight: 680;
    text-decoration: none;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.filter-search {
    position: relative;
    flex: 1 1 280px;
}

.filter-search svg {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-soft);
    transform: translateY(-50%);
}

.filter-bar input,
.filter-bar select,
.receipt-form input,
.receipt-form select,
.receipt-form textarea {
    min-height: 41px;
    padding: 8px 11px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
}

.filter-search input {
    width: 100%;
    padding-left: 38px;
}

.filter-bar select {
    min-width: 180px;
}

.filter-bar-wide select {
    min-width: 165px;
}

.filter-button {
    gap: 7px;
    min-height: 41px;
    padding: 0 14px;
}

.filter-button svg,
.heading-actions svg,
.portal-action-button svg,
.receipt-form button svg {
    width: 16px;
    height: 16px;
}

.filter-clear {
    padding: 7px;
    color: var(--text-soft);
    font-size: 11px;
}

.status-pending {
    color: #1766a5;
    background: #e2f0fb;
    border: 1px solid #c4def1;
}

.status-overdue {
    color: var(--red-600);
    background: var(--red-100);
    border: 1px solid #f4c3c3;
}

.status-draft {
    color: #685427;
    background: #f7efd9;
    border: 1px solid #e9d9aa;
}

.large-status {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 11px;
}

.finance-form {
    max-width: 1080px;
}

.management-form .form-field textarea {
    width: 100%;
    padding: 10px 12px;
    resize: vertical;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
}

.management-form .form-field textarea:focus,
.receipt-form input:focus,
.receipt-form select:focus,
.receipt-form textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(20, 120, 201, .13);
}

.input-prefix {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
}

.input-prefix > span {
    display: grid;
    place-items: center;
    min-width: 44px;
    color: var(--text-soft);
    background: var(--surface-muted);
    border: 1px solid var(--line-strong);
    border-right: 0;
    border-radius: 6px 0 0 6px;
    font-size: 11px;
    font-weight: 700;
}

.management-form .input-prefix input {
    border-radius: 0 6px 6px 0;
}

.form-callout {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    color: #1766a5;
    background: color-mix(in srgb, #e2f0fb 74%, var(--surface));
    border: 1px solid #c4def1;
    border-radius: 7px;
}

.form-callout > svg {
    flex: 0 0 auto;
}

.form-callout > span {
    display: grid;
}

.form-callout strong {
    color: var(--text);
    font-size: 12px;
}

.form-callout small {
    color: var(--text-soft);
    font-size: 10px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: minmax(120px, .7fr) minmax(0, 1.3fr);
    gap: 18px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}

.detail-list dt,
.detail-list dd {
    margin: 0;
    font-size: 11px;
}

.detail-list dt {
    color: var(--text-soft);
}

.detail-list dd {
    overflow-wrap: anywhere;
    font-weight: 680;
    text-align: right;
}

.summary-values {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}

.summary-values > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 55px;
    border-bottom: 1px solid var(--line);
}

.summary-values small {
    color: var(--text-soft);
    font-size: 11px;
}

.summary-values strong {
    font-size: 14px;
}

.section-spaced {
    margin-top: 18px;
}

.detail-text,
.internal-note p {
    color: var(--text-soft);
    font-size: 12px;
    white-space: pre-line;
}

.internal-note {
    margin-top: 18px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.internal-note strong {
    font-size: 11px;
}

.internal-note p {
    margin: 5px 0 0;
}

.activation-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 22px;
    background: color-mix(in srgb, var(--green-100) 76%, var(--surface));
    border: 1px solid #b8e7d2;
    border-radius: 8px;
}

.activation-panel > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.activation-panel > div > svg {
    flex: 0 0 auto;
    color: var(--green-600);
}

.activation-panel span {
    display: grid;
}

.activation-panel strong {
    font-size: 13px;
}

.activation-panel small {
    color: var(--text-soft);
    font-size: 11px;
}

.receipt-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.receipt-form .form-field {
    display: grid;
}

.receipt-form .form-field:nth-child(4),
.receipt-form button {
    grid-column: 1 / -1;
}

.receipt-form textarea {
    resize: vertical;
}

.receipt-form button {
    width: fit-content;
}

.danger-action {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.reminder-timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.reminder-timeline > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    min-width: 0;
    padding: 13px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.timeline-dot {
    width: 8px;
    height: 8px;
    margin-top: 4px;
    background: var(--blue-600);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(20, 120, 201, .12);
}

.reminder-timeline > div > span:last-child {
    display: grid;
}

.reminder-timeline strong {
    font-size: 11px;
}

.reminder-timeline small {
    color: var(--text-soft);
    font-size: 9px;
}

.integration-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 14px 16px;
    color: #1766a5;
    background: color-mix(in srgb, #e2f0fb 78%, var(--surface));
    border: 1px solid #c4def1;
    border-radius: 7px;
}

.integration-notice > svg {
    flex: 0 0 auto;
}

.integration-notice > span {
    display: grid;
}

.integration-notice strong {
    color: var(--text);
    font-size: 12px;
}

.integration-notice small {
    color: var(--text-soft);
    font-size: 10px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.template-grid > div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.template-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #1766a5;
    background: #e2f0fb;
    border-radius: 6px;
}

.template-icon svg {
    width: 16px;
    height: 16px;
}

.template-grid > div > span:last-child {
    display: grid;
}

.template-grid strong {
    font-size: 11px;
}

.template-grid small {
    color: var(--text-soft);
    font-size: 9px;
}

.message-preview {
    min-width: 94px;
}

.message-preview summary {
    color: var(--blue-600);
    cursor: pointer;
    font-size: 11px;
    font-weight: 680;
}

.message-preview[open] {
    width: min(360px, 50vw);
    padding: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.message-preview strong {
    display: block;
    margin-top: 8px;
    font-size: 11px;
}

.message-preview p {
    margin: 5px 0 0;
    color: var(--text-soft);
    font-size: 10px;
    white-space: normal;
}

html[data-theme="dark"] .status-pending,
html[data-theme="dark"] .template-icon {
    color: #82c8f4;
    background: #18344c;
    border-color: #285271;
}

html[data-theme="dark"] .integration-notice {
    color: #82c8f4;
    background: rgba(17, 36, 54, .94);
    border-color: #315878;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}

html[data-theme="dark"] .integration-notice strong {
    color: #edf4fc;
}

html[data-theme="dark"] .integration-notice small {
    color: #b7c7d9;
}

html[data-theme="dark"] .form-callout {
    color: #82c8f4;
    background: rgba(17, 36, 54, .94);
    border-color: #315878;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}

html[data-theme="dark"] .form-callout strong {
    color: #edf4fc;
}

html[data-theme="dark"] .form-callout small {
    color: #b7c7d9;
}

html[data-theme="dark"] .status-draft {
    color: #e5c879;
    background: #342c18;
    border-color: #594b27;
}

@media (max-width: 1050px) {
    .finance-dashboard-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .template-grid,
    .reminder-timeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .filter-bar,
    .activation-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-bar select,
    .filter-button,
    .activation-panel form,
    .activation-panel button {
        width: 100%;
    }

    .heading-actions {
        justify-content: flex-start;
    }

    .template-grid,
    .reminder-timeline,
    .receipt-form {
        grid-template-columns: 1fr;
    }

    .receipt-form .form-field,
    .receipt-form button {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* Invoice e-mail operations */
.invoice-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.invoice-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    color: var(--text-soft);
    border-bottom: 2px solid transparent;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.invoice-tabs a:hover,
.invoice-tabs a:focus-visible,
.invoice-tabs a.active {
    color: var(--blue-600);
    border-bottom-color: var(--blue-600);
}

.invoice-tabs svg,
.automation-status svg,
.validation-chip svg,
.setting-icon svg,
.smtp-test-grid button svg,
.form-actions button svg,
.inline-error svg {
    width: 16px;
    height: 16px;
}

.automation-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 168px;
    min-height: 48px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.automation-status > span {
    display: grid;
}

.automation-status small {
    color: var(--text-soft);
    font-size: 9px;
    text-transform: uppercase;
}

.automation-status strong {
    font-size: 12px;
}

.automation-status.is-active {
    color: var(--green-600);
    border-color: #b8e7d2;
}

.automation-status.is-inactive {
    color: var(--amber-600);
    border-color: #e9d9aa;
}

.email-settings-form {
    max-width: 1100px;
}

.validation-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.validation-chip.is-valid {
    color: var(--green-600);
    background: var(--green-100);
    border-color: #b8e7d2;
}

.validation-chip.is-pending {
    color: var(--amber-600);
    background: var(--amber-100);
    border-color: #e9d9aa;
}

.last-test-line {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 18px 0 0;
    padding-top: 14px;
    color: var(--text-soft);
    border-top: 1px solid var(--line);
    font-size: 10px;
}

.last-test-line strong {
    color: var(--text);
}

.automation-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1100px;
}

.automation-section > div {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.automation-section > div > span:last-child {
    display: grid;
}

.automation-section strong {
    font-size: 13px;
}

.automation-section small {
    color: var(--text-soft);
    font-size: 10px;
}

.setting-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #1766a5;
    background: #e2f0fb;
    border-radius: 6px;
}

.switch-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.switch-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.switch-control > span {
    position: relative;
    width: 42px;
    height: 23px;
    background: var(--surface-muted);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    transition: background .16s ease, border-color .16s ease;
}

.switch-control > span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    content: "";
    background: #ffffff;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    transition: transform .16s ease;
}

.switch-control input:checked + span {
    background: var(--green-600);
    border-color: var(--green-600);
}

.switch-control input:checked + span::after {
    border-color: #ffffff;
    transform: translateX(19px);
}

.switch-control input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(20, 120, 201, .18);
}

.switch-control b {
    font-size: 11px;
}

.setting-error {
    position: absolute;
    right: 22px;
    bottom: -20px;
}

.smtp-test-section {
    max-width: 1100px;
}

.smtp-test-grid {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 14px;
}

.smtp-test-grid form {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    padding: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.smtp-test-grid form > div:not(.form-field) {
    display: grid;
}

.smtp-test-grid strong {
    font-size: 12px;
}

.smtp-test-grid small {
    color: var(--text-soft);
    font-size: 10px;
}

.smtp-test-grid .form-field {
    flex: 1 1 auto;
    min-width: 0;
}

.smtp-test-grid input,
.email-history-filters > input {
    width: 100%;
    min-height: 41px;
    padding: 8px 11px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
}

.smtp-test-grid button {
    flex: 0 0 auto;
    gap: 7px;
}

.inline-error {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 12px;
    color: var(--red-600);
    background: var(--red-100);
    border: 1px solid #f4c3c3;
    border-radius: 6px;
    font-size: 11px;
}

.email-history-filters {
    flex-wrap: wrap;
}

.email-history-filters > input {
    flex: 1 1 145px;
    max-width: 210px;
}

html[data-theme="dark"] .validation-chip.is-valid {
    color: #8de0bd;
    background: #12382c;
    border-color: #226047;
}

html[data-theme="dark"] .validation-chip.is-pending {
    color: #e5c879;
    background: #342c18;
    border-color: #594b27;
}

html[data-theme="dark"] .setting-icon {
    color: #82c8f4;
    background: #18344c;
}

html[data-theme="dark"] .inline-error {
    color: #ffaaaa;
    background: #351c24;
    border-color: #65313d;
}

@media (max-width: 900px) {
    .smtp-test-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .invoice-tabs {
        overflow-x: auto;
    }

    .invoice-tabs a {
        flex: 0 0 auto;
    }

    .automation-section,
    .smtp-test-grid form {
        align-items: stretch;
        flex-direction: column;
    }

    .setting-error {
        position: static;
    }

    .smtp-test-grid button,
    .email-history-filters > input {
        width: 100%;
        max-width: none;
    }
}

/* Final portal readability precedence */
.section-link,
.filter-clear,
.large-status,
.invoice-tabs a,
.automation-status strong,
.automation-status small,
.last-test-line,
.automation-section strong,
.automation-section small,
.smtp-test-grid strong,
.smtp-test-grid small,
.inline-error {
    font-size: 12px;
}

.section-link,
.invoice-tabs a {
    font-size: 13px;
}

.portal-table th {
    font-size: 12px;
}

.portal-table td,
.detail-list dt,
.detail-list dd,
.summary-values small,
.detail-text,
.internal-note p,
.activation-panel small,
.reminder-timeline small {
    font-size: 14px;
}

.activity-list strong,
.table-stack strong,
.table-entity strong,
.table-user strong {
    font-size: 14px;
}

.activity-list small,
.table-stack small,
.table-entity small,
.table-user small {
    font-size: 12px;
}

.summary-values strong,
.activation-panel strong,
.internal-note strong,
.reminder-timeline strong {
    font-size: 15px;
}

.invoice-tabs a {
    min-height: 42px;
}

.portal-secondary,
.portal-primary {
    gap: 8px;
}

.metric-card small,
.metric-card span:last-child {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.metric-card strong.metric-money {
    font-size: 21px;
    white-space: nowrap;
}

.section-heading {
    flex-wrap: wrap;
}

.section-heading > div {
    min-width: 0;
}

.section-heading .section-link {
    flex: 0 0 auto;
}

/* Proposals and projects */
.compact-button {
    min-height: 36px;
    padding: 7px 11px;
}

.proposal-item-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) 100px 78px 154px 118px 42px;
    gap: 10px;
    align-items: end;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.proposal-item-row:first-child {
    padding-top: 0;
}

.proposal-item-row .form-field {
    min-width: 0;
}

.proposal-item-row .form-field input {
    width: 100%;
}

.proposal-item-total {
    display: grid;
    min-width: 0;
    min-height: 44px;
    align-content: center;
}

.proposal-item-total small {
    color: var(--text-soft);
    font-size: 11px;
}

.proposal-item-total strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.proposal-item-remove {
    width: 42px;
    height: 42px;
    color: var(--red-600);
}

.add-proposal-item {
    margin-top: 14px;
}

.proposal-live-total {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.proposal-live-total > span {
    display: grid;
    gap: 3px;
    padding: 15px;
    background: var(--surface-soft);
}

.proposal-live-total small {
    color: var(--text-soft);
    font-size: 12px;
}

.proposal-live-total strong {
    font-size: 18px;
}

.proposal-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    gap: 16px;
}

.proposal-values {
    margin: 0;
}

.proposal-values > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.proposal-values dt {
    color: var(--text-soft);
}

.proposal-values dd {
    margin: 0;
    white-space: nowrap;
}

.proposal-values .proposal-grand-total {
    padding-top: 15px;
    color: var(--text);
    border: 0;
    font-size: 20px;
}

.proposal-copy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.proposal-copy-grid > div {
    min-width: 0;
}

.proposal-copy-grid strong {
    font-size: 14px;
}

.proposal-copy-grid p {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 14px;
    white-space: pre-line;
}

.proposal-copy-wide {
    grid-column: 1 / -1;
}

.proposal-items-table th:nth-child(n+2),
.proposal-items-table td:nth-child(n+2) {
    white-space: nowrap;
}

.proposal-action-grid {
    display: grid;
    gap: 12px;
}

.proposal-action-grid > form,
.proposal-issue-blocked {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.proposal-action-grid > form > span,
.proposal-issue-blocked > span {
    display: grid;
    flex: 1 1 auto;
}

.proposal-action-grid > form small,
.proposal-issue-blocked small {
    color: var(--text-soft);
    font-size: 12px;
}

.proposal-action-grid select {
    min-height: 42px;
    padding: 8px 34px 8px 11px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
}

.inline-error a {
    color: inherit;
}

.confirm-open {
    overflow: hidden;
}

.system-confirm-backdrop {
    position: fixed;
    z-index: 3000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 13, 26, .62);
    backdrop-filter: blur(4px);
}

.system-confirm-backdrop[hidden] {
    display: none;
}

.system-confirm-dialog {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 15px;
    width: min(100%, 540px);
    padding: 25px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(3, 13, 26, .28);
    animation: system-confirm-in .18s ease-out;
}

.system-confirm-close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.system-confirm-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: var(--blue-600);
    background: color-mix(in srgb, var(--blue-600) 12%, var(--surface));
    border-radius: 7px;
}

.system-confirm-dialog.is-danger .system-confirm-icon {
    color: var(--red-600);
    background: var(--red-100);
}

html[data-theme="dark"] .portal-notice {
    color: #86dfba;
    background: #12372f;
    border-color: #285e50;
}

html[data-theme="dark"] .portal-notice-error,
html[data-theme="dark"] .system-confirm-dialog.is-danger .system-confirm-icon {
    color: #ffb3b3;
    background: #351c24;
    border-color: #65313d;
}

.system-confirm-copy {
    padding: 1px 35px 0 0;
}

.system-confirm-copy h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.system-confirm-copy p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.system-confirm-reason {
    display: grid;
    grid-column: 1 / -1;
    gap: 7px;
    width: 100%;
    margin-top: 2px;
}

.system-confirm-reason[hidden] { display: none; }

.system-confirm-reason label {
    color: var(--text);
    font-size: 14px;
}

.system-confirm-reason textarea {
    width: 100%;
    resize: vertical;
    min-height: 84px;
    padding: 10px 12px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
}

.system-confirm-reason textarea:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-600) 15%, transparent);
}

.system-confirm-reason small { color: var(--text-muted); }

.table-action-group { display: inline-flex; align-items: center; gap: 7px; }
.table-action-group form { margin: 0; }
.icon-button-danger { color: var(--danger); }
.ticket-danger-zone { display:grid;gap:16px;padding:18px;border:1px solid color-mix(in srgb,var(--danger) 35%,var(--line));border-radius:7px;background:color-mix(in srgb,var(--danger) 5%,var(--surface)); }
.ticket-danger-zone > div { display:flex;align-items:flex-start;gap:11px; }
.ticket-danger-zone > div > span { display:grid;place-items:center;width:38px;height:38px;color:var(--danger);background:color-mix(in srgb,var(--danger) 12%,transparent);border-radius:6px; }
.ticket-danger-zone p { display:grid;gap:3px;margin:0; }
.ticket-danger-zone small { color:var(--text-muted);line-height:1.45; }
.ticket-danger-zone form { margin:0; }
.ticket-danger-zone .portal-danger { width:100%;justify-content:center; }
.audit-integrity-badge { display:inline-flex;align-items:center;gap:8px;padding:8px 11px;color:var(--green-700);background:var(--green-100);border:1px solid color-mix(in srgb,var(--green-600) 28%,transparent);border-radius:6px; }
.admin-audit-metrics { margin-bottom:20px; }
.audit-event-group { display:inline-flex;padding:3px 7px;color:var(--blue-700);background:var(--blue-100);border-radius:5px;font-size:12px; }
.audit-origin { display:inline-flex;align-items:center;gap:6px;white-space:nowrap;color:var(--text-muted); }
.audit-origin svg { width:14px;height:14px; }

.audit-pagination,
.compact-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    color: var(--text-soft);
    background: var(--surface-soft);
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.audit-pagination p,
.compact-pagination p { margin: 0; }
.audit-pagination nav,
.compact-pagination nav { display: flex; align-items: center; gap: 10px; }
.audit-pagination .icon-button,
.compact-pagination .icon-button { width: 36px; height: 36px; background: var(--surface); }
.audit-pagination .icon-button svg,
.compact-pagination .icon-button svg { width: 17px; height: 17px; }
.audit-pagination .is-disabled,
.compact-pagination .is-disabled { opacity: .38; cursor: default; }

.system-confirm-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 7px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

@keyframes system-confirm-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1300px) {
    .proposal-item-row {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .proposal-item-description,
    .proposal-item-details {
        grid-column: span 6;
    }

    .proposal-item-quantity,
    .proposal-item-unit {
        grid-column: span 2;
    }

    .proposal-item-price {
        grid-column: span 3;
    }

    .proposal-item-total {
        grid-column: span 3;
    }

    .proposal-item-remove {
        grid-column: span 2;
        justify-self: end;
    }
}

@media (max-width: 800px) {
    .proposal-summary-grid,
    .proposal-copy-grid {
        grid-template-columns: 1fr;
    }

    .proposal-copy-wide {
        grid-column: auto;
    }

    .proposal-live-total {
        grid-template-columns: 1fr;
    }

    .proposal-action-grid > form,
    .proposal-issue-blocked {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .deadline-input-group {
        grid-template-columns: 1fr;
    }

    .system-confirm-dialog {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 12px;
        padding: 20px;
    }

    .system-confirm-copy {
        padding-right: 28px;
    }

    .system-confirm-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .system-confirm-actions button {
        width: 100%;
    }

    .audit-pagination,
    .compact-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    .audit-pagination nav,
    .compact-pagination nav {
        justify-content: space-between;
        width: 100%;
    }

    .proposal-item-row {
        grid-template-columns: 1fr 1fr;
    }

    .proposal-item-description,
    .proposal-item-details,
    .proposal-item-price {
        grid-column: 1 / -1;
    }

    .proposal-item-quantity,
    .proposal-item-unit,
    .proposal-item-total,
    .proposal-item-remove {
        grid-column: auto;
    }

    .proposal-item-remove {
        justify-self: end;
    }
}

/* Auth experience 2026-08: institutional split layout with animated night sky */
.auth-body {
    min-width: 320px;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    color: #f5f8fc;
    background: #02070d;
}

.auth-sky {
    position: fixed;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    background: #02070d;
    pointer-events: none;
}

.auth-sky::before {
    position: absolute;
    inset: 0;
    content: "";
    background:
        radial-gradient(circle at 19% 23%, rgba(36, 175, 208, .12), transparent 24%),
        radial-gradient(circle at 78% 72%, rgba(20, 73, 117, .16), transparent 28%);
}

.auth-sky::after {
    position: absolute;
    inset: 0;
    content: "";
    background-image: linear-gradient(rgba(5, 14, 25, 0), rgba(2, 7, 13, .52));
}

.auth-stars {
    position: absolute;
    inset: -12%;
    opacity: .72;
    background-repeat: repeat;
    animation: auth-star-drift 80s linear infinite;
}

.auth-stars-a {
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, .9) 0 1px, transparent 1.2px),
        radial-gradient(circle, rgba(114, 219, 246, .9) 0 1px, transparent 1.3px);
    background-position: 18px 24px, 86px 73px;
    background-size: 126px 126px, 173px 173px;
}

.auth-stars-b {
    opacity: .4;
    background-image:
        radial-gradient(circle, rgba(180, 225, 246, .82) 0 .8px, transparent 1.1px),
        radial-gradient(circle, rgba(255, 255, 255, .7) 0 .7px, transparent 1px);
    background-position: 42px 18px, 118px 96px;
    background-size: 214px 214px, 271px 271px;
    animation-duration: 120s;
    animation-direction: reverse;
}

.auth-stars-c {
    opacity: .2;
    background-image: radial-gradient(circle, rgba(73, 199, 239, .9) 0 1px, transparent 1.5px);
    background-position: 92px 137px;
    background-size: 337px 337px;
    animation-duration: 160s;
}

.auth-meteors,
.auth-meteors > span {
    position: absolute;
}

.auth-meteors {
    inset: 0;
    overflow: hidden;
}

.auth-meteors > span {
    top: var(--meteor-y);
    left: var(--meteor-x);
    width: 150px;
    height: 1px;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(199, 240, 255, .92));
    filter: drop-shadow(0 0 5px rgba(79, 202, 238, .9));
    transform: rotate(-24deg) translateX(-32vw);
    transform-origin: right center;
    animation: auth-meteor-flight var(--meteor-duration) linear var(--meteor-delay) infinite;
}

.auth-meteors > span::after {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 3px;
    height: 3px;
    content: "";
    background: #eafaff;
    border-radius: 50%;
    box-shadow: 0 0 9px rgba(114, 224, 250, .95);
}

.auth-meteors > span:nth-child(1) { --meteor-x: 6vw; --meteor-y: 13vh; --meteor-delay: -2s; --meteor-duration: 11s; }
.auth-meteors > span:nth-child(2) { --meteor-x: 31vw; --meteor-y: 5vh; --meteor-delay: -7s; --meteor-duration: 14s; }
.auth-meteors > span:nth-child(3) { --meteor-x: 64vw; --meteor-y: 18vh; --meteor-delay: -4s; --meteor-duration: 12s; }
.auth-meteors > span:nth-child(4) { --meteor-x: 78vw; --meteor-y: 48vh; --meteor-delay: -9s; --meteor-duration: 15s; }
.auth-meteors > span:nth-child(5) { --meteor-x: 18vw; --meteor-y: 67vh; --meteor-delay: -11s; --meteor-duration: 16s; }
.auth-meteors > span:nth-child(6) { --meteor-x: 48vw; --meteor-y: 79vh; --meteor-delay: -5s; --meteor-duration: 13s; }

.auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(380px, 430px);
    align-items: center;
    gap: clamp(48px, 7vw, 100px);
    width: min(100%, 1280px);
    min-height: 100svh;
    margin: 0 auto;
    padding: 62px 52px 72px;
    isolation: isolate;
}

.auth-story {
    min-width: 0;
}

.auth-story-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 660px;
}

.auth-story-logo {
    display: block;
    width: min(100%, 620px);
    height: auto;
    margin: 0 0 28px;
    filter: drop-shadow(0 0 20px rgba(39, 194, 231, .2));
}

.auth-story-copy {
    max-width: 625px;
}

.auth-story-kicker,
.auth-login-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #67d3eb;
    font-size: 12px;
    line-height: 1.4;
    text-transform: uppercase;
}

.auth-story-kicker {
    margin-bottom: 13px;
}

.auth-story-copy h2 {
    max-width: 590px;
    margin: 0;
    color: #f7f9fc;
    font-size: 39px;
    font-weight: 620;
    line-height: 1.15;
}

.auth-story-copy p {
    max-width: 590px;
    margin: 17px 0 0;
    color: rgba(213, 226, 238, .76);
    font-size: 16px;
    line-height: 1.7;
}

.auth-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(125, 177, 207, .2);
}

.auth-benefits li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 20px 18px 0 0;
}

.auth-benefits li + li {
    padding-left: 18px;
    border-left: 1px solid rgba(125, 177, 207, .16);
}

.auth-benefits svg {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    color: #55cae8;
    stroke-width: 1.65;
}

.auth-benefits span {
    color: rgba(190, 208, 224, .67);
    font-size: 12px;
    line-height: 1.55;
}

.auth-benefits strong {
    display: block;
    margin-bottom: 4px;
    color: #e9f2f8;
    font-size: 13px;
    font-weight: 620;
}

.auth-panel {
    position: relative;
    z-index: 2;
    display: block;
    min-width: 0;
    min-height: 0;
    padding: 0;
}

.auth-panel-stage {
    width: 100%;
}

.auth-panel-inner {
    position: relative;
    width: 100%;
    padding: 34px 34px 30px;
    overflow: hidden;
    color: #f5f9ff;
    background: rgba(4, 13, 25, .88);
    border: 1px solid rgba(101, 181, 219, .3);
    border-radius: 8px;
    box-shadow:
        0 26px 74px rgba(0, 0, 0, .46),
        0 0 0 1px rgba(74, 196, 232, .04),
        inset 0 1px 0 rgba(255, 255, 255, .05);
    backdrop-filter: blur(20px) saturate(120%);
}

.auth-panel-inner::before {
    top: 0;
    left: 34px;
    width: 64px;
    height: 2px;
    background: #4fcbea;
    border-radius: 0;
    box-shadow: 0 0 14px rgba(79, 203, 234, .8);
    transform: none;
    animation: none;
}

.auth-panel-inner::after {
    inset: 8px;
    border-color: rgba(114, 192, 224, .06);
    border-radius: 5px;
    box-shadow: none;
}

.auth-copy {
    margin-bottom: 23px;
    text-align: left;
}

.auth-login-kicker {
    margin-bottom: 12px;
    color: rgba(105, 211, 235, .82);
    font-size: 10px;
}

.auth-login-kicker svg {
    width: 14px;
    height: 14px;
}

.auth-copy h1 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 640;
    line-height: 1.2;
}

.auth-copy p:last-child {
    margin-top: 8px;
    color: rgba(206, 222, 235, .68);
    font-size: 13px;
}

.auth-form {
    gap: 14px;
}

.auth-panel-inner .form-field {
    gap: 7px;
}

.auth-panel-inner .form-field label {
    color: rgba(231, 240, 247, .9);
    font-size: 12px;
    font-weight: 560;
}

.auth-input-glow {
    padding: 0;
    border-radius: 6px;
}

.auth-input-glow::before {
    display: none;
}

.auth-panel-inner .auth-input-glow input {
    height: 48px;
    padding-left: 46px;
    background: rgba(2, 10, 20, .72);
    border: 1px solid rgba(127, 171, 203, .3);
    border-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.auth-panel-inner .auth-input-glow input:hover {
    border-color: rgba(120, 198, 229, .48);
}

.auth-panel-inner .auth-input-glow input:focus {
    background: rgba(3, 15, 28, .9);
    border-color: rgba(80, 204, 235, .82);
    box-shadow: 0 0 0 3px rgba(80, 204, 235, .1);
}

.auth-panel-inner .input-wrap > svg {
    left: 15px;
    color: rgba(111, 199, 226, .82);
}

.auth-panel-inner .auth-submit {
    min-height: 48px;
    margin-top: 4px;
    color: #03111b;
    background: #5bc9e8;
    border-color: #5bc9e8;
    box-shadow: 0 12px 30px rgba(35, 154, 191, .19);
}

.auth-panel-inner .auth-submit:hover,
.auth-panel-inner .auth-submit:focus-visible {
    color: #020c13;
    background: #7bd8ee;
    border-color: #7bd8ee;
    box-shadow: 0 14px 34px rgba(35, 154, 191, .26);
}

.auth-submit-glow {
    display: none;
}

.auth-access-request {
    gap: 8px;
    min-height: 28px;
    margin-top: 3px;
    padding-top: 16px;
    color: rgba(193, 211, 226, .64);
    border-top: 1px solid rgba(125, 177, 207, .15);
    font-size: 12px;
}

.auth-access-request a {
    color: #65d2e9;
    font-weight: 620;
}

.auth-page-footer {
    position: fixed;
    z-index: 2;
    right: 28px;
    bottom: 20px;
    color: rgba(169, 191, 209, .42);
    font-size: 11px;
}

.auth-body .auth-reveal {
    animation: auth-content-reveal .48s cubic-bezier(.2, .75, .2, 1) var(--reveal-delay, 0s) both;
}

.auth-copy { --reveal-delay: .08s; }
.auth-panel-inner .portal-alert { --reveal-delay: .14s; }
.auth-reveal-username { --reveal-delay: .16s; }
.auth-reveal-password { --reveal-delay: .22s; }
.auth-submit { --reveal-delay: .28s; }
.auth-access-request { --reveal-delay: .34s; }

@keyframes auth-star-drift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(7%, 4%, 0); }
}

@keyframes auth-meteor-flight {
    0%, 72% {
        opacity: 0;
        transform: rotate(-24deg) translateX(-32vw);
    }
    74% { opacity: .9; }
    84% { opacity: 0; }
    100% {
        opacity: 0;
        transform: rotate(-24deg) translateX(55vw);
    }
}

@media (max-width: 1080px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
        gap: 44px;
        padding-inline: 34px;
    }

    .auth-story-copy h2 {
        font-size: 34px;
    }

    .auth-benefits {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-benefits li {
        padding: 14px 0;
    }

    .auth-benefits li + li {
        padding-left: 0;
        border-top: 1px solid rgba(125, 177, 207, .12);
        border-left: 0;
    }
}

@media (max-width: 800px) {
    .auth-body {
        overflow-y: auto;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        gap: 30px;
        width: min(100%, 520px);
        padding: 34px 20px 58px;
    }

    .auth-story-inner {
        align-items: center;
        text-align: center;
    }

    .auth-story-logo {
        width: min(100%, 460px);
        margin-bottom: 14px;
    }

    .auth-story-kicker,
    .auth-story-copy p,
    .auth-benefits {
        display: none;
    }

    .auth-story-copy h2 {
        max-width: 430px;
        font-size: 22px;
        font-weight: 560;
        line-height: 1.3;
    }

    .auth-panel-inner {
        padding: 30px 24px 25px;
    }

    .auth-page-footer {
        position: absolute;
        right: 0;
        bottom: 18px;
        left: 0;
        text-align: center;
    }
}

@media (max-width: 420px) {
    .auth-shell {
        padding-inline: 14px;
    }

    .auth-panel-inner {
        padding: 28px 18px 23px;
    }

    .auth-copy h1 {
        font-size: 25px;
    }

    .auth-access-request {
        align-items: center;
        flex-direction: column;
    }
}

@media (max-height: 740px) and (min-width: 801px) {
    .auth-shell {
        padding-block: 34px 48px;
    }

    .auth-story-logo {
        width: min(100%, 520px);
        margin-bottom: 18px;
    }

    .auth-story-copy h2 {
        font-size: 32px;
    }

    .auth-story-copy p {
        margin-top: 12px;
        font-size: 14px;
    }

    .auth-benefits {
        margin-top: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-stars,
    .auth-meteors > span,
    .auth-body .auth-reveal {
        animation: none !important;
    }

    .auth-meteors {
        display: none;
    }
}

/* Auth and global theme refinement 2026-08 */
.theme-selector {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(3, 34px);
    gap: 3px;
    padding: 4px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid color-mix(in srgb, var(--line-strong) 76%, transparent);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(1, 8, 18, .16), inset 0 1px 0 rgba(255, 255, 255, .05);
    backdrop-filter: blur(16px) saturate(120%);
    transform: translateX(-50%);
}

.theme-selector button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 32px;
    padding: 0;
    color: var(--text-soft);
    background: transparent;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.theme-selector button:hover,
.theme-selector button:focus-visible {
    color: var(--text);
    background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
}

.theme-selector button.is-active {
    color: #087ca0;
    background: color-mix(in srgb, var(--cyan-100) 84%, transparent);
    box-shadow: inset 0 0 0 1px rgba(24, 185, 207, .24);
}

html[data-theme="dark"] .theme-selector button.is-active {
    color: #72daf0;
    background: rgba(24, 185, 207, .13);
    box-shadow: inset 0 0 0 1px rgba(74, 205, 233, .24), 0 0 14px rgba(24, 185, 207, .09);
}

.theme-selector svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.8;
}

.auth-stars {
    inset: auto;
    top: -4vh;
    left: -4vw;
    width: 1px;
    height: 1px;
    color: rgba(222, 245, 255, .86);
    background: currentColor;
    background-image: none;
    border-radius: 50%;
    opacity: .72;
    animation: ambient-star-drift 90s linear infinite, ambient-star-pulse 5.5s ease-in-out infinite alternate;
}

.auth-stars-a {
    box-shadow:
        5vw 9vh currentColor, 11vw 31vh currentColor, 17vw 17vh currentColor, 24vw 59vh currentColor,
        29vw 8vh currentColor, 34vw 41vh currentColor, 39vw 73vh currentColor, 45vw 22vh currentColor,
        51vw 52vh currentColor, 57vw 12vh currentColor, 62vw 82vh currentColor, 68vw 34vh currentColor,
        73vw 64vh currentColor, 79vw 16vh currentColor, 84vw 47vh currentColor, 91vw 75vh currentColor,
        97vw 27vh currentColor, 14vw 87vh currentColor, 37vw 94vh currentColor, 88vw 91vh currentColor;
}

.auth-stars-b {
    width: 2px;
    height: 2px;
    color: rgba(79, 201, 232, .66);
    opacity: .58;
    box-shadow:
        8vw 21vh currentColor, 19vw 47vh currentColor, 27vw 76vh currentColor, 36vw 14vh currentColor,
        43vw 63vh currentColor, 54vw 29vh currentColor, 61vw 57vh currentColor, 71vw 7vh currentColor,
        76vw 79vh currentColor, 86vw 33vh currentColor, 94vw 61vh currentColor, 49vw 91vh currentColor;
    animation-duration: 130s, 7s;
    animation-direction: reverse, alternate;
}

.auth-stars-c {
    width: 1px;
    height: 1px;
    color: rgba(255, 255, 255, .55);
    opacity: .42;
    box-shadow:
        3vw 68vh currentColor, 13vw 4vh currentColor, 22vw 36vh currentColor, 31vw 91vh currentColor,
        41vw 27vh currentColor, 47vw 84vh currentColor, 58vw 44vh currentColor, 65vw 19vh currentColor,
        74vw 52vh currentColor, 82vw 87vh currentColor, 90vw 12vh currentColor, 99vw 42vh currentColor;
    animation-duration: 170s, 9s;
}

.auth-meteors > span {
    width: var(--meteor-width, 190px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(215, 248, 255, .9));
    filter: drop-shadow(0 0 4px rgba(72, 193, 226, .72));
    transform: rotate(var(--meteor-angle, -22deg)) translateX(-38vw);
    animation-name: ambient-meteor-flight;
}

.auth-meteors > span:nth-child(1) { --meteor-x: 4vw; --meteor-y: 14vh; --meteor-delay: -2s; --meteor-duration: 13s; --meteor-angle: -19deg; --meteor-width: 210px; }
.auth-meteors > span:nth-child(2) { --meteor-x: 28vw; --meteor-y: 7vh; --meteor-delay: -8s; --meteor-duration: 17s; --meteor-angle: -25deg; --meteor-width: 150px; }
.auth-meteors > span:nth-child(3) { --meteor-x: 57vw; --meteor-y: 21vh; --meteor-delay: -4s; --meteor-duration: 14s; --meteor-angle: -17deg; --meteor-width: 235px; }
.auth-meteors > span:nth-child(4) { --meteor-x: 76vw; --meteor-y: 43vh; --meteor-delay: -11s; --meteor-duration: 19s; --meteor-angle: -28deg; --meteor-width: 175px; }
.auth-meteors > span:nth-child(5) { --meteor-x: 13vw; --meteor-y: 69vh; --meteor-delay: -13s; --meteor-duration: 20s; --meteor-angle: -21deg; --meteor-width: 250px; }
.auth-meteors > span:nth-child(6) { --meteor-x: 44vw; --meteor-y: 81vh; --meteor-delay: -6s; --meteor-duration: 16s; --meteor-angle: -24deg; --meteor-width: 180px; }
.auth-meteors > span:nth-child(7) { --meteor-x: 66vw; --meteor-y: 68vh; --meteor-delay: -15s; --meteor-duration: 22s; --meteor-angle: -18deg; --meteor-width: 220px; }
.auth-meteors > span:nth-child(8) { --meteor-x: 87vw; --meteor-y: 9vh; --meteor-delay: -9s; --meteor-duration: 18s; --meteor-angle: -26deg; --meteor-width: 160px; }

.auth-shell {
    grid-template-columns: minmax(0, 1fr) minmax(460px, 500px);
    gap: clamp(74px, 7vw, 132px);
    width: min(calc(100% - 48px), 1500px);
    padding: 68px 0 76px;
}

.auth-story-inner {
    max-width: 760px;
}

.auth-story-logo {
    width: min(100%, 720px);
    margin-bottom: 35px;
}

.auth-story-copy,
.auth-story-copy h2,
.auth-story-copy p {
    max-width: 700px;
}

.auth-story-copy h2 {
    font-size: 46px;
    line-height: 1.12;
}

.auth-story-copy p {
    font-size: 17px;
}

.auth-benefits span {
    font-size: 13px;
}

.auth-benefits strong {
    font-size: 14px;
}

.auth-panel-stage {
    width: 100%;
}

.auth-panel-inner {
    padding: 40px 40px 35px;
}

.auth-panel-inner::before {
    display: none;
}

.auth-copy h1 {
    font-size: 32px;
}

.auth-copy p:last-child {
    font-size: 14px;
}

.auth-panel-inner .form-field label {
    font-size: 13px;
}

.auth-input-glow {
    isolation: isolate;
    padding: 1px;
    border-radius: 7px;
}

.auth-input-glow::before {
    display: block;
    background: radial-gradient(
        130px circle at var(--auth-glow-x) var(--auth-glow-y),
        rgba(90, 219, 246, .98),
        rgba(33, 137, 190, .62) 38%,
        transparent 76%
    );
}

.auth-panel-inner .auth-input-glow input {
    height: 54px;
    padding-left: 48px;
    border: 0;
}

.auth-panel-inner .auth-submit {
    min-height: 54px;
}

.auth-access-request {
    margin-top: 5px;
    padding-top: 19px;
    font-size: 13px;
}

.module-body .ambient-sky {
    display: block;
}

.module-body .module-shell {
    position: relative;
    z-index: 1;
    background: rgba(238, 246, 250, .80);
}

html[data-theme="dark"] .module-body .module-shell {
    background: rgba(2, 9, 18, .76);
}

.module-body .module-topbar {
    min-height: 92px;
}

.module-body .module-brand-zone {
    transform: translateY(-12px);
}

.module-body .theme-selector {
    top: 50px;
}

html[data-theme="light"] .auth-body {
    color: #162638;
    background: #edf5f8;
}

html[data-theme="light"] .auth-sky {
    background: #edf5f8;
}

html[data-theme="light"] .auth-sky::before {
    background:
        radial-gradient(circle at 18% 24%, rgba(55, 177, 207, .13), transparent 26%),
        radial-gradient(circle at 79% 73%, rgba(80, 139, 179, .10), transparent 30%);
}

html[data-theme="light"] .auth-sky::after {
    background: linear-gradient(rgba(243, 249, 251, 0), rgba(225, 239, 245, .46));
}

html[data-theme="light"] .auth-stars-a {
    color: rgba(25, 99, 128, .52);
}

html[data-theme="light"] .auth-stars-b {
    color: rgba(19, 136, 164, .42);
}

html[data-theme="light"] .auth-stars-c {
    color: rgba(61, 101, 126, .34);
}

html[data-theme="light"] .auth-meteors > span {
    background: linear-gradient(90deg, transparent, rgba(17, 129, 160, .68));
    filter: drop-shadow(0 0 3px rgba(26, 149, 179, .48));
}

html[data-theme="light"] .auth-story-logo {
    filter: brightness(.34) contrast(1.2) saturate(1.35) drop-shadow(0 0 18px rgba(28, 142, 172, .14));
}

html[data-theme="light"] .auth-story-copy h2 {
    color: #142438;
}

html[data-theme="light"] .auth-story-copy p {
    color: #53667a;
}

html[data-theme="light"] .auth-story-kicker {
    color: #087e9e;
}

html[data-theme="light"] .auth-benefits {
    border-color: rgba(45, 106, 137, .2);
}

html[data-theme="light"] .auth-benefits li + li {
    border-color: rgba(45, 106, 137, .15);
}

html[data-theme="light"] .auth-benefits strong {
    color: #1d3044;
}

html[data-theme="light"] .auth-benefits span {
    color: #617387;
}

html[data-theme="light"] .auth-panel-inner {
    color: #17283a;
    background: rgba(255, 255, 255, .86);
    border-color: rgba(50, 128, 165, .27);
    box-shadow: 0 26px 68px rgba(50, 90, 112, .18), inset 0 1px 0 rgba(255, 255, 255, .9);
}

html[data-theme="light"] .auth-copy h1 {
    color: #142438;
}

html[data-theme="light"] .auth-copy p:last-child,
html[data-theme="light"] .auth-access-request {
    color: #64768a;
}

html[data-theme="light"] .auth-panel-inner .form-field label {
    color: #2b3c4f;
}

html[data-theme="light"] .auth-panel-inner .auth-input-glow input {
    color: #17283a;
    background: rgba(249, 252, 253, .96);
    box-shadow: inset 0 0 0 1px rgba(62, 111, 142, .28);
}

html[data-theme="light"] .auth-panel-inner .password-toggle {
    color: #63788d;
}

html[data-theme="light"] .auth-page-footer {
    color: rgba(42, 73, 94, .5);
}

@keyframes ambient-star-drift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(5vw, 3vh, 0); }
}

@keyframes ambient-star-pulse {
    from { filter: brightness(.72); }
    to { filter: brightness(1.35); }
}

@keyframes ambient-meteor-flight {
    0%, 70% {
        opacity: 0;
        transform: rotate(var(--meteor-angle, -22deg)) translateX(-38vw);
    }
    72% { opacity: .88; }
    84% { opacity: 0; }
    100% {
        opacity: 0;
        transform: rotate(var(--meteor-angle, -22deg)) translateX(60vw);
    }
}

@media (max-width: 1200px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr) minmax(410px, 460px);
        gap: 48px;
        width: min(calc(100% - 48px), 1120px);
    }

    .auth-story-logo {
        width: min(100%, 610px);
    }

    .auth-story-copy h2 {
        font-size: 38px;
    }

    .auth-benefits {
        grid-template-columns: 1fr;
    }

    .auth-benefits li {
        padding-block: 13px;
    }

    .auth-benefits li + li {
        padding-left: 0;
        border-top: 1px solid rgba(125, 177, 207, .12);
        border-left: 0;
    }
}

@media (max-width: 800px) {
    .theme-selector {
        top: 10px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        gap: 28px;
        width: min(calc(100% - 28px), 540px);
        padding: 68px 0 62px;
    }

    .auth-story-inner {
        align-items: center;
        text-align: center;
    }

    .auth-story-logo {
        width: min(100%, 470px);
        margin-bottom: 14px;
    }

    .auth-story-kicker,
    .auth-story-copy p,
    .auth-benefits {
        display: none;
    }

    .auth-story-copy h2 {
        max-width: 450px;
        font-size: 24px;
        font-weight: 580;
        line-height: 1.3;
    }

    .auth-panel-inner {
        padding: 32px 26px 27px;
    }

    .auth-copy h1 {
        font-size: 28px;
    }

    .module-body .theme-selector {
        top: 52px;
    }
}

@media (max-width: 640px) {
    .portal-body .topbar {
        min-height: 108px;
        align-items: flex-start;
        padding-top: 12px;
    }

    .portal-body .theme-selector {
        top: 64px;
    }

    .module-body .module-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: 46px 58px;
        min-height: 112px;
        padding: 6px 14px 2px;
    }

    .module-body .module-brand-zone {
        grid-column: 1;
        grid-row: 1;
        justify-content: flex-start;
        transform: none;
    }

    .module-body .module-topbar .topbar-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .module-body .theme-selector {
        top: 61px;
    }
}

@media (max-width: 420px) {
    .auth-shell {
        width: min(calc(100% - 20px), 540px);
    }

    .auth-panel-inner {
        padding: 29px 19px 24px;
    }

    .auth-panel-inner .auth-input-glow input,
    .auth-panel-inner .auth-submit {
        min-height: 51px;
        height: 51px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-stars,
    .auth-meteors > span {
        animation: none !important;
    }
}

/* Login refinements: stable neon focus and restored external shortcuts. */
.auth-story-logo {
    margin-bottom: 31px;
}

.auth-copy {
    margin-bottom: 25px;
}

.auth-input-glow {
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 0 0 0 rgba(84, 213, 242, 0);
    transition: box-shadow .22s ease, transform .22s ease;
}

.auth-input-glow::before {
    display: none;
}

.auth-panel-inner .auth-input-glow input {
    border: 1px solid rgba(127, 171, 203, .30);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
    transition: border-color .22s ease, background-color .22s ease, box-shadow .22s ease;
}

.auth-input-glow:focus-within {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 3px rgba(75, 205, 236, .10),
        0 0 20px rgba(44, 188, 224, .16);
}

.auth-panel-inner .auth-input-glow input:focus {
    background: rgba(3, 16, 30, .96);
    border-color: rgba(101, 222, 247, .88);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .055),
        inset 0 0 18px rgba(42, 183, 221, .055);
}

.auth-input-glow:focus-within > svg,
.auth-input-glow:focus-within .password-toggle {
    color: #77e1f5;
    filter: drop-shadow(0 0 7px rgba(73, 211, 241, .45));
}

.auth-external-links {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(145px, .85fr);
    gap: 10px;
    margin-top: 11px;
}

.auth-external-links a {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 15px;
    color: rgba(218, 236, 247, .86);
    text-decoration: none;
    background: rgba(5, 18, 33, .82);
    border: 1px solid rgba(100, 181, 219, .25);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
    backdrop-filter: blur(14px) saturate(120%);
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.auth-external-links a:hover,
.auth-external-links a:focus-visible {
    color: #f6fcff;
    background: rgba(8, 27, 46, .94);
    border-color: rgba(91, 216, 244, .62);
    box-shadow:
        0 0 0 3px rgba(76, 207, 237, .07),
        0 0 20px rgba(44, 188, 224, .12),
        inset 0 1px 0 rgba(255, 255, 255, .055);
    transform: translateY(-1px);
}

.auth-external-links svg {
    width: 18px;
    height: 18px;
    color: #5bd2ec;
    stroke-width: 1.8;
}

.auth-external-links svg:last-child {
    width: 15px;
    height: 15px;
    justify-self: end;
}

.auth-external-links .instagram-app-icon {
    width: 20px;
    height: 20px;
    overflow: visible;
    border-radius: 5px;
    box-shadow: 0 3px 9px rgba(146, 38, 129, .24);
}

.auth-external-links span {
    overflow: hidden;
    font-size: 12px;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-theme="light"] .auth-panel-inner .auth-input-glow input {
    color: #17283a;
    background: rgba(249, 252, 253, .96);
    border-color: rgba(62, 111, 142, .30);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

html[data-theme="light"] .auth-panel-inner .auth-input-glow input:focus {
    background: #ffffff;
    border-color: rgba(20, 157, 190, .72);
    box-shadow: inset 0 0 16px rgba(37, 176, 207, .045);
}

html[data-theme="light"] .auth-external-links a {
    color: #294158;
    background: rgba(255, 255, 255, .76);
    border-color: rgba(50, 128, 165, .24);
    box-shadow: 0 8px 22px rgba(50, 90, 112, .09), inset 0 1px 0 rgba(255, 255, 255, .9);
}

html[data-theme="light"] .auth-external-links a:hover,
html[data-theme="light"] .auth-external-links a:focus-visible {
    color: #142f43;
    background: rgba(255, 255, 255, .96);
    border-color: rgba(18, 154, 187, .48);
}

@media (max-width: 800px) {
    .auth-story-logo {
        margin-bottom: 10px;
    }
}

@media (max-width: 420px) {
    .auth-external-links {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-input-glow,
    .auth-external-links a {
        transition: none;
    }
}
