/* assets/css/styles.css */
/* Premium CSS Design System for PGPro */

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

:root {
    --font-sans: 'Outfit', sans-serif;
    
    /* Harmonized HSL Palette */
    --bg-base-dark: 224 71% 4%;
    --bg-card-dark: 223 47% 7%;
    --border-dark: 217 33% 17%;
    
    --bg-base-light: 210 40% 98%;
    --bg-card-light: 0 0% 100%;
    --border-light: 214 32% 91%;

    --primary: 250 84% 54%;      /* Royal Indigo */
    --success: 142 76% 36%;      /* Deep Emerald */
    --danger: 346 84% 50%;       /* Crimson */
    --warning: 38 92% 50%;       /* Amber */
    
    /* Glassmorphism settings */
    --glass-opacity-dark: 0.25;
    --glass-opacity-light: 0.6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

body {
    background-color: hsl(var(--bg-base-dark));
    color: #f8fafc;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.light-theme {
    background-color: hsl(var(--bg-base-light));
    color: #0f172a;
}

/* Base Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}
.light-theme ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

/* Glassmorphism Styles */
.glass-panel {
    background: rgba(13, 18, 30, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme .glass-panel {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
}

.glass-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.2s ease;
}

.light-theme .glass-card {
    background: rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.glass-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.light-theme .glass-card:hover {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
}

/* Auth Login Screen styling */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(98, 0, 234, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(0, 229, 255, 0.08) 0%, transparent 40%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
}

/* Floor Grid Visual Matrix */
.room-matrix-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.room-card {
    position: relative;
    padding: 20px;
    overflow: hidden;
}

.room-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: hsl(var(--primary));
}

.room-card.sharing-ac::after {
    background: hsl(var(--success));
}

.room-card.sharing-non-ac::after {
    background: hsl(var(--warning));
}

.bed-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 10px;
    transition: all 0.2s ease;
}

.light-theme .bed-slot {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.bed-slot.occupied {
    border-color: rgba(220, 38, 38, 0.2);
    background: rgba(220, 38, 38, 0.04);
}

.light-theme .bed-slot.occupied {
    background: rgba(220, 38, 38, 0.03);
}

.bed-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: hsl(var(--success));
}

.occupied .bed-status-indicator {
    background: hsl(var(--danger));
}

/* Interactive Controls and Buttons */
.btn-primary {
    background: hsl(var(--primary));
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.light-theme .btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.light-theme .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* Inputs & Form Fields */
.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.light-theme .form-input {
    background: rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

.form-input:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px rgba(98, 0, 234, 0.15);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease forwards;
}

.modal-content {
    width: 100%;
    max-width: 520px;
    padding: 30px;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* AI Chat Window Panel */
.chat-window {
    height: 480px;
    display: flex;
    flex-col: column;
    overflow-y: auto;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-bubble {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 12px;
    line-height: 1.5;
    font-size: 14px;
}

.chat-bubble.user {
    background: hsl(var(--primary));
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.light-theme .chat-bubble.assistant {
    background: rgba(0, 0, 0, 0.04);
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

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

/* Skeleton Loading Placements */
.skeleton-card {
    height: 140px;
    background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 75%);
    background-size: 200% 100%;
    animation: shiver 1.5s infinite;
    border-radius: 16px;
}

.light-theme .skeleton-card {
    background: linear-gradient(90deg, rgba(0,0,0,0.02) 25%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.02) 75%);
    background-size: 200% 100%;
}

@keyframes shiver {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- PREMIUM DYNAMIC TOAST SYSTEM STYLES --- */
.toast-card {
    min-width: 320px;
    max-width: 420px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: rgba(13, 18, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast-card.success {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, rgba(13, 18, 30, 0.85), rgba(16, 185, 129, 0.1));
}
.toast-card.success .toast-icon {
    color: #10b981;
}

.toast-card.error {
    border-color: rgba(244, 63, 94, 0.3);
    background: linear-gradient(135deg, rgba(13, 18, 30, 0.85), rgba(244, 63, 94, 0.1));
}
.toast-card.error .toast-icon {
    color: #f43f5e;
}

.toast-card.warning {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, rgba(13, 18, 30, 0.85), rgba(245, 158, 11, 0.1));
}
.toast-card.warning .toast-icon {
    color: #f59e0b;
}

.toast-card.info {
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, rgba(13, 18, 30, 0.85), rgba(99, 102, 241, 0.1));
}
.toast-card.info .toast-icon {
    color: #6366f1;
}

/* Light Theme overrides for toasts */
.light-theme .toast-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}
.light-theme .toast-card .toast-content {
    color: #0f172a !important;
}

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

/* ==========================================================================
   JOURNALPRO-ALIGNED SOFT LIGHT THEME OVERRIDES
   ========================================================================== */

body.light-theme {
    background-color: #F8FAFC !important;
    color: #0F172A !important;
}

/* Background overrides for main shell */
body.light-theme #app-view {
    background-color: #F8FAFC !important;
}

/* Sidebar overrides: pure white sidebar with soft border and dark slate text */
body.light-theme aside {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    backdrop-filter: none !important;
}

body.light-theme #active-property-section {
    border-color: #E2E8F0 !important;
}

/* Sidebar Brand and Sub-headers */
body.light-theme aside h2 {
    color: #0F172A !important;
}
body.light-theme aside span,
body.light-theme aside p {
    color: #64748B !important;
}

/* Sidebar Custom PG Dropdown Selector Trigger */
body.light-theme #custom-property-trigger {
    background-color: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    color: #0F172A !important;
}
body.light-theme #custom-property-trigger span {
    color: #0F172A !important;
}
body.light-theme #custom-property-trigger i {
    color: #64748B !important;
}

