:root {
    --background: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --sidebar: #0b1f33;
    --sidebar-soft: #132c45;
    --text: #132238;
    --muted: #66758a;
    --border: #dfe6ef;
    --primary: #136f63;
    --primary-dark: #0e554c;
    --primary-soft: #e6f4f1;
    --danger: #a83b3b;
    --danger-soft: #fff0f0;
    --shadow: 0 18px 45px rgba(11, 31, 51, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input {
    font: inherit;
}

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

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

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

.eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 26px 22px;
}

.brand strong,
.auth-brand strong {
    display: block;
    color: #ffffff;
    font-size: 0.94rem;
}

.brand span,
.auth-brand span {
    display: block;
    margin-top: 3px;
    color: #9db1c5;
    font-size: 0.76rem;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.brand-mark-large {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 1rem;
}

.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    overflow-y: auto;
    background: var(--sidebar);
    color: #ffffff;
}

.primary-navigation {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
}

.primary-navigation a {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 13px;
    border-radius: 12px;
    color: #c4d0dc;
    font-size: 0.91rem;
    font-weight: 650;
}

.primary-navigation a:hover,
.primary-navigation a.active {
    background: var(--sidebar-soft);
    color: #ffffff;
}

.primary-navigation a[aria-disabled="true"] {
    cursor: default;
    opacity: 0.7;
}

.primary-navigation small {
    color: #8298ac;
    font-size: 0.61rem;
    font-weight: 700;
}

.navigation-section {
    margin: 22px 12px 6px;
    color: #71889e;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar-footer {
    padding: 17px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
}

.user-summary strong,
.user-summary span {
    display: block;
}

.user-summary strong {
    font-size: 0.85rem;
}

.user-summary span {
    margin-top: 2px;
    color: #91a6b9;
    font-size: 0.72rem;
}

.avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
    font-weight: 800;
}

.logout-button {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    background: transparent;
    color: #dce6ef;
    cursor: pointer;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.07);
}

.main-column {
    min-width: 0;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 82px;
    align-items: center;
    gap: 18px;
    padding: 14px 30px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
}

.topbar h1 {
    margin: 0;
    font-size: 1.5rem;
}

.topbar .eyebrow {
    margin-bottom: 3px;
}

.organization-badge {
    margin-left: auto;
    padding: 9px 13px;
    border: 1px solid #cce5df;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.menu-button {
    display: none;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 1.35rem;
}

.page-content {
    width: min(1450px, 100%);
    margin: 0 auto;
    padding: 30px;
}

.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 24px;
    padding: 26px 28px;
    overflow: hidden;
    border-radius: var(--radius);
    background:
        radial-gradient(
            circle at top right,
            rgba(255, 255, 255, 0.2),
            transparent 35%
        ),
        linear-gradient(135deg, #0b5f55, #163d56);
    color: #ffffff;
    box-shadow: var(--shadow);
}

.welcome-panel .eyebrow {
    color: #a7e0d7;
}

.welcome-panel h2 {
    margin: 0 0 8px;
    font-size: clamp(1.4rem, 2vw, 2rem);
}

.welcome-panel p {
    max-width: 680px;
    margin: 0;
    color: #d4e8e6;
    line-height: 1.6;
}

.plan-summary {
    min-width: 170px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
}

.plan-summary span,
.plan-summary strong {
    display: block;
}

.plan-summary span {
    margin-bottom: 5px;
    color: #c7dfdd;
    font-size: 0.72rem;
}

.plan-summary strong {
    font-size: 1.05rem;
}

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

.metric-card,
.content-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 9px 30px rgba(11, 31, 51, 0.045);
}

.metric-card {
    padding: 21px;
}

.metric-card-emphasis {
    border-color: #bfdfd8;
    background: linear-gradient(150deg, #ffffff, #edf8f5);
}

.metric-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.metric-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
}

.metric-value {
    display: block;
    margin: 21px 0 6px;
    font-size: clamp(1.25rem, 2vw, 1.85rem);
    letter-spacing: -0.035em;
}

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

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

