:root {
    --bg: #f6f5f2;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --text: #071936;
    --muted: #687686;
    --line: #e8e4e1;
    --brand: #0d7187;
    --brand-strong: #07586b;
    --brand-deep: #061936;
    --accent: #826263;
    --accent-strong: #684b4e;
    --accent-soft: #f4eaea;
    --brand-soft: #e5f3f6;
    --ink-soft: #eef2f6;
    --glass: rgba(255, 255, 255, 0.74);
    --danger: #b64d55;
    --warning: #a46b2a;
    --shadow: 0 24px 70px rgba(6, 25, 54, 0.08);
    --shadow-tight: 0 14px 34px rgba(6, 25, 54, 0.07);
    --radius: 28px;
    --radius-tight: 18px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        radial-gradient(circle at 7% -7%, rgba(13, 113, 135, 0.16), transparent 28%),
        radial-gradient(circle at 90% 2%, rgba(130, 98, 99, 0.13), transparent 30%),
        linear-gradient(180deg, #faf8f5 0%, #fbfcfd 54%, #f5f8f8 100%);
    color: var(--text);
    font-family: "Libre Franklin", "Segoe UI", sans-serif;
    font-size: 11px;
    line-height: 1.38;
    letter-spacing: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis-weight: none;
}

strong,
b {
    font-weight: 600;
}

::selection {
    background: rgba(13, 113, 135, 0.18);
    color: var(--brand-deep);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.skip-link {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 120;
    padding: 10px 14px;
    border-radius: 12px;
    background: #ffffff;
    color: var(--brand-deep);
    border: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(6, 25, 54, 0.12);
    transform: translateY(-140%);
    transition: transform 0.18s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-link:focus-visible,
.btn-link:focus-visible,
.ghost-link:focus-visible,
.topbar-exit:focus-visible,
.topbar-user:focus-visible,
.pagination-link:focus-visible {
    outline: 3px solid rgba(14, 111, 134, 0.26);
    outline-offset: 2px;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 268px 1fr; transition: grid-template-columns 0.2s ease; }
.app-shell.sidebar-collapsed { grid-template-columns: 86px 1fr; }

.sidebar {
    padding: 18px 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(249, 249, 247, 0.92) 100%),
        radial-gradient(circle at 45% 0%, rgba(13, 113, 135, 0.11), transparent 30%);
    color: var(--brand-deep);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(6, 25, 54, 0.075);
    transition: padding 0.2s ease, width 0.2s ease;
}

.brand, .user-chip { display: flex; align-items: center; gap: 14px; }

.brand-lite {
    display: grid;
    gap: 6px;
    padding: 0 8px 12px;
}

.brand-identity {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 54px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    padding: 6px;
    border-radius: 17px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid rgba(6, 25, 54, 0.08);
    box-shadow: 0 10px 24px rgba(6, 25, 54, 0.08);
}

.brand-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.brand-copy strong {
    overflow: hidden;
    color: var(--brand-deep);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: -0.012em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy small {
    color: var(--accent);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.menu-kicker {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.82rem;
    color: #7f6670;
    font-weight: 600;
}

.brand-mark, .user-chip span {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    font-weight: 600;
    overflow: hidden;
}

.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand small, .user-chip small, .topbar p, .panel-subtitle, .table td small, .empty-state p { color: var(--muted); }

.nav { display: grid; gap: 2px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px;
    border-radius: 15px;
    color: #203954;
    font-size: 0.76rem;
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.app-shell.sidebar-collapsed .sidebar {
    padding-left: 10px;
    padding-right: 10px;
}
.app-shell.sidebar-collapsed .menu-kicker,
.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-link span:not(.nav-icon),
.app-shell.sidebar-collapsed .user-line,
.app-shell.sidebar-collapsed .ghost-link {
    display: none;
}
.app-shell.sidebar-collapsed .brand-lite {
    padding: 0 0 14px;
}
.app-shell.sidebar-collapsed .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
.app-shell.sidebar-collapsed .sidebar-foot {
    justify-items: center;
    padding-left: 0;
    padding-right: 0;
}

.nav-link:hover {
    background: rgba(13, 113, 135, 0.075);
    transform: translateX(2px);
}

.nav-link.is-active {
    background: linear-gradient(135deg, rgba(13, 113, 135, 0.13), rgba(130, 98, 99, 0.08));
    color: var(--brand-deep);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand), 0 10px 24px rgba(6, 25, 54, 0.045);
}

.nav-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #445b73;
    flex: 0 0 28px;
}

.nav-icon svg {
    width: 21px;
    height: 21px;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-icon svg * {
    fill: none !important;
    stroke: currentColor !important;
}

.sidebar-foot {
    margin-top: auto;
    display: grid;
    gap: 10px;
    padding: 8px;
}

.user-line {
    display: grid;
    gap: 4px;
    padding: 0;
    color: #6f7d8d;
    font-size: 0.74rem;
}

.ghost-link {
    padding: 9px 12px;
    border: 1px solid rgba(6, 25, 54, 0.08);
    border-radius: 14px;
    text-align: center;
    color: #294866;
    background: #fdfefe;
    font-size: 0.76rem;
}

.main-content { padding: 0 26px 28px; }
.topbar-shell {
    margin: 0 -26px 20px;
    border-bottom: 1px solid rgba(6, 25, 54, 0.08);
}
.topbar-utility {
    display: grid;
    grid-template-columns: 40px minmax(240px, 720px) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 26px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(22px);
}
.topbar {
    padding: 18px 26px 18px;
    background:
        radial-gradient(circle at top right, rgba(13, 113, 135, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(248, 247, 245, 0.42) 100%);
}
.topbar-heading {
    display: grid;
    gap: 6px;
}
.topbar h1 {
    margin: 0;
    font-size: clamp(1.06rem, 1.08vw, 1.38rem);
    font-weight: 600;
    letter-spacing: -0.018em;
}
.topbar-kicker {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.58rem;
    color: var(--accent);
    font-weight: 600;
}
.topbar-search {
    display: flex;
    align-items: center;
    min-height: 40px;
    border: 1px solid rgba(6, 25, 54, 0.1);
    border-radius: 16px;
    background: #ffffff;
    padding: 0 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 22px rgba(6, 25, 54, 0.04);
}
.topbar-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 0.78rem;
    color: var(--text);
}
.topbar-search input::placeholder { color: #83909c; }
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
    margin-left: auto;
}
.topbar-user,
.topbar-exit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(6, 25, 54, 0.09);
    background: linear-gradient(180deg, #f9fbfb 0%, #eef5f6 100%);
    font-size: 0.76rem;
    color: var(--brand-deep);
}
.topbar-exit { background: #ffffff; }
.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(6, 25, 54, 0.09);
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
}
.nav-toggle-desktop {
    display: inline-grid;
    place-items: center;
}
.nav-toggle span {
    display: block;
    width: 14px;
    height: 2px;
    background: var(--brand-deep);
    border-radius: 999px;
    margin: 2px 0;
}

.flash { padding: 14px 16px; border-radius: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.flash-success { background: linear-gradient(135deg, #edf8f9, #e7f4f6); border: 1px solid #d5e9ee; }
.flash-error { background: linear-gradient(135deg, #fff0f0, #f9e7e6); border: 1px solid #efcdcd; }
.decision-modal[hidden] { display: none; }
.decision-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
}
.decision-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 25, 54, 0.32);
    backdrop-filter: blur(5px);
}
.decision-modal__dialog {
    position: relative;
    width: min(440px, calc(100vw - 32px));
    padding: 22px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(247,250,251,0.98) 100%);
    border: 1px solid #dce7eb;
    box-shadow: 0 30px 70px rgba(6, 25, 54, 0.2);
}
.decision-modal__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}
.decision-modal__title {
    margin: 0 0 8px;
    font-family: "Libre Franklin", "Segoe UI", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.018em;
    color: var(--brand-deep);
}
.decision-modal__message {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.5;
}
.decision-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
.success-modal[hidden] { display: none; }
.success-modal {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: grid;
    place-items: center;
}
.success-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 25, 54, 0.24);
    backdrop-filter: blur(6px);
}
.success-modal__dialog {
    position: relative;
    width: min(420px, calc(100vw - 32px));
    padding: 24px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(235,246,249,0.98) 100%);
    border: 1px solid #d1e6eb;
    box-shadow: 0 28px 68px rgba(6, 25, 54, 0.22);
}
.success-modal__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 8px;
}
.success-modal__title {
    margin: 0 0 8px;
    font-family: "Libre Franklin", "Segoe UI", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.018em;
    color: var(--brand-deep);
}
.success-modal__message {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}
.success-modal__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}
.success-modal-error .success-modal__dialog {
    background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(255,244,244,0.98) 100%);
    border-color: #f0d3d3;
}
.success-modal-error .success-modal__eyebrow {
    color: #b55353;
}
.session-lock-modal[hidden] { display: none; }
.session-lock-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
}
.session-lock-modal__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 28%, rgba(14, 111, 134, 0.22), transparent 34%),
        rgba(6, 25, 54, 0.62);
    backdrop-filter: blur(9px);
}
.session-lock-modal__dialog {
    position: relative;
    width: min(460px, calc(100vw - 32px));
    padding: 26px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(239,248,250,0.99) 100%);
    border: 1px solid rgba(205, 226, 232, 0.95);
    box-shadow: 0 34px 90px rgba(6, 25, 54, 0.34);
}
.session-lock-modal__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 8px;
}
.session-lock-modal__title {
    margin: 0 0 8px;
    font-family: "Libre Franklin", "Segoe UI", sans-serif;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -0.018em;
    color: var(--brand-deep);
}
.session-lock-modal__message {
    margin: 0 0 18px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--muted);
}
.session-lock-modal__form {
    display: grid;
    gap: 12px;
}
.session-lock-modal__error {
    min-height: 18px;
    margin: 0;
    font-size: 0.76rem;
    color: #a74040;
}
.session-lock-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}
body.is-session-locked {
    overflow: hidden;
}
.request-code-line {
    margin: 10px 0 0;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--brand);
}

