/* ==========================================================================
   Smart Finance Family Manager - Design System & Stylesheet
   ========================================================================== */

:root {
    /* Color Palette */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    
    --emerald: #10b981;
    --emerald-dark: #059669;
    --emerald-light: #ecfdf5;
    
    --rose: #f43f5e;
    --rose-dark: #e11d48;
    --rose-light: #fff1f2;
    
    --amber: #f59e0b;
    --amber-dark: #d97706;
    --amber-light: #fffbeb;
    
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* System Tokens */
    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.12);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
    --bg-app: #0b0f19;
    --bg-card: #151d30;
    --border-color: #2a364f;
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    
    --primary-light: #1e1b4b;
    --emerald-light: #022c22;
    --rose-light: #4c0519;
    --amber-light: #451a03;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 14px -2px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 30px -5px rgba(0,0,0,0.5);
}

[data-theme="dark"] .table th {
    background: #111827;
    color: #9ca3af;
}

[data-theme="dark"] .table tbody tr:hover {
    background: #1e293b;
}

[data-theme="dark"] .profile-hero-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #151d30 100%);
    border-color: #2a364f;
}

[data-theme="dark"] .bg-disabled {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .alert-danger {
    background: #4c0519;
    color: #fecdd3;
    border-color: #9f1239;
}

[data-theme="dark"] .alert-success {
    background: #022c22;
    color: #a7f3d0;
    border-color: #065f46;
}

[data-theme="dark"] .badge-income {
    background: #064e3b;
    color: #6ee7b7;
}

[data-theme="dark"] .badge-expense {
    background: #881337;
    color: #fda4af;
}

[data-theme="dark"] .badge-indigo {
    background: #312e81;
    color: #a5b4fc;
}

[data-theme="dark"] .badge-emerald {
    background: #064e3b;
    color: #6ee7b7;
}

/* Theme Toggle Component */
.theme-toggle-group {
    display: inline-flex;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
}

.theme-btn {
    border: none;
    background: transparent;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.theme-btn.active {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.theme-btn:hover:not(.active) {
    color: var(--text-main);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Hide scrollbar visually while preserving scrolling functionality */
* {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

*::-webkit-scrollbar {
    display: none;
    width: 0px;
    height: 0px;
    background: transparent;
}

html, body {
    width: 100%;
    max-width: 100vw;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.hidden { display: none !important; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1.25rem; }
.p-0 { padding: 0 !important; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.mb-3 { margin-bottom: 0.75rem; }

.text-center { text-align: center; }
.text-emerald { color: var(--emerald) !important; }
.text-rose { color: var(--rose) !important; }
.text-indigo { color: var(--primary) !important; }
.text-amber { color: var(--amber) !important; }
.text-muted { color: var(--text-muted); }

.bg-emerald-light { background-color: var(--emerald-light) !important; }
.bg-rose-light { background-color: var(--rose-light) !important; }
.bg-indigo-light { background-color: var(--primary-light) !important; }
.bg-amber-light { background-color: var(--amber-light) !important; }

/* Grid Layouts */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* ==========================================================================
   AUTHENTICATION OVERLAY
   ========================================================================== */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    overflow-y: auto;
}

.auth-card {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-lg);
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo-img {
    max-width: 150px;
    height: auto;
    margin-bottom: 0.85rem;
    border-radius: var(--radius-md);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.auth-brand h1,
.auth-brand h2,
.auth-brand-name {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary);
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

[data-theme="dark"] .auth-brand h1,
[data-theme="dark"] .auth-brand h2,
[data-theme="dark"] .auth-brand-name {
    background: linear-gradient(135deg, #818cf8 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-brand p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.auth-tabs {
    display: flex;
    background: var(--bg-app);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.auth-tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.forgot-pw-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.45rem;
    margin-bottom: 0.2rem;
}

.forgot-pw-link {
    font-size: 0.82rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.forgot-pw-link:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Forms */
.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-group label i {
    color: var(--text-muted);
    margin-right: 4px;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--bg-card);
    transition: var(--transition);
    box-sizing: border-box;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 2.75rem !important;
}

.password-toggle-btn {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    z-index: 5;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: var(--primary);
}

.password-toggle-btn:focus {
    outline: none;
    color: var(--primary);
}

.form-control-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    transition: var(--transition);
    box-sizing: border-box;
}

.form-control-sm:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

select option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Input Validation Error State (Red Border) */
.input-error,
.form-group input.input-error,
.form-group select.input-error,
.form-group textarea.input-error {
    border: 1.5px solid #ef4444 !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    user-select: none;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.btn:active {
    transform: scale(0.96) translateY(0);
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}

.btn-emerald { background: var(--emerald); color: #fff; }
.btn-emerald:hover {
    background: var(--emerald-dark);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.btn-rose { background: var(--rose); color: #fff; }
.btn-rose:hover {
    background: var(--rose-dark);
    box-shadow: 0 6px 18px rgba(244, 63, 94, 0.35);
}

.btn-amber { background: var(--amber); color: #fff; }
.btn-amber:hover {
    background: var(--amber-dark);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-outline:hover {
    background: var(--bg-app);
    transform: translateY(-2px);
}

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-icon:hover {
    background: var(--rose-light);
    color: var(--rose);
    transform: scale(1.14) rotate(4deg);
}
.btn-icon:active {
    transform: scale(0.92);
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
}
.alert-danger { background: var(--rose-light); color: var(--rose-dark); border: 1px solid #fecdd3; }
.alert-success { background: var(--emerald-light); color: var(--emerald-dark); border: 1px solid #a7f3d0; }

/* ==========================================================================
   MAIN APP LAYOUT
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ==========================================================================
   TOP FULL-WIDTH APPLICATION HEADER
   ========================================================================== */
.app-top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    max-width: 100vw;
    box-sizing: border-box;
}

.app-top-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex-shrink: 1;
}

.sidebar-hamburger-btn {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 8px;
    gap: 5px;
    transition: all 0.25s ease;
    color: var(--text-main);
    flex-shrink: 0;
}

.sidebar-hamburger-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.04);
}

.sidebar-hamburger-btn:active {
    transform: scale(0.96);
}

.sidebar-hamburger-btn .hamburger-bar {
    display: block;
    width: 22px;
    height: 2.5px;
    background-color: currentColor;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.app-header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex-shrink: 1;
}

.top-header-logo-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.app-header-title {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--primary);
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .app-header-title {
    background: linear-gradient(135deg, #818cf8 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-inr-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border-radius: 9999px;
    border: 1px solid rgba(16, 185, 129, 0.25);
    white-space: nowrap;
}

.app-top-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Sidebar Backdrop (Overlay Drawer for Mobile, Tablet, Laptop, and Desktop) */
.sidebar-backdrop {
    display: block;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Sidebar — STRICTLY CLOSED BY DEFAULT ACROSS ALL DEVICES */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px;
    bottom: 0;
    left: 0;
    z-index: 1100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    transform: translateX(-100%); /* ALWAYS CLOSED BY DEFAULT */
    box-shadow: none;
}

/* Sidebar Open State (When hamburger menu ☰ is clicked) */
.app-layout.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.18);
}

.app-layout.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sidebar-close-btn:hover {
    background: var(--bg-app);
    color: var(--rose);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    font-size: 1rem;
    color: var(--primary);
}

.sidebar-brand-name {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--primary);
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .sidebar-brand-name {
    background: linear-gradient(135deg, #818cf8 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item i {
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item:hover {
    background: var(--bg-app);
    color: var(--text-main);
    transform: translateX(4px);
}

.nav-item:hover i {
    transform: scale(1.18) rotate(5deg);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-rights-notice {
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-app);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}
.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area — FULL AVAILABLE WIDTH BY DEFAULT */
.main-content {
    margin-left: 0;
    margin-top: 64px;
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 2rem;
    min-height: calc(100vh - 64px);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.views-wrapper {
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.view-panel {
    min-width: 0;
    max-width: 100%;
}

/* Application Page Footer */
.app-page-footer {
    margin-top: 3rem;
    padding: 1.5rem 0 1rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.footer-title {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-rights {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.auth-rights-reserved {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 1.6rem;
    font-weight: 800;
}
.page-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.topbar-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-topbar-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.62rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    white-space: nowrap;
    border: none;
    cursor: pointer;
}
.btn-topbar-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.table-filter-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.filter-search-wrap input {
    padding-left: 2.1rem !important;
    min-width: 190px;
}

/* Panels & Animations */
.view-panel {
    display: none;
}
.view-panel.active {
    display: block;
    animation: slideFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideFadeIn {
    0% { opacity: 0; transform: translateY(12px) scale(0.99); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dashboard Welcome Banner */
.dash-welcome-card {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-sm);
}

.dash-welcome-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.dash-welcome-text h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.dash-welcome-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.dash-welcome-pills {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.metric-balance .metric-icon {
    background: var(--emerald-light);
    color: var(--emerald);
}

[data-theme="dark"] .dash-welcome-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #151d30 100%);
    border-color: #2a364f;
}

/* ==========================================================================
   CARDS & METRICS
   ========================================================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.12);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.25s ease;
}

.metric-card:hover .metric-icon i {
    transform: scale(1.2) rotate(6deg);
}

.metric-income .metric-icon { background: var(--emerald-light); color: var(--emerald); }
.metric-expense .metric-icon { background: var(--rose-light); color: var(--rose); }
.metric-savings .metric-icon { background: var(--amber-light); color: var(--amber); }
.metric-budget .metric-icon { background: var(--primary-light); color: var(--primary); }

.metric-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.sub-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Standard Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.card:hover {
    box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
}

.card-header {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    max-width: 100%;
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-body {
    padding: 1.25rem;
    min-width: 0;
    max-width: 100%;
}

/* Quick Actions */
.quick-actions-body {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.1rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    user-select: none;
    position: relative;
    overflow: hidden;
}
.quick-btn i {
    font-size: 1.45rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.quick-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 24px -4px rgba(79, 70, 229, 0.16);
    border-color: rgba(79, 70, 229, 0.35);
}
.quick-btn:hover i {
    transform: scale(1.22) rotate(8deg);
}
.quick-btn:active {
    transform: scale(0.96);
}

/* Progress Bars */
.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.table th {
    background: var(--bg-app);
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.table tbody tr:hover {
    background: var(--bg-app);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-income { background: var(--emerald-light); color: var(--emerald-dark); }
.badge-expense { background: var(--rose-light); color: var(--rose-dark); }

/* ==========================================================================
   SAVINGS GOALS CARDS
   ========================================================================== */
.savings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.savings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.savings-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

.savings-amounts {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-card {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.25);
    animation: modalPopIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: scale(0.90) translateY(16px);
    }
    60% {
        transform: scale(1.02) translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 800;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* Export Toolbar & Animations */
.flex-container-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.export-btn-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-export-anim {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.btn-export-anim:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.btn-export-anim:active {
    transform: translateY(0) scale(0.97);
}
.btn-export-anim i {
    transition: transform 0.25s ease;
}
.btn-export-anim:hover i {
    transform: scale(1.25);
}

.modal-sm {
    max-width: 420px;
}

.choose-trans-options {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 0.5rem;
}

.choose-trans-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-app);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    color: var(--text-main);
}

.choose-trans-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -4px rgba(0, 0, 0, 0.1);
}

.choose-income-btn:hover {
    border-color: var(--emerald);
    background: rgba(16, 185, 129, 0.05);
}

.choose-expense-btn:hover {
    border-color: var(--rose);
    background: rgba(244, 63, 94, 0.05);
}

.choose-trans-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.choose-trans-info {
    display: flex;
    flex-direction: column;
}

.choose-trans-info strong {
    font-size: 1.05rem;
    font-weight: 700;
}

.choose-trans-info small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Professional Profile Hero Banner */
.profile-hero-card {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.profile-hero-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.profile-hero-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #ffffff;
    font-size: 1.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
    border: 3px solid var(--card-bg);
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar-upload-badge-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    border: 2px solid var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    transition: all 0.2s ease;
}

.avatar-upload-badge-btn:hover {
    background: #4338ca;
    transform: scale(1.1);
}

.profile-hero-contacts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.support-contact-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: border-color 0.2s ease;
}

.support-contact-box:hover {
    border-color: var(--primary);
}

.support-mail-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.support-email-link {
    color: var(--primary);
    transition: color 0.15s ease;
    word-break: break-all;
}

.support-email-link:hover {
    color: #4338ca;
    text-decoration: underline;
}

.profile-hero-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-hero-title h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
}

.profile-hero-sub {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 0.25rem;
}

.profile-hero-badges {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-stat-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.bg-disabled {
    background-color: var(--bg-app) !important;
    opacity: 0.85;
    cursor: not-allowed;
}

.border-b {
    border-bottom: 1px solid var(--border-color);
}

.font-medium {
    font-weight: 600;
}

.mr-1 {
    margin-right: 0.25rem;
}

.display-block {
    display: block;
}

/* Print Stylesheet */
@media print {
    .sidebar, .topbar, .no-print, .btn, .modal-overlay, .auth-overlay, .btn-icon {
        display: none !important;
    }
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM (ALL DEVICES)
   ========================================================================== */

/* Utility Flex & Grid Helpers */
.row-flex {
    display: flex;
}
.flex-1 {
    flex: 1;
}
.min-w-200 {
    min-width: 200px;
}
.max-w-500 {
    max-width: 500px;
}
.input-currency-group {
    position: relative;
    display: flex;
    align-items: center;
}
.currency-prefix {
    position: absolute;
    left: 12px;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}
.input-currency-group input {
    padding-left: 28px !important;
}

/* Base 3-Card Financial Views (Desktop Default: 3 Columns, never leaves 4th slot empty) */
#view-incomes .metrics-grid,
#view-expenses .metrics-grid,
#view-budget .metrics-grid,
#view-reports .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* 1. Large Screens & Desktops (min-width: 1441px - MacBook Pro 16-inch Reference) */
@media (min-width: 1441px) {
    .views-wrapper {
        max-width: 1560px;
        margin: 0 auto;
    }
    #view-dashboard .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    #view-incomes .metrics-grid,
    #view-expenses .metrics-grid,
    #view-budget .metrics-grid,
    #view-reports .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    .main-content {
        padding: 2.25rem 3rem;
    }
}

/* 2. Laptops & Standard Desktops (1025px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    #view-dashboard .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
    #view-incomes .metrics-grid,
    #view-expenses .metrics-grid,
    #view-budget .metrics-grid,
    #view-reports .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
    .main-content {
        padding: 2rem 2rem;
    }
}

/* 3. Tablets & Small Laptops (768px - 1024px) */
@media (max-width: 1024px) {
    #view-dashboard .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    #view-incomes .metrics-grid,
    #view-expenses .metrics-grid,
    #view-budget .metrics-grid,
    #view-reports .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    .quick-actions-body {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-content {
        padding: 1.5rem 1.25rem;
    }
    .grid-2col {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .dash-welcome-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .dash-welcome-pills {
        width: 100%;
        justify-content: flex-start;
    }
}

/* 4. Large Mobile Phones & Phablets (481px - 767px) */
@media (max-width: 767px) {
    .main-content {
        padding: 1rem 0.85rem;
        margin-top: 60px;
        min-height: calc(100vh - 60px);
    }
    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1.15rem;
    }
    .page-title h1 {
        font-size: 1.35rem;
        line-height: 1.3;
        margin-bottom: 0.25rem;
    }
    .page-title p {
        font-size: 0.82rem;
        line-height: 1.4;
    }
    .topbar-actions {
        display: flex;
        width: 100%;
        gap: 0.5rem;
    }
    .topbar-actions .btn {
        flex: 1;
        width: 100%;
        justify-content: center;
        text-align: center;
        min-height: 44px;
        font-size: 0.92rem;
    }
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    #view-incomes .metrics-grid,
    #view-expenses .metrics-grid,
    #view-budget .metrics-grid,
    #view-reports .metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    .quick-actions-body {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .grid-2col {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    .dash-welcome-card {
        padding: 1.15rem 1rem;
    }
    .dash-welcome-text h2 {
        font-size: 1.25rem;
        line-height: 1.35;
    }
    .dash-welcome-pills {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.5rem;
    }
    .dash-welcome-pills .profile-stat-pill {
        width: 100%;
        justify-content: center;
    }

    /* Card Header & Content Layout on Mobile */
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem 0.85rem;
    }
    .card-header h3 {
        font-size: 1.05rem;
        line-height: 1.35;
        flex-wrap: wrap;
    }
    .card-body {
        padding: 1rem 0.85rem;
    }

    /* Table Filter Toolbar - Responsive Stack */
    .table-filter-toolbar {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    .filter-search-wrap {
        width: 100%;
        flex: 1 1 100%;
    }
    .filter-search-wrap input {
        width: 100% !important;
        min-width: 0 !important;
    }
    .table-filter-toolbar select {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Reports View Responsive Enhancements */
    #view-reports .flex-container-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    #view-reports .export-btn-group,
    #view-reports .btn-export-anim {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
    #reports-category-bars .progress-info {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    /* Profile View Responsive Enhancements */
    .profile-hero-card {
        padding: 1.15rem 1rem;
    }
    .profile-hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.85rem;
    }
    .profile-hero-title {
        justify-content: center;
        gap: 0.4rem;
    }
    .profile-hero-badges {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.5rem;
    }
    .profile-hero-badges .profile-stat-pill {
        width: 100%;
        justify-content: center;
    }
    #card-language-settings .form-group {
        max-width: 100% !important;
        width: 100%;
    }
    #app-language-selector {
        width: 100% !important;
        min-height: 44px;
        font-size: 16px !important;
    }
    .theme-toggle-group {
        width: 100%;
        display: flex;
    }
    .theme-btn {
        flex: 1;
        justify-content: center;
        min-height: 44px;
    }

    /* Savings Goals View Responsive */
    #view-savings .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    #view-savings #savings-action-bar,
    #view-savings #savings-action-bar .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
    .savings-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .savings-amounts {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Budget View Responsive */
    #view-budget .card-header > div:last-child {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    #view-budget #budget-form {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    #view-budget .min-w-200 {
        min-width: 0 !important;
        width: 100%;
    }
    #view-budget #budget-submit-btn {
        width: 100%;
        min-height: 44px;
        margin-top: 0.5rem;
    }

    /* Family Members View Responsive */
    #view-family .flex-container-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }
    #view-family .family-header-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
    }
    #view-family .family-header-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.6rem;
    }
    #view-family .family-code-card {
        width: 100%;
        justify-content: center;
    }
    #view-family #fam-add-member-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    /* Modal Cards */
    .modal-card {
        width: 95vw;
        max-width: 95vw;
        padding: 1.25rem 1rem;
    }
    .modal-header h3 {
        font-size: 1.1rem;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        display: block;
    }
    .table {
        min-width: 600px;
    }

    /* Footer Spacing */
    .app-page-footer {
        margin-top: 1.5rem;
        padding: 1rem 0;
    }
}

/* 5. Mobile Phones (361px - 480px) */
@media (max-width: 480px) {
    .app-top-header {
        padding: 0 0.75rem;
        height: 58px;
    }
    .sidebar {
        top: 58px;
        width: 85vw;
        max-width: 300px;
    }
    .sidebar-backdrop {
        top: 58px;
    }
    .main-content {
        margin-top: 58px;
        padding: 0.75rem 0.6rem;
        min-height: calc(100vh - 58px);
    }
    .app-header-brand {
        gap: 0.4rem;
        min-width: 0;
    }
    .top-header-logo-img {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
    }
    .app-header-title {
        font-size: 0.92rem;
        font-weight: 800;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 155px;
    }
    .badge-inr-tag {
        display: none !important;
    }
    .family-code-tag {
        display: none !important;
    }
    .family-badge {
        font-size: 0.72rem;
        padding: 0.2rem 0.45rem;
    }
    .role-badge {
        font-size: 0.68rem;
        padding: 0.15rem 0.4rem;
    }

    /* Metric Cards Stack Vertically */
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .metric-card {
        padding: 0.9rem;
        gap: 0.75rem;
    }
    .metric-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .metric-value {
        font-size: 1.35rem;
    }

    /* Layout Grids */
    .grid-2col {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    /* Topbar & Actions */
    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }
    .topbar-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    .topbar-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        font-size: 0.92rem;
    }
    .page-title h1 {
        font-size: 1.22rem;
    }
    .page-title p {
        font-size: 0.8rem;
    }

    .card-header {
        padding: 0.85rem 0.75rem;
    }
    .card-body {
        padding: 0.85rem 0.75rem;
    }
    .card-header h3 {
        font-size: 0.98rem;
    }

    /* Forms on Mobile (Prevent Safari Auto-Zoom with font-size: 16px) */
    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-control,
    .form-control-sm {
        font-size: 16px !important;
        min-height: 44px;
        padding: 0.65rem 0.85rem;
    }
    .btn {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Modals on Mobile */
    .modal-card {
        width: 96vw;
        max-width: 96vw;
        padding: 1rem 0.85rem;
        margin: 0 auto;
        border-radius: var(--radius-md);
    }
    .modal-header h3 {
        font-size: 1.05rem;
    }

    /* Bill Modal Tools & Viewer */
    .bill-modal-tools {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.4rem;
    }
    .bill-modal-info-strip {
        grid-template-columns: 1fr 1fr;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    .bill-viewer-container {
        min-height: 240px;
        max-height: 55vh;
    }
    #bill-img-preview {
        max-height: 50vh;
    }

    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        border-radius: var(--radius-sm);
        display: block;
    }
    .table {
        min-width: 560px;
    }
    .table th, .table td {
        padding: 0.6rem 0.55rem;
        font-size: 0.8rem;
    }

    /* Auth Screen */
    .auth-card {
        padding: 1.35rem 1rem;
        width: 95vw;
    }
}

/* 6. Compact Mobile Phones (320px - 360px) */
@media (max-width: 360px) {
    .app-header-title {
        max-width: 105px;
        font-size: 0.82rem;
    }
    .role-badge {
        display: none !important;
    }
    .main-content {
        padding: 0.65rem 0.5rem;
    }
    .card-header {
        padding: 0.75rem 0.6rem;
    }
    .card-body {
        padding: 0.75rem 0.6rem;
    }
    .metric-card {
        padding: 0.75rem;
        gap: 0.65rem;
    }
    .metric-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .metric-value {
        font-size: 1.2rem;
    }
    .quick-btn {
        padding: 0.75rem 0.4rem;
        font-size: 0.8rem;
    }
    .card-header h3 {
        font-size: 0.92rem;
    }
    .modal-card {
        width: 98vw;
        max-width: 98vw;
        padding: 0.85rem 0.65rem;
    }
}

/* 7. Landscape Orientation for Mobile Devices & Small Tablets */
@media (max-height: 520px) and (orientation: landscape) {
    .app-top-header {
        height: 52px;
    }
    .sidebar {
        top: 52px;
    }
    .sidebar-backdrop {
        top: 52px;
    }
    .main-content {
        margin-top: 52px;
        padding: 1rem 1.25rem;
    }
    .modal-card {
        max-height: 90vh;
        padding: 1rem;
    }
    .bill-viewer-container {
        max-height: 50vh;
        min-height: 200px;
    }
    #bill-img-preview {
        max-height: 45vh;
    }
}

/* 8. Touch Target Optimization for Touchscreens (Mobile / Tablet / Touch Laptops) */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-item,
    .sidebar-hamburger-btn,
    .sidebar-close-btn,
    .quick-btn,
    .btn-bill-action {
        min-height: 44px;
        touch-action: manipulation;
    }
    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-control,
    .form-control-sm {
        font-size: 16px !important;
        min-height: 44px;
    }
}

/* ==========================================================================
   Indian Family Finance & Role-Based Access Badges
   ========================================================================== */
.title-with-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.family-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.family-badge:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.family-code-tag {
    background: var(--primary);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-family: monospace;
    letter-spacing: 0.5px;
}

.copy-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

.role-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-role-admin {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-role-member {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-role-viewer {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

/* Payment Method Badges */
.badge-payment {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-upi {
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-cash {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-bank {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    border: 1px solid rgba(14, 165, 233, 0.25);
}

.badge-card {
    background: rgba(168, 85, 247, 0.12);
    color: #9333ea;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.badge-other {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.25);
}

/* Family View Elements */
.family-header-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.family-header-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.family-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.family-code-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1.5px dashed var(--primary);
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}
.family-code-card:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}
.family-code-card .code-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.family-code-card .code-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Bill Photo / Document Preview Modal & Actions
   ========================================================================== */
.modal-lg {
    max-width: 840px !important;
    width: 95vw !important;
}

.bill-modal-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.zoom-controls-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.zoom-level-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 44px;
    text-align: center;
}

.bill-viewer-container {
    min-height: 380px;
    max-height: 72vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #090d16;
    overflow: hidden;
    position: relative;
}

.bill-image-wrapper {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

#bill-img-preview {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transform-origin: center center;
    transition: transform 0.15s ease-out;
}

.bill-pdf-frame {
    width: 100%;
    height: 70vh;
    border: none;
    background: #ffffff;
}

/* Table Actions & Bill Buttons */
.table-actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    white-space: nowrap;
}

.btn-bill-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.88rem;
    transition: var(--transition);
}

.btn-bill-view {
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
    border-color: rgba(99, 102, 241, 0.25);
}
.btn-bill-view:hover {
    background: #4f46e5;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-bill-download {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.25);
}
.btn-bill-download:hover {
    background: #10b981;
    color: #ffffff;
    transform: translateY(-1px);
}

.no-bill-tag {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
    padding: 0 4px;
}

.bill-modal-info-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: #111827;
    border-bottom: 1px solid var(--border-color);
}

.bill-info-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bill-info-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.bill-info-val {
    font-size: 0.88rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   CUTE & PROFESSIONAL POP-UP TOAST NOTIFICATION SYSTEM (TOP-RIGHT)
   ========================================================================== */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 48px);
}

.toast {
    pointer-events: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.05);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    backdrop-filter: blur(12px);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

[data-theme="dark"] .toast {
    background: #1e293b;
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5), 0 4px 12px -2px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.toast-hiding {
    animation: toastSlideOut 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* Toast Color Varieties */
.toast-success {
    border-left: 4px solid #10b981;
}
.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
.toast-success .toast-progress {
    background: #10b981;
}

.toast-error,
.toast-danger {
    border-left: 4px solid #ef4444;
}
.toast-error .toast-icon,
.toast-danger .toast-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
.toast-error .toast-progress,
.toast-danger .toast-progress {
    background: #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}
.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}
.toast-warning .toast-progress {
    background: #f59e0b;
}

.toast-info {
    border-left: 4px solid #6366f1;
}
.toast-info .toast-icon {
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
}
.toast-info .toast-progress {
    background: #6366f1;
}

/* Toast Elements */
.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.toast-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #0f172a;
    margin-bottom: 2px;
    line-height: 1.3;
}

[data-theme="dark"] .toast-title {
    color: #f8fafc;
}

.toast-message {
    font-size: 0.83rem;
    color: #475569;
    line-height: 1.4;
    word-break: break-word;
}

[data-theme="dark"] .toast-message {
    color: #94a3b8;
}

.toast-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.25rem;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    margin-top: -2px;
}

.toast-close:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .toast-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    border-radius: 0 0 16px 16px;
    transform-origin: left;
    animation: toastProgress linear forwards;
}

/* Keyframes */
@keyframes toastSlideIn {
    from {
        transform: translateX(115%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(115%);
        opacity: 0;
    }
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Responsive Toast Adjustments for Mobile Screens */
@media (max-width: 576px) {
    .toast-container {
        top: 14px;
        left: 14px;
        right: 14px;
        width: auto;
        max-width: none;
    }
    .toast {
        padding: 12px 14px;
        border-radius: 14px;
    }
    .toast-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    .toast-title {
        font-size: 0.88rem;
    }
    .toast-message {
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   FINANCIAL INSIGHTS & ANALYTICS SECTION (CHARTS)
   ========================================================================== */
.analytics-section {
    position: relative;
}

.analytics-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.analytics-filter-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analytics-filter-box select {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-app);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.analytics-filter-box select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

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

.chart-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 340px;
    min-width: 0;
    max-width: 100%;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.chart-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px -4px rgba(15, 23, 42, 0.1);
}

.chart-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 250px;
    flex: 1;
    overflow: hidden;
}

.chart-container canvas {
    max-width: 100% !important;
}

.chart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-align: center;
}

.budget-analytics-summary {
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
}

@media (max-width: 1024px) {
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .chart-container {
        height: 240px;
    }
}

@media (max-width: 576px) {
    .analytics-filter-box {
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
    .chart-body {
        padding: 0.75rem 0.5rem;
    }
    .chart-container {
        height: 220px;
    }
    .budget-analytics-summary {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Danger Zone & Permanent Action Styling */
.border-danger-zone {
    border: 1px solid rgba(244, 63, 94, 0.4) !important;
    background: var(--bg-card);
}
.border-danger-zone:hover {
    border-color: var(--rose) !important;
}
.badge-rose {
    background: var(--rose-light);
    color: var(--rose-dark);
}

/* ==========================================================================
   ADMIN REGISTERED USERS DIRECTORY & USER DETAILS MODAL STYLING
   ========================================================================== */

.admin-toolbar-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-search-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 480px;
}

.admin-search-wrap .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.9rem;
}

.admin-search-wrap .form-control {
    padding-left: 38px;
    padding-right: 36px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.admin-search-wrap .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: var(--bg-card);
}

.admin-search-wrap .search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}

.admin-search-wrap .search-clear-btn:hover {
    color: var(--rose);
}

.admin-filters-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-filters-wrap .filter-select-group {
    min-width: 160px;
}

.admin-filters-wrap .form-control {
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    font-size: 0.88rem;
    font-weight: 500;
}

.admin-action-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-id-mono-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.18s ease;
}

.user-id-mono-pill:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.copy-icon-subtle {
    font-size: 0.75rem;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

.user-id-mono-pill:hover .copy-icon-subtle {
    opacity: 1;
}

/* User Details Modal Attributes Grid */
.user-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-item {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.detail-full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--text-main);
    word-break: break-word;
}

.detail-val-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.btn-icon-xs {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-icon-xs:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pagination-page-indicator {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Responsive Adaptations */
@media (max-width: 768px) {
    .admin-toolbar-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-search-wrap {
        max-width: 100%;
        width: 100%;
    }
    .admin-filters-wrap {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    .admin-filters-wrap .filter-select-group {
        width: 100%;
    }
    .admin-action-btns {
        width: 100%;
    }
    .admin-action-btns .btn {
        flex: 1;
        justify-content: center;
        min-height: 44px;
    }
    .user-detail-grid {
        grid-template-columns: 1fr;
    }
    .hide-on-mobile {
        display: none;
    }
}

/* Interactive User ID & Link Badges */
.profile-uid-badge-link {
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.profile-uid-badge-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    background: #4f46e5 !important;
    color: #ffffff !important;
}

.profile-stat-pill-interactive {
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-stat-pill-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
}

.admin-sb-uuid-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.admin-sb-uuid-pill:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: #6366f1;
}

.input-with-action {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-action .form-control {
    padding-right: 2.5rem;
}

.input-action-btn {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 4px;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.input-action-btn:hover {
    color: var(--primary-hover);
}
