:root {
    color-scheme: light;
    --brand-navy: #092640;
    --brand-blue: #175c9e;
    --brand-sky: #eaf5ff;
    --brand-green: #168b63;
    --brand-red: #d63232;
    --bg: #f4f8fc;
    --surface: #ffffff;
    --surface-soft: rgba(255,255,255,.92);
    --border: #dbe7f2;
    --text: #1d2b3a;
    --muted: #68788b;
    --shadow: 0 22px 58px rgba(9,38,64,.12);
    --shadow-soft: 0 10px 26px rgba(9,38,64,.07);
    --page-bg: #eef4f9;
    --topbar-bg: #0b2f52;
    --hero-bg: linear-gradient(135deg, rgba(11,47,82,.96), rgba(18,78,128,.92)), #0b2f52;
    --hero-text: #ffffff;
    --hero-muted: rgba(255,255,255,.68);
    --panel-bg: #ffffff;
    --panel-soft: #f8fbfe;
    --table-head-bg: #f5f8fb;
    --table-chip-bg: #eef6ff;
    --table-chip-text: #175c9e;
    --strong-text: #12263a;
    --warning-text: #9a5c00;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --brand-navy: #e8f2ff;
    --brand-blue: #7db7ff;
    --brand-sky: #102b45;
    --brand-green: #5de0ad;
    --brand-red: #ff8b8b;
    --bg: #07111d;
    --surface: #0f1b28;
    --surface-soft: rgba(15,27,40,.96);
    --border: #24384d;
    --text: #e8f2ff;
    --muted: #9fb2c7;
    --shadow: 0 18px 44px rgba(0,0,0,.34);
    --shadow-soft: 0 10px 24px rgba(0,0,0,.24);
    --page-bg: #07111d;
    --topbar-bg: #0a2138;
    --hero-bg: linear-gradient(135deg, rgba(15,39,63,.98), rgba(12,55,86,.94)), #0b2238;
    --hero-text: #f4f9ff;
    --hero-muted: #9fbad4;
    --panel-bg: #0f1b28;
    --panel-soft: #132235;
    --table-head-bg: #132235;
    --table-chip-bg: #102f50;
    --table-chip-text: #9ccaff;
    --strong-text: #f4f9ff;
    --warning-text: #ffc66d;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background: var(--page-bg);
}
:root[data-theme="dark"] body {
    background: var(--page-bg);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.material-symbols-outlined { font-size: 20px; line-height: 1; vertical-align: middle; }

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 28px;
}
.auth-shell {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: minmax(0,1.1fr) minmax(360px,.9fr);
    gap: 22px;
    align-items: stretch;
}
.auth-hero,
.auth-panel,
.surface {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 8px;
}
.auth-hero {
    padding: 40px;
    display: grid;
    align-content: center;
    gap: 22px;
    min-height: 520px;
}
.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand-mark,
.portal-brand-mark {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(180deg, var(--brand-blue), #0b355b);
    color: #fff;
    font-weight: 900;
    font-size: 1.5rem;
    box-shadow: var(--shadow-soft);
}
.brand-copy strong,
.portal-brand-copy strong {
    display: block;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 900;
}
.brand-copy small,
.portal-brand-copy small {
    color: var(--muted);
    font-weight: 700;
}
.auth-title {
    margin: 0;
    max-width: 680px;
    font-size: clamp(2rem, 4vw, 3.75rem);
    line-height: 1.02;
    letter-spacing: 0;
}
.auth-text {
    margin: 0;
    max-width: 620px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}
.auth-feature-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
}
.auth-feature {
    min-height: 92px;
    padding: 15px;
    border-radius: 8px;
    background: var(--brand-sky);
    border: 1px solid var(--border);
}
.auth-feature strong {
    display: block;
    margin-bottom: 6px;
    font-size: .9rem;
}
.auth-feature span {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.35;
}
.auth-panel {
    padding: 32px;
    align-content: center;
    display: grid;
}
.panel-title {
    margin: 0 0 8px;
    font-size: 1.6rem;
}
.panel-sub {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.55;
}
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.label { color: var(--text); font-size: .84rem; font-weight: 900; }
.input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 0 14px;
    outline: none;
}
.input:focus {
    border-color: rgba(23,92,158,.52);
    box-shadow: 0 0 0 4px rgba(23,92,158,.12);
}
.btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 900;
}
.btn-primary {
    width: 100%;
    background: linear-gradient(180deg, var(--brand-blue), #0a3a66);
    color: #fff;
    box-shadow: var(--shadow-soft);
}
.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #8a1d1d;
    background: #fff1f1;
    border: 1px solid #ffd0d0;
    font-weight: 800;
}
.alert-info {
    color: #174a72;
    background: #eaf5ff;
    border-color: #cbe4fb;
}