.content-card {
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.financial-list,
.detail-grid {
    margin: 0;
}

.financial-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.financial-list > div:last-child {
    border-bottom: 0;
}

.financial-list dt {
    color: var(--muted);
    font-size: 0.87rem;
}

.financial-list dd {
    margin: 0;
    font-weight: 750;
}

.financial-list .financial-total {
    margin-top: 6px;
    padding: 17px;
    border: 0;
    border-radius: 12px;
    background: var(--surface-soft);
}

.financial-total dt,
.financial-total dd {
    color: var(--text);
    font-weight: 850;
}

.workspace-details {
    margin-bottom: 24px;
}

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

.detail-grid > div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.detail-grid dt {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.73rem;
    font-weight: 750;
    text-transform: uppercase;
}

.detail-grid dd {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 750;
}

.auth-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
}

.auth-introduction {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(30px, 5vw, 72px);
    background:
        radial-gradient(
            circle at 85% 18%,
            rgba(40, 173, 153, 0.28),
            transparent 30%
        ),
        linear-gradient(145deg, #071b2c, #103b4d 58%, #0b6256);
    color: #ffffff;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-message {
    max-width: 680px;
    padding: 70px 0;
}

.auth-message .eyebrow {
    color: #88d8cc;
}

.auth-message h1 {
    max-width: 650px;
    margin: 0 0 22px;
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: 1.03;
    letter-spacing: -0.055em;
}

.auth-message p {
    max-width: 590px;
    margin: 0;
    color: #c5d9dc;
    font-size: 1.05rem;
    line-height: 1.75;
}

.interface-note {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #dcebea;
}

.interface-note span {
    color: #9dbdbd;
    font-size: 0.83rem;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 32px;
    background: #f5f8fb;
}

.login-card {
    width: min(440px, 100%);
    padding: clamp(28px, 4vw, 46px);
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.mobile-brand {
    display: none;
}

.login-card h2 {
    margin: 0 0 10px;
    font-size: 1.7rem;
    letter-spacing: -0.025em;
}

.muted {
    margin: 0 0 26px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.login-form label {
    margin: 15px 0 7px;
    font-size: 0.8rem;
    font-weight: 750;
}

.login-form input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid #ccd6e2;
    border-radius: 11px;
    outline: none;
    background: #ffffff;
    color: var(--text);
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(19, 111, 99, 0.11);
}

.primary-button {
    min-height: 50px;
    margin-top: 24px;
    border: 0;
    border-radius: 11px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
}

.primary-button:hover {
    background: var(--primary-dark);
}

.security-note {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.55;
}

.alert {
    margin: 18px 0 4px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.alert-error {
    border: 1px solid #f0caca;
    background: var(--danger-soft);
    color: var(--danger);
}

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

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

    .auth-layout {
        grid-template-columns: 1fr 470px;
    }
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 50;
        left: 0;
        width: min(290px, 88vw);
        transform: translateX(-105%);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
        transition: transform 180ms ease;
    }

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

    .menu-button {
        display: block;
    }

    .topbar {
        padding: 13px 18px;
    }

    .organization-badge {
        display: none;
    }

    .page-content {
        padding: 20px;
    }

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

    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-introduction {
        display: none;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 11px;
        margin-bottom: 34px;
    }

    .mobile-brand strong {
        font-size: 0.92rem;
    }
}

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

    .welcome-panel {
        align-items: flex-start;
        flex-direction: column;
        padding: 23px;
    }

    .plan-summary {
        width: 100%;
    }

    .auth-panel {
        align-items: start;
        padding: 18px;
    }

    .login-card {
        margin-top: 18px;
        padding: 27px 22px;
        border-radius: 18px;
    }

    .topbar h1 {
        font-size: 1.25rem;
    }

    .page-content {
        padding: 15px;
    }
}

/* RC33.2A — Customer wallet interface */

.page-heading-panel,
.wallet-detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 1rem;
}

.page-heading-panel h2,
.wallet-detail-hero h2 {
    margin: 0.25rem 0 0.5rem;
}

.page-heading-panel p,
.wallet-detail-hero p {
    margin: 0;
    color: var(--muted-text, #64748b);
}

.wallet-total-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.wallet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    gap: 1.25rem;
}

.wallet-card {
    display: flex;
    flex-direction: column;
    min-height: 24rem;
    padding: 1.4rem;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 1rem;
    box-shadow: 0 0.4rem 1.2rem rgba(15, 23, 42, 0.05);
}

