/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-gradient-1: #0f172a;
    --bg-gradient-2: #1e1b4b;
    --bg-gradient-3: #311042;
    
    --panel-bg: rgba(20, 20, 35, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-border-glow: rgba(99, 102, 241, 0.25);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    
    --success: #10b981;
    --success-hover: #059669;
    --success-glow: rgba(16, 185, 129, 0.3);
    
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-glow: rgba(245, 158, 11, 0.3);
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.3);

    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light Theme Variables */
body.light-theme {
    --bg-gradient-1: #f1f5f9;
    --bg-gradient-2: #e2e8f0;
    --bg-gradient-3: #cbd5e1;
    
    --panel-bg: rgba(255, 255, 255, 0.65);
    --panel-border: rgba(0, 0, 0, 0.08);
    --panel-border-glow: rgba(99, 102, 241, 0.15);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --primary-glow: rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-gradient-3));
    background-attachment: fixed;
    background-size: 300% 300%;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Ambient Background Blobs */
body::before, body::after {
    content: '';
    position: fixed;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}
body::before {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}
body::after {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, var(--warning) 0%, transparent 70%);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.scrollable {
    overflow-y: auto;
    max-height: 100%;
}

/* ==========================================================================
   COMMON GLASS PANEL & CORE UI ELEMENTS
   ========================================================================== */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: var(--panel-border-glow);
    box-shadow: 0 12px 35px -10px rgba(0, 0, 0, 0.35);
}

h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--panel-border);
    margin: 1.5rem 0;
}

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: 0.75rem; }

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-bounce);
    outline: none;
    color: white;
}

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

.btn-primary {
    background: linear-gradient(135deg, #818cf8 0%, var(--primary) 100%);
    box-shadow: 0 4px 15px -3px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    box-shadow: 0 6px 20px -3px var(--primary-glow);
}

.btn-success {
    background: linear-gradient(135deg, #34d399 0%, var(--success) 100%);
    box-shadow: 0 4px 15px -3px var(--success-glow);
}
.btn-success:hover {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-hover) 100%);
    box-shadow: 0 6px 20px -3px var(--success-glow);
}

.btn-warning {
    background: linear-gradient(135deg, #fbbf24 0%, var(--warning) 100%);
    box-shadow: 0 4px 15px -3px var(--warning-glow);
    color: #1e1b4b;
}
.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-hover) 100%);
    box-shadow: 0 6px 20px -3px var(--warning-glow);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171 0%, var(--danger) 100%);
    box-shadow: 0 4px 15px -3px var(--danger-glow);
}
.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
    box-shadow: 0 6px 20px -3px var(--danger-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.btn-icon {
    padding: 0.75rem;
    border-radius: 50%;
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
}
.btn-text:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--border-radius-sm);
}

.btn-xs {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--border-radius-sm);
}

.btn-group {
    display: inline-flex;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.15);
}

.btn-group .btn {
    border-radius: 0;
    border: none;
}

.btn-group .btn:not(:last-child) {
    border-right: 1px solid var(--panel-border);
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

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

/* Checkbox Container Custom styling */
.checkbox-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
    color: var(--text-primary);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 1.25rem;
    width: 1.25rem;
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--text-secondary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-option-row {
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 400px;
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    background: rgba(15, 23, 42, 0.9);
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    color: white;
    transform: translateX(120%);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(0);
}

.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-danger { border-left-color: var(--danger); }

/* ==========================================================================
   1. SETUP WIZARD VIEW
   ========================================================================== */
.overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 10, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999;
    padding: 1rem;
}

.setup-card {
    width: 100%;
    max-width: 600px;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.setup-card h2 {
    margin-bottom: 0.5rem;
}
.setup-card p {
    margin-bottom: 2rem;
}

.color-picker-wrapper {
    height: 42px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--panel-border);
}
.color-picker-wrapper input[type="color"] {
    width: 120%;
    height: 120%;
    border: none;
    cursor: pointer;
    transform: translate(-10%, -10%);
}

.avatar-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.avatar-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.8rem;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    background: rgba(255,255,255,0.05);
    transition: var(--transition-bounce);
}

.avatar-opt:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,0.1);
}

.avatar-opt.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.1);
}

/* ==========================================================================
   2. LOGIN SCREEN
   ========================================================================== */
