:root {
    --ink: #1d1d1f;
    --muted: #6e6e73;
    --line: rgba(29, 29, 31, 0.11);
    --surface: rgba(255, 255, 255, 0.78);
    --surface-solid: #ffffff;
    --canvas: #f5f5f7;
    --blue: #0071e3;
    --blue-hover: #0077ed;
    --green: #1f9d69;
    --red: #d94b4b;
    --radius-lg: 30px;
    --radius-md: 20px;
    --shadow-soft: 0 24px 70px rgba(20, 20, 30, 0.09);
    --shadow-card: 0 10px 35px rgba(20, 20, 30, 0.065);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea {
    font: inherit;
}

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

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

button {
    color: inherit;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.25;
    pointer-events: none;
    animation: drift 16s ease-in-out infinite alternate;
}

.ambient-one {
    top: -360px;
    left: -120px;
    background: #7cc7ff;
}

.ambient-two {
    top: 230px;
    right: -380px;
    background: #c0a7ff;
    animation-delay: -7s;
}

@keyframes drift {
    to {
        transform: translate3d(60px, 45px, 0) scale(1.12);
    }
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    padding: 14px 24px;
    transition: padding 280ms ease, background 280ms ease, box-shadow 280ms ease;
}

.site-header.scrolled {
    padding-top: 8px;
    padding-bottom: 8px;
    background: rgba(245, 245, 247, 0.72);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
    backdrop-filter: saturate(180%) blur(22px);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.nav-shell,
.content-shell {
    width: min(1240px, calc(100% - 48px));
    margin-inline: auto;
}

.nav-shell {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--ink);
    border-radius: 10px;
    font-size: 17px;
    font-weight: 750;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.brand-inverse {
    color: #fff;
}

.brand-inverse .brand-mark {
    color: #0c0c0e;
    background: #fff;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: #515154;
    font-size: 14px;
    transition: color 180ms ease;
}

.nav-link:hover {
    color: var(--ink);
}

.button {
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

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

.button:active {
    transform: scale(0.98);
}

.button-small {
    min-height: 38px;
    padding-inline: 16px;
}

.button-primary {
    color: #fff;
    background: var(--blue);
    box-shadow: 0 8px 22px rgba(0, 113, 227, 0.25);
}

.button-primary:hover {
    background: var(--blue-hover);
    box-shadow: 0 11px 28px rgba(0, 113, 227, 0.3);
}

.button-secondary,
.button-quiet {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.75);
    box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.1);
}

.button-secondary:hover,
.button-quiet:hover {
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.16), 0 8px 24px rgba(0, 0, 0, 0.06);
}

.button-wide {
    width: 100%;
}

.button-dark {
    color: #fff;
    background: var(--ink);
}

.hero {
    min-height: 720px;
    padding: 168px 24px 105px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 750;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 950px;
    margin: 0;
    font-size: clamp(50px, 7vw, 88px);
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.hero h1 span {
    background: linear-gradient(100deg, #0071e3 10%, #6e5ce6 48%, #bf5af2 90%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.hero-copy {
    max-width: 660px;
    margin: 28px auto 38px;
    color: var(--muted);
    font-size: clamp(18px, 2vw, 23px);
    line-height: 1.45;
    letter-spacing: -0.02em;
}

.search-card {
    position: relative;
    width: min(760px, 100%);
    padding: 12px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(30, 40, 70, 0.14), inset 0 0 0 1px rgba(0, 0, 0, 0.035);
    text-align: left;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: transform 250ms ease, box-shadow 250ms ease;
}

.search-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 34px 90px rgba(30, 70, 140, 0.18), 0 0 0 4px rgba(0, 113, 227, 0.09);
}

.search-card > label {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip: rect(0 0 0 0);
}

.search-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-icon {
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-left: 10px;
    border: 2px solid #86868b;
    border-radius: 50%;
}

.search-icon::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 2px;
    right: -5px;
    bottom: -2px;
    background: #86868b;
    border-radius: 3px;
    transform: rotate(45deg);
}

.search-control input {
    min-width: 0;
    flex: 1;
    height: 52px;
    padding: 0 4px;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 18px;
    letter-spacing: -0.015em;
}

.search-control input::placeholder {
    color: #a0a0a5;
}

.search-help {
    display: block;
    padding: 4px 14px 1px 44px;
    color: #8c8c91;
    font-size: 12px;
}