.wallet-card-default {
    border-color: var(--primary, #2563eb);
}

.wallet-card-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.wallet-icon {
    display: grid;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border-radius: 0.8rem;
    background: #eef2ff;
    color: #3730a3;
    font-size: 1.2rem;
    font-weight: 700;
}

.wallet-icon-large {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.5rem;
}

.wallet-heading {
    min-width: 0;
}

.wallet-heading h3 {
    margin: 0;
}

.wallet-heading > span {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted-text, #64748b);
    font-size: 0.86rem;
}

.wallet-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.wallet-balance {
    padding: 1.35rem 0;
    margin: 1.25rem 0;
    border-top: 1px solid var(--border, #e5e7eb);
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.wallet-balance span {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--muted-text, #64748b);
    font-size: 0.85rem;
}

.wallet-balance strong {
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.wallet-summary {
    display: grid;
    gap: 0.85rem;
    margin: 0;
}

.wallet-summary div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.wallet-summary dt {
    color: var(--muted-text, #64748b);
}

.wallet-summary dd {
    margin: 0;
    text-align: right;
    font-weight: 600;
}

.wallet-card-actions {
    padding-top: 1.2rem;
    margin-top: auto;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary, #2563eb);
    font-weight: 700;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge-success {
    background: #dcfce7;
    color: #166534;
}

.button-disabled {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 0.65rem 0.9rem;
    border-radius: 0.65rem;
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
    font-weight: 700;
}

.button-disabled small {
    margin-top: 0.15rem;
    font-size: 0.65rem;
    font-weight: 500;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    color: var(--muted-text, #64748b);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary, #2563eb);
    text-decoration: none;
}

.wallet-detail-metrics {
    margin-bottom: 1.5rem;
}

.empty-state {
    padding: 4rem 1.5rem;
    text-align: center;
    background: var(--surface, #ffffff);
    border: 1px dashed var(--border, #cbd5e1);
    border-radius: 1rem;
}

.empty-state-icon {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.empty-state h2 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin: 0;
    color: var(--muted-text, #64748b);
}

@media (max-width: 720px) {
    .page-heading-panel,
    .wallet-detail-hero {
        align-items: flex-start;
        flex-direction: column;
    }

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

/* RC33.2B — Customer wallet management forms */

.button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.7rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 750;
}

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

.button:hover {
    background: var(--primary-dark);
}

.secondary-button {
    border-color: #cbd5e1;
    background: #ffffff;
    color: var(--text);
}

.secondary-button:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.wallet-form-card {
    max-width: 980px;
}

.wallet-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

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

.form-field label {
    font-size: 0.84rem;
    font-weight: 750;
}

.form-field input,
.form-field select {
    width: 100%;
    min-height: 48px;
    padding: 0 0.85rem;
    border: 1px solid #ccd6e2;
    border-radius: 0.7rem;
    outline: none;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(19, 111, 99, 0.11);
}

.form-field input:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.form-field small,
.checkbox-field small {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid #dbe3ec;
    border-radius: 0.8rem;
    background: #f8fafc;
    cursor: pointer;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
    margin-top: 0.15rem;
}

.checkbox-field span {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wallet-template-hints {
    padding: 1rem;
    border-radius: 0.8rem;
    background: #f8fafc;
}

.wallet-template-hints h3 {
    margin: 0 0 0.8rem;
    font-size: 0.9rem;
}

.wallet-template-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.wallet-template-list > span {
    display: inline-flex;
    flex-direction: column;
    padding: 0.5rem 0.65rem;
    border: 1px solid #dbe3ec;
    border-radius: 0.6rem;
    background: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
}

.wallet-template-list small {
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.form-submit {
    min-width: 150px;
    margin-top: 0;
}

@media (max-width: 720px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

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

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions > * {
        width: 100%;
    }
}

.wallet-management-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.wallet-management-actions form {
    margin: 0;
}

.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 1px solid #fecaca;
    border-radius: 0.7rem;
    background: #fff1f2;
    color: #be123c;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 750;
}

.danger-button:hover {
    border-color: #fda4af;
    background: #ffe4e6;
}

@media (max-width: 720px) {
    .wallet-management-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .wallet-management-actions form,
    .wallet-management-actions .button,
    .wallet-management-actions .danger-button {
        width: 100%;
    }
}
