/* ═══════════════════════════════════════════════════════════════
   FamilyHub — Design System & Styles
   Aesthetic: Dark Modern Glassmorphism with Warm & Vibrant Accents
   ═══════════════════════════════════════════════════════════════ */

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

:root {
    /* Color Palette */
    --bg-base: #0a0e1a;
    --bg-surface: #111827;
    --bg-surface-elevated: #1a2236;
    --bg-card: rgba(22, 30, 48, 0.72);
    --bg-card-hover: rgba(29, 41, 66, 0.88);
    --bg-modal: rgba(15, 23, 42, 0.94);

    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-card: rgba(255, 255, 255, 0.11);
    --border-focus: #6366f1;

    /* Accents & Brand Gradients */
    --brand-primary: #6366f1;
    --brand-primary-light: #818cf8;
    --brand-secondary: #8b5cf6;
    --brand-accent: #ec4899;
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --card-gradient: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    --glow-primary: 0 0 25px rgba(99, 102, 241, 0.35);

    /* Semantic Status Colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.15);

    /* Text */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Member Color Palette for Avatars/Events */
    --member-1: #6366f1;
    --member-2: #ec4899;
    --member-3: #10b981;
    --member-4: #f59e0b;
    --member-5: #06b6d4;
    --member-6: #8b5cf6;

    /* Typography & Sizing */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-modal: 0 25px 60px -15px rgba(0, 0, 0, 0.75);

    --sidebar-width: 280px;
    --header-height: 72px;
}

/* Light Theme Variables (optional toggle) */
[data-theme="light"] {
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-modal: rgba(255, 255, 255, 0.98);
    --border-subtle: rgba(0, 0, 0, 0.07);
    --border-card: rgba(0, 0, 0, 0.1);
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;
    --card-gradient: linear-gradient(145deg, rgba(255, 255, 255, 0.8) 0%, rgba(241, 245, 249, 0.5) 100%);
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

a {
    color: var(--brand-primary-light);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #c7d2fe;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
}

/* ═══════════════════════════════════════════════════════════════
   Layout Structure
   ═══════════════════════════════════════════════════════════════ */

#app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar (Desktop) */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.2);
    color: var(--brand-primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 4px 20px -4px rgba(99, 102, 241, 0.3);
}

.nav-item .icon {
    font-size: 1.2rem;
    width: 24px;
    display: inline-flex;
    justify-content: center;
}

.nav-badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--brand-primary);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

/* Sidebar Footer / User snippet */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.15);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    box-shadow: var(--glow-primary);
    overflow: hidden;
    flex-shrink: 0;
}
.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-pill {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.2);
    color: var(--brand-primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.user-actions-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}
.user-actions-btn:hover {
    color: var(--danger);
}

/* Main Content Workspace */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: calc(100% - var(--sidebar-width));
}

/* Top App Header */
.top-header {
    height: var(--header-height);
    background: rgba(11, 15, 25, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-hamburger {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mobile-hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.page-title-box h1 {
    font-size: 1.4rem;
    font-weight: 700;
}

.page-title-box p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* AI Quick Action Bar */
.ai-quick-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.5rem 0.35rem 1rem;
    gap: 0.5rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.ai-quick-bar:focus-within {
    border-color: var(--brand-primary-light);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
}

.ai-quick-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 0.88rem;
    width: 220px;
}
.ai-quick-input::placeholder {
    color: var(--text-dim);
}

.ai-voice-btn {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.ai-voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
}

/* Notification Bell */
.notif-bell-btn {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-full);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s;
}
.notif-bell-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
}

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-surface);
}

/* App View Container */
.app-view {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-out;
}

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

/* ═══════════════════════════════════════════════════════════════
   Glassmorphism Cards & Components
   ═══════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

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

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Stat Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.stat-icon.indigo { background: rgba(99, 102, 241, 0.18); color: #818cf8; }
.stat-icon.pink { background: rgba(236, 72, 153, 0.18); color: #f472b6; }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.18); color: #22d3ee; }

.stat-content {
    flex: 1;
}

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

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    margin-top: 0.2rem;
}

.stat-subtext {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    outline: none;
}

.btn-primary {
    background: var(--brand-gradient);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

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

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

/* Form Controls */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

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

