:root { 
    --primary: #0A2647; 
    --primary-hover: #144272; 
    --bg: #F3F4F6; 
    --card: #FFFFFF; 
    --text-main: #1F2937; 
    --text-muted: #6B7280; 
    --danger: #EF4444; 
    --success: #10B981; 
    --warning: #F59E0B; 
    --info: #3B82F6; 
    --border: #E5E7EB; 
    --shadow-sm: 0 2px 6px rgba(10,38,71,0.06); 
    --shadow-md: 0 4px 14px rgba(10,38,71,0.1); 
}

body.dark-mode { 
    --bg: #111827; 
    --card: #1F2937; 
    --text-main: #F9FAFB; 
    --text-muted: #9CA3AF; 
    --border: #374151; 
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.3); 
    --shadow-md: 0 4px 14px rgba(0,0,0,0.4); 
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: var(--bg); 
    color: var(--text-main); 
    margin: 0; 
    padding: 0; 
    display: flex; 
    justify-content: center; 
    height: 100vh; 
    height: 100dvh; 
    overflow: hidden; 
    transition: background-color 0.3s, color 0.3s; 
}

.app-container { 
    background-color: var(--card); 
    width: 100%; 
    max-width: 550px; 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.12); 
    position: relative; 
    transition: background-color 0.3s; 
}

.header { 
    background: linear-gradient(135deg, #0A2647 0%, #144272 100%); 
    color: white; 
    padding: 14px 16px; 
    border-bottom-left-radius: 18px; 
    border-bottom-right-radius: 18px; 
    flex-shrink: 0; 
    z-index: 10; 
    position: relative; 
    box-shadow: var(--shadow-md); 
}

.icon-btn { 
    background: rgba(255,255,255,0.18); 
    border: 1px solid rgba(255,255,255,0.25); 
    color: white; 
    padding: 6px; 
    border-radius: 50%; 
    cursor: pointer; 
    font-size: 13px; 
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    width: 32px; 
    height: 32px; 
    transition: 0.2s; 
    backdrop-filter: blur(4px); 
}

.icon-btn:hover { 
    background: rgba(255,255,255,0.3); 
    transform: scale(1.05); 
}

/* 💎 റോയൽ ഗോൾഡ് റീഫ്രഷ് ബട്ടൺ സ്റ്റൈൽ */
.icon-btn.refresh-btn { 
    color: #FFD700; 
    border-color: rgba(255, 215, 0, 0.45); 
    padding: 0;
}

.icon-btn.refresh-btn svg { 
    width: 16px; 
    height: 16px; 
    transition: transform 0.4s ease; 
}

.icon-btn.refresh-btn:hover { 
    background: rgba(255, 215, 0, 0.25); 
    border-color: #FFD700; 
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

.icon-btn.refresh-btn.spinning svg { 
    animation: spinRefresh 0.6s cubic-bezier(0.4, 0, 0.2, 1); 
}

@keyframes spinRefresh { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

.notif-badge { 
    position: absolute; 
    top: -2px; 
    right: -2px; 
    background: var(--danger); 
    color: white; 
    border-radius: 50%; 
    width: 10px; 
    height: 10px; 
    font-size: 0px; 
    border: 2px solid var(--primary); 
    display: none; 
}
.notif-badge.active { display: block; }

.content { 
    padding: 20px; 
    flex: 1; 
    overflow-y: auto; 
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}
.content::-webkit-scrollbar { display: none; }

.input-group { margin-bottom: 14px; }
.input-group label { display: block; margin-bottom: 5px; color: var(--text-main); font-weight: 600; font-size: 13px; }
.input-group input, .input-group select, .input-group textarea { 
    width: 100%; 
    padding: 11px 12px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    box-sizing: border-box; 
    font-size: 14px; 
    font-family: inherit; 
    background-color: var(--bg); 
    color: var(--text-main); 
    transition: all 0.2s ease; 
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02); 
}
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { 
    border-color: var(--primary); 
    outline: none; 
    box-shadow: 0 0 0 3px rgba(10,38,71,0.15); 
}
.flex-row { display: flex; gap: 10px; }
.flex-row .input-group { flex: 1; }

.btn { 
    width: 100%; 
    padding: 12px; 
    border: none; 
    border-radius: 8px; 
    font-size: 15px; 
    font-weight: 600; 
    cursor: pointer; 
    color: white; 
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
    margin-bottom: 10px; 
    box-shadow: var(--shadow-sm); 
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%); } 
.btn-danger { background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%); } 
.btn-success { background: linear-gradient(135deg, #10B981 0%, #059669 100%); } 
.btn-warning { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); color: #fff; } 
.btn-info { background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%); } 
.btn-secondary { background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%); }
.btn-small { padding: 6px 12px; font-size: 12px; margin-bottom: 0; width: auto; }