.login-box {
    width: 100%;
    max-width: 500px;
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-box h1 {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #fff 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-box p {
    margin-bottom: 2.5rem;
}

.member-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.member-avatar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition-bounce);
    outline: none;
}

.member-avatar-btn:hover {
    transform: translateY(-8px);
}

.member-avatar-btn:hover .avatar-circle {
    box-shadow: 0 0 25px var(--hover-color);
    transform: scale(1.05);
}

.avatar-circle {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid var(--member-color, var(--panel-border));
    box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.5);
    transition: var(--transition-bounce);
}

.member-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* PIN Keypad Panel */
.keypad-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

#btn-back-to-users {
    align-self: flex-start;
    margin-bottom: 1.5rem;
}

.keypad-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.selected-user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    border: 1px solid var(--panel-border);
}

.avatar-large {
    font-size: 1.8rem;
}

.pin-display {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.pin-dot {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid var(--text-secondary);
    background: transparent;
    transition: var(--transition-bounce);
}

.pin-dot.active {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    transform: scale(1.2);
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 280px;
}

.keypad-btn {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    outline: none;
}

.keypad-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--text-secondary);
}

.keypad-btn:active {
    transform: scale(0.9);
}

.keypad-special {
    font-size: 1rem;
    color: white;
}

/* ==========================================================================
   3. APP LAYOUT & SIDEBAR
   ========================================================================== */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.sidebar {
    height: 100vh;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    background: rgba(10, 10, 25, 0.75);
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.logo-icon {
    font-size: 2.2rem;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.family-brand {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 40%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-nav li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.sidebar-nav li:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav li.active {
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    box-shadow: 0 4px 15px -3px var(--primary-glow);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid var(--panel-border);
    padding-top: 1.5rem;
}

.active-profile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profile-avatar {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 2px solid var(--user-color, var(--primary));
}

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

.profile-name {
    font-weight: 600;
    font-size: 0.95rem;
}

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

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Content Panel Main */
.content-panel {
    padding: 2.5rem;
    overflow-y: auto;
    height: 100vh;
    position: relative;
}

.content-view {
    height: 100%;
    animation: fadeIn 0.4s ease;
}

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

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ==========================================================================
   DASHBOARD VIEW STYLING
   ========================================================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.greeting-panel h1 {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
    font-weight: 800;
}

.clock-panel {
    padding: 0.75rem 1.75rem;
    border-radius: var(--border-radius-md);
}

#digital-clock {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 1px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 1.75rem;
    height: calc(100vh - 180px);
}

.dashboard-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem;
}

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

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
}

.card-body {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.quick-add-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quick-add-form input {
    padding: 0.5rem 1rem;
}

.right-column-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
}

/* Weather Widget Card */
.weather-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid var(--panel-border);
}

.weather-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.weather-temp-info {
    display: flex;
    flex-direction: column;
}

.weather-temp-info .temp {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
}

.weather-temp-info .city {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.weather-icon-container {
    width: 3.5rem;
    height: 3.5rem;
}

.weather-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.weather-svg {
    width: 100%;
    height: 100%;
}

/* Timeline/Schedule component */
.timeline {
    position: relative;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--panel-border);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline-dot {
    position: absolute;
    left: -22px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--event-color, var(--primary));
    box-shadow: 0 0 8px var(--event-color, var(--primary));
}

.timeline-content {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1rem;
    border: 1px solid var(--panel-border);
    transition: var(--transition-smooth);
}

.timeline-content:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.03);
}

.timeline-time {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--event-color, var(--primary));
    margin-bottom: 0.25rem;
}

.timeline-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.timeline-assignee {
    display: inline-flex;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.timeline-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 0;
}

/* Shopping summary list checkbox elements */
.shopping-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shopping-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-radius: var(--border-radius-md);
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--panel-border);
    transition: var(--transition-smooth);
}

.shopping-summary-item:hover {
    background: rgba(0, 0, 0, 0.22);
}

.shopping-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shopping-item-text {
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    transition: var(--transition-smooth);
}

.shopping-item-qty {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Strike-through checklist animation */
.shopping-summary-item.checked .shopping-item-text {
    color: var(--text-muted);
    text-decoration: line-through;
}

.shopping-summary-item.checked {
    opacity: 0.6;
    background: rgba(0,0,0,0.05);
}

.shopping-tag-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.shopping-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 0;
}

