@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f4f6fb;
    --bg-accent: #e8ecff;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0b1220;
    --text-secondary: #334155;
    --muted: #64748b;
    --brand: #0026FF;
    --brand-dark: #001dbf;
    --primary: #0026FF;
    --primary-dark: #001dbf;
    --primary-soft: #e8ecff;
    --customers: #0026FF;
    --customers-soft: #e8ecff;
    --finance: #059669;
    --finance-soft: #d1fae5;
    --tasks: #d97706;
    --tasks-soft: #fef3c7;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --warning-soft: #fef9c3;
    --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.06);
    --shadow: 0 12px 32px rgba(0, 38, 255, 0.1);
    --shadow-lg: 0 22px 50px rgba(0, 38, 255, 0.16);
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --drawer-width: 300px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── Login ── */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 12% 12%, rgba(0, 38, 255, 0.18), transparent 40%),
        radial-gradient(circle at 88% 88%, rgba(0, 0, 0, 0.08), transparent 40%),
        linear-gradient(160deg, #000 0%, #0a0f2e 45%, #0026FF 140%);
}

.login-wrap {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.login-logo-img {
    width: min(280px, 80vw);
    height: auto;
    display: block;
    margin-bottom: 0.85rem;
    filter: drop-shadow(0 10px 28px rgba(0, 38, 255, 0.35));
}

.login-logo p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.92rem;
    margin-top: 0.15rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 38, 255, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.35rem;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--brand), #1a3fff);
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 38, 255, 0.32);
}

.btn-primary:hover {
    box-shadow: 0 12px 28px rgba(0, 38, 255, 0.4);
}

.btn-sm {
    width: auto;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
}

.btn-ghost {
    background: #fff;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1.15rem;
}

.alert-error {
    background: var(--danger-soft);
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* ── Drawer ── */
body.drawer-open {
    overflow: hidden;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    z-index: 40;
}

.drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.app-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(var(--drawer-width), 88vw);
    background: #000;
    color: #fff;
    z-index: 50;
    display: flex;
    flex-direction: column;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.35);
}

.app-drawer.is-open {
    transform: translateX(0);
}

.drawer-brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #0a0f2e 0%, #000 100%);
}

.drawer-logo {
    width: 170px;
    max-width: 70%;
    height: auto;
    display: block;
}

.drawer-close {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.drawer-close svg {
    width: 18px;
    height: 18px;
}

.drawer-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 0.95rem;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
    margin-bottom: 0.35rem;
    transition: background 0.2s, color 0.2s;
}

.drawer-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.drawer-link.is-active {
    background: rgba(0, 38, 255, 0.28);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 38, 255, 0.45);
}

.drawer-link-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 38, 255, 0.2);
    color: #7a8fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.drawer-link.is-active .drawer-link-icon {
    background: var(--brand);
    color: #fff;
}

.drawer-link-icon svg {
    width: 18px;
    height: 18px;
}

.drawer-count,
.drawer-soon {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
}

.drawer-count {
    background: var(--brand);
    color: #fff;
}

.drawer-soon {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
}

.drawer-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-install {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    margin-bottom: 0.85rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), #1a3fff);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.drawer-install svg {
    width: 18px;
    height: 18px;
}

.drawer-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.drawer-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    background: #111;
}

.drawer-user strong {
    display: block;
    font-size: 0.92rem;
}

.drawer-user span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
}

.drawer-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fca5a5;
    font-size: 0.88rem;
    font-weight: 600;
}

.drawer-logout svg {
    width: 16px;
    height: 16px;
}

/* ── App shell ── */
.app-shell {
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
}