.form-input, .form-select, .form-textarea {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background: rgba(15, 23, 42, 0.9);
}

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

/* ═══════════════════════════════════════════════════════════════
   Auth Views (Login, Signup, OTP, Passkey)
   ═══════════════════════════════════════════════════════════════ */

#auth-container {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.auth-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    padding: 2.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-gradient);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .logo-icon {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.auth-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.35rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.35rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.auth-tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab-btn.active {
    background: var(--bg-surface-elevated);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.passkey-hero-box {
    text-align: center;
    padding: 1.5rem 1rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.passkey-hero-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* OTP 6-Digit Box Input */
.otp-inputs {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 1.5rem 0;
}

.otp-digit {
    width: 50px;
    height: 60px;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-card);
    color: var(--brand-primary-light);
    outline: none;
}
.otp-digit:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   Calendar & Planner Views
   ═══════════════════════════════════════════════════════════════ */

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

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.member-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    transition: all 0.2s;
}

.member-chip.active {
    color: white;
    border-color: currentColor;
    background: rgba(255, 255, 255, 0.12);
}

.member-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: currentColor;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
    min-height: 600px;
}

.day-col {
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

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

.day-col-header {
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.day-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
}

.day-number {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    margin-top: 0.15rem;
}

.event-card {
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    border-left: 3px solid var(--brand-primary);
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.15s, background 0.15s;
}
.event-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.event-time {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.event-title {
    font-weight: 600;
    margin-top: 0.15rem;
    color: #ffffff;
}

.event-tag {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    margin-top: 0.3rem;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   Logistics & Drop-off / Pick-up Engine
   ═══════════════════════════════════════════════════════════════ */

.logistics-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.logistics-recommendation-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform 0.2s;
}
.logistics-recommendation-card:hover {
    transform: translateY(-2px);
    border-color: var(--brand-primary);
}

.logistics-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.15);
    color: var(--brand-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.conflict-badge {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

/* ═══════════════════════════════════════════════════════════════
   Chore Management System
   ═══════════════════════════════════════════════════════════════ */

.chore-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chore-status-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.35rem;
    border-radius: var(--radius-md);
}

.chore-tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.chore-tab-btn.active {
    background: var(--bg-surface-elevated);
    color: #ffffff;
}

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

.chore-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 190px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chore-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6);
}

.chore-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.chore-reward-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.25) 100%);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
}

.chore-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.chore-room-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.35rem;
}

.chore-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: 1rem;
    font-size: 0.8rem;
}

.chore-assignee {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
}

.chore-status-pill {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
}
.status-open { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.status-accepted { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.status-completed { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-verified { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

/* ═══════════════════════════════════════════════════════════════
   Allowance & Bank System
   ═══════════════════════════════════════════════════════════════ */

.allowance-kids-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kid-bank-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.kid-bank-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-gradient);
}

.kid-bank-balance {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 800;
    margin: 0.5rem 0;
}
.kid-bank-balance.positive { color: #34d399; }
.kid-bank-balance.negative { color: #f87171; }

.negative-balance-alert {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-size: 0.8rem;
    color: #fca5a5;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   Modal Dialogs
   ═══════════════════════════════════════════════════════════════ */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    animation: modalFadeIn 0.2s ease-out;
}

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

.modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
    animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.2s;
}
.modal-close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   Toast Notifications
   ═══════════════════════════════════════════════════════════════ */

#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

/* ═══════════════════════════════════════════════════════════════
   Mobile Responsive Styles (≤ 860px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 860px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.7);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 95;
    }
    .sidebar-overlay.active {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
        max-width: 100%;
    }

    .mobile-hamburger {
        display: flex;
    }

    .top-header {
        padding: 0 1rem;
    }

    .ai-quick-bar {
        display: none; /* Hide topbar AI input on small screens, use floating button */
    }

    .app-view {
        padding: 1.25rem 1rem;
    }

    .week-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