/* Dashboard Notes Board list */
.dash-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dash-note-item {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    color: #1e1b4b;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: var(--transition-smooth);
}

.dash-note-item:hover {
    transform: translateY(-2px);
}

.dash-note-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.dash-note-content {
    font-size: 0.85rem;
    white-space: pre-line;
}

.dash-notes-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
}

/* ==========================================================================
   CALENDAR VIEW STYLING
   ========================================================================== */
.calendar-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-title-text {
    min-width: 150px;
    text-align: center;
}

.filter-panel {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--member-color);
    background: transparent;
    color: var(--text-primary);
    transition: var(--transition-bounce);
}

.filter-pill.active {
    background: var(--member-color);
    color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.calendar-wrapper {
    flex-grow: 1;
    overflow: hidden;
    padding: 1.25rem;
}

.calendar-grid-month {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto repeat(6, 1fr);
    height: calc(100vh - 270px);
    gap: 1px;
    background: var(--panel-border);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--panel-border);
}

.calendar-weekday-header {
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    padding: 0.75rem 0.25rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--panel-border);
}

.calendar-cell {
    background: rgba(10, 10, 20, 0.4);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
}

.calendar-cell:hover {
    background: rgba(255, 255, 255, 0.03);
}

.calendar-cell.other-month {
    opacity: 0.3;
}

.calendar-cell.today {
    background: rgba(99, 102, 241, 0.08);
}

.calendar-cell.today .day-number {
    background: var(--primary);
    color: white;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.day-number {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    align-self: flex-start;
}

.cell-events-container {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Event badges in calendar cells */
.cal-event-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--event-color, var(--primary));
    border-left: 3px solid rgba(0,0,0,0.3);
    transition: var(--transition-bounce);
}

.cal-event-badge:hover {
    transform: scale(1.03);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

/* Week View Grid */
.calendar-grid-week {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    grid-template-rows: auto repeat(24, 60px);
    height: calc(100vh - 270px);
    overflow-y: auto;
    gap: 1px;
    background: var(--panel-border);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--panel-border);
}

/* Day View Grid */
.calendar-grid-day {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto repeat(24, 60px);
    height: calc(100vh - 270px);
    overflow-y: auto;
    gap: 1px;
    background: var(--panel-border);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--panel-border);
}

.week-time-label-header {
    background: rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 2;
}

.week-day-header {
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    padding: 0.75rem 0.25rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--panel-border);
    position: sticky;
    top: 0;
    z-index: 2;
}

.week-day-header.today {
    color: var(--primary);
}

.week-time-cell {
    background: rgba(10, 10, 20, 0.5);
    text-align: right;
    padding-right: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.week-day-cell {
    background: rgba(10, 10, 20, 0.4);
    position: relative;
}

/* Weekly view event placing positioning wrapper */
.week-event-card {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: var(--event-color, var(--primary));
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    overflow: hidden;
    cursor: pointer;
    border-left: 3px solid rgba(0,0,0,0.3);
    z-index: 1;
}

/* List View */
.calendar-list-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: calc(100vh - 340px);
    overflow-y: auto;
    padding-right: 0.5rem;
}

.list-day-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-day-header {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.25rem;
    margin-bottom: 0.25rem;
}

.list-event-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--border-radius-md);
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--panel-border);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.list-event-card:hover {
    background: rgba(255,255,255,0.02);
    transform: translateX(4px);
}

.list-event-time {
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 90px;
    color: var(--event-color, var(--primary));
}

.list-event-details {
    flex-grow: 1;
}

.list-event-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.list-event-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   SHOPPING LIST VIEW STYLING
   ========================================================================== */
.shopping-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    height: calc(100vh - 180px);
}

.shopping-input-card {
    padding: 1.5rem;
    height: fit-content;
}

.shopping-input-card h3 {
    margin-bottom: 1.25rem;
}

.shopping-list-card {
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
}

.shopping-categories-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.shopping-category-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shopping-category-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--success);
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shopping-list-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.shopping-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--panel-border);
    transition: var(--transition-smooth);
}

.shopping-item-card:hover {
    background: rgba(255,255,255,0.02);
}

.shopping-item-card.checked {
    opacity: 0.5;
}

