/* =============================================
   RoomMate Pro — Premium CSS
   by Abishek Yadav
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99,102,241,0.25);

    --abishek-color: #06b6d4;
    --abishek-glow: rgba(6,182,212,0.2);
    --arun-color: #f59e0b;
    --arun-glow: rgba(245,158,11,0.2);

    --bg-main: #0d0d1a;
    --bg-card: rgba(255,255,255,0.06);
    --bg-sidebar: rgba(10,10,30,0.97);
    --text-main: #f0f0ff;
    --text-muted: #a0a0c8;
    --text-soft: #6060a0;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --glass-border: rgba(255,255,255,0.1);
    --glass-shadow: 0 4px 24px rgba(99,102,241,0.2), 0 1px 2px rgba(0,0,0,0.3);
    --card-shadow: 0 8px 32px rgba(99,102,241,0.25), 0 2px 8px rgba(0,0,0,0.3);

    --sidebar-width: 260px;
    --header-height: 68px;
    --bottom-nav-height: 64px;
    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

body.dark-mode {
    --bg-main: #07071a;
    --bg-card: rgba(255,255,255,0.04);
    --bg-sidebar: rgba(7,7,26,0.99);
    --text-main: #eeeeff;
    --text-muted: #9090be;
    --text-soft: #50507a;
    --glass-border: rgba(255,255,255,0.07);
    --glass-shadow: 0 4px 24px rgba(0,0,0,0.6), 0 1px 2px rgba(0,0,0,0.4);
    --card-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-main);
    background-image:
        radial-gradient(ellipse 120% 80% at 10% 0%,   rgba(99,102,241,0.35) 0%, transparent 55%),
        radial-gradient(ellipse 80%  60% at 90% 100%, rgba(124,58,237,0.28) 0%, transparent 55%),
        radial-gradient(ellipse 60%  50% at 50% 50%,  rgba(6,182,212,0.08)  0%, transparent 70%),
        linear-gradient(160deg, #0d0d1a 0%, #12102a 40%, #0e0e22 100%);
    background-attachment: fixed;
    color: var(--text-main);
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Background noise/grain overlay for depth */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* ---- Typography ---- */
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.3px; }
h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.2px; }
h3 { font-size: 1rem; font-weight: 600; }
h4 { font-size: 0.9rem; font-weight: 600; }
p  { line-height: 1.6; }

/* ---- Utilities ---- */
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-info    { color: var(--info)    !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-muted); }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.text-center { text-align: center; }
.mb-4 { margin-bottom: 1rem; }

/* ---- Glass Card ---- */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 1;
}

/* ---- Layout ---- */
.app-container { display: flex; min-height: 100vh; position: relative; }

/* ---- Sidebar (Desktop) ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    backdrop-filter: blur(24px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,0.04);
}

.sidebar-header {
    padding: 0.5rem 1.5rem 2rem;
}

.sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.brand-sub {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-soft);
    padding-left: 1.9rem;
    margin-top: -0.3rem;
    letter-spacing: 0.3px;
}

.nav-links { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; padding: 0 0.75rem; }

.nav-links li {
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    border-radius: var(--radius-md);
    border-left: none;
}

.nav-links li i { width: 18px; text-align: center; }

.nav-links li:hover {
    background: rgba(99,102,241,0.08);
    color: var(--primary);
}

.nav-links li.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(124,58,237,0.08));
    color: var(--primary);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(99,102,241,0.15);
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* ---- Header ---- */
.app-header {
    height: var(--header-height);
    padding: 0 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 12px rgba(0,0,0,0.04);
}

.header-left { display: flex; align-items: center; gap: 1.5rem; }
.header-left h1 { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.3px; }

.month-selector {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-main);
    padding: 0.35rem 0.8rem;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    font-size: 0.85rem;
    font-weight: 500;
}

.month-selector button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    padding: 0.1rem 0.2rem;
    border-radius: 50%;
    transition: background var(--transition);
    line-height: 1;
}

.month-selector button:hover { background: var(--primary-glow); }

.user-profiles { display: flex; gap: 0.4rem; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 2px solid white;
}

#avatar-abishek { background: linear-gradient(135deg, #06b6d4, #0284c7); }
#avatar-arun    { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* ---- Views ---- */
.views-container { padding: 1.5rem; flex: 1; }