.portal-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
}
.portal-sidebar {
    grid-row: 1 / 3;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 17px;
    background: #071d33;
    color: #fff;
    border-right: 1px solid rgba(83,156,221,.2);
    box-shadow: 12px 0 28px rgba(7,29,51,.14);
    z-index: 30;
}
.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 84px;
    background: #0f3b63;
    color: #fff;
    border-bottom: 1px solid rgba(83,156,221,.38);
    box-shadow: 0 10px 22px rgba(7,29,51,.16);
    backdrop-filter: blur(14px);
}
:root[data-theme="dark"] .portal-topbar {
    background: #0f3b63;
}
.portal-topbar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 84px;
    padding: 10px 20px;
}
.portal-brand {
    display: grid;
    justify-items: start;
    gap: 8px;
    color: #fff;
    min-height: 78px;
    padding: 0 0 14px;
    border-bottom: 1px solid rgba(83,156,221,.18);
}
.portal-brand-mark {
    width: 78px;
    height: 46px;
    font-size: 1.25rem;
    border-radius: 10px;
    background:
        radial-gradient(circle at 26% 42%, rgba(74,43,139,.95) 0 20%, transparent 21%),
        radial-gradient(circle at 25% 58%, rgba(226,33,44,.95) 0 18%, transparent 19%),
        linear-gradient(120deg, #3d2a89, #0d3d68 54%, transparent 55%);
    color: transparent;
    box-shadow: none;
}
.portal-brand-mark::after {
    content: 'K';
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(72,48,144,.9);
    border-left-color: #e62b35;
    border-radius: 50%;
    color: #fff;
    font-weight: 1000;
}
.portal-brand-copy strong { color: #fff; }
.portal-brand-copy small { color: rgba(255,255,255,.72); }
.portal-nav {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin-top: 18px;
}
.portal-nav-link {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: 8px;
    color: rgba(255,255,255,.86);
    font-weight: 900;
    border: 1px solid transparent;
}
.portal-nav-link.active,
.portal-nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.14);
}
.portal-topbar-side {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-width: 0;
}
.portal-market-strip {
    display: grid;
    grid-template-columns: 116px 116px 252px 230px 126px;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    width: 884px;
    max-width: 100%;
    min-width: 0;
}
.portal-info-card {
    min-height: 56px;
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 8px 12px;
    border: 1px solid rgba(114,177,234,.22);
    border-left: 3px solid #58b7ff;
    border-radius: 9px;
    background: linear-gradient(180deg, rgba(30,75,113,.95), rgba(23,61,94,.92));
    color: #b9d8f2;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(7,29,51,.16);
    white-space: nowrap;
    overflow: hidden;
}
.portal-info-label {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #b7d7f3;
    font-size: .68rem;
    line-height: 1;
    letter-spacing: .04em;
    font-weight: 800;
    text-transform: uppercase;
}
.portal-info-label .material-symbols-outlined {
    font-size: 17px;
}
.portal-info-card > strong {
    color: #77c8ff;
    font-size: 1rem;
    line-height: 1.05;
    font-weight: 1000;
}
.portal-info-label-accent,
.portal-info-status > strong {
    color: #ffbf3d;
}
.portal-info-label-green,
.portal-info-date > strong {
    color: #5ee6ad;
}
.portal-info-label-purple,
.portal-info-time > strong {
    color: #e19aff;
}
.portal-info-status {
    border-left-color: #ffbf3d;
}
.portal-info-date {
    border-left-color: #42dca0;
}
.portal-info-time {
    border-left-color: #d899ff;
}
.portal-info-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.portal-info-split span {
    display: grid;
    gap: 1px;
}
.portal-info-split small {
    color: #d7eaff;
    font-size: .58rem;
    font-weight: 900;
}
.portal-info-split strong {
    color: #ffbf3d;
    font-size: .86rem;
    line-height: 1;
}
.portal-user-menu { position: relative; }
.portal-user-trigger {
    min-height: 56px;
    display: grid;
    grid-template-columns: 38px minmax(0,1fr) 20px;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    border: 1px solid rgba(114,177,234,.22);
    border-radius: 9px;
    background: linear-gradient(180deg, rgba(30,75,113,.95), rgba(23,61,94,.92));
    color: #fff;
    padding: 6px 10px;
    cursor: pointer;
    text-align: left;
}
.portal-avatar {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff;
    color: #0b355b;
    font-weight: 900;
}
.portal-user-copy { min-width: 0; display: grid; }
.portal-user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.portal-user-copy small { color: rgba(255,255,255,.7); font-weight: 800; }
.portal-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 100%;
    min-width: 220px;
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.14);
    background: #071d33;
    box-shadow: 0 18px 36px rgba(0,0,0,.28);
}
.portal-user-dropdown[hidden] { display: none; }
.portal-dropdown-action {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.06);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
}
.portal-dropdown-action.danger { color: #ffd2d2; }

.portal-main {
    width: min(1380px, 100%);
    margin: 0;
    padding: 22px 22px 44px;
}
.ops-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 14px;
    margin-bottom: 14px;
}
.ops-hero-main {
    min-height: 150px;
    padding: 24px 28px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    background:
        var(--hero-bg);
    color: var(--hero-text);
    border-color: rgba(11,47,82,.18);
    box-shadow: 0 14px 36px rgba(11,47,82,.14);
}
.ops-kicker {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--hero-muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.ops-hero-main h1 {
    margin: 0;
    font-size: 2.05rem;
    line-height: 1.1;
    letter-spacing: 0;
}
.ops-hero-meta {
    display: grid;
    justify-items: end;
    gap: 4px;
    color: var(--hero-muted);
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}
.ops-hero-meta strong {
    color: var(--hero-text);
    font-size: .95rem;
}
.ops-status-panel {
    padding: 18px;
    display: grid;
    gap: 10px;
    background: var(--panel-bg);
    box-shadow: 0 14px 36px rgba(9,38,64,.09);
}
.ops-status-row {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-soft);
    font-size: .88rem;
    color: var(--text);
}
.ops-status-row strong {
    margin-left: auto;
}
.ops-status-row.muted {
    color: var(--muted);
}
.status-dot.warn {
    background: #f2a93b;
}
.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0,1.2fr) minmax(360px,.8fr);
    gap: 18px;
    margin-bottom: 18px;
}
.hero-copy {
    padding: 28px;
    min-height: 260px;
}
.hero-copy h1 {
    margin: 0 0 10px;
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.05;
}
.hero-copy p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}
.quick-panel {
    padding: 22px;
    display: grid;
    gap: 12px;
}
.quick-row {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) max-content;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.quick-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--brand-sky);
    color: var(--brand-blue);
}
.quick-row strong { display: block; }
.quick-row span { color: var(--muted); font-size: .82rem; }
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-green);
}
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.metric-card {
    padding: 18px 20px;
    min-height: 108px;
    position: relative;
    overflow: hidden;
    background: var(--panel-bg);
    box-shadow: 0 12px 30px rgba(9,38,64,.08);
}
.metric-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--accent, var(--brand-blue));
}
.metric-blue { --accent: #175c9e; }
.metric-amber { --accent: #f2a93b; }
.metric-green { --accent: #168b63; }
.metric-red { --accent: #d63232; }
.metric-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 900;
    font-size: .84rem;
}
.metric-value {
    display: block;
    margin-top: 14px;
    color: var(--strong-text);
    font-size: 2rem;
    line-height: 1;
}
.orders-panel {
    padding: 0;
    overflow: hidden;
    background: var(--panel-bg);
    box-shadow: 0 14px 36px rgba(9,38,64,.09);
}
.panel-head {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-bg);
}
.panel-head h2 {
    margin: 0;
    color: var(--strong-text);
    font-size: 1.08rem;
}
.panel-count {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
}
.orders-table-wrap {
    overflow-x: auto;
}
.orders-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
    background: var(--panel-bg);
}
.orders-table th {
    height: 42px;
    padding: 0 18px;
    color: var(--muted);
    background: var(--table-head-bg);
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: .76rem;
    font-weight: 900;
}
.orders-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.orders-table td strong {
    display: block;
    color: var(--strong-text);
    font-size: .9rem;
}
.orders-table td span,
.orders-table td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.35;
}
.order-status {
    width: max-content;
    min-height: 28px;
    display: inline-flex !important;
    align-items: center;
    border-radius: 8px;
    padding: 0 10px;
    font-size: .74rem !important;
    font-weight: 900;
}
.status-review {
    color: var(--warning-text) !important;
    background: rgba(242,169,59,.14);
    border: 1px solid rgba(242,169,59,.28);
}
.status-ready {
    color: var(--brand-green) !important;
    background: rgba(22,139,99,.1);
    border: 1px solid rgba(22,139,99,.2);
}
.line-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.line-preview span {
    margin: 0 !important;
    display: inline-flex !important;
    min-height: 28px;
    align-items: center;
    border-radius: 8px;
    padding: 0 9px;
    background: var(--table-chip-bg);
    color: var(--table-chip-text) !important;
    font-weight: 800;
}
.table-action {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--table-chip-text);
    background: var(--table-chip-bg);
    font-size: .78rem;
    font-weight: 900;
    white-space: nowrap;
}
.table-action .material-symbols-outlined {
    font-size: 18px;
}
.empty-state {
    padding: 28px;
    color: var(--muted);
    font-weight: 800;
}
.metric-foot {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: .8rem;
}
.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
}
.module-card {
    padding: 20px;
    min-height: 190px;
}
.module-card h2 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}
.module-card p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.55;
}
.module-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    padding: 0 10px;
    background: var(--brand-sky);
    border: 1px solid var(--border);
    color: var(--brand-blue);
    font-size: .8rem;
    font-weight: 900;
}
.security-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 14px;
}
.security-card {
    padding: 18px;
    display: grid;
    gap: 8px;
}
.security-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.security-card h2 {
    margin: 0;
    font-size: 1rem;
}
.security-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}
.security-status {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    padding: 0 10px;
    font-size: .78rem;
    font-weight: 900;
    border: 1px solid var(--border);
}
.security-ok {
    color: var(--brand-green);
    background: rgba(22,139,99,.1);
}
.security-warn {
    color: var(--warning-text);
    background: rgba(242,169,59,.14);
}
.security-bad {
    color: var(--brand-red);
    background: rgba(214,50,50,.1);
}
.page-title-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.page-title-row h2 {
    margin: 0;
    font-size: 1.35rem;
}
.page-title-row p {
    margin: 4px 0 0;
    color: var(--muted);
}
.order-review-form {
    display: grid;
    gap: 12px;
}
.review-head {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--panel-bg);
    color: var(--text);
    border-left: 4px solid var(--brand-blue);
    box-shadow: none;
}
.back-link {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    margin-bottom: 6px;
}
.back-link .material-symbols-outlined {
    font-size: 18px;
}
.review-head h1 {
    margin: 0;
    color: var(--strong-text);
    font-size: 1.52rem;
    line-height: 1.1;
}
.review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}
.review-meta span {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    padding: 0 8px;
    background: var(--panel-soft);
    color: var(--muted);
    border: 1px solid var(--border);
    font-size: .76rem;
    font-weight: 800;
}
.review-section {
    padding: 18px 20px 20px;
    background: var(--panel-bg);
    box-shadow: none;
}
.review-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -2px 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.review-section-head h2 {
    margin: 0;
    color: var(--strong-text);
    font-size: .98rem;
}
.review-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, .45fr) minmax(170px, .35fr);
    gap: 12px;
}
.review-warning {
    margin-top: 12px;
    border: 1px solid rgba(242,169,59,.28);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--warning-text);
    background: rgba(242,169,59,.1);
    font-size: .86rem;
    font-weight: 800;
}
.review-lines {
    overflow-x: auto;
    display: grid;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-bg);
}
.review-line {
    min-width: 1260px;
    display: grid;
    grid-template-columns: 44px minmax(310px, 1.35fr) 110px 96px 130px minmax(260px, 1fr) minmax(180px, .72fr);
    gap: 0;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.review-line:last-child { border-bottom: 0; }
.review-line-head {
    min-height: 34px;
    padding: 0;
    border-radius: 0;
    background: var(--table-head-bg);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    border-bottom: 1px solid var(--border);
}
.review-line-head span {
    padding: 0 10px;
}
.review-line > strong {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    color: var(--strong-text);
    border-right: 1px solid var(--border);
}
.review-line .input {
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    font-size: .82rem;
}
.review-line .input:last-child { border-right: 0; }
.review-line .input:focus {
    position: relative;
    z-index: 1;
    background: var(--panel-soft);
    box-shadow: inset 0 0 0 2px rgba(125,183,255,.34);
}
.review-actions {
    position: sticky;
    bottom: 0;
    z-index: 15;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 0 0;
    background: linear-gradient(180deg, transparent, var(--page-bg) 34%);
}
.review-save,
.review-approve {
    width: auto;
    min-width: 150px;
}
.review-save {
    border-color: var(--border);
    color: var(--text);
    background: var(--panel-bg);
}
:root[data-theme="dark"] .alert-info {
    color: #b9d8f2;
    background: #102235;
    border-color: #29445e;
}
:root[data-theme="dark"] .input {
    background: #0b1825;
    border-color: #29445e;
}
:root[data-theme="dark"] .review-line .input {
    background: transparent;
}
.netsis-sample-grid {
    display: grid;
    gap: 8px;
}
.netsis-sample-row {
    min-height: 42px;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-soft);
}
.netsis-sample-row strong {
    color: var(--strong-text);
    font-size: .82rem;
}
.netsis-sample-row span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
}

