:root {
    font-family: 'Segoe UI', Carlito, Arial, sans-serif;
    color: #233649;
    background: #f5f7fb;
    font-synthesis: none;
    --blue: #1762d5;
    --line: #dde4ee;
    --muted: #6a7889;
    --nav: #f0f4fa;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-size: 14px;
}
h1,h2,p {
    margin-top: 0;
}
h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -.5px;
    margin-bottom: 6px;
}
h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 0;
}
a {
    color: var(--blue);
}
button, input, select {
    font: inherit;
}
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 7px 14px;
    border: 1px solid #d5deea;
    border-radius: 6px;
    background: white;
    color: #263b52;
    cursor: pointer;
    white-space: nowrap;
}
button:hover {
    background: #edf2f9;
}
button:disabled {
    opacity: .45;
    cursor: default;
}
button.primary {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}
button.primary:hover {
    background: #1056c0;
}
button.danger {
    background: #c62839;
    color: white;
    border-color: #c62839;
}
button:focus-visible, a:focus-visible, input:focus, select:focus {
    outline: 2px solid #5b97ec;
    outline-offset: 2px;
}
input,select {
    border: 1px solid #d4ddea;
    border-radius: 5px;
    padding: 8px 10px;
    min-width: 0;
    color: #233649;
    background: white;
}
.app-shell {
    display: grid;
    grid-template-columns: 248px minmax(0,1fr);
    min-height: 100dvh;
}
.sidebar {
    background: var(--nav);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 18px 12px 12px;
}
.brand {
    height: 86px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
}
.brand img {
    width: 158px;
    height: auto;
    object-fit: contain;
}
.sidebar-toggle {
    margin-left: auto;
    border: 0;
    padding: 6px;
    background: transparent;
}
nav {
    padding-top: 12px;
    flex: 1;
    overflow-y: auto;
}
nav a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 12px;
    margin-bottom: 4px;
    color: #334b64;
    text-decoration: none;
    border-radius: 7px;
    position: relative;
}
nav a:hover {
    background: #e2eaf5;
}
nav a.active {
    background: #dce8fa;
    color: #135cbe;
    font-weight: 600;
}
nav a.active::before {
    content: '';
    position: absolute;
    width: 3px;
    top: 7px;
    bottom: 7px;
    left: 0;
    background: var(--blue);
    border-radius: 3px;
}
.nav-icon {
    flex-shrink: 0;
}
.nav-caption {
    margin: 22px 12px 9px;
    font-size: 12px;
    color: var(--muted);
}
.sidebar-footer {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}
.user-name {
    display: block;
    padding: 8px 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.logout {
    background: transparent;
    border: 0;
    justify-content: flex-start;
    width: 100%;
    padding: 10px 12px;
}
.logout:hover {
    color: #be2437;
    background: #fbe5e8;
}
.workspace {
    min-width: 0;
}
.topbar {
    height: 54px;
    background: white;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    color: var(--muted);
    font-size: 13px;
}
.environment {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    background: #e9f1fc;
    color: #21589e;
    padding: 4px 9px;
    border-radius: 4px;
    letter-spacing: 1px;
}
.page-content {
    padding: 28px;
}
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.page-heading p {
    color: var(--muted);
    margin: 0;
}
.panel,.shortcut {
    background: white;
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: 0 2px 6px #17345105;
    min-width: 0;
}
.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.shortcut {
    display: block;
    padding: 22px;
    text-decoration: none;
    color: #233649;
    transition: border-color .15s;
}
.shortcut:hover {
    border-color: #80a9de;
}
.shortcut .nav-icon {
    color: var(--blue);
    margin-bottom: 15px;
}
.shortcut h2 {
    margin-bottom: 8px;
}
.shortcut p {
    color: var(--muted);
    margin-bottom: 0;
}
.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    gap: 12px;
}
.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.table-scroll {
    overflow: auto;
    max-width: 100%;
}
.data-grid {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 13px;
    text-align: left;
}
.data-grid th {
    font-weight: 600;
    background: #eff3f8;
    position: sticky;
    top: 0;
    z-index: 1;
}
.data-grid td,.data-grid th {
    padding: 6px 10px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-grid th:last-child,.data-grid td:last-child {
    border-right: 0;
}
.run-table td {
    padding: 11px 10px;
}
.status-pill {
    display: inline-block;
    padding: 3px 7px;
    background: #eaf5ee;
    color: #236a42;
    border-radius: 4px;
    font-size: 11px;
}
.status-pill.muted {
    background: #f0f1f3;
    color: #697480;
}
.empty-state {
    padding: 48px 24px;
    color: var(--muted);
    text-align: center;
}
.loading {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--muted);
}
.spinner {
    display: inline-block;
    height: 30px;
    width: 30px;
    border: 3px solid #e1eaf8;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .85s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.text-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 4px 8px;
    min-height: 28px;
}
.maintenance-split {
    display: flex;
    gap: 16px;
    min-height: calc(100dvh - 190px);
}
.catalog {
    display: flex;
    flex-direction: column;
    width: 250px;
    min-width: 170px;
    max-width: 50%;
    flex-shrink: 0;
    resize: horizontal;
    overflow: auto;
}
.catalog-tree {
    flex: 1;
    padding: 12px 8px;
}
details summary {
    cursor: pointer;
    padding: 8px 4px;
    font-weight: 600;
}
.table-link {
    display: flex;
    min-height: 28px;
    justify-content: flex-start;
    gap: 6px;
    padding: 5px 8px;
    border: 0;
    width: 100%;
    font-size: 13px;
    white-space: normal;
    text-align: left;
    border-radius: 4px;
}
.table-link.active {
    background: #e8f0fd;
    color: var(--blue);
    box-shadow: inset 3px 0 var(--blue);
}
.catalog-note {
    color: var(--muted);
    font-size: 11px;
    padding: 12px;
    margin: 0;
    border-top: 1px solid var(--line);
}
.table-panel {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.table-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px 14px;
    flex-wrap: wrap;
}
.sql-search {
    display: flex;
    gap: 6px;
    flex: 1 1 280px;
}
.sql-search input {
    width: 100%;
}
.edit-scroll {
    flex: 1;
    max-height: calc(100dvh - 340px);
    min-height: 200px;
}
.edit-grid {
    width: max-content;
    min-width: 100%;
}
.edit-grid td,.edit-grid th {
    padding: 0;
    height: 25px;
}
.edit-grid thead th {
    padding: 4px 8px;
}
.edit-grid input,.edit-grid select {
    border: 0;
    border-radius: 0;
    padding: 3px 7px;
    height: 24px;
    min-width: 120px;
    width: 100%;
    background: transparent;
    font-size: 13px;
}
.edit-grid input:focus {
    outline-offset: -2px;
    background: #f7faff;
}
.cell-value {
    display: block;
    padding: 3px 7px;
    min-width: 60px;
    color: #647184;
}
.edit-grid .row-number {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f2f5f9;
    width: 1%;
    min-width: 30px;
}
.edit-grid thead .row-number {
    z-index: 3;
}
.row-number-button {
    min-height: 24px;
    padding: 0 5px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 12px;
    width: 100%;
}
.edit-grid .deleted {
    text-decoration: line-through;
    color: #8d6268;
    background: #fff3f4;
}
.edit-grid .added {
    background: #f0f9f2;
}
.required {
    color: #be3b48;
}
.table-footer {
    padding: 9px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--line);
}
.logs-drawer {
    position: fixed;
    right: 0;
    top: 54px;
    bottom: 0;
    width: min(500px,90vw);
    background: white;
    border-left: 1px solid var(--line);
    box-shadow: -8px 0 32px #223a561a;
    overflow: auto;
    z-index: 10;
}
.logs-drawer .panel-heading {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid var(--line);
}
.log-entry {
    padding: 18px;
    border-bottom: 1px solid var(--line);
}
.log-entry>div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}
.log-entry time,.log-entry span {
    font-size: 12px;
    color: var(--muted);
}
.log-entry p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 10px 0 0;
    line-height: 1.5;
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: #14283f66;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}
.dialog {
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 70px #11243a40;
    padding: 26px;
    width: min(600px,100%);
    max-height: 85dvh;
    overflow: auto;
}
.dialog h2 {
    margin-bottom: 16px;
    font-size: 20px;
}
.dialog p {
    line-height: 1.6;
}
.dialog footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
}
.error-message {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.login-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(ellipse at 70% 20%,#e0eafa,transparent 65%),#f5f7fb;
}
.login-card {
    background: white;
    padding: 38px;
    width: min(430px,100%);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 16px 70px #2138510c;
}
.login-logo {
    display: block;
    width: 200px;
    height: auto;
    margin-bottom: 28px;
}
.login-card h1 {
    margin-top: 20px;
}
.login-card>p {
    color: var(--muted);
}
.login-card form {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 24px;
}
.login-card label:not(:first-child) {
    margin-top: 12px;
}
.login-card button {
    margin-top: 18px;
    min-height: 40px;
}
.login-card .login-error {
    color: #a52c3b;
    background: #fff1f3;
    padding: 12px;
    border-radius: 6px;
    line-height: 1.5;
}
.collapsed {
    grid-template-columns: 72px minmax(0,1fr);
}
.collapsed .sidebar {
    padding: 18px 8px 12px;
}
.collapsed .brand {
    justify-content: center;
}
.collapsed .sidebar-toggle {
    margin: 0;
}
.collapsed nav a {
    justify-content: center;
    padding: 12px;
}
.collapsed .nav-label,.collapsed .nav-caption,.collapsed .user-name,.collapsed .logout-label {
    display: none;
}
.collapsed .logout {
    justify-content: center;
}
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff0d4;
    color: #4a3e26;
    padding: 16px;
    z-index: 200;
}
@media (max-width: 850px) {
    .page-content {
        padding: 18px;
    }
    .shortcut-grid {
        grid-template-columns: 1fr;
    }
    .app-shell {
        grid-template-columns: 72px minmax(0,1fr);
    }
    .brand img,.nav-label,.nav-caption,.user-name,.logout-label {
        display: none;
    }
    .brand {
        justify-content: center;
    }
    .sidebar-toggle {
        margin: 0;
    }
    nav a,.logout {
        justify-content: center;
    }
    .maintenance-split {
        flex-direction: column;
    }
    .catalog {
        width: 100%;
        max-width: 100%;
        max-height: 240px;
        resize: none;
    }
    .page-heading {
        align-items: flex-start;
    }
}
@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 2s;
    }
}
.workflow-panel { padding: 20px; }
.workflow-panel > h2 { margin: 8px 0 12px; }
.workflow-panel > p { line-height: 1.6; margin: 12px 0; color: var(--muted); }
.workflow-panel > .actions { margin: 14px 0; }
.workflow-panel hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.run-picker { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.run-picker > select { flex: 1; min-width: 240px; }
.run-picker > input { flex: 0 1 200px; }
.run-picker label, .form-grid label, .workflow-panel > label { display: flex; flex-direction: column; gap: 7px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin: 18px 0; }
.form-grid select { width: 100%; }
.process-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; }
.process-tabs button { border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.process-tabs button.active { color: var(--blue); background: #e6eefe; box-shadow: inset 0 -2px var(--blue); }
.file-button, .button-link { display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: white; cursor: pointer; color: #233649; text-decoration: none; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-button:focus-within { outline: 2px solid var(--blue); }
.workflow-panel details { padding: 12px 0; }
.workflow-panel summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
textarea { display: block; width: 100%; min-height: 90px; padding: 10px; font: inherit; border: 1px solid var(--line); border-radius: 6px; resize: vertical; margin: 8px 0; }
.operation-progress { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: #eaf1fc; border-radius: 7px; margin: 0 0 14px; }
.operation-progress .spinner { width: 22px; height: 22px; flex-shrink: 0; }
.operation-progress .text-button { margin-left: auto; }
.operation-status { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); line-height: 1.6; margin: 16px 0; }
.workflow-footer { display: flex; gap: 8px; justify-content: flex-end; }
.billing-state { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-radius: 7px; background: #f0f5fa; gap: 16px; }
.billing-state p { margin: 6px 0 0; color: var(--muted); }
.dqm-checks { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.dqm-checks .active { background: #e7effc; color: var(--blue); }
.download-list { padding: 16px; margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.download-list summary { cursor: pointer; font-weight: 600; }
.download-list a { display: block; margin-top: 10px; overflow-wrap: anywhere; }
.batch-result { padding: 12px; border-left: 3px solid #289254; background: #eff8f2; margin-top: 10px; }
.batch-result.failure { border-color: #bf3546; background: #fff1f3; }
.batch-result p { margin: 6px 0 0; white-space: pre-wrap; }
.web-explorer { border: 1px solid var(--line); border-radius: 7px; margin-top: 16px; overflow: hidden; background: white; min-width: 0; }
.explorer-heading { display: flex; justify-content: space-between; align-items: center; padding: 12px; gap: 12px; }
.explorer-heading button { min-height: 30px; padding: 5px 9px; font-size: 12px; }
.explorer-search { padding: 0 12px 12px; }
.explorer-scroll { height: 420px; min-height: 180px; max-height: 85dvh; overflow: auto; resize: vertical; }
.shared-grid { width: max-content; min-width: 100%; font-size: inherit; }
.shared-grid thead th { padding: 0; height: 30px; }
.shared-grid td { padding: 0; height: 28px; min-width: 100px; }
.shared-grid td > span { display: block; padding: 4px 7px; min-height: 27px; }
.shared-grid td > input { width: 100%; min-width: 100px; height: 27px; padding: 4px 7px; border: 0; border-radius: 0; background: transparent; font-size: inherit; }
.shared-grid td > input:focus { outline-offset: -2px; background: #f7faff; }
.shared-grid .row-number { position: sticky; left: 0; width: calc(var(--row-number-width) + 10px); min-width: calc(var(--row-number-width) + 10px); padding: 0; z-index: 2; background: #f1f5f9; font-size: 12px; }
.shared-grid thead .row-number { z-index: 3; }
.shared-grid .row-number button { width: 100%; padding: 0 5px; font-size: 12px; background: transparent; border: 0; min-height: 27px; border-radius: 0; }
.column-sort { background: transparent; border: 0; padding: 5px 7px; font-weight: 600; min-height: 28px; font-size: inherit; border-radius: 0; }
.filter-toggle { padding: 2px 6px; border: 0; background: transparent; min-height: 24px; color: var(--muted); border-radius: 0; }
.filter-toggle.filtered { color: var(--blue); background: #dce9fc; }
.shared-grid td.cell-selected { background: #eaf2ff; outline: 1px solid #a9c8ee; outline-offset: -1px; }
.shared-grid tr.deleted { text-decoration: line-through; background: #fff1f2; color: #92626a; }
.explorer-footer { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.explorer-expanded { position: fixed; inset: 20px; z-index: 40; display: flex; flex-direction: column; margin: 0; box-shadow: 0 0 0 30px #15304b66; }
.explorer-expanded .explorer-scroll { flex: 1; height: auto; max-height: none; }
.filter-dialog { max-width: 380px; }
.filter-dialog > input { width: 100%; margin-bottom: 12px; }
.filter-values { height: 300px; overflow: auto; margin: 12px 0; }
.filter-values label { display: flex; align-items: center; gap: 9px; padding: 5px 2px; min-height: 30px; overflow-wrap: anywhere; }
.filter-values input { accent-color: var(--blue); width: 16px; height: 16px; margin: 0; }
.context-menu { position: fixed; right: 32px; top: 100px; z-index: 80; display: flex; flex-direction: column; padding: 5px; background: white; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 6px 24px #17334d22; }
.context-menu button { justify-content: flex-start; border: 0; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } .explorer-heading { flex-wrap: wrap; } .billing-state { flex-direction: column; align-items: flex-start; } }
.configuration-dialog { width: min(1000px,94vw); height: min(760px,88dvh); display: flex; flex-direction: column; }
.config-search { width: 100%; margin: 8px 0 16px; }
.configuration-tree { flex: 1; overflow: auto; min-height: 100px; }
.configuration-tree details { margin-left: 18px; }
.configuration-tree > details { margin-left: 0; }
.configuration-tree summary { cursor: pointer; display: flex; align-items: center; gap: 7px; padding: 8px 4px; font-weight: 600; }
.configuration-tree label { display: flex; align-items: center; gap: 7px; min-height: 28px; margin-left: 20px; }
.configuration-tree input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); }
.technical-drawer { width: min(1000px,90vw); padding: 0 14px 14px; }
.technical-drawer .explorer-scroll { height: calc(100dvh - 300px); }
.technical-drawer .process-tabs { margin-top: 12px; }
.explorer-info { padding: 12px; background: #f6f9fd; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.explorer-info dl { display: grid; grid-template-columns: minmax(120px,1fr) 2fr; gap: 6px 12px; max-height: 280px; overflow: auto; }
.explorer-info dt { font-weight: 600; }
.explorer-info dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.filter-chips button { font-size: 12px; padding: 4px 8px; min-height: 26px; background: #e7eefb; border-color: #d7e3f7; }
.explorer-footer label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.explorer-footer input { padding: 0; width: 90px; }
.nav-entry { position: relative; }
.nav-entry > a:first-child { padding-right: 28px; }
nav .nav-popout { position: absolute; right: 3px; top: 5px; padding: 8px 4px; background: transparent; font-size: 15px; color: #78889a; }
.collapsed .nav-popout { display: none; }
.context-menu a { padding: 9px 14px; text-decoration: none; color: #233649; border-radius: 4px; }
.context-menu a:hover { background: #edf2f9; }
.login-card label.remember-login { display: flex; flex-direction: row; align-items: center; gap: 8px; margin-top: 12px; }
.remember-login input { width: 16px; height: 16px; accent-color: var(--blue); padding: 0; }
.session-job { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; padding: 8px; text-decoration: none; }
.session-job .spinner { width: 15px; height: 15px; border-width: 2px; flex-shrink: 0; }
.unsaved-dot { width: 7px; height: 7px; background: #d99715; border-radius: 50%; flex-shrink: 0; }
.collapsed .session-job > span:last-child { display: none; }
.step-complete { width: 18px; height: 18px; color: #1c9454; flex-shrink: 0; }