.app-shell::before {
    content: '';
    position: fixed;
    inset: 0;
    max-width: 480px;
    margin: 0 auto;
    background:
        radial-gradient(circle at 0% 0%, rgba(0, 38, 255, 0.08), transparent 45%),
        radial-gradient(circle at 100% 20%, rgba(0, 0, 0, 0.04), transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.header-btn {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.header-btn:hover {
    background: #fff;
    border-color: var(--border-strong);
    color: var(--primary);
}

.header-btn svg {
    width: 20px;
    height: 20px;
}

.app-header-brand {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo {
    height: 36px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    /* logo is blue on black — show on light header with invert? keep as-is with dark pill */
    background: #000;
    padding: 0.35rem 0.65rem;
    border-radius: 10px;
}

.app-header-title {
    text-align: center;
    min-width: 0;
    width: 100%;
}

.app-header-title h1 {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header-title span {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    margin-top: 0.1rem;
}

/* Install banner */
.install-banner {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin: 0.85rem 1rem 0;
    padding: 0.75rem;
    background: #000;
    color: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 5;
}

.install-banner.is-visible {
    display: flex;
}

.install-banner img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
}

.install-banner div {
    flex: 1;
    min-width: 0;
}

.install-banner strong {
    display: block;
    font-size: 0.88rem;
}

.install-banner span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
}

.install-banner .btn-sm {
    flex-shrink: 0;
}

.install-banner-x {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.install-banner-x svg {
    width: 14px;
    height: 14px;
}

.app-main {
    position: relative;
    z-index: 1;
    padding: 1.25rem 1.25rem 5.5rem;
}

/* Bottom dashboard nav */
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 25;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.45rem 0.25rem;
    border-radius: 12px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
    min-width: 0;
}

.bottom-nav-item span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bottom-nav-item.is-active,
.bottom-nav-item:hover {
    background: var(--primary-soft);
    color: var(--brand);
}

.bottom-nav-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-icon svg {
    width: 22px;
    height: 22px;
}

/* ── Home welcome ── */
.home-welcome {
    margin-bottom: 1.25rem;
}

.home-welcome h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.home-welcome p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.home-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #000000 0%, #001a99 45%, #0026FF 100%);
    border-radius: var(--radius-lg);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.home-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.home-stat-icon svg {
    width: 26px;
    height: 26px;
}

.home-stat-body span {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.home-stat-body strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 0.15rem;
}

.home-stat-body small {
    font-size: 0.82rem;
    opacity: 0.9;
}

.type-total-stat {
    margin-bottom: 1rem;
}

.bills-summary-card {
    display: block;
    margin-bottom: 1.25rem;
    padding: 1.15rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #000000 0%, #001a99 45%, #0026FF 100%);
    color: #fff;
    box-shadow: var(--shadow-lg);
    transition: transform 0.15s, box-shadow 0.2s;
}

a.bills-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 38, 255, 0.28);
}

.bills-summary-card.is-static {
    cursor: default;
}

.bills-summary-top {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.bills-summary-top > div:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.bills-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.85;
}

.bills-expected {
    display: block;
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0.15rem 0;
}

.bills-summary-top small {
    font-size: 0.8rem;
    opacity: 0.85;
}

.bills-chevron {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bills-chevron svg {
    width: 16px;
    height: 16px;
}

.bills-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.bills-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin-top: 1rem;
}

.bills-split-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: inherit;
    text-decoration: none;
}

.bills-split-item span {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.78;
}

.bills-split-item strong {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
}

.bills-split-item.is-prior {
    background: rgba(253, 164, 175, 0.16);
    border-color: rgba(253, 164, 175, 0.35);
}

.bills-split-item.is-prior strong {
    color: #fecdd3;
}

a.bills-split-item.is-prior:hover,
a.bills-split-item.is-prior.is-active {
    background: rgba(253, 164, 175, 0.26);
    border-color: rgba(253, 164, 175, 0.5);
}

.bills-metric {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
}

a.bills-metric-link {
    color: inherit;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s, border-color 0.2s;
}

a.bills-metric-link:hover,
a.bills-metric-link.is-active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.bills-summary-link {
    color: inherit;
    text-decoration: none;
}

.bills-metric span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.8;
    margin-bottom: 0.2rem;
}

.bills-metric strong {
    font-size: 1.05rem;
    font-weight: 800;
}

.bills-metric em {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    font-style: normal;
    opacity: 0.75;
}

.bills-metric.paid strong {
    color: #86efac;
}

.bills-metric.remaining strong {
    color: #fde68a;
}

.bills-metric.prior strong {
    color: #fda4af;
}

.remaining-tag {
    color: #b45309 !important;
}

.paid-tag {
    color: var(--success) !important;
    font-weight: 800;
}

.prior-tag {
    color: #be123c !important;
    font-weight: 800;
}

.badge-remain {
    background: #fef3c7;
    color: #b45309;
}