.shopping-item-card.checked .shopping-item-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.shopping-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-delete-item {
    color: var(--text-muted);
    opacity: 0;
    transition: var(--transition-smooth);
}

.shopping-item-card:hover .btn-delete-item {
    opacity: 1;
}

.btn-delete-item:hover {
    color: var(--danger);
}

/* ==========================================================================
   NOTES VIEW STYLING (STICKY NOTES)
   ========================================================================== */
.notes-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 0.5rem;
}

.note-card {
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    color: #1e1b4b;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.4);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: var(--transition-bounce);
}

/* Rotate post-its slightly for analog feel */
.note-card:nth-child(even) {
    transform: rotate(1.5deg);
}

.note-card:nth-child(odd) {
    transform: rotate(-1.5deg);
}

.note-card:nth-child(3n) {
    transform: rotate(0.8deg);
}

.note-card:hover {
    transform: rotate(0deg) scale(1.05) translateY(-5px);
    box-shadow: 10px 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.note-pin-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
    z-index: 2;
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    border-bottom: 1px dashed rgba(30, 27, 75, 0.15);
    padding-bottom: 0.5rem;
}

.note-card-title {
    font-weight: 800;
    font-size: 1.05rem;
}

.note-actions {
    display: flex;
    gap: 2px;
}

.btn-note-action {
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(30, 27, 75, 0.6);
    padding: 2px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.btn-note-action:hover {
    color: #1e1b4b;
    background: rgba(0,0,0,0.05);
}

.note-card-content {
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-wrap;
    flex-grow: 1;
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: rgba(30, 27, 75, 0.5);
    margin-top: 1rem;
    border-top: 1px dashed rgba(30, 27, 75, 0.1);
    padding-top: 0.5rem;
    font-weight: 500;
}

/* ==========================================================================
   SETTINGS VIEW STYLING
   ========================================================================== */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: calc(100vh - 180px);
    overflow-y: auto;
}

.settings-card {
    padding: 2rem;
    height: fit-content;
}

.settings-card h3 {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-desc {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.settings-members-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.settings-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--panel-border);
}

.settings-member-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-member-avatar {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid var(--member-color);
}

.settings-member-name {
    font-weight: 600;
}

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

.settings-form {
    display: flex;
    flex-direction: column;
}

/* Option toggle layouts */
.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--panel-border);
}

.option-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 75%;
}

.option-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.option-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.option-input-action {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

input.form-control-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border-radius: var(--border-radius-sm);
    width: 130px;
    flex-shrink: 0;
}

/* Role-based Visibility */
body.user-is-member .admin-only,
body.user-is-member .admin-only-field {
    display: none !important;
}

/* iOS Toggle Slider */
.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-color: rgba(255,255,255,0.1);
    border: 1px solid var(--panel-border);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* QR Code Connection block */
.qr-code-settings-panel {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    background: rgba(0,0,0,0.15);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--panel-border);
}

.qr-code-placeholder {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.qr-code-placeholder canvas {
    width: 100% !important;
    height: 100% !important;
}

.qr-loading {
    font-size: 0.65rem;
    color: black;
    text-align: center;
}

.qr-info {
    flex-grow: 1;
}

.qr-info code {
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--primary);
    word-break: break-all;
}

/* ==========================================================================
   4. MODALS & DIALOG OVERLAYS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 10, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

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

.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Category selection styling inside modals */
.assigned-checkboxes-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid var(--panel-border);
    padding: 0.5rem;
    border-radius: var(--border-radius-md);
    background: rgba(0,0,0,0.15);
}

.assigned-checkboxes-container .checkbox-container {
    font-size: 0.85rem;
}

.note-color-picker {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.color-dot {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.color-dot:hover {
    transform: scale(1.1);
}

.color-dot.active {
    border-color: #1e1b4b;
    transform: scale(1.15);
}

/* ==========================================================================
   KIOSK MODE LAYOUT OPTIMIZATIONS
   ========================================================================== */
body.kiosk-mode {
    font-size: 1.15rem; /* Larger font size overall for tablet view */
}

body.kiosk-mode h1 { font-size: 2.8rem; }
body.kiosk-mode h2 { font-size: 2.2rem; }
body.kiosk-mode h3 { font-size: 1.5rem; }

body.kiosk-mode .app-layout {
    grid-template-columns: 280px 1fr;
}

body.kiosk-mode .sidebar {
    display: flex !important;
}

body.kiosk-mode .content-panel {
    padding: 1.5rem;
}

/* Add floating back button to exit kiosk mode on tablet if needed */
.kiosk-exit-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    opacity: 0.3;
    transition: var(--transition-smooth);
    background: rgba(15, 23, 42, 0.8);
}
.kiosk-exit-btn:hover {
    opacity: 1;
}

/* Re-adjust Kiosk Dashboard grid to use full screen heights */
body.kiosk-mode .dashboard-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
    height: calc(100vh - 120px);
}