.view { display: none; animation: fadeSlideIn 0.3s ease-out; }
.view.active { display: block; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Brand Banner ---- */
.brand-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.6rem 1.9rem;
    margin-bottom: 1.4rem;
    background: linear-gradient(145deg, rgba(99,102,241,0.14), rgba(124,58,237,0.08), rgba(6,182,212,0.06));
    border: 1px solid rgba(99,102,241,0.22);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 32px rgba(99,102,241,0.1);
}

.brand-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #7c3aed, #06b6d4, var(--primary));
    background-size: 200% 100%;
    animation: shimmer-border 4s linear infinite;
}
@keyframes shimmer-border {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.brand-banner::after {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(99,102,241,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.brand-banner-left h2 {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #7c3aed, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-banner-left p {
    color: var(--text-muted);
    font-size: 0.83rem;
    font-weight: 400;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.22rem 0.75rem;
    border-radius: 20px;
    letter-spacing: 1px;
    margin-bottom: 0.55rem;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(99,102,241,0.35);
}

.brand-icon-lg {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.22;
    filter: drop-shadow(0 0 20px rgba(99,102,241,0.3));
    animation: float-icon 4s ease-in-out infinite;
}
@keyframes float-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ---- Cards Grid ---- */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media(min-width: 900px) {
    .cards-grid { grid-template-columns: repeat(4, 1fr); }
    .settlement-card { grid-column: span 1; }
}

/* ---- Premium Card Overhaul ---- */
.card {
    padding: 1.3rem 1.4rem;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: default;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
    pointer-events: none;
    border-radius: inherit;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(99,102,241,0.18);
}

.card h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.75rem;
}

.card .amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1;
}

.user-card.abishek {
    border-top: 3px solid var(--abishek-color);
    background: linear-gradient(160deg, var(--bg-card), rgba(6,182,212,0.04));
}
.user-card.arun {
    border-top: 3px solid var(--arun-color);
    background: linear-gradient(160deg, var(--bg-card), rgba(245,158,11,0.04));
}

.settlement-card { grid-column: span 2; }

.settlement-card .subtitle {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-weight: 500;
    display: block;
}

/* ---- Dashboard Widgets ---- */
.dashboard-widgets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media(min-width: 900px) {
    .dashboard-widgets { grid-template-columns: 340px 1fr; }
}

/* ---- Chart Containers (Reports page) ---- */
.chart-container { padding: 1.25rem; }
.chart-container h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 1rem;
}

/* CRITICAL: Fixed chart sizing for mobile */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
}
@media(min-width: 900px) {
    .chart-wrapper { height: 260px; }
}
canvas { max-width: 100% !important; max-height: 100% !important; }

/* ---- Premium Recent Transactions Panel ---- */
.recent-panel {
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
}

.recent-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #7c3aed, #06b6d4);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

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

.recent-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-panel-title i {
    font-size: 1rem;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.recent-panel-title h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.2px;
}

.btn-view-all {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.3px;
}
.btn-view-all:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 16px var(--primary-glow);
}

/* Scrollable recent list — max 5 visible, scroll after */
.recent-scrollable {
    max-height: 370px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-glow) transparent;
    padding-right: 2px;
}
.recent-scrollable::-webkit-scrollbar { width: 4px; }
.recent-scrollable::-webkit-scrollbar-track { background: transparent; }
.recent-scrollable::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), #7c3aed);
    border-radius: 4px;
}

/* ---- Legacy Recent Transactions (History page) ---- */
.recent-transactions { padding: 1.25rem; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.section-header h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0;
}

/* ---- Transaction List ---- */
.transaction-list { list-style: none; }

.transaction-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0.75rem;
    margin-bottom: 0.3rem;
    border-radius: var(--radius-md);
    background: transparent;
    transition: all var(--transition);
    position: relative;
}

.transaction-list li::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99,102,241,0.05), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.transaction-list li:hover::before { opacity: 1; }
.transaction-list li:hover { transform: translateX(2px); }

.recent-scrollable .transaction-list li {
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0;
    border-radius: 0;
}
.recent-scrollable .transaction-list li:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.recent-scrollable .transaction-list li:last-child { border-bottom: none; border-radius: 0 0 var(--radius-md) var(--radius-md); }

