/* ═══════════════════════════════════════════════════════════════════════
   FinancialWise App – Mobile-First Modern CSS
   ═══════════════════════════════════════════════════════════════════════ */

html, body {
    font-family: 'Manrope', 'Inter', 'Roboto', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

/* ── Scrollbar ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.25); }

/* ── Font weight helpers ─────────────────────────────────────────────── */
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }

/* ── Page header ─────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }

/* ═══════════════════════════════════════════════════════════════════════
   Bottom Navigation (Mobile)
   ═══════════════════════════════════════════════════════════════════════ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 4px 0 env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.mud-theme-dark .bottom-nav {
    background: rgba(18, 18, 24, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.bottom-nav-inner { width: 100%; padding: 0 4px; }

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 10px;
    border-radius: 16px;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.4);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 52px;
    position: relative;
}

.bottom-nav-item:hover {
    color: rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.04);
}

.bottom-nav-item.active {
    color: var(--mud-palette-primary);
    background: rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

.bottom-nav-item.active .mud-icon-root {
    transform: scale(1.1);
}

.mud-theme-dark .bottom-nav-item { color: rgba(255,255,255,.4); }
.mud-theme-dark .bottom-nav-item:hover { color: rgba(255,255,255,.7); background: rgba(255,255,255,.05); }
.mud-theme-dark .bottom-nav-item.active { color: var(--mud-palette-primary); background: rgba(255,255,255,.08); }

/* ═══════════════════════════════════════════════════════════════════════
   Page Transitions
   ═══════════════════════════════════════════════════════════════════════ */
.page-transition {
    animation: pageIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════
   FAB Speed Dial (Mobile)
   ═══════════════════════════════════════════════════════════════════════ */
.fab-container {
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom, 6px));
    right: 16px;
    z-index: 1099;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.fab-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: -1;
    animation: fadeIn 0.2s ease;
}

.mud-theme-dark .fab-overlay {
    background: rgba(0, 0, 0, 0.55);
}

.fab-speed-dial {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 14px;
}