.hero-browse-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.browse-divider {
    color: #9a9a9f;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.button-all-dealers {
    min-height: 48px;
    padding-inline: 18px 15px;
    color: #343438;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 26px rgba(30, 40, 70, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.button-all-dealers:hover {
    color: var(--blue);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 13px 34px rgba(30, 60, 110, 0.13);
}

.button-all-dealers b {
    margin-left: 3px;
    font-size: 17px;
    font-weight: 500;
    transition: transform 180ms ease;
}

.button-all-dealers:hover b {
    transform: translateX(3px);
}

.all-dealers-icon {
    width: 24px;
    height: 24px;
    padding: 4px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 2px;
    background: #e8f2ff;
    border-radius: 8px;
}

.all-dealers-icon i {
    height: 8px;
    background: var(--blue);
    border-radius: 3px;
}

.all-dealers-icon i:nth-child(2) {
    height: 13px;
}

.all-dealers-icon i:nth-child(3) {
    height: 10px;
}

.suggestions {
    position: absolute;
    z-index: 30;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    overflow: hidden;
    padding: 8px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    box-shadow: 0 24px 65px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(24px);
}

.suggestions a {
    padding: 11px 12px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 160ms ease;
}

.suggestions a:hover,
.suggestions a:focus {
    background: #f2f2f5;
    outline: none;
}

