:root {
    --bg: #0c111d;
    --panel: #131b2b;
    --panel-soft: #172235;
    --border: #24324a;
    --text: #f4f7fb;
    --muted: #8e9bb0;
    --accent: #45d6a0;
    --accent-dark: #163d35;
    --blue: #5c8cff;
    --danger: #ff6879;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

form {
    margin: 0;
}

.bank-container {
    max-width: 1560px;
    padding-left: clamp(18px, 3vw, 48px);
    padding-right: clamp(18px, 3vw, 48px);
}

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgb(12 17 29 / 88%);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand, .login-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    letter-spacing: .12em;
}

.brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.dashboard {
    padding-top: 42px;
    padding-bottom: 80px;
}

.page-heading {
    margin-bottom: 30px;
}

.page-heading h1 {
    margin: 5px 0 3px;
    font-size: clamp(30px, 3vw, 44px);
    letter-spacing: -.04em;
}

.page-heading p, .muted {
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
}

.heading-actions {
    display: flex;
    align-items: end;
    gap: 10px;
    margin-top: 18px;
}

.heading-actions label {
    display: block;
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 11px;
}

.year-pill, select {
    min-height: 39px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel);
    color: var(--text);
}

.button {
    min-height: 39px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 8px 15px;
    cursor: pointer;
    color: var(--text);
    background: transparent;
    font-weight: 700;
    transition: .18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--accent);
    color: #061711;
}

.button-secondary {
    border-color: #31514d;
    background: var(--accent-dark);
    color: #7de8c1;
}

.button-ghost {
    border-color: var(--border);
    color: var(--muted);
}

.button-block {
    width: 100%;
    margin-top: 12px;
}

.panel {
    height: 100%;
    background: linear-gradient(145deg, var(--panel), #111827);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 45px rgb(0 0 0 / 16%);
}

.metric-grid {
    margin-bottom: 48px;
}

.limit-panel {
    padding: 24px 26px;
}

.panel-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.hero-value {
    margin: 6px 0 11px;
    font-size: clamp(33px, 4vw, 50px);
    font-weight: 800;
    letter-spacing: -.045em;
}

.limit-copy {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    color: var(--muted);
    font-size: 12px;
}

.progress {
    height: 8px;
    overflow: hidden;
    margin: 10px 0 13px;
    border-radius: 20px;
    background: #27344a;
}

.progress span {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #65a8ff);
}

.remaining {
    color: var(--muted);
}

.remaining strong {
    color: var(--accent);
}

.metric-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
}

.metric-value {
    margin: 10px 0 2px;
    font-size: clamp(24px, 2.4vw, 34px);
    font-weight: 800;
    letter-spacing: -.035em;
}

.metric-panel small {
    color: var(--muted);
}

.positive {
    color: var(--accent);
}

.section-block {
    margin-top: 44px;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
}

.section-title h2 {
    margin: 3px 0 0;
    font-size: 21px;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-link {
    white-space: nowrap;
}

.data-note {
    color: var(--muted);
    font-size: 12px;
}

.quarter-card {
    padding: 18px;
}

.quarter-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--border);
}

.quarter-card header span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 27px;
    border-radius: 7px;
    background: var(--accent-dark);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.quarter-card header strong {
    font-size: 20px;
}

.quarter-month {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding-top: 11px;
    color: var(--muted);
    font-size: 13px;
}

.quarter-month span:last-child {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

th, td {
    padding: 14px 17px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    color: var(--muted);
    background: rgb(255 255 255 / 1.5%);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
}

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

tbody tr:hover td {
    background: rgb(92 140 255 / 3%);
}

.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.strong {
    font-weight: 800;
}

.muted-cell, .empty-state {
    color: var(--muted);
}

.empty-state {
    padding: 36px;
    text-align: center;
}

.nowrap {
    white-space: nowrap;
}

.alert-error, .alert-success {
    margin-bottom: 18px;
    padding: 12px 15px;
    border-radius: 9px;
}

.alert-error {
    border: 1px solid rgb(255 104 121 / 35%);
    background: rgb(255 104 121 / 9%);
    color: #ff9daa;
}

.alert-success {
    border: 1px solid rgb(69 214 160 / 35%);
    background: rgb(69 214 160 / 9%);
    color: #7de8c1;
}

.bridge-error {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bridge-error form {
    margin-left: auto;
}

.bank-login {
    min-height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at 50% 0%, #15263a 0, var(--bg) 50%);
    /*background: url(/img/bank/login-bg-xs.jpg) center no-repeat;*/
    background-size: cover;
}

.login-shell {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: center;
    padding-top: 35px;
    padding-bottom: 35px;
}

.login-shell > .row {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
}

.login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.login-brand strong, .login-brand small {
    display: block;
}

.login-brand small {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .06em;
}

.login-card {
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgb(19 27 43 / 88%);
    backdrop-filter: blur(18px);
    box-shadow: 0 25px 80px rgb(0 0 0 / 38%);
}

.login-card h1 {
    margin: 5px 0 4px;
    font-size: 32px;
    letter-spacing: -.04em;
}

.login-card label {
    display: block;
    margin: 14px 0 6px;
    color: #c8d0dd;
    font-size: 12px;
    font-weight: 700;
}

.login-card input {
    width: 100%;
    height: 45px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: #0d1523;
    color: var(--text);
}

.login-card input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(69 214 160 / 9%);
}

.login-card .alert-error {
    margin: 18px 0 0;
}

.login-glow {
    position: fixed;
    width: 430px;
    height: 430px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: .12;
}

.login-glow-a {
    top: -170px;
    left: -140px;
    background: var(--blue);
}

.login-glow-b {
    right: -160px;
    bottom: -180px;
    background: var(--accent);
}

.settings-page {
    max-width: 1180px;
}

.settings-panel {
    padding: 26px;
}

.settings-panel h2 {
    margin: 4px 0;
    font-size: 21px;
}

.settings-list {
    margin-top: 24px;
    border-top: 1px solid var(--border);
}

.setting-row, .setting-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    color: #cdd5e2;
    font-weight: 650;
}