.grid { display: grid; gap: 20px; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card, .panel, .login-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.88) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(6, 25, 54, 0.075);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card, .panel { padding: 24px; }
.panel-nested { margin-top: 18px; }
.opinion-grid { margin-top: 16px; }
.opinion-card {
    padding: 18px;
    border-radius: 18px;
}
.opinion-card strong {
    display: block;
    margin: 6px 0 8px;
}
.opinion-card p {
    margin: 0;
}
.opinion-card p + p {
    margin-top: 8px;
}
.card h3, .panel h2, .panel h3 { margin-top: 0; margin-bottom: 6px; }
.card h3, .panel h2, .panel h3, .login-form h1, .login-showcase h2, .section-title {
    font-family: "Libre Franklin", "Segoe UI", sans-serif;
    font-weight: 600;
    letter-spacing: -0.018em;
}
.metric { font-size: 1.02rem; font-weight: 600; margin-top: 8px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--brand-soft);
    color: var(--brand);
}

.badge.warning { background: #fff2dd; color: var(--warning); }
.badge.danger { background: #ffe4e4; color: var(--danger); }

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}
.panel h2 {
    font-size: clamp(0.9rem, 0.96vw, 1.1rem);
    letter-spacing: -0.012em;
}
.panel-subtitle {
    margin: 10px 0 0;
    max-width: 30ch;
    line-height: 1.35;
    font-size: 0.74rem;
}
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.table th {
    color: #70807a;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.table tbody tr:hover {
    background: rgba(13, 113, 135, 0.042);
}
.table td strong {
    display: inline-block;
    margin-bottom: 6px;
}
.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid #d8e5e9;
    background: #ffffff;
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 500;
}
.pagination-link.is-active {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-color: transparent;
    color: #ffffff;
}
.pagination-link.is-disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.field { display: grid; gap: 8px; }
.field[hidden],
[data-cedsif-fields][hidden] {
    display: none !important;
}
.field.has-error label { color: #9b3f3f; }
.field label {
    font-weight: 600;
    font-size: 0.72rem;
}
.field input, .field select, .field textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 15px;
    border: 1px solid rgba(13, 113, 135, 0.18);
    background: var(--surface-strong);
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(13, 113, 135, 0.55);
    box-shadow: 0 0 0 4px rgba(13, 113, 135, 0.12);
    background: #fbfdfe;
}