.fab-action {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    animation: fabActionIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.fab-action:active {
    transform: scale(0.95);
}

.fab-label {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.02em;
}

.fab-main {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
}

.mud-theme-dark .fab-main {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

@keyframes fabActionIn {
    from { opacity: 0; transform: translateY(12px) scale(0.8); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Cards & Stat Cards
   ═══════════════════════════════════════════════════════════════════════ */
.entity-card {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.entity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}
.entity-card:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}
.mud-theme-dark .entity-card {
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-card {
    text-align: center;
    padding: 1.25rem 0.75rem;
    border-radius: 16px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════════
   Tables – touch & mobile optimized
   ═══════════════════════════════════════════════════════════════════════ */
.row-actions { white-space: nowrap; }

.mud-table .mud-table-row:active {
    background: rgba(26, 35, 126, 0.04) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Form Panel Transitions
   ═══════════════════════════════════════════════════════════════════════ */
.form-panel {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════
   Status Colors
   ═══════════════════════════════════════════════════════════════════════ */
.status-active  { color: #2e7d32 !important; }
.status-inactive { color: #9e9e9e !important; }
.status-warning { color: #f57f17 !important; }
.status-danger  { color: #c62828 !important; }

/* ═══════════════════════════════════════════════════════════════════════
   Currency & Amount Display
   ═══════════════════════════════════════════════════════════════════════ */
.currency-amount {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.amount-deposit    { color: #2e7d32; font-weight: 600; }
.amount-withdrawal { color: #c62828; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   Progress bar in table cells
   ═══════════════════════════════════════════════════════════════════════ */
.inline-progress { min-width: 80px; }

/* ═══════════════════════════════════════════════════════════════════════
   MudBlazor Component Overrides
   ═══════════════════════════════════════════════════════════════════════ */

/* Rounder chips */
.mud-chip { border-radius: 20px !important; }

/* Nicer table */
.mud-table-container {
    border-radius: 12px !important;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.mud-theme-dark .mud-table-container {
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Smoother drawer */
.mud-drawer { transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; }

/* App bar glass effect */
.mud-appbar {
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}

/* Dialog slide up on mobile */
.mud-dialog {
    animation: dialogSlide 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes dialogSlide {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Snackbar rounded */
.mud-snackbar { border-radius: 12px !important; }

/* -----------------------------------------------------------------------
   Login Page
   ----------------------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 15%, rgba(26, 35, 126, 0.14), transparent 42%),
        radial-gradient(circle at 88% 88%, rgba(0, 137, 123, 0.14), transparent 44%),
        linear-gradient(160deg, #eef1f8 0%, #f7f8fc 100%);
}

.login-shell {
    width: min(92vw, 460px);
    margin-inline: auto;
    display: block;
}

.login-card {
    width: 100%;
    max-width: 460px;
    margin-inline: auto;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.10);
    animation: loginIn 0.45s ease;
}

.login-hero {
    display: none !important;
}

.hero-chip {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.34);
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 6px 10px;
    margin-bottom: 14px;
}

.login-hero h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.1;
}

.login-hero p {
    margin: 0 0 18px;
    color: rgba(255,255,255,0.88);
    font-size: 1rem;
}

.hero-points {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: rgba(255,255,255,0.9);
    font-size: 0.92rem;
}

.login-card {
    width: 100%;
    max-width: 460px;
    justify-self: center;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.10);
    animation: loginIn 0.45s ease;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.login-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--mud-palette-primary, #1a237e);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.login-card h2 {
    margin: 0;
    font-size: 1.45rem;
}

.login-card p {
    margin: 2px 0 0;
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.92rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form label {
    font-size: 0.83rem;
    color: rgba(0, 0, 0, 0.66);
}

.login-form input {
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    padding: 0 12px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.login-form input:focus {
    border-color: var(--mud-palette-primary, #1a237e);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.12);
}

.login-form button {
    margin-top: 10px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: var(--mud-palette-primary, #1a237e);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease, filter .2s ease;
}

.login-form button:hover { filter: brightness(1.06); }
.login-form button:active { transform: translateY(1px); }

.login-note {
    margin-top: 4px;
    color: rgba(0,0,0,.55);
    font-size: 0.76rem;
    text-align: center;
}

.login-error {
    margin-bottom: 12px;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.86rem;
    color: #b71c1c;
    background: rgba(198, 40, 40, 0.1);
}

@keyframes loginIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mud-theme-dark .login-page {
    background:
        radial-gradient(circle at 15% 15%, rgba(121, 134, 203, 0.16), transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(77, 182, 172, 0.14), transparent 45%),
        linear-gradient(160deg, #10131b 0%, #131722 100%);
}

.mud-theme-dark .login-card {
    background: rgba(25, 30, 43, 0.86);
    border-color: rgba(255, 255, 255, 0.10);
}

.mud-theme-dark .login-card h2,
.mud-theme-dark .login-card p,
.mud-theme-dark .login-form label,
.mud-theme-dark .login-note {
    color: rgba(255, 255, 255, 0.78);
}

.mud-theme-dark .login-form input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* Brand logo system */
.brand-logo {
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.12));
}

.brand-logo-appbar {
    width: 24px;
    height: 24px;
    border-radius: 7px;
}

.brand-avatar {
    background: transparent !important;
}

.brand-logo-drawer {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.brand-logo-login {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

/* -----------------------------------------------------------------------
   Drawer spacing fix (persistent)
   ----------------------------------------------------------------------- */
.app-drawer .mud-drawer-content {
    display: block !important;
    padding-top: 0 !important;
}

.app-drawer .drawer-divider,
.app-drawer .mud-divider-fullwidth,
.app-drawer hr.mud-divider {
    flex: 0 0 auto !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    height: auto !important;
    margin: 0 !important;
}

.app-drawer .drawer-nav-menu,
.app-drawer .mud-navmenu {
    margin-top: 0 !important;
    padding-top: 0 !important;
    justify-content: flex-start !important;
}