/* Sidebar Dropdown Menu options */
body.light-theme #custom-property-menu {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}
body.light-theme #custom-property-menu button {
    border-bottom-color: #F1F5F9 !important;
}
body.light-theme #custom-property-menu button p.text-white {
    color: #0F172A !important;
}
body.light-theme #custom-property-menu button:hover {
    background-color: #F1F5F9 !important;
}
body.light-theme #custom-property-menu button:hover p.text-white {
    color: #0F172A !important;
}

body.light-theme #manage-properties-btn {
    color: #64748B !important;
}
body.light-theme #manage-properties-btn:hover {
    color: #4F46E5 !important;
    background-color: #F1F5F9 !important;
}

/* Sidebar Navigation Tabs */
body.light-theme .sidebar-tab {
    color: #475569 !important;
}
body.light-theme .sidebar-tab i {
    color: #64748B !important;
}
body.light-theme .sidebar-tab:hover {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
}
body.light-theme .sidebar-tab.active {
    background-color: rgba(99, 102, 241, 0.1) !important;
    color: #4F46E5 !important;
    border: 1px solid rgba(99, 102, 241, 0.15) !important;
}
body.light-theme .sidebar-tab.active i {
    color: #4F46E5 !important;
}

/* Sidebar user profile at the bottom */
body.light-theme aside .border-t {
    border-color: #E2E8F0 !important;
}
body.light-theme aside .text-white {
    color: #0F172A !important;
}
body.light-theme aside .text-slate-400 {
    color: #64748B !important;
}
body.light-theme #logout-btn {
    color: #64748B !important;
}
body.light-theme #logout-btn:hover {
    color: #EF4444 !important;
    background-color: #FEE2E2 !important;
}