.field input:invalid,
.field select:invalid,
.field textarea:invalid {
    border-color: #d8b1b1;
    box-shadow: 0 0 0 3px rgba(198, 84, 84, 0.08);
}
.field-error {
    display: none;
    font-size: 0.66rem;
    line-height: 1.35;
    color: #b14d4d;
    margin-top: -2px;
}
.field-error.is-visible { display: block; }

.field textarea {
    min-height: 116px;
    resize: vertical;
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.wizard-actions { justify-content: flex-end; }
.actions-compact { margin-top: 0; align-items: center; justify-content: flex-end; }
.align-right { justify-content: flex-end; }
.actions-gap-bottom { margin-bottom: 18px; }
.section-block + .section-block {
    margin-top: 18px;
}
.section-block + .actions-compact,
.section-block + .actions.actions-compact {
    margin-top: 18px;
}
.document-upload-actions {
    margin-top: 14px;
    margin-bottom: 18px;
}
.document-picker {
    display: grid;
    gap: 10px;
}
.document-record {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(249, 250, 251, 0.9) 0%, rgba(255, 255, 255, 0.96) 100%);
}
.document-record-compact {
    padding: 12px 14px;
}
.document-record strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
}
.document-record p {
    margin: 0;
    font-size: 0.7rem;
}
.table-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.inline-form { margin: 0; }
.inline-form select { min-width: 180px; }
.client-wizard { gap: 14px; }
.wizard-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}
.wizard-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(229, 243, 246, 0.64) 0%, rgba(244, 234, 234, 0.38) 100%);
    border: 1px solid rgba(13, 113, 135, 0.13);
    align-items: stretch;
}
.wizard-progress {
    display: grid;
    gap: 4px;
    padding-bottom: 6px;
    align-content: center;
    grid-column: 1 / -1;
}
.wizard-progress-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.62rem;
    color: var(--accent);
    font-weight: 600;
}
.wizard-step {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    align-items: start;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    padding: 10px;
    text-align: left;
    color: var(--text);
    min-width: 0;
    min-height: 76px;
    overflow: visible;
}
.wizard-step > span:last-child { min-width: 0; }
.wizard-step strong {
    display: block;
    font-size: 0.72rem;
    line-height: 1.12;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
}
.wizard-step small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.58rem;
    line-height: 1.18;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
}
.wizard-step.is-active {
    border-color: rgba(13, 113, 135, 0.34);
    background: white;
    box-shadow: 0 12px 26px rgba(6, 25, 54, 0.08);
}
.wizard-step-index {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}
.wizard-step.is-active .wizard-step-index {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: white;
}
.wizard-summary {
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #d9e6ea;
    display: grid;
    align-content: center;
    grid-column: 1 / -1;
}
.wizard-summary p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.66rem;
}
.wizard-summary p:last-child { margin-bottom: 0; }
.wizard-content { min-width: 0; }
.wizard-panel {
    display: none;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(249, 251, 252, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
    border: 1px solid rgba(6, 25, 54, 0.075);
}
.wizard-panel.is-active { display: block; }
.wizard-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    align-items: end;
}
.wizard-panel-head h3 {
    margin: 0;
    font-size: 0.84rem;
}

