/* ═══════════════════════════════════════════════════════════════════════════
   SMS · iNdex — Mobile-First CSS  (Android / iOS MAUI Blazor)
   Theme: Brand Blue — aligned to appicon / splash logo palette
   Primary: #1565C0  |  Navy dark: #0A2D55  |  Sky accent: #0288D1
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
    --brand:        #1565C0;   /* logo primary blue                */
    --brand-dark:   #0D47A1;   /* darker brand — pressed states    */
    --brand-light:  #BBDEFB;   /* light tint — chip backgrounds    */
    --brand-navy:   #0A2D55;   /* deep navy — drawer / login bg    */
    --brand-sky:    #0288D1;   /* sky blue — secondary accent      */
    --surface:      #FFFFFF;
    --surface-2:    #F0F4F8;
    --outline:      #D0DCE8;
    --on-surface:   #0A2D55;
    --on-surface-2: #37607E;
    --on-surface-3: #7BA7D4;
    --error:        #C62828;
    --warning:      #E65100;
    --success:      #2E7D32;
    --radius-sm:    10px;
    --radius-md:    16px;
    --radius-lg:    20px;
    --nav-height:   64px;
    --appbar-height:56px;
}

/* ── Font ────────────────────────────────────────────────────────────────── */
*, .mud-typography, .mud-button-root, .mud-input-slot, .mud-input-label {
    font-family: 'Outfit', 'Roboto', 'Segoe UI', sans-serif !important;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

/* ── Root layout ─────────────────────────────────────────────────────────── */
html, body { height: 100%; background: var(--surface-2); }

/* ── Scrollbar — thin on mobile ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-thumb { background: var(--outline); border-radius: 2px; }

/* ── AppBar ──────────────────────────────────────────────────────────────── */
.mud-appbar {
    border-bottom: 1px solid var(--outline) !important;
    box-shadow: none !important;
    height: var(--appbar-height) !important;
}

/* ── Page content wrapper ────────────────────────────────────────────────── */
.mud-main-content {
    padding-top: var(--appbar-height) !important;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 80px) !important;
    padding-left:   0 !important;
    margin-left:    0 !important;
    min-height: 100vh;
}

.page-content {
    padding: 12px 14px;
    max-width: 100%;
}

/* ── Page subtitle bar ───────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 0 10px;
}
.page-header h1 {
    font-size: 16px;
    font-weight: 600;
    color: var(--on-surface-2);
    margin: 0;
    display: none;
}
.page-header p {
    font-size: 12px;
    color: var(--on-surface-2);
    margin: 0;
    font-weight: 500;
}

/* ── Search bar ──────────────────────────────────────────────────────────── */
.mob-search {
    width: 100%;
    margin-bottom: 10px;
}
.mob-search .mud-input-outlined { border-radius: var(--radius-md) !important; }

/* ── Filter chips row ────────────────────────────────────────────────────── */
.chip-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-bottom: 8px;
}
.chip-row::-webkit-scrollbar { display: none; }

/* ── Section label ───────────────────────────────────────────────────────── */
.section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--on-surface-3);
    padding: 12px 0 6px;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STAT CARDS (Dashboard)
   ═══════════════════════════════════════════════════════════════════════════ */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: 0 1px 4px rgba(21,101,192,.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--stat-color, var(--brand));
    border-radius: 3px 3px 0 0;
}
.stat-card .stat-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--stat-color, var(--brand)) 12%, white);
    color: var(--stat-color, var(--brand));
    flex-shrink: 0;
    margin-bottom: 2px;
}
.stat-card .stat-icon .mud-icon-root { font-size: 20px !important; color: inherit; }
.stat-value {
    font-size: 24px !important;
    font-weight: 800 !important;
    line-height: 1;
    color: var(--on-surface);
    font-family: 'Outfit', sans-serif !important;
}
.stat-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--on-surface-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOB-LIST  — card-based list items
   ═══════════════════════════════════════════════════════════════════════════ */
.mob-list {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(21,101,192,.07);
    margin-bottom: 12px;
}