body.kiosk-mode .btn,
body.kiosk-mode input,
body.kiosk-mode select,
body.kiosk-mode textarea {
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
}

.mobile-nav-bar {
    display: none;
}
body.kiosk-mode .mobile-nav-bar {
    display: none !important;
}

/* ==========================================================================
   RESPONSIVE LAYOUTS & MOBILE MEDIA QUERIES
   ========================================================================== */

/* Tablet & Smaller Screen adjustments (Kiosk tablets in portrait or smaller landscape) */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 240px 1fr;
    }
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        height: auto;
        overflow-y: visible;
    }
    .right-column-container {
        grid-column: span 2;
        flex-direction: row;
        height: auto;
    }
    .weather-card, .notes-card {
        flex: 1;
    }
    .shopping-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .settings-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* Mobile Devices (iPhone / Android Portrait) */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    /* Move sidebar to a top header navigation */
    .sidebar {
        height: auto;
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
        background: rgba(10, 10, 25, 0.9);
    }
    
    .sidebar-header {
        margin-bottom: 0;
    }
    
    .sidebar-brand {
        font-size: 1.1rem;
    }
    
    .sidebar-nav {
        display: none; /* In phone, we can use a compact drop navigation or simple button tab */
    }
    
    /* Make custom mobile bottom-bar menu instead */
    .sidebar-footer {
        border-top: none;
        padding-top: 0;
        margin-left: auto;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    
    .active-profile-card {
        display: none; /* Hide profile card on mobile top header */
    }
    
    .sidebar-actions {
        flex-direction: row;
    }
    
    .content-panel {
        padding: 1.25rem;
        padding-bottom: 90px !important;
        height: calc(100vh - 70px);
    }
    
    /* Dashboard Stack layout */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .clock-panel {
        width: 100%;
        text-align: center;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .right-column-container {
        grid-column: span 1;
        flex-direction: column;
    }
    
    /* Calendar control wrap */
    .calendar-controls {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }
    
    .cal-view-toggle {
        justify-content: center;
    }
    
    .calendar-grid-month {
        height: 400px;
    }
    
    .calendar-weekday-header {
        font-size: 0.75rem;
    }
    
    .day-number {
        font-size: 0.75rem;
    }
    
    .cal-event-badge {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
    
    /* Form fields grids stacking */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    /* Mobile view specific bottom navigation injector */
    .mobile-nav-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 25, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--panel-border);
        z-index: 998;
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-nav-bar::-webkit-scrollbar {
        display: none;
    }
    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        color: var(--text-secondary);
        font-size: 0.7rem;
        cursor: pointer;
        padding: 0.25rem 0.75rem;
        flex-shrink: 0;
        min-width: 16.66%;
        flex-grow: 1;
    }
    
    .mobile-nav-item.active {
        color: var(--primary);
    }
    
    .mobile-nav-item span.material-symbols-rounded {
        font-size: 1.4rem;
    }

    /* Settings View mobile wrap fixes */
    .settings-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .option-info {
        max-width: 100%;
    }
    
    .option-input-action {
        width: 100%;
    }
    
    .option-input-action input {
        flex-grow: 1;
        width: 100% !important;
    }
    
    .qr-code-settings-panel {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    /* Mobile scroll & height limit overrides */
    .meal-planner-card,
    .recipes-card,
    .todos-card,
    .shopping-list-card {
        height: auto !important;
        overflow: visible !important;
    }
    
    .meal-planner-grid,
    .recipes-grid,
    .todos-list-container,
    .shopping-categories-container {
        height: auto !important;
        overflow: visible !important;
    }

    .scrollable {
        max-height: none !important;
        overflow: visible !important;
    }
}

/* ==========================================================================
   BUDGET & PURCHASES STYLING
   ========================================================================== */
.budget-card-container {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
}

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

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

.budget-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .budget-body {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

.budget-progress-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.budget-info-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
}

.budget-progress-bar-bg {
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
}

.budget-progress-bar-fill {
    height: 100%;
    background: #10b981; /* Green */
    width: 0%;
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.1, 0.8, 0.1, 1), background-color 0.3s;
}