@media (max-width: 1180px) {
    .portal-shell { grid-template-columns: 224px minmax(0, 1fr); }
    .portal-topbar-main { align-items: stretch; }
    .portal-topbar-side {
        align-items: stretch;
    }
    .portal-market-strip {
        grid-template-columns: repeat(2, minmax(116px, 1fr));
        width: 100%;
    }
    .portal-user-trigger { min-width: 260px; }
    .dashboard-hero,
    .ops-hero,
    .auth-shell {
        grid-template-columns: 1fr;
    }
    .auth-hero { min-height: auto; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .review-grid { grid-template-columns: 1fr; }
    .module-grid,
    .security-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .portal-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }
    .portal-sidebar {
        position: static;
        height: auto;
        grid-row: auto;
        padding: 12px 14px;
    }
    .portal-brand {
        padding: 0 0 12px;
    }
    .portal-nav {
        display: flex;
        overflow-x: auto;
        margin-top: 12px;
        padding-bottom: 2px;
    }
    .portal-nav-link {
        white-space: nowrap;
    }
}

@media (max-width: 640px) {
    .auth-page { padding: 14px; }
    .auth-hero,
    .auth-panel,
    .hero-copy,
    .quick-panel { padding: 20px; }
    .auth-feature-row,
    .metric-grid { grid-template-columns: 1fr; }
    .portal-main { padding: 16px 14px 32px; }
    .portal-topbar-main { padding: 12px 14px; }
    .portal-user-trigger { min-width: 100%; }
    .portal-topbar-side { display: grid; }
}