.mob-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--surface-2);
    cursor: pointer;
    position: relative;
    transition: background 0.1s;
    min-height: 64px;
    text-decoration: none;
    color: inherit;
    width: 100%;
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    text-align: left;
}
.mob-list-item:last-child { border-bottom: none; }
.mob-list-item:active { background: #EEF4FC; }

.mob-list-lead { flex-shrink: 0; }

.mob-list-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mob-list-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}
.mob-list-sub {
    font-size: 12px;
    color: var(--on-surface-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.mob-list-sub2 {
    font-size: 11px;
    color: var(--on-surface-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mob-list-trail {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    min-width: 60px;
}
.mob-trail-primary {
    font-size: 14px;
    font-weight: 700;
    color: var(--on-surface);
    white-space: nowrap;
}
.mob-trail-secondary {
    font-size: 11px;
    color: var(--on-surface-2);
    white-space: nowrap;
}

/* ── Avatar ──────────────────────────────────────────────────────────────── */
.mob-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
    text-transform: uppercase;
}
.mob-avatar-sq {
    border-radius: 12px;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.mob-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 24px;
    gap: 12px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 4px rgba(21,101,192,.07);
}
.mob-empty .mud-icon-root { font-size: 52px !important; color: var(--on-surface-3) !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   FAB — Floating Action Button
   ═══════════════════════════════════════════════════════════════════════════ */
.fab {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--brand);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(21,101,192,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 200;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fab .mud-icon-root { font-size: 26px !important; color: white !important; }
.fab:active { transform: scale(0.92); box-shadow: 0 2px 8px rgba(21,101,192,.3); }

/* ── Extended FAB (with label) ───────────────────────────────────────────── */
.fab-ext {
    width: auto;
    padding: 0 20px 0 16px;
    gap: 8px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DIALOGS  — mobile-friendly sizing
   ═══════════════════════════════════════════════════════════════════════════ */
.mud-dialog .mud-dialog-title {
    padding: 20px 20px 10px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
}
.mud-dialog .mud-dialog-content {
    padding: 4px 20px 8px !important;
    max-height: 70vh;
    overflow-y: auto;
}
.mud-dialog .mud-dialog-actions {
    padding: 10px 20px 16px !important;
    gap: 8px;
}
.mud-dialog .mud-dialog-actions .mud-button-root {
    flex: 1;
    border-radius: 12px !important;
    min-height: 44px !important;
}

/* ── Form fields ─────────────────────────────────────────────────────────── */
.mud-input-outlined { border-radius: 12px !important; }
.mud-input-control { margin-bottom: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.mud-card {
    border-radius: var(--radius-md) !important;
    box-shadow: 0 1px 4px rgba(21,101,192,.08) !important;
    border: 1px solid var(--outline) !important;
}
.mud-card:hover { box-shadow: 0 3px 10px rgba(21,101,192,.13) !important; }
.mud-card-content { padding: 16px !important; }

/* ── Info row inside cards ───────────────────────────────────────────────── */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--surface-2);
    font-size: 13.5px;
    gap: 8px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--on-surface-2); font-weight: 500; flex-shrink: 0; }
.info-value { color: var(--on-surface); font-weight: 600; text-align: right; }

/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM NAV BAR  (mobile only)
   ═══════════════════════════════════════════════════════════════════════════ */
.desktop-only { display: flex !important; }
.mobile-only  { display: none !important; }

@media (max-width: 959.98px) {
    .desktop-only { display: none !important; }
    .mobile-only  { display: flex !important; }
    .mud-main-content { padding-left: 0 !important; margin-left: 0 !important; }
    .mud-drawer { display: none !important; }
}

.bottom-nav-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--brand-navy);
    align-items: center;
    justify-content: space-around;
    z-index: 1400;
    border-top: 1px solid rgba(255,255,255,.07);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    gap: 0;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #7BA7D4;
    text-decoration: none;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    gap: 2px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s ease;
    padding: 0;
    white-space: nowrap;
}
.bottom-nav-item .mud-icon-root { font-size: 23px !important; width: 23px !important; height: 23px !important; }
/* Active item uses sky blue — clearly visible against the navy bar */
.bottom-nav-item.active { color: #64B5F6; }
.bottom-nav-item.active .mud-icon-root { color: #64B5F6; }

/* ── More bottom sheet ───────────────────────────────────────────────────── */
.bottom-sheet-overlay {
    position: fixed; inset: 0;
    background: rgba(10,45,85,.50);
    z-index: 1500;
    animation: bsOverlayIn .2s ease;
}
@keyframes bsOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.bottom-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 1600;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(0.32,0.72,0,1);
    max-height: 82vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 12px);
    flex-direction: column !important;
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet-handle {
    width: 40px; height: 4px;
    background: #CFD8DC; border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
}
.bottom-sheet-title {
    padding: 10px 20px 4px; margin: 0;
    font-size: 11px; font-weight: 700;
    letter-spacing: .09em; text-transform: uppercase;
    color: var(--on-surface-2);
}
.bottom-sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px 12px 16px;
}
.bottom-sheet-item {
    display: flex; flex-direction: column;
    align-items: center; justify-content: flex-start;
    padding: 10px 4px; border-radius: 14px;
    text-decoration: none; color: var(--on-surface);
    font-size: 10.5px; font-weight: 600;
    text-align: center; gap: 6px;
    border: none; background: transparent;
    cursor: pointer; width: 100%;
    transition: background .13s ease;
}
.bottom-sheet-item:active { background: #EEF4FC; }
.bottom-sheet-icon {
    width: 48px; height: 48px;
    border-radius: 14px; background: #DDEEFF;
    display: flex; align-items: center; justify-content: center;
    color: var(--brand); flex-shrink: 0;
}
.bottom-sheet-icon .mud-icon-root { font-size: 22px !important; color: inherit; }
.bottom-sheet-logout { color: var(--error); }
.bottom-sheet-icon--danger { background: #FFF0F0 !important; color: var(--error) !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   SPLASH SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */
.splash-screen {
    min-height: 100vh; background: var(--brand-navy);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px;
}
.splash-brand { display: flex; align-items: center; gap: 12px; }
.splash-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700; font-size: 26px;
    letter-spacing: 0.14em; color: #E8F0F8;
}
.splash-sub {
    font-size: 12px; color: #7BA7D4;
    letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px;
}
.splash-loader {
    width: 140px; height: 3px;
    background: rgba(255,255,255,.08);
    border-radius: 2px; overflow: hidden; margin-top: 24px;
}
.splash-bar {
    height: 100%; width: 40%;
    background: var(--brand); border-radius: 2px;
    animation: slide 1.4s ease-in-out infinite;
}
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh; background: var(--brand-navy);
    display: flex; align-items: center; justify-content: center;
    padding: 24px 20px;
}
.login-card-wrap { width: 100%; max-width: 400px; }
.login-card-wrap .mud-paper { border-radius: var(--radius-lg) !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   BRAND SIDEBAR (desktop)
   ═══════════════════════════════════════════════════════════════════════════ */
.mud-drawer--left.mud-drawer-open .mud-drawer-content,
.mud-drawer--left .mud-drawer-content {
    background: var(--brand-navy) !important;
    border-right: 1px solid rgba(255,255,255,.05) !important;
}
.mud-nav-link { border-radius: 8px !important; margin-bottom: 2px !important; }
/* Active nav uses brand-light highlight */
.mud-nav-link.active { background: rgba(21,101,192,.22) !important; color: #90CAF9 !important; }
.mud-nav-link:hover { background: rgba(255,255,255,.06) !important; }
.mud-nav-link .mud-nav-link-text { font-size: 13.5px !important; font-weight: 500 !important; }

/* ── Brand avatar ────────────────────────────────────────────────────────── */
.brand-avatar {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--brand);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-avatar svg { width: 20px; height: 20px; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: .06em; color: #E8F0F8; }
.brand-sub { font-size: 10px; color: #7BA7D4; letter-spacing: .08em; text-transform: uppercase; }

/* ── Table tweaks (desktop) ──────────────────────────────────────────────── */
.mud-table-head th {
    font-size: 11px !important; font-weight: 700 !important;
    text-transform: uppercase !important; letter-spacing: .07em !important;
    color: #37607E !important; background: #F0F4F8 !important;
}
.mud-table-row:hover td { background: #EEF4FC !important; }

/* ── Chart ───────────────────────────────────────────────────────────────── */
.chart-wrap { min-height: 200px; }

/* ── Blazor error bar ────────────────────────────────────────────────────── */
#blazor-error-ui {
    background: var(--error); color: white; font-size: 13px;
    padding: 10px 16px; text-align: center;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999; display: none;
}
#blazor-error-ui .reload { color: white; margin-left: 8px; text-decoration: underline; }
#blazor-error-ui .dismiss { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; }

/* Desktop: when the side menu is open, push the page over instead of covering its left edge
   (the rule above zeroes MudBlazor's own margin for the phone layout). */
@media (min-width: 960px) {
    .mud-layout.mud-drawer-open-responsive-md-left .mud-main-content {
        margin-left: var(--mud-drawer-width-left, 240px) !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   COUNTRY + PHONE FIELD (Shared/CountryPhoneField.razor)
   ═══════════════════════════════════════════════════════════════════════════ */
.cpf { display: flex; gap: 8px; align-items: flex-start; width: 100%; min-width: 0; }
.cpf-number { flex: 1 1 auto; min-width: 0; }
.cpf-country {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
    height: 54px; min-width: 64px; margin-top: 8px; padding: 0 2px 0 10px;
    border: 1px solid rgba(0,0,0,.28); border-radius: 4px; background: #fff;
    font: inherit; font-size: 15px; font-weight: 600; color: #1a1a1a; cursor: pointer;
}
@media (hover: hover) { .cpf-country:hover { border-color: rgba(0,0,0,.6); } }
.cpf-country:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.cpf-country:disabled { opacity: .5; cursor: default; }
.cpf-flag { display: inline-block; min-width: 1.5em; text-align: center; font-size: 26px; line-height: 1; font-family: "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", sans-serif; }

.cpf-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1500; }
.cpf-sheet {
    position: fixed; z-index: 1501; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(92vw, 380px); max-height: min(80vh, 640px);
    display: flex; flex-direction: column; background: #fff; border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.35); overflow: hidden;
}
.cpf-sheet-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 6px 6px 6px 18px; font-weight: 700; font-size: 17px; border-bottom: 1px solid rgba(0,0,0,.08);
}
.cpf-close {
    width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: inherit;
}
@media (hover: hover) { .cpf-close:hover { background: rgba(0,0,0,.06); } }
.cpf-list { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.cpf-item {
    width: 100%; min-height: 48px; display: flex; align-items: center; gap: 12px;
    padding: 8px 18px; border: 0; background: transparent; cursor: pointer;
    font: inherit; font-size: 16px; color: #1a1a1a; text-align: left;
}
.cpf-item:focus-visible { background: rgba(21,101,192,.08); outline: none; }
@media (hover: hover) { .cpf-item:hover { background: rgba(21,101,192,.08); } }
.cpf-item-on { background: rgba(21,101,192,.12); font-weight: 600; }
.cpf-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "Pay into this account" (BankDetailsCard): every value says what it is; number + holder copyable */
.bank-card { background: #EEF6FF; border-radius: 12px; padding: 12px 14px; border-left: 4px solid #1565C0; }
.bank-card-title { font-size: 11px; font-weight: 700; color: #1565C0; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.bank-row { font-size: 13px; color: #37474F; margin-top: 2px; overflow-wrap: anywhere; }
.bank-row-copy { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.bank-row-text { min-width: 0; }
.bank-label { font-weight: 700; margin-right: 4px; }
.bank-account { font-size: 15px; font-weight: 800; color: #0A2D55; letter-spacing: .03em; }

/* "Paid from" on the payment screens: flag only when closed, flag + name in the list */
.paid-from .paid-from-flag { font-size: 20px; line-height: 1; font-family: "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", sans-serif; }
.paid-from-item { display: flex; align-items: center; gap: 12px; min-height: 32px; width: 100%; white-space: nowrap; }
.paid-from-list { min-width: 220px; max-width: calc(100vw - 32px); }
.paid-from-item-flag { font-size: 22px; }

/* Forgot-password: small "checking" state while the reset options load */
.reset-checking { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 0 20px; }