.tx-left { display: flex; align-items: center; gap: 0.9rem; }

.tx-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.transaction-list li:hover .tx-icon { transform: scale(1.08); }

.tx-icon.abishek {
    background: linear-gradient(145deg, #06b6d4, #0284c7);
    box-shadow: 0 4px 14px rgba(6,182,212,0.4);
}
.tx-icon.arun {
    background: linear-gradient(145deg, #f59e0b, #d97706);
    box-shadow: 0 4px 14px rgba(245,158,11,0.4);
}

.tx-info h4 {
    font-size: 0.9rem;
    margin: 0 0 0.2rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.tx-info p {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

.tx-right { text-align: right; flex-shrink: 0; }
.tx-right .amount {
    font-weight: 800;
    font-size: 1.05rem;
    background: linear-gradient(135deg, var(--text-main), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.tx-right .date { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ---- History Controls ---- */
.history-container { padding: 1.25rem; }

.history-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

/* ---- Inputs ---- */
input, select, textarea {
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-main);
    outline: none;
    transition: border var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-field.short { width: auto; min-width: 130px; }

/* ---- Buttons ---- */
.btn {
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: white; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.btn-success:hover { transform: translateY(-1px); }

.btn-danger  { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; box-shadow: 0 4px 12px rgba(239,68,68,0.3); }
.btn-danger:hover { transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary-glow); }

.btn-large { padding: 0.9rem 2rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-block  { width: 100%; }
.btn-text   { background: none; border: none; color: var(--primary); cursor: pointer; font-weight: 600; font-size: 0.85rem; }

/* ---- FAB ---- */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    font-size: 1.4rem;
    border: none;
    box-shadow: 0 6px 24px var(--primary-glow), 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.fab:hover { transform: scale(1.08) rotate(90deg); box-shadow: 0 8px 30px var(--primary-glow); }
.fab:active { transform: scale(0.96); }

/* ---- Modals ---- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,15,30,0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
}

.modal.show { display: flex; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    width: 100%;
    max-width: 480px;
    padding: 1.75rem;
    max-height: 92vh;
    overflow-y: auto;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

button, input, select, textarea {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

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

.close-modal {
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: color var(--transition);
}
.close-modal:hover { color: var(--danger); }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.row { display: flex; gap: 0.75rem; }
.col { flex: 1; min-width: 0; }

/* ---- Radio Cards (Payer) ---- */
.radio-group { display: flex; gap: 0.75rem; }

.radio-card { flex: 1; position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; width: 0; height: 0; }

.radio-card span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem;
    text-align: center;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition);
    color: var(--text-muted);
}

.radio-card.abishek input:checked + span {
    border-color: var(--abishek-color);
    background: rgba(6,182,212,0.1);
    color: var(--abishek-color);
    box-shadow: 0 0 0 3px rgba(6,182,212,0.15);
}
.radio-card.arun input:checked + span {
    border-color: var(--arun-color);
    background: rgba(245,158,11,0.1);
    color: var(--arun-color);
    box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

/* ---- Settings ---- */
.settings-container { padding: 1.5rem; }

.setting-group { margin-bottom: 2rem; }
.setting-group h3 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 0.75rem; }

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--text-soft);
    transition: var(--transition);
}
.slider:before {
    position: absolute; content: "";
    height: 18px; width: 18px;
    left: 4px; bottom: 4px;
    background: white;
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
input:checked + .slider { background: var(--primary); }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* ---- Reports ---- */
.report-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.75rem 1.25rem;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    text-align: center;
}

.report-card:hover { transform: translateY(-4px); box-shadow: 0 16px 48px rgba(99,102,241,0.15); }
.report-card h3 { margin: 0; font-size: 0.9rem; }
.report-card i { font-size: 2rem; }

/* ---- Settlement Action ---- */
.settlement-action-card {
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(124,58,237,0.05));
    margin-bottom: 1.25rem;
}

.settlement-action-card h2 { font-size: 1.1rem; color: var(--text-main); margin-bottom: 1.25rem; }

/* ---- Settlement Result Modal ---- */
.settlement-details {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.user-total {
    flex: 1;
    padding: 1rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.user-total.abishek { background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.2); }
.user-total.arun    { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); }
.user-total h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 0.5rem; }
.user-total p  { font-size: 1.3rem; font-weight: 800; }

.result-message { padding: 1.5rem 0; }
.result-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.result-message h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4rem; }
.result-message p  { color: var(--text-muted); font-size: 0.9rem; }

/* ---- User Select Modal ---- */
#modal-select-user .modal-content {
    max-width: 380px;
}