/* Main Dashboard Cards and Glass Panels */
body.light-theme .glass-panel {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

/* Headings and generic texts in dashboard */
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6 {
    color: #0F172A !important;
}

/* Vibrant status colors override for light theme metrics */
body.light-theme .text-emerald-400,
body.light-theme .text-emerald-500 {
    color: #10b981 !important;
}
body.light-theme .text-rose-500,
body.light-theme .text-rose-400 {
    color: #f43f5e !important;
}
body.light-theme .text-amber-500,
body.light-theme .text-amber-600 {
    color: #b45309 !important; /* Darker amber for premium high-contrast visibility on light backgrounds */
}
body.light-theme .text-indigo-400,
body.light-theme .text-indigo-500 {
    color: #6366f1 !important;
}

body.light-theme .text-white:not(button, a, .badge, [class*="bg-indigo"], [class*="bg-rose"], [class*="bg-emerald"], [class*="bg-green"], [class*="bg-red"], [class*="bg-blue"], [class*="bg-slate-700"], [class*="bg-slate-800"], [class*="bg-slate-900"]) {
    color: #0F172A !important;
}

body.light-theme .text-slate-100,
body.light-theme .text-slate-200,
body.light-theme .text-slate-300 {
    color: #334155 !important;
}

body.light-theme .text-slate-400 {
    color: #475569 !important;
}

body.light-theme .text-slate-500 {
    color: #64748B !important;
}

body.light-theme .border-white\/5,
body.light-theme .border-white\/10 {
    border-color: #E2E8F0 !important;
}

body.light-theme .bg-black\/20,
body.light-theme .bg-white\/5,
body.light-theme .bg-black\/35,
body.light-theme .bg-black\/15 {
    background-color: #F1F5F9 !important;
}

body.light-theme .bg-slate-700 {
    background-color: #E2E8F0 !important;
    color: #334155 !important;
}

body.light-theme .bg-slate-700:hover {
    background-color: #CBD5E1 !important;
}

/* Matrix & Floor Grid specific light styles */
body.light-theme .room-card {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}

body.light-theme .bed-slot {
    background-color: #F8FAFC !important;
    border-color: #E2E8F0 !important;
}

body.light-theme .bed-slot.occupied {
    background-color: #FEF2F2 !important;
    border-color: #FEE2E2 !important;
}

body.light-theme .bed-slot.occupied span.text-white {
    color: #0F172A !important;
}

body.light-theme .bed-slot.occupied span.text-slate-400 {
    color: #64748B !important;
}

/* Modals inside light theme */
body.light-theme .modal-content {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .modal-backdrop {
    background-color: rgba(15, 23, 42, 0.3) !important;
}

/* Input Fields and Select Inputs */
body.light-theme .form-input,
body.light-theme select {
    background-color: #FFFFFF !important;
    border-color: #CBD5E1 !important;
    color: #0F172A !important;
}

body.light-theme select option {
    background-color: #FFFFFF !important;
    color: #0F172A !important;
}

body.light-theme .form-input::placeholder {
    color: #94A3B8 !important;
}

/* Table light theme updates */
body.light-theme table th {
    background-color: #F1F5F9 !important;
    color: #475569 !important;
    border-bottom: 2px solid #E2E8F0 !important;
}

body.light-theme table td {
    color: #334155 !important;
    border-bottom-color: #F1F5F9 !important;
}

body.light-theme table tr:hover {
    background-color: #F8FAFC !important;
}

/* Special Badges */
body.light-theme .badge-buy,
body.light-theme .bg-emerald-500\/10 {
    background-color: #D1FAE5 !important;
    color: #065F46 !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

body.light-theme .badge-sell,
body.light-theme .bg-rose-500\/10 {
    background-color: #FEE2E2 !important;
    color: #991B1B !important;
    border: 1px solid rgba(244, 63, 94, 0.2) !important;
}

body.light-theme .bg-indigo-600\/20 {
    background-color: rgba(99, 102, 241, 0.15) !important;
    color: #4F46E5 !important;
}

body.light-theme .text-indigo-400 {
    color: #4F46E5 !important;
}

body.light-theme .text-slate-400 {
    color: #64748B !important;
}

/* Calendar heat map and items */
body.light-theme .day-trade-item {
    background-color: #F1F5F9 !important;
}

body.light-theme .day-trade-item .pair-name {
    color: #334155 !important;
}

/* Top bar and secondary headers */
body.light-theme header.border-b {
    border-color: #E2E8F0 !important;
}

body.light-theme header button.hover\:bg-white\/5:hover {
    background-color: #F1F5F9 !important;
}

/* Sub tabs and buttons navigation inside sub panels */
body.light-theme .sub-tab-btn {
    color: #64748B !important;
}

body.light-theme .sub-tab-btn.active {
    color: #4F46E5 !important;
    border-bottom-color: #4F46E5 !important;
}

body.light-theme .sub-tab-btn:hover {
    color: #0F172A !important;
}

/* AI Copilot chat updates */
body.light-theme .chat-window {
    background-color: #F8FAFC !important;
    border-color: #E2E8F0 !important;
}

body.light-theme .chat-bubble.assistant {
    background-color: #FFFFFF !important;
    color: #0F172A !important;
    border-color: #E2E8F0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
}

body.light-theme .chat-bubble.user {
    background-color: #4F46E5 !important;
    color: #FFFFFF !important;
}

/* Manage properties popup specific */
body.light-theme #manage-properties-list > div {
    background-color: #F8FAFC !important;
    border-color: #E2E8F0 !important;
}

body.light-theme #manage-properties-list p.text-white {
    color: #0F172A !important;
}

body.light-theme #manage-properties-list p.text-slate-400 {
    color: #64748B !important;
}