.card { 
    background: var(--card); 
    border: 1px solid var(--border); 
    padding: 16px; 
    border-radius: 14px; 
    margin-bottom: 18px; 
    box-shadow: var(--shadow-sm); 
    transition: transform 0.2s, box-shadow 0.2s; 
}
.card:hover { box-shadow: var(--shadow-md); }
.due-amount { font-size: 32px; color: var(--danger); font-weight: bold; text-align: center; margin: 10px 0; }
.balance-amount { font-size: 20px; color: var(--success); font-weight: bold; text-align: center; margin-bottom: 10px; }
.hidden { display: none !important; }
.error-msg { color: var(--danger); text-align: center; font-size: 14px; margin-top: 10px; }
h4 { margin-top: 0; margin-bottom: 12px; color: var(--text-main); font-size: 16px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.list-item { background: var(--card); padding: 12px; border-radius: 10px; margin-bottom: 10px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.user-details { font-size: 12px; color: var(--text-muted); display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.bill-details { font-size: 12px; font-weight: bold; padding-top: 6px; border-top: 1px dashed var(--border); margin-top: 6px; }
.bill-breakdown { background: var(--bg); padding: 15px; border-radius: 10px; border: 1px dashed var(--border); margin-top: 10px; font-size: 14px; text-align: left; box-shadow: inset 0 1px 3px rgba(0,0,0,0.03); }
#member-form-section { background: rgba(10, 38, 71, 0.04); padding: 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid rgba(10, 38, 71, 0.2); box-shadow: var(--shadow-sm); }

.bottom-nav { display: flex; background: var(--card); border-top: 1px solid var(--border); width: 100%; flex-shrink: 0; z-index: 10; position: relative; box-shadow: 0 -4px 15px rgba(0,0,0,0.06); }
.nav-item { flex: 1; text-align: center; padding: 10px 2px; cursor: pointer; color: var(--text-muted); font-size: 10px; font-weight: 600; transition: 0.25s; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.nav-item i { font-size: 17px; font-style: normal; }
.nav-item.active { color: var(--primary); border-top: 3px solid var(--primary); background: rgba(10, 38, 71, 0.06); }

.menu-card { background: var(--bg); padding: 15px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.menu-card h5 { margin: 0 0 6px 0; color: var(--primary); }
.receipt-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; margin-left: 10px; cursor: pointer; border: 1px solid #ccc; box-shadow: var(--shadow-sm); }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); margin-right: 10px; background: #ddd; box-shadow: var(--shadow-sm); }
.chart-container { position: relative; height: 200px; width: 100%; margin-top: 15px; }
.recent-exp-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: center; }
.recent-exp-item:last-child { border-bottom: none; }
.meal-selector { display: flex; justify-content: space-between; margin-bottom: 15px; }
.meal-btn { padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--bg); color: var(--text-main); font-weight: bold; flex: 1; margin: 0 5px; text-align: center; transition: 0.2s; box-shadow: var(--shadow-sm); }
.meal-btn.active { background-color: var(--success); color: white; border-color: var(--success); box-shadow: var(--shadow-md); }
.schedule-badge { display: inline-block; padding: 4px 10px; border-radius: 14px; font-size: 11px; font-weight: bold; margin-bottom: 5px; }
.badge-wash { background: rgba(236, 72, 153, 0.15); color: #BE185D; border: 1px solid rgba(236, 72, 153, 0.3); }
.badge-clean { background: rgba(16, 185, 129, 0.15); color: #047857; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-kitchen { background: rgba(245, 158, 11, 0.15); color: #B45309; border: 1px solid rgba(245, 158, 11, 0.3); }
.grocery-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.grocery-checked { text-decoration: line-through; color: var(--text-muted); }
.poll-option { display: flex; align-items: center; margin-bottom: 8px; cursor: pointer; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-weight:bold; justify-content:center; transition:0.2s; box-shadow: var(--shadow-sm); }
.poll-option:hover { background: rgba(10, 38, 71, 0.05); border-color: var(--primary); }
.poll-progress { height: 8px; background: var(--border); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.poll-progress-fill { height: 100%; background: var(--info); width: 0%; transition: width 0.3s; }
#expense-alert-banner { background: #FEF2F2; border-color: #FCA5A5; color: #991B1B; padding: 12px; margin-bottom: 15px; text-align: center; font-weight: bold; border-radius: 10px; border: 1px solid; box-shadow: var(--shadow-sm); }

/* Duty Alarm Banner */
#duty-alarm-banner { background: #FEF3C7; border: 1px solid #F59E0B; padding: 12px; border-radius: 10px; color: #B45309; margin-bottom: 15px; text-align: center; font-size: 13px; font-weight: bold; box-shadow: var(--shadow-sm); }

.chat-bubble { max-width: 80%; padding: 9px 14px; border-radius: 14px; font-size: 13px; word-wrap: break-word; position: relative; box-shadow: var(--shadow-sm); }
.chat-mine { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%); color: white; align-self: flex-end; border-bottom-right-radius: 2px; }
.chat-other { background-color: var(--card); border: 1px solid var(--border); color: var(--text-main); align-self: flex-start; border-bottom-left-radius: 2px; }
.chat-time { font-size: 10px; opacity: 0.75; margin-top: 4px; text-align: right; }
.chat-name { font-size: 10px; font-weight: bold; margin-bottom: 3px; opacity: 0.85; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.65); z-index: 1000; justify-content: center; align-items: center; padding: 20px; backdrop-filter: blur(3px); }
.modal-overlay.active { display: flex; }
.modal-content { background: var(--card); width: 100%; max-width: 450px; max-height: 82vh; border-radius: 16px; padding: 22px; overflow-y: auto; position: relative; box-shadow: 0 12px 30px rgba(0,0,0,0.25); border: 1px solid var(--border); }
.close-modal { position: absolute; top: 15px; right: 15px; cursor: pointer; font-size: 22px; color: var(--danger); background: none; border: none; font-weight: bold; }
#cloud-loader { display:none; position: fixed; top:12px; left:50%; transform:translateX(-50%); background:var(--success); color:white; padding:6px 18px; border-radius:20px; font-size:12px; font-weight:bold; z-index:2000; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

/* HAMBURGER SIDE MENU */
.hamburger-btn { background: none; border: none; font-size: 26px; color: #FFFFFF; cursor: pointer; z-index: 15; transition: 0.3s; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.hamburger-btn:hover { transform: scale(1.1); }

.side-menu { position: fixed; top: 0; left: -280px; width: 270px; height: 100%; background: var(--card); box-shadow: 6px 0 25px rgba(0,0,0,0.3); z-index: 2001; transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; border-top-right-radius: 16px; border-bottom-right-radius: 16px; overflow: hidden; }
.side-menu.open { left: 0; }

.side-menu-header { background: linear-gradient(135deg, #0A2647 0%, #144272 100%); color: white; padding: 22px 18px; display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: bold; border-bottom: 2px solid rgba(255,255,255,0.1); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.close-menu { background: rgba(255,255,255,0.15); border: none; color: white; font-size: 24px; cursor: pointer; line-height: 1; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.close-menu:hover { background: rgba(255,255,255,0.3); transform: rotate(90deg); }

.menu-list { list-style: none; padding: 12px 10px; margin: 0; flex: 1; overflow-y: auto; }
.menu-list li { margin-bottom: 8px; border-radius: 10px; overflow: hidden; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); background: var(--bg); border: 1px solid var(--border); box-shadow: 0 2px 6px rgba(0,0,0,0.03); }
.menu-list li a { display: flex; padding: 14px 16px; color: var(--text-main); text-decoration: none; font-size: 14px; font-weight: 600; transition: all 0.25s ease; align-items: center; gap: 12px; }

.menu-list li:hover { background: linear-gradient(135deg, rgba(10, 38, 71, 0.08) 0%, rgba(20, 66, 114, 0.03) 100%); transform: translateX(4px); box-shadow: 0 4px 12px rgba(10, 38, 71, 0.12); border-left: 4px solid var(--primary); }
.menu-list li a:hover { color: var(--primary); padding-left: 18px; }

.menu-lang-box { padding: 12px 14px; margin: 8px 10px; background: var(--bg); border-radius: 10px; border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 6px rgba(0,0,0,0.03); }

.menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); z-index: 2000; display: none; transition: 0.3s; }
.menu-overlay.active { display: block; }