#modal-select-user h2 { font-size: 1.15rem; }

#btn-select-abishek {
    border-color: var(--abishek-color) !important;
    color: var(--abishek-color) !important;
    font-size: 1rem;
    padding: 1rem;
}
#btn-select-abishek:hover {
    background: rgba(6,182,212,0.1) !important;
}

#btn-select-arun {
    border-color: var(--arun-color) !important;
    color: var(--arun-color) !important;
    font-size: 1rem;
    padding: 1rem;
}
#btn-select-arun:hover {
    background: rgba(245,158,11,0.1) !important;
}

/* ---- Action Buttons ---- */
.action-btns { display: flex; gap: 0.3rem; justify-content: flex-end; margin-top: 0.3rem; }
.action-btns button {
    background: none; border: none; cursor: pointer;
    padding: 0.3rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.btn-edit   { color: var(--info); }
.btn-delete { color: var(--danger); }
.btn-edit:hover   { background: rgba(59,130,246,0.1); }
.btn-delete:hover { background: rgba(239,68,68,0.1); }

/* ---- Full History List ---- */
.full-list .transaction-list li { padding: 0.9rem 0.5rem; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    flex-direction: column;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.empty-state i { font-size: 2.5rem; color: var(--text-soft); }
.empty-state p { font-size: 0.9rem; }

/* ---- Toast ---- */
#toast-container {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    color: white;
    padding: 0.7rem 1.4rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    animation: toastIn 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
    white-space: nowrap;
}

@keyframes toastIn {
    from { transform: translateY(20px) scale(0.9); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* =============================================
   MOBILE — Bottom Navigation
   ============================================= */
@media(max-width: 768px) {
    .sidebar {
        width: 100%;
        height: var(--bottom-nav-height);
        bottom: 0; top: auto;
        flex-direction: row;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    }

    .sidebar-header { display: none; }

    .nav-links {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        gap: 0;
        padding: 0;
    }

    .nav-links li {
        flex-direction: column;
        padding: 0.5rem 0.25rem;
        gap: 0.2rem;
        border-radius: 0;
        font-size: 0.65rem;
        font-weight: 500;
        flex: 1;
        justify-content: center;
    }

    .nav-links li i { font-size: 1.1rem; width: auto; }
    .nav-links li span { display: block; }

    .nav-links li:hover,
    .nav-links li.active {
        background: none;
        color: var(--primary);
        box-shadow: none;
    }

    .main-content {
        margin-left: 0;
        padding-bottom: calc(var(--bottom-nav-height) + 0.5rem);
    }

    .app-header { padding: 0 1rem; }
    .header-left h1 { font-size: 1rem; }
    .header-left { gap: 0.75rem; }
    .month-selector { padding: 0.3rem 0.6rem; font-size: 0.78rem; }

    .views-container { padding: 0.85rem; }

    .brand-banner { padding: 1.1rem 1.25rem; }
    .brand-banner-left h2 { font-size: 1rem; }
    .brand-icon-lg { font-size: 2rem; }

    /* Charts: fixed height so they don't overflow on mobile */
    .chart-wrapper { height: 200px; }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .settlement-card { grid-column: span 2; }

    .card .amount { font-size: 1.25rem; }

    .dashboard-widgets { gap: 0.85rem; }

    .fab {
        bottom: calc(var(--bottom-nav-height) + 0.85rem);
        right: 1rem;
        width: 52px; height: 52px;
        font-size: 1.2rem;
    }

    #toast-container { bottom: calc(var(--bottom-nav-height) + 5rem); }

    .modal-content { padding: 1.4rem; }
    .row { flex-direction: column; gap: 0; }
    .settlement-details { flex-direction: column; }
}

/* ---- Offline & Sync Badges ---- */
.offline-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    animation: pulse-offline 2s ease-in-out infinite;
}

@keyframes pulse-offline {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.sync-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

.sync-badge i { animation: spin 1.5s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