/* Identity card in statement modal (light gradient) */
body.light-theme .modal-content .bg-gradient-to-br {
    background: linear-gradient(135deg, #F1F5F9, #E2E8F0) !important;
    border-color: #CBD5E1 !important;
}
body.light-theme .modal-content .bg-gradient-to-br h4,
body.light-theme .modal-content .bg-gradient-to-br strong {
    color: #0F172A !important;
}
body.light-theme .modal-content .bg-gradient-to-br .text-slate-400 {
    color: #475569 !important;
}

/* Statement detail block, details tags, and accordions */
body.light-theme #ledger-demographics-details {
    background-color: #F8FAFC !important;
    border-color: #E2E8F0 !important;
}
body.light-theme #ledger-demographics-details summary:hover {
    background-color: #F1F5F9 !important;
}
body.light-theme #ledger-demographics-details summary {
    color: #475569 !important;
    border-bottom: 1px solid #E2E8F0 !important;
}
body.light-theme #ledger-demographics-details div {
    color: #475569 !important;
}
body.light-theme #ledger-demographics-details div strong {
    color: #0F172A !important;
}

/* Scrollable timeline box inside modal */
body.light-theme #tenant-ledger-modal .bg-black\/15 {
    background-color: #F8FAFC !important;
    border-color: #E2E8F0 !important;
}
body.light-theme #tenant-ledger-modal #ledger-timeline-container > div {
    border-bottom-color: #E2E8F0 !important;
}
body.light-theme #tenant-ledger-modal #ledger-timeline-container h6.text-white {
    color: #0F172A !important;
}
body.light-theme #tenant-ledger-modal #ledger-timeline-container p.text-slate-400 {
    color: #64748B !important;
}
body.light-theme #tenant-ledger-modal #ledger-timeline-container div.pl-4 {
    border-left-color: #CBD5E1 !important;
    color: #475569 !important;
}
body.light-theme #tenant-ledger-modal #ledger-timeline-container div.pl-4 span {
    color: #475569 !important;
}

/* Startup loader adjustments */
#startup-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.light-theme #startup-loader {
    background-color: #F8FAFC !important;
}

.light-theme #startup-loader span {
    color: #64748B !important;
}

/* Mobile responsive drawer styling */
@media (max-width: 768px) {
    aside.mobile-hidden {
        transform: translateX(-100%);
    }
    aside {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 50;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        width: 256px !important;
        height: 100vh !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4) !important;
        background-color: #0f1424 !important;
    }
    
    .light-theme aside {
        background-color: #FFFFFF !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.08) !important;
    }
}

/* Light Theme Overrides for Mobile Header */
.light-theme #app-view > header {
    background-color: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    color: #0F172A !important;
}
.light-theme #app-view > header h2 {
    color: #4F46E5 !important;
}
.light-theme #app-view > header button {
    color: #64748B !important;
}
.light-theme #app-view > header button:hover {
    color: #0F172A !important;
}

/* ==========================================================================
   MOBILE SCREEN OPTIMIZATIONS (CALENDAR, HEADINGS & GRIDS)
   ========================================================================== */

@media (max-width: 1024px) {
    /* Let the calendar grid expand naturally vertically on mobile instead of forcing h-[calc(100vh-210px)] */
    #tab-calendar > .grid {
        height: auto !important;
        min-height: 0 !important;
    }
    
    #calendar-grid-cells {
        overflow-y: visible !important;
    }
}

@media (max-width: 640px) {
    /* 1. Scale down large main headings on mobile */
    h1.text-3xl, .text-3xl {
        font-size: 1.35rem !important; /* Scale 30px down to ~22px for better title fitting */
        line-height: 1.85rem !important;
    }
    
    h2.text-2xl, .text-2xl {
        font-size: 1.15rem !important;
        line-height: 1.5rem !important;
    }

    /* 2. Optimize Page padding and glass-panel padding for tiny screens */
    main {
        padding: 12px !important;
    }
    
    .glass-panel {
        padding: 14px !important;
        border-radius: 14px !important;
    }
    
    /* 3. Calendar Days Capsule Stretches Fix */
    .calendar-day-cell, 
    #calendar-grid-cells > div {
        min-height: 48px !important; /* Ensure square cells */
        padding: 4px 6px !important; /* Extremely tight padding to fit elements */
        border-radius: 8px !important;
        justify-content: flex-start !important;
        gap: 2px !important;
    }
    
    /* Hide numeric paid amounts on mobile inside grid cells to avoid crowding */
    .calendar-day-cell span.text-\[9px\] {
        display: none !important;
    }
    
    /* Adjust indicator dots wrapper */
    .calendar-day-cell .flex-wrap {
        margin-top: 1px !important;
        gap: 1.5px !important;
    }
    .calendar-day-cell .flex-wrap span {
        width: 3.5px !important;
        height: 3.5px !important;
    }
}