.btn, .btn-secondary, .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 9px 14px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 52%, var(--brand-deep) 100%);
    color: white;
    box-shadow: 0 14px 28px rgba(6, 25, 54, 0.16);
}
.btn:hover,
.btn-secondary:hover {
    transform: translateY(-1px);
}
.btn-secondary {
    background: linear-gradient(180deg, #f5fafb 0%, var(--brand-soft) 100%);
    color: var(--brand-deep);
    border: 1px solid rgba(13, 113, 135, 0.09);
}
.btn-link { background: transparent; color: var(--brand); padding: 0; }
.btn-link-danger { color: var(--danger); }
.btn:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}
.client-layout { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
.client-layout-single { grid-template-columns: minmax(0, 1fr); }
.client-layout > .panel:not(:first-child) {
    padding: 20px;
}
.client-layout > .panel:not(:first-child) .list {
    gap: 12px;
}
.client-layout > .panel:not(:first-child) .list-item {
    padding: 12px 14px;
    border-radius: 16px;
}
.client-layout > .panel:not(:first-child) .empty-state {
    padding: 18px;
    min-height: 130px;
    display: grid;
    place-items: center;
    border-radius: 16px;
}
.form-grid-wide { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
.field-span-full { grid-column: 1 / -1; }
.section-gap-top { margin-top: 18px; }
.panel-note-top {
    margin-top: 18px;
    max-width: none;
}
.login-info-panel { margin-top: 18px; }
.field-search-action {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.field-search-action .btn,
.field-search-action .btn-secondary {
    width: 100%;
    min-height: 42px;
}
.payment-search-row {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(220px, 280px);
    gap: 16px;
    align-items: end;
    margin-bottom: 6px;
}

.hero {
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(6, 25, 54, 0.96), rgba(13, 113, 135, 0.9) 58%, rgba(130, 98, 99, 0.88)),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.28), transparent 24%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    right: -64px;
    top: -86px;
    width: 240px;
    height: 360px;
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.03));
    transform: skewX(-14deg) rotate(13deg);
    pointer-events: none;
}

.hero p { color: rgba(255, 255, 255, 0.85); }
.stack, .list { display: grid; gap: 18px; }

.list-item {
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(250, 252, 252, 0.96), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(6, 25, 54, 0.075);
}