.badge-remain::before {
    background: currentColor;
}

.badge-prior {
    background: #ffe4e6;
    color: #be123c;
}

.badge-prior::before {
    background: currentColor;
}

/* ── App grid ── */
.section-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.85rem;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.app-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.app-tile::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.12;
    transform: translate(30%, -30%);
}

.app-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--border-strong);
}

.app-tile-customers::after {
    background: var(--customers);
}

.app-tile-finance::after {
    background: var(--finance);
}

.app-tile-tasks::after {
    background: var(--tasks);
}

.app-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-tile-icon svg {
    width: 24px;
    height: 24px;
}

.app-tile-customers .app-tile-icon {
    background: var(--customers-soft);
    color: var(--customers);
}

.app-tile-finance .app-tile-icon {
    background: var(--finance-soft);
    color: var(--finance);
}

.app-tile-tasks .app-tile-icon {
    background: var(--tasks-soft);
    color: var(--tasks);
}

.app-tile-label {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.app-tile-desc {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

.app-tile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.25rem;
}

.app-tile-count {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--customers);
}

.app-tile-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
}

.app-tile-badge.soon {
    background: #fef3c7;
    color: #b45309;
}

.app-tile-arrow {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: background 0.2s, color 0.2s;
}

.app-tile:hover .app-tile-arrow {
    background: var(--primary-soft);
    color: var(--primary);
}

.app-tile-arrow svg {
    width: 16px;
    height: 16px;
}

/* ── Section hint ── */
.section-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    background: var(--primary-soft);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.section-hint svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 0.1rem;
}

.section-hint strong {
    color: var(--text);
}

/* ── Type cards ── */
.type-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.type-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}

.type-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
    border-color: #c7d2fe;
}

.type-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.type-card-body {
    flex: 1;
    min-width: 0;
}

.type-card-body h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.type-card-body p {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 500;
}

.type-card-count {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand), #1a3fff);
    color: #fff;
    font-weight: 800;
    font-size: 0.88rem;
    border-radius: 12px;
    padding: 0 0.5rem;
    flex-shrink: 0;
}

.type-card-chevron {
    color: var(--border-strong);
    margin-left: -0.25rem;
}

.type-card-chevron svg {
    width: 18px;
    height: 18px;
}

/* ── Customer list ── */
.customer-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.customer-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.2s;
}

.customer-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.customer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0026FF, #001a99);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.customer-card-main {
    flex: 1;
    min-width: 0;
}

.customer-card-main h3 {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-card-main p {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.customer-card-fee {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--finance);
}

.customer-card-arrow svg {
    width: 16px;
    height: 16px;
    color: var(--border-strong);
}

/* ── Detail ── */
.detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.detail-hero {
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
    background: linear-gradient(160deg, #e8ecff 0%, #fff 60%);
    border-bottom: 1px solid var(--border);
}

.detail-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--brand), #001a99);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0, 38, 255, 0.28);
}

.detail-hero h2 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.detail-hero .detail-code {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
}

.detail-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-secondary);
}

.detail-section {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.85rem;
}

.detail-section h4 svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.detail-rows {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.65rem 0.75rem;
    background: var(--surface-2);
    border-radius: 10px;
    font-size: 0.88rem;
}

.detail-row dt {
    color: var(--muted);
    font-weight: 600;
    flex-shrink: 0;
}

.detail-row dd {
    font-weight: 600;
    color: var(--text);
    text-align: right;
    word-break: break-word;
}

.detail-notes {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 0.75rem;
    background: var(--surface-2);
    border-radius: 10px;
}

/* ── Badges & states ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: capitalize;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-active {
    background: var(--success-soft);
    color: var(--success);
}

.badge-inactive {
    background: #f1f5f9;
    color: var(--muted);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.empty-state,
.wait-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
}

.empty-icon,
.wait-state-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 20px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.wait-state h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.45rem;
}

.wait-state p {
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 280px;
    margin: 0 auto;
    line-height: 1.5;
}

.wait-back {
    margin-top: 1.25rem;
}

.alert-db {
    background: var(--warning-soft);
    border: 1px solid #fde047;
    color: #854d0e;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    font-weight: 500;
}

@media (min-width: 520px) {
    .app-shell {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }
}

@media (max-width: 380px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
}