.setting-field {
    margin-top: 24px;
}

.input-suffix {
    display: flex;
    align-items: center;
    overflow: hidden;
    min-width: 230px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #0d1523;
}

.input-suffix.compact {
    min-width: 140px;
}

.input-suffix input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.input-suffix span {
    padding: 0 12px;
    color: var(--muted);
    white-space: nowrap;
}

.input-suffix:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(69 214 160 / 9%);
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.vat-rules-panel {
    margin-top: 30px;
}

.settings-rule-table {
    margin-top: 22px;
}

.settings-rule-table input[type="text"], .settings-rule-table select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0d1523;
    color: var(--text);
    padding: 8px 11px;
}

.settings-rule-table th:last-child, .rule-delete {
    width: 100px;
    text-align: center;
}

.settings-rule-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--danger);
}

.deductible-page {
    max-width: 1300px;
}

.deductible-form-panel {
    padding: 24px;
}

.deductible-form-panel label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.deductible-form-panel select, .deductible-form-panel input[type="number"], .deductible-form-panel input[type="file"] {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #0d1523;
    color: var(--text);
    padding: 8px 11px;
}

.deductible-form-panel input[type="file"] {
    padding: 7px;
}

.deductible-form-panel input[type="file"]::file-selector-button {
    margin-right: 12px;
    border: 0;
    border-radius: 6px;
    background: var(--panel-soft);
    color: var(--text);
    padding: 5px 9px;
    cursor: pointer;
}

.button-wide {
    width: 100%;
}

.document-link {
    color: var(--accent);
    font-weight: 700;
}

.business-page, .work-days-page {
    max-width: 1300px;
}

.info-card {
    display: flex;
    min-height: 132px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 24px;
}

.info-card > span, .work-form-panel label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.info-card strong {
    font-size: clamp(20px, 2.2vw, 29px);
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.info-card small {
    color: var(--muted);
}

.primary-info {
    border-color: #31514d;
    background: linear-gradient(145deg, var(--accent-dark), #111827);
}

.client-balance {
    padding: 20px;
}

.client-balance header, .client-balance > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.client-balance header {
    margin-bottom: 18px;
    font-size: 17px;
}

.client-balance header strong {
    color: var(--accent);
    font-size: 25px;
    white-space: nowrap;
}

.client-balance > div {
    color: var(--muted);
    font-size: 12px;
}

.client-balance.negative-balance header strong {
    color: var(--danger);
}

.work-form-panel {
    padding: 24px;
}

.work-form-panel h2 {
    margin: 4px 0 20px;
}

.work-form-panel label {
    display: block;
    margin-bottom: 6px;
}

.work-form-panel input, .work-form-panel select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #0d1523;
    color: var(--text);
    padding: 8px 11px;
}

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

.mobile-label, .mobile-icon {
    display: none;
}

.public-legal-page {
    width: min(760px, calc(100% - 36px));
    margin: 48px auto;
}

.public-legal-card {
    padding: clamp(24px, 5vw, 48px);
}

.legal-brand {
    margin-bottom: 40px;
}

.public-legal-card h1 {
    margin: 6px 0 2px;
    font-size: clamp(30px, 5vw, 44px);
    letter-spacing: -.04em;
}

.public-legal-card h2 {
    margin: 30px 0 7px;
    font-size: 17px;
}

.public-legal-card p {
    margin: 0;
    color: #c5cedb;
}

.public-legal-card a, .legal-links a {
    color: var(--accent);
}

.public-legal-card .legal-updated {
    color: var(--muted);
}

.legal-links {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-weight: 700;
}

.mobile-icon {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

@media (min-width: 1024px) {
    .bank-login {
        /*background-image: url(/img/bank/login-bg.jpg);*/
    }
}

@media (max-width: 767.98px) {
    .brand-name, .desktop-label {
        display: none;
    }

    .mobile-label, .mobile-icon {
        display: inline-block;
    }

    .icon-button {
        display: inline-grid;
        place-items: center;
        width: 36px;
        padding-right: 0;
        padding-left: 0;
    }

    .mobile-compact-action {
        width: 34px;
    }

    .business-page .page-heading, .work-days-page .page-heading {
        margin-bottom: 22px;
    }

    .info-card {
        min-height: 105px;
        padding: 18px;
    }

    .work-form-panel {
        padding: 18px;
    }

    .topbar {
        height: auto;
        min-height: 72px;
        padding: 10px 0;
    }

    .topbar .row {
        flex-wrap: nowrap;
        row-gap: 0;
    }

    .topbar-actions {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        margin-left: auto;
        justify-content: flex-end;
        gap: 6px;
    }

    .topbar-actions .button {
        min-height: 34px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .heading-actions {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .heading-actions form:last-child {
        flex: 1;
    }

    .heading-actions .button {
        width: 100%;
    }

    .section-title {
        align-items: start;
        flex-direction: column;
        gap: 4px;
    }

    .section-actions {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .metric-panel {
        min-width: 0;
        padding: 16px;
    }

    .metric-value {
        max-width: 100%;
        font-size: clamp(16px, 5vw, 23px);
        white-space: nowrap;
    }

    .metric-grid > div {
        min-height: 160px;
    }

    .setting-row, .setting-field {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .input-suffix {
        width: 100%;
    }
}