.suggestions a > span:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.suggestions strong,
.suggestions small {
    overflow: hidden;
    display: block;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestions strong {
    font-size: 14px;
}

.suggestions small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.suggestions b {
    color: var(--blue);
    font-size: 18px;
}

.suggestion-avatar,
.dealer-avatar,
.mini-avatar,
.account-avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #2859a2;
    background: linear-gradient(145deg, #e7f3ff, #d9e6ff);
    border-radius: 12px;
    font-weight: 750;
}

.suggestion-avatar {
    width: 38px;
    height: 38px;
}

.compact-shell {
    margin-top: -70px;
    margin-bottom: 70px;
}

.notice {
    padding: 14px 17px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 550;
}

.notice-warning {
    color: #7b5500;
    background: #fff4cf;
    border: 1px solid #f1dc93;
}

.notice-success {
    color: #17623f;
    background: #e8f8f0;
    border: 1px solid #bfe8d3;
}

.notice-error {
    color: #932f37;
    background: #fff0f1;
    border: 1px solid #f2c7ca;
}

.empty-state,
.result-picker,
.account-section {
    margin-bottom: 110px;
}

.empty-state {
    padding: 70px 24px;
    background: var(--surface-solid);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.empty-state h2,
.section-heading h2,
.account-header h2 {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.empty-state > p:not(.eyebrow) {
    max-width: 530px;
    margin: 16px auto 26px;
    color: var(--muted);
}

.empty-orbit {
    position: relative;
    width: 68px;
    height: 68px;
    margin: 0 auto 22px;
    border: 1px solid rgba(0, 113, 227, 0.2);
    border-radius: 50%;
}

.empty-orbit::before,
.empty-orbit::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(0, 113, 227, 0.13);
    border-radius: 50%;
}

.empty-orbit::after {
    inset: 21px;
    background: var(--blue);
    border: 0;
    box-shadow: 0 0 24px rgba(0, 113, 227, 0.35);
}

.section-heading {
    margin-bottom: 28px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.section-heading.centered {
    justify-content: center;
    text-align: center;
}

.soft-label {
    padding: 8px 13px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.dealer-grid {
    display: grid;
    gap: 10px;
}

.dealer-result {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.035);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.dealer-result:hover {
    z-index: 1;
    background: #fff;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px) scale(1.006);
}

.dealer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 15px;
}

.dealer-result-main {
    min-width: 0;
    flex: 1;
}

.dealer-result-main strong,
.dealer-result-main small {
    display: block;
}

.dealer-result-main strong {
    letter-spacing: -0.015em;
}

.dealer-result-main small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.dealer-result-balance {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.result-arrow {
    color: var(--blue);
    font-size: 20px;
}

.account-header {
    margin-bottom: 30px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.account-kicker {
    display: block;
    margin-bottom: 9px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
}

.account-contact {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    color: var(--muted);
    font-size: 14px;
}

.account-contact span + span::before {
    content: "·";
    margin-right: 9px;
    color: #b0b0b4;
}

.summary-grid {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.summary-card {
    min-height: 176px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
}

.summary-card > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.summary-card strong {
    margin-block: auto 3px;
    display: block;
    font-size: clamp(25px, 3vw, 37px);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.045em;
}

.summary-card small {
    color: #8e8e93;
    font-size: 12px;
}

.summary-card.balance-card {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #0a68ce 0%, #338cff 55%, #6e5ce6 130%);
    border-color: transparent;
}

.summary-card.balance-card::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    top: -100px;
    right: -60px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    filter: blur(2px);
}

.summary-card.balance-card.is-positive {
    background: linear-gradient(135deg, #17704c, #25a46c);
}

.summary-card.balance-card span,
.summary-card.balance-card small {
    color: rgba(255, 255, 255, 0.8);
}

.ledger-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.055);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.ledger-heading {
    padding: 26px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.ledger-heading .eyebrow {
    margin-bottom: 5px;
}

.ledger-heading h3 {
    margin: 0;
    font-size: 23px;
    letter-spacing: -0.025em;
}

.live-pill {
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #24724f;
    background: #eaf8f1;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.live-pill i,
.topbar-status i {
    width: 7px;
    height: 7px;
    background: #2ab477;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(42, 180, 119, 0.13);
}

.table-scroll {
    overflow-x: auto;
    scrollbar-color: #d1d1d6 transparent;
    scrollbar-width: thin;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ledger-table th,
.ledger-table td {
    padding: 15px 13px;
    border-bottom: 1px solid rgba(29, 29, 31, 0.075);
    text-align: left;
    white-space: nowrap;
}

.ledger-table th {
    color: #76767b;
    background: #fafafa;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.ledger-table tbody tr {
    transition: background 160ms ease;
}

.ledger-table tbody tr:hover {
    background: #f8f9fb;
}

.ledger-table .description-cell {
    min-width: 310px;
    max-width: 430px;
    white-space: normal;
    line-height: 1.4;
}

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

.ledger-table .debt {
    color: #8b3d42;
}

.ledger-table .credit {
    color: #14734b;
}

.ledger-table .balance {
    color: var(--ink);
    font-weight: 750;
}

.ledger-table tfoot td {
    padding-block: 18px;
    color: var(--ink);
    background: #f5f7fa;
    border-bottom: 0;
    font-weight: 750;
}

.ledger-table tfoot td:first-child {
    text-align: right;
}

.ledger-table .total-balance {
    color: #fff;
    background: var(--ink);
}

.table-empty {
    padding: 46px 20px !important;
    color: var(--muted);
    text-align: center !important;
}

.how-section {
    padding: 105px 0 120px;
    background: #fff;
}

.steps-grid {
    margin-top: 42px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.step-card {
    min-height: 245px;
    padding: 28px;
    background: #f5f5f7;
    border-radius: 26px;
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.step-number {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--blue);
    background: #fff;
    border-radius: 13px;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.06);
    font-size: 12px;
    font-weight: 750;
}

.step-card h3 {
    margin: 55px 0 9px;
    font-size: 23px;
    letter-spacing: -0.03em;
}

.step-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.site-footer {
    padding: 30px 0;
    color: #8e8e93;
    background: #f5f5f7;
    font-size: 12px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-footer .brand {
    color: var(--ink);
    font-size: 14px;
}

.site-footer .brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 13px;
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 650ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms),
                transform 650ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Login */
.login-page {
    min-height: 100vh;
    overflow: hidden auto;
    color: #fff;
    background: #09090b;
}

.login-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 113, 227, 0.3), transparent 35%),
        radial-gradient(circle at 90% 80%, rgba(142, 69, 230, 0.18), transparent 30%);
}

.login-shell {
    position: relative;
    min-height: 100vh;
    padding: 34px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-shell > .brand {
    align-self: flex-start;
}

.login-card {
    width: min(440px, 100%);
    margin: auto;
    padding: 40px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 30px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.4);
}

.login-icon {
    position: relative;
    width: 54px;
    height: 54px;
    margin-bottom: 24px;
    display: grid;
    place-items: center;
    background: #e8f2ff;
    border-radius: 17px;
}

.login-icon::before {
    content: "";
    width: 20px;
    height: 15px;
    margin-top: 8px;
    border: 2px solid var(--blue);
    border-radius: 5px;
}

.login-icon::after {
    content: "";
    position: absolute;
    top: 12px;
    width: 13px;
    height: 14px;
    border: 2px solid var(--blue);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 36px;
    letter-spacing: -0.045em;
}

.login-card > p:not(.eyebrow) {
    margin: 0 0 27px;
    color: var(--muted);
}

.login-card .notice {
    margin-bottom: 20px;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field > span:first-child {
    color: #57575c;
    font-size: 12px;
    font-weight: 700;
}

.field input,
.field textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    color: var(--ink);
    background: #f5f5f7;
    border: 1px solid transparent;
    border-radius: 12px;
    outline: 0;
    transition: background 160ms ease, border 160ms ease, box-shadow 160ms ease;
}

.field textarea {
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    background: #fff;
    border-color: rgba(0, 113, 227, 0.5);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.password-wrap {
    position: relative;
    display: block;
}

.password-wrap input {
    padding-right: 70px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    padding: 5px;
    color: var(--blue);
    background: transparent;
    border: 0;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transform: translateY(-50%);
}

.back-link {
    margin-top: 24px;
    display: block;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.back-link:hover {
    color: var(--blue);
}

.login-footnote {
    margin: 20px 0 0;
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
}

/* Admin */
.admin-page {
    min-height: 100vh;
    background: #f3f3f5;
}

.admin-sidebar {
    position: fixed;
    z-index: 200;
    inset: 0 auto 0 0;
    width: 294px;
    padding: 22px 16px 18px;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: #111113;
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.12);
}

.sidebar-head {
    padding: 0 6px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-close {
    display: none;
    color: #fff;
    background: transparent;
    border: 0;
    font-size: 28px;
}

.sidebar-section-title {
    padding: 0 7px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #7f7f85;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-section-title span:last-child {
    padding: 2px 7px;
    color: #bcbcc2;
    background: #29292d;
    border-radius: 999px;
}

.sidebar-search {
    position: relative;
    margin-bottom: 10px;
}

.sidebar-search .search-icon {
    position: absolute;
    top: 13px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-color: #69696f;
}

.sidebar-search .search-icon::after {
    background: #69696f;
}

.sidebar-search input {
    width: 100%;
    height: 41px;
    padding: 0 12px 0 37px;
    color: #fff;
    background: #222225;
    border: 1px solid #2d2d31;
    border-radius: 11px;
    outline: 0;
    font-size: 12px;
}

.sidebar-search input:focus {
    border-color: #4a4a50;
}

.dealer-nav {
    min-height: 80px;
    margin: 0 -4px;
    padding: 2px 4px;
    flex: 1;
    overflow-y: auto;
    scrollbar-color: #3b3b40 transparent;
    scrollbar-width: thin;
}

.dealer-nav-item {
    margin-bottom: 4px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #c6c6ca;
    border-radius: 12px;
    transition: color 150ms ease, background 150ms ease;
}

.dealer-nav-item:hover {
    color: #fff;
    background: #202023;
}

.dealer-nav-item.active {
    color: #fff;
    background: #29292d;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.mini-avatar {
    width: 34px;
    height: 34px;
    color: #cfe5ff;
    background: #26384f;
    border-radius: 10px;
    font-size: 13px;
}

.dealer-nav-item > span:last-child {
    min-width: 0;
    flex: 1;
}

.dealer-nav-item strong,
.dealer-nav-item small {
    overflow: hidden;
    display: block;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dealer-nav-item strong {
    font-size: 11px;
}

.dealer-nav-item small {
    margin-top: 2px;
    color: #77777d;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.sidebar-empty {
    padding: 20px 12px;
    color: #707076;
    font-size: 12px;
    text-align: center;
}

.button-sidebar {
    width: 100%;
    margin-top: 10px;
    color: #fff;
    background: #252529;
    border: 1px solid #35353a;
}

.button-sidebar:hover {
    background: #303034;
}

.sidebar-footer {
    margin-top: 14px;
    padding: 14px 6px 0;
    display: grid;
    gap: 2px;
    border-top: 1px solid #28282c;
}

.sidebar-footer a,
.sidebar-footer button {
    width: 100%;
    padding: 8px 2px;
    display: flex;
    justify-content: space-between;
    color: #898990;
    background: transparent;
    border: 0;
    font-size: 11px;
    text-align: left;
    cursor: pointer;
    transition: color 150ms ease;
}

.sidebar-footer a:hover,
.sidebar-footer button:hover {
    color: #fff;
}

.sidebar-backdrop {
    display: none;
}

.admin-main {
    min-width: 0;
    margin-left: 294px;
}

.admin-topbar {
    position: sticky;
    z-index: 50;
    top: 0;
    height: 68px;
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(243, 243, 245, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.065);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.admin-topbar > div:first-of-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.admin-topbar > div:first-of-type span {
    color: var(--muted);
}

.admin-topbar > div:first-of-type strong::before {
    content: "/";
    margin-right: 8px;
    color: #c4c4c8;
}

.topbar-status {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #42775d;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
}

.menu-toggle {
    display: none;
    padding: 8px;
    background: transparent;
    border: 0;
    font-size: 19px;
}

.admin-content {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 42px 38px 70px;
}

.toast {
    position: fixed;
    z-index: 300;
    top: 82px;
    right: 25px;
    max-width: 420px;
    padding-right: 43px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.14);
    animation: toastIn 380ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast button {
    position: absolute;
    top: 50%;
    right: 12px;
    color: currentColor;
    background: transparent;
    border: 0;
    font-size: 20px;
    cursor: pointer;
    transform: translateY(-50%);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
    }
}

.admin-welcome {
    margin-bottom: 28px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.admin-welcome h1 {
    margin: 0 0 6px;
    font-size: clamp(34px, 4vw, 52px);
    line-height: 1;
    letter-spacing: -0.055em;
}

.admin-welcome h1 span {
    color: #929297;
}

.admin-welcome > div > p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.admin-stat-grid {
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 13px;
}

.admin-stat {
    min-width: 0;
    min-height: 138px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.055);
    border-radius: 19px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.035);
}

.admin-stat > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.admin-stat strong {
    overflow: hidden;
    margin: auto 0 0;
    font-size: clamp(22px, 2.4vw, 32px);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
    text-overflow: ellipsis;
}

.admin-stat small {
    color: #9a9a9f;
    font-size: 10px;
}

.admin-stat.accent {
    color: #fff;
    background: linear-gradient(135deg, #141416, #303036);
}

.admin-stat.accent > span,
.admin-stat.accent small {
    color: #a8a8ad;
}

.admin-empty-card {
    min-height: 390px;
    padding: 60px 24px;
    display: grid;
    place-items: center;
    align-content: center;
    background: #fff;
    border-radius: 22px;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.admin-empty-card h2 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -0.04em;
}

.admin-empty-card p {
    max-width: 460px;
    margin: 10px auto 22px;
    color: var(--muted);
}

.admin-account-card {
    position: relative;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.055);
    border-radius: 23px;
    box-shadow: var(--shadow-card);
}

.admin-account-head {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}

.admin-account-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.account-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 19px;
}

.admin-account-title p {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-account-title h2 {
    overflow: hidden;
    max-width: 620px;
    margin: 0;
    font-size: clamp(20px, 2.5vw, 28px);
    letter-spacing: -0.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-actions {
    position: relative;
    display: flex;
    gap: 7px;
}

.icon-menu {
    width: 45px;
    height: 45px;
    background: #f5f5f7;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.context-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    padding: 7px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.13);
}

.context-menu button {
    width: 100%;
    padding: 10px 11px;
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.context-menu button:hover {
    background: #fff1f2;
}

.danger-text {
    color: #bd3d46;
}

.mini-summary {
    margin: 20px 24px 0;
    padding: 13px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: #f6f6f8;
    border-radius: 16px;
}

.mini-summary > div {
    padding: 12px 14px;
}

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

.mini-summary span {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
}

.mini-summary strong {
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.035em;
}

.mini-summary .highlight {
    color: #fff;
    background: var(--ink);
    border-radius: 12px;
}

.mini-summary .highlight span {
    color: #a9a9ae;
}

.admin-ledger-head {
    padding: 27px 24px 16px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.admin-ledger-head h3 {
    margin: 0 0 2px;
    font-size: 19px;
    letter-spacing: -0.025em;
}

.admin-ledger-head p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.admin-table-scroll {
    margin-bottom: 7px;
}

.admin-table {
    font-size: 11px;
}

.admin-table th,
.admin-table td {
    padding: 12px 10px;
}

.admin-table .description-cell {
    min-width: 230px;
    max-width: 330px;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.row-actions button {
    padding: 5px 7px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 650;
    cursor: pointer;
}

.row-edit {
    color: var(--blue);
}

.row-delete {
    color: var(--red);
}

.row-actions button:hover {
    background: #f0f0f2;
}

/* Dialogs */
.app-dialog {
    width: min(610px, calc(100% - 30px));
    max-height: calc(100vh - 30px);
    padding: 0;
    overflow: hidden auto;
    background: #fff;
    border: 0;
    border-radius: 24px;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.32);
}

.app-dialog-wide {
    width: min(780px, calc(100% - 30px));
}

.app-dialog::backdrop {
    background: rgba(12, 12, 14, 0.58);
    backdrop-filter: blur(7px);
}

.app-dialog[open] {
    animation: dialogIn 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dialogIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
}

.dialog-form {
    display: block;
}

.dialog-head {
    padding: 24px 26px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}

.dialog-head .eyebrow {
    margin-bottom: 4px;
    font-size: 10px;
}

.dialog-head h2 {
    margin: 0;
    font-size: 26px;
    letter-spacing: -0.04em;
}

.dialog-close {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #6e6e73;
    background: #ededf0;
    border: 0;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
}

.dialog-body {
    padding: 24px 26px;
    display: grid;
    gap: 17px;
}

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

.field-row.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.money-row {
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
}

.or-badge {
    margin-bottom: 15px;
    color: #96969b;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.money-input {
    position: relative;
    display: block;
}

.money-input input {
    padding-right: 38px;
    font-variant-numeric: tabular-nums;
}

.money-input b {
    position: absolute;
    top: 50%;
    right: 14px;
    color: #8e8e93;
    font-size: 14px;
    transform: translateY(-50%);
}

.form-hint {
    margin: -5px 0 0;
    color: #8e8e93;
    font-size: 11px;
}

.dialog-actions {
    padding: 16px 26px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    background: #fafafa;
    border-top: 1px solid var(--line);
}

@media (max-width: 1180px) {
    .admin-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-card strong {
        font-size: 27px;
    }
}

@media (max-width: 900px) {
    .summary-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        min-height: 150px;
    }

    .step-card {
        min-height: 210px;
    }

    .step-card h3 {
        margin-top: 38px;
    }

    .admin-sidebar {
        width: min(320px, 86vw);
        transform: translateX(-105%);
        transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    .sidebar-close {
        display: block;
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 190;
        inset: 0;
        display: block;
        visibility: hidden;
        opacity: 0;
        background: rgba(0, 0, 0, 0.45);
        transition: opacity 220ms ease, visibility 220ms ease;
    }

    .sidebar-backdrop.visible {
        visibility: visible;
        opacity: 1;
    }

    .sidebar-open {
        overflow: hidden;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-topbar {
        padding-inline: 20px;
        justify-content: flex-start;
        gap: 12px;
    }

    .menu-toggle {
        display: block;
    }

    .topbar-status {
        margin-left: auto;
    }

    .mini-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .site-header {
        padding-inline: 16px;
    }

    .nav-shell,
    .content-shell {
        width: min(100% - 28px, 1240px);
    }

    .nav-link {
        display: none;
    }

    .brand > span:last-child {
        font-size: 14px;
    }

    .hero {
        min-height: 650px;
        padding: 135px 14px 75px;
    }

    .hero h1 {
        font-size: clamp(44px, 13vw, 64px);
    }

    .hero-copy {
        margin-block: 22px 30px;
        font-size: 17px;
    }

    .search-card {
        padding: 9px;
        border-radius: 20px;
    }

    .search-control {
        flex-wrap: wrap;
    }

    .search-icon {
        margin-left: 9px;
    }

    .search-control input {
        height: 48px;
        font-size: 16px;
    }

    .search-control .button {
        width: 100%;
    }

    .search-help {
        padding: 6px 4px 2px;
        text-align: center;
    }

    .account-header,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-header h2 {
        font-size: 34px;
    }

    .dealer-result {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .dealer-result-balance {
        margin-left: 64px;
    }

    .result-arrow {
        margin-left: auto;
    }

    .ledger-heading {
        padding: 22px 18px;
    }

    .live-pill {
        display: none;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer p {
        margin: 0;
    }

    .login-card {
        padding: 28px 22px;
    }

    .admin-content {
        padding: 30px 15px 55px;
    }

    .admin-welcome,
    .admin-account-head,
    .admin-ledger-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-welcome .button,
    .admin-ledger-head .button {
        width: 100%;
    }

    .admin-stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .admin-stat {
        min-height: 120px;
        padding: 16px;
    }

    .admin-stat strong {
        font-size: 22px;
    }

    .admin-account-title {
        align-items: flex-start;
    }

    .admin-account-title h2 {
        white-space: normal;
    }

    .account-actions {
        justify-content: flex-end;
    }

    .account-actions .button {
        flex: 1;
    }

    .mini-summary {
        margin-inline: 14px;
    }

    .admin-ledger-head {
        padding-inline: 16px;
    }

    .field-row,
    .field-row.three,
    .money-row {
        grid-template-columns: 1fr;
    }

    .or-badge {
        margin: -4px auto;
    }

    .dialog-head,
    .dialog-body,
    .dialog-actions {
        padding-left: 19px;
        padding-right: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