.budget-progress-bar-fill.warning {
    background: #f59e0b; /* Orange */
}

.budget-progress-bar-fill.danger {
    background: #ef4444; /* Red */
}

.budget-status-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.budget-history h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.25rem;
}

.budget-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 110px;
    overflow-y: auto;
    padding-right: 4px;
}

.budget-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
}

.budget-history-item .item-lbl {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.budget-history-item .meta-lbl {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-left: 6px;
}

.budget-history-item .price-lbl {
    font-weight: 700;
    color: #ef4444;
}

.budget-history-item .btn-delete-purchase {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.budget-history-item .btn-delete-purchase:hover {
    color: var(--danger);
    background: rgba(255,255,255,0.05);
}

/* ==========================================================================
   TODOS VIEW STYLING
   ========================================================================== */
.todos-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    height: calc(100vh - 240px);
}

@media (max-width: 1024px) {
    .todos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.todos-card {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.todos-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.5rem;
}

.todos-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.todo-item-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.todo-item-card:hover {
    background: rgba(255, 255, 255, 0.02);
    transform: translateX(2px);
}

.todo-item-left {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    flex-grow: 1;
}

.todo-item-checkbox {
    margin-top: 3px;
    cursor: pointer;
}

.todo-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.todo-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.todo-item-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: pre-line;
}

.todo-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.todo-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--panel-border);
}

.todo-date-badge.overdue {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.todo-assignee-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--member-color, rgba(255, 255, 255, 0.08));
    color: white;
}

.todo-item-card.checked {
    opacity: 0.55;
    background: rgba(0, 0, 0, 0.05);
}

.todo-item-card.checked .todo-item-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-item-right {
    display: flex;
    align-items: center;
    opacity: 0;
    transition: var(--transition-smooth);
}

.todo-item-card:hover .todo-item-right {
    opacity: 1;
}

.btn-delete-todo {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.btn-delete-todo:hover {
    color: var(--danger);
}


/* ==========================================================================
   KITCHEN & MEAL PLANNING STYLING
   ========================================================================== */
.kitchen-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    height: calc(100vh - 180px);
}

@media (max-width: 1024px) {
    .kitchen-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.meal-planner-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.meal-planner-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    margin-top: 1rem;
    flex-grow: 1;
    padding-right: 4px;
}

.meal-day-row {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-md);
    gap: 1rem;
    transition: var(--transition-smooth);
}

.meal-day-row:hover {
    background: rgba(255, 255, 255, 0.01);
}

.meal-day-row.today {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.meal-day-name {
    display: flex;
    flex-direction: column;
}

.meal-day-name .day-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.meal-day-name .day-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.meal-day-content {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.meal-day-content.empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
    font-weight: 400;
}

.meal-day-actions {
    display: flex;
    gap: 0.25rem;
}

.recipes-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.recipes-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.75rem;
}

.recipe-filter-search {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.recipe-filter-search input {
    flex-grow: 1;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

.recipe-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 2px;
    border: 1px solid var(--panel-border);
}

.recipe-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.recipe-tab-btn.active {
    background: var(--primary);
    color: white;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.85rem;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.recipe-item-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
    cursor: pointer;
    transition: var(--transition-bounce);
}

.recipe-item-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.25);
}

.recipe-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.3;
}

.recipe-fav-star {
    color: #fbbf24;
}

.recipe-card-bottom {
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    color: var(--text-secondary);
}

.recipe-ingredients-form-list {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid var(--panel-border);
    padding: 0.5rem;
    border-radius: var(--border-radius-md);
    background: rgba(0, 0, 0, 0.15);
}

.recipe-ingredient-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.recipe-ingredient-row input {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.8rem !important;
}

.recipe-ingredient-row button {
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin {
    display: inline-block;
    animation: spin 1.5s linear infinite;
}

/* Premium Store Badge for shopping items */
.shopping-item-shop-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 8px;
    vertical-align: middle;
}