.split { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.muted { color: var(--muted); }
.empty-state { padding: 30px; text-align: center; border: 1px dashed var(--line); border-radius: 18px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { max-width: 1040px; width: 100%; overflow: hidden; display: grid; grid-template-columns: 1fr 0.9fr; }

.login-showcase {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    padding: 42px;
    background:
        linear-gradient(135deg, #061936 0%, #0b455a 46%, #0d7187 100%);
    color: white;
}
.login-showcase::before {
    content: "";
    position: absolute;
    inset: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 34px;
    pointer-events: none;
}
.login-showcase::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 18%, rgba(255,255,255,0.16), transparent 22%),
        linear-gradient(90deg, rgba(6, 25, 54, 0.24) 0%, rgba(6, 25, 54, 0.06) 70%);
    pointer-events: none;
}
.login-showcase-copy {
    position: relative;
    z-index: 1;
    max-width: 470px;
}
.login-showcase-shape {
    position: absolute;
    border-radius: 28px;
    pointer-events: none;
}
.login-showcase-shape-primary {
    width: 150px;
    height: 520px;
    right: 132px;
    top: 54px;
    background: linear-gradient(180deg, #12a0ba 0%, #0d7187 42%, rgba(6, 25, 54, 0.82) 100%);
    transform: skewX(-14deg) rotate(10deg);
    box-shadow: 0 26px 80px rgba(2, 12, 26, 0.28);
}
.login-showcase-shape-secondary {
    width: 142px;
    height: 500px;
    left: 130px;
    bottom: 54px;
    background: linear-gradient(180deg, #9a7474 0%, #826263 58%, rgba(6, 25, 54, 0.8) 100%);
    transform: skewX(-18deg) rotate(19deg);
    box-shadow: 0 26px 80px rgba(2, 12, 26, 0.22);
}
.login-showcase-shape-outline {
    width: 210px;
    height: 440px;
    right: -10px;
    bottom: 42px;
    border: 1px solid rgba(255,255,255,0.18);
    transform: skewX(17deg) rotate(-18deg);
    opacity: 0.78;
}

.login-form { padding: 44px; background: linear-gradient(180deg, #ffffff 0%, #fbfbfa 100%); }
.login-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 118px;
    height: 92px;
    margin-bottom: 18px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(6, 25, 54, 0.07);
    box-shadow: 0 18px 42px rgba(6, 25, 54, 0.07);
}
.login-brand img {
    width: 96px;
    height: 70px;
    object-fit: contain;
}
.login-form h1 { font-size: 1.08rem; }
.login-showcase h2 { font-size: 1.24rem; }
.login-form h1, .login-showcase h2 { margin-top: 0; }
.login-captcha {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 150px);
    gap: 12px;
    align-items: end;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(13, 113, 135, 0.13);
    background: linear-gradient(180deg, #f7fbfb, #f9f7f6);
}
.login-captcha strong {
    display: block;
    margin-top: 5px;
    font-size: 0.92rem;
    color: var(--brand-deep);
}
.login-captcha-field {
    gap: 6px;
}
.kpi-strip { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-top: 24px; }
.kpi-strip div { background: rgba(255, 255, 255, 0.1); padding: 14px; border-radius: 18px; }
.section-title { margin: 0 0 14px; }

@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        transform: translateX(-110%);
        transition: transform 0.25s ease;
        z-index: 20;
        box-shadow: 0 20px 50px rgba(21, 55, 90, 0.18);
    }
    .sidebar.open { transform: translateX(0); }
    .nav-toggle {
        display: inline-flex;
    }
    .nav-toggle-desktop {
        display: inline-grid;
    }
    .main-content { padding: 0 16px 16px; }
    .topbar-shell { margin: 0 -16px 18px; }
    .topbar-utility {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 14px 16px;
    }
    .topbar-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
    .topbar {
        padding: 16px;
    }
    .card, .panel { padding: 22px; }
    .login-card { grid-template-columns: 1fr; }
    .login-showcase {
        min-height: 320px;
    }
    .login-captcha { grid-template-columns: 1fr; }
    .kpi-strip { grid-template-columns: 1fr; }
    .login-showcase::after {
        background: linear-gradient(180deg, rgba(6, 25, 54, 0.14) 0%, rgba(6, 25, 54, 0.08) 52%, rgba(6, 25, 54, 0.04) 100%);
    }
    .client-layout,
    .wizard-shell,
    .form-grid-wide { grid-template-columns: 1fr; }
    .wizard-rail {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    .wizard-progress,
    .wizard-summary {
        grid-column: 1 / -1;
    }
    .table-actions { justify-content: flex-start; }
}

@media (max-width: 1280px) {
    .wizard-rail {
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    }
    .form-grid-wide {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}
