/* CrecheSoft Web - Design System (Warm & Playful Professional) */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;500;600;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}
html, body {
    width: 100%;
    overflow-x: hidden;
}
img, svg, video, canvas, iframe {
    max-width: 100%;
    height: auto;
}
button, input, select, textarea {
    min-width: 0;
}

:root {
    --bg-color: #f7f9f6;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(255, 255, 255, 0.8);
    --text-primary: #2c3e35;
    --text-secondary: #607266;
    
    /* Playful HSL Palette - Warm Tropical & Palms */
    --primary-h: 16;
    --primary-s: 90%;
    --primary-l: 65%;
    --primary-color: hsl(var(--primary-h), var(--primary-s), var(--primary-l)); /* Coral/Terracotta #FF8566 */
    --primary-hover: hsl(var(--primary-h), var(--primary-s), 55%);
    
    --secondary-h: 42;
    --secondary-s: 95%;
    --secondary-l: 60%;
    --secondary-color: hsl(var(--secondary-h), var(--secondary-s), var(--secondary-l)); /* Sunny Gold #FFCA3A */
    
    --teal-h: 145;
    --teal-s: 55%;
    --teal-l: 45%;
    --teal-color: hsl(var(--teal-h), var(--teal-s), var(--teal-l)); /* Palm Leaf Green #33B37B */
    
    --blue-h: 195;
    --blue-s: 85%;
    --blue-l: 60%;
    --blue-color: hsl(var(--blue-h), var(--blue-s), var(--blue-l)); /* Soft Sky Blue #4DCCE6 */
    
    --green-h: 88;
    --green-s: 45%;
    --green-l: 62%;
    --green-color: hsl(var(--green-h), var(--green-s), var(--green-l)); /* Sage Green #91C788 */
    
    --border-radius-lg: 2.2rem;
    --border-radius-md: 1.2rem;
    --card-shadow: 0 15px 35px rgba(51, 179, 123, 0.06), 0 5px 15px rgba(0, 0, 0, 0.01);
    --transition-speed: 0.3s;
}

/* Dark Mode Theme Overrides */
[data-bs-theme="dark"] {
    --bg-color: #121319;
    --card-bg: rgba(30, 32, 41, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f7fafc;
    --text-secondary: #a0aec0;
    --card-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

/* General resets */
body {
    font-family: 'Fredoka', 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    min-width: 0;
}

.app-content,
.main-wrapper,
.custom-card,
.table-responsive,
.app-sidebar,
.nav-menu,
.content-header,
.landing-hero {
    min-width: 0;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .table {
    min-width: 100%;
}

.table th,
.table td {
    word-break: break-word;
}

/* App Shell Layout */
.app-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styling */
.app-sidebar {
    /* Responsive width using clamp: min 260px, preferred 18vw, max 320px */
    width: clamp(260px, 18vw, 320px);
    min-width: 260px;
    max-width: 320px;
    background: linear-gradient(180deg, hsla(var(--primary-h), 100%, 97%, 0.98) 0%, hsla(var(--secondary-h), 100%, 96%, 0.98) 100%);
    border-right: 2px solid hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.15);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    /* Responsive padding: min 1rem, preferred 2%, max 2rem */
    padding: clamp(1rem, 2%, 2rem) clamp(0.8rem, 1.5%, 1.5rem);
    transition: all var(--transition-speed) ease, left var(--transition-speed) ease, transform var(--transition-speed) ease;
    z-index: 100;
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

[data-bs-theme="dark"] .app-sidebar {
    background: linear-gradient(180deg, rgba(30, 20, 25, 0.98) 0%, rgba(20, 22, 28, 0.98) 100%);
    border-right: 2px solid rgba(255, 255, 255, 0.08);
}

/* Custom subtle scrollbar for sidebar */
.app-sidebar::-webkit-scrollbar {
    width: 6px;
}
.app-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}
.app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
}
[data-bs-theme="dark"] .app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
}
.app-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.45);
}
[data-bs-theme="dark"] .app-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 1vw, 0.8rem);
    padding-bottom: clamp(1rem, 2%, 2rem);
    border-bottom: 1px solid var(--card-border);
    margin-bottom: clamp(1rem, 1.5%, 1.5rem);
}

.brand-title {
    /* Responsive font size: min 1.1rem, preferred 1.4rem, max 1.6rem */
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(0.3rem, 0.5vw, 0.6rem);
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: clamp(0.7rem, 1.2vw, 1.2rem);
    padding: clamp(0.65rem, 1% 1.2%, 1rem) clamp(0.8rem, 1%, 1.5rem);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    /* Responsive font size for nav items */
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item-link:hover, .nav-item-link.active {
    background: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.12);
    color: var(--primary-color);
}

.nav-item-link i {
    /* Responsive icon size */
    font-size: clamp(1rem, 1.8vw, 1.4rem);
}

/* Main Content Area */
.app-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-x: hidden;
}

/* Header section */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h2 {
    font-weight: 700;
    margin-bottom: 0.2rem;
}

/* Custom premium cards */
.custom-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(10px);
    padding: 1.8rem;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.custom-card:hover {
    transform: translateY(-8px) scale(1.015);
    box-shadow: 0 22px 45px rgba(255, 93, 124, 0.12);
}

/* Stat Card specific designs */
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

/* Pastel gradients for indicators */
.bg-pastel-primary { background: rgba(255, 139, 114, 0.12); color: var(--primary-color); }
.bg-pastel-secondary { background: rgba(255, 210, 117, 0.15); color: #d19e27; }
.bg-pastel-teal { background: rgba(85, 193, 181, 0.12); color: var(--teal-color); }
.bg-pastel-blue { background: rgba(127, 168, 235, 0.12); color: var(--blue-color); }

/* Landing Page Elements */
.landing-navbar {
    background: rgba(255, 253, 250, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 253, 250, 0.5);
    transition: all var(--transition-speed);
}

.landing-hero {
    background: radial-gradient(circle at 10% 20%, rgba(255, 210, 117, 0.15) 0%, rgba(255, 139, 114, 0.1) 90.2%);
    padding: 8rem 0 6rem 0;
    position: relative;
    overflow: hidden;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
}
.shape-1 { width: 300px; height: 300px; background: rgba(255, 139, 114, 0.2); top: -50px; right: -50px; }
.shape-2 { width: 400px; height: 400px; background: rgba(85, 193, 181, 0.15); bottom: -100px; left: -100px; }

/* Filterable Gallery styling */
.gallery-filter-btn {
    border-radius: 2rem;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-secondary);
    transition: all var(--transition-speed);
}

.gallery-filter-btn.active, .gallery-filter-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.gallery-item {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
}

.gallery-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 80%);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    transition: opacity var(--transition-speed);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Boutique Marketplace Cards */
.product-card {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    background: var(--card-bg);
    transition: all var(--transition-speed);
}

.product-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.cart-badge {
    position: absolute;
    top: -5px; right: -5px;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* QR Code Reader terminal UI */
.scanner-container {
    max-width: 600px;
    margin: 0 auto;
}

.scanner-viewfinder {
    width: 100%;
    height: 300px;
    border-radius: var(--border-radius-lg);
    background: #000;
    overflow: hidden;
    position: relative;
    border: 4px solid var(--card-border);
}

.scanner-laser {
    position: absolute;
    width: 100%; height: 3px;
    background: #ef4444;
    top: 0; left: 0;
    box-shadow: 0 0 10px #ef4444;
    animation: laser-animation 2s infinite linear;
}

@keyframes laser-animation {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

/* Messaging layout */
.chat-wrapper {
    height: 500px;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-bubble {
    max-width: 70%;
    padding: 0.8rem 1.2rem;
    border-radius: 1.2rem;
    font-size: 0.95rem;
}

.chat-sent {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0.2rem;
}

.chat-received {
    background-color: rgba(var(--blue-h), var(--blue-s), var(--blue-l), 0.12);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 0.2rem;
}

/* Responsive sidebars */
@media (max-width: 991.98px) {
    /* Stack layout on small screens so fixed sidebar does not reserve flex space */
    .app-wrapper {
        display: block !important;
    }
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        right: auto;
        bottom: 0;
        /* Mobile sidebar width: min 250px, preferred 80vw, max 300px */
        width: clamp(250px, 80vw, 300px) !important;
        max-width: clamp(250px, 80vw, 300px) !important;
        transform: translateX(-100vw);
        transition: transform var(--transition-speed) ease, left var(--transition-speed) ease, width var(--transition-speed) ease;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
        height: 100vh;
        z-index: 1050;
        overflow: hidden;
        overflow-y: auto;
    }
    .app-sidebar::before, .app-sidebar::after, .app-sidebar *::before, .app-sidebar *::after {
        display: none !important;
    }
    /* When showing, expand to viewport width */
    .app-sidebar.show,
    body.sidebar-open .app-sidebar {
        transform: translateX(0);
        left: 0;
        width: clamp(250px, 80vw, 300px) !important;
        max-width: clamp(250px, 80vw, 300px) !important;
    }
    /* Prevent the main content from being shifted/reserved when sidebar is fixed overlay */
    .main-wrapper,
    .app-content,
    .app-wrapper > .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .app-content {
        padding: clamp(1rem, 2%, 1.5rem);
    }
    .content-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .nav-menu {
        gap: clamp(0.25rem, 0.5vw, 0.35rem);
    }
    .nav-item-link {
        padding: clamp(0.6rem, 1%, 0.8rem) clamp(0.8rem, 1%, 1rem);
        font-size: clamp(0.8rem, 1.3vw, 0.95rem);
    }
    .nav-item-link i {
        font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    }
    .brand-section {
        gap: clamp(0.4rem, 0.8vw, 0.6rem);
        padding-bottom: clamp(0.8rem, 1.5%, 1.2rem);
        margin-bottom: clamp(0.8rem, 1%, 1rem);
    }
    .brand-title {
        font-size: clamp(0.95rem, 1.8vw, 1.3rem);
    }
    .custom-card {
        padding: clamp(1rem, 1.5%, 1.4rem);
    }
    body.sidebar-open {
        overflow: hidden;
    }
    .sidebar-backdrop {
        display: block;
    }
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13, 15, 28, 0.35);
    backdrop-filter: blur(1px);
    z-index: 95;
    cursor: pointer;
}

@media (min-width: 992px) {
    /* Desktop Electron app: preserve desktop sidebar layout on large windows */
    .desktop-app .app-sidebar {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        bottom: auto !important;
        width: clamp(260px, 18vw, 320px) !important;
        max-width: 320px !important;
        height: 100vh !important;
        margin-right: 0;
        transform: translateX(0) !important;
    }
    .desktop-app .app-sidebar.show {
        left: 0 !important;
    }
}

@media (max-width: 767.98px) {
    .app-content {
        padding: clamp(0.75rem, 1.5%, 1rem);
    }
    .mobile-topbar {
        padding: clamp(0.75rem, 1.5%, 1rem);
    }
    .brand-section {
        flex-wrap: nowrap;
        gap: clamp(0.4rem, 0.8vw, 0.6rem);
    }
    .nav-item-link {
        font-size: clamp(0.75rem, 1.2vw, 0.9rem);
        padding: clamp(0.55rem, 0.8% 0.8%, 0.65rem) clamp(0.7rem, 0.8%, 0.9rem);
    }
    .nav-item-link i {
        font-size: clamp(0.85rem, 1.3vw, 1rem);
    }
    .stat-icon {
        width: clamp(45px, 10vw, 50px);
        height: clamp(45px, 10vw, 50px);
        font-size: clamp(1rem, 1.5vw, 1.2rem);
    }
    .brand-title {
        font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    }
    /* Ensure user profile badge scales */
    .d-flex.align-items-center.gap-3.mb-4.p-2 {
        padding: clamp(0.5rem, 1%, 0.8rem) !important;
    }
}

/* Print Badge & Receipts styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    .no-print {
        display: none !important;
    }
    .print-only {
        display: block !important;
    }
}

/* Sidebar Dropdown Chevron animation */
.nav-item-link .dropdown-arrow {
    transition: transform var(--transition-speed) ease;
}
.nav-item-link[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mobile Topbar for Staff Dashboard */
.mobile-topbar {
    background: var(--card-bg) !important;
    border-bottom: 1px solid var(--card-border) !important;
    backdrop-filter: blur(15px);
    z-index: 99;
}

/* Playful, child-friendly platform enhancements */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(circle at 15% 15%, hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.04) 0%, transparent 40%),
                      radial-gradient(circle at 85% 85%, hsla(var(--blue-h), var(--blue-s), var(--blue-l), 0.04) 0%, transparent 40%),
                      radial-gradient(circle at 50% 50%, hsla(var(--secondary-h), var(--secondary-s), var(--secondary-l), 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Wiggle animation for icons */
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg) scale(1.1); }
    75% { transform: rotate(5deg) scale(1.1); }
}

.nav-menu .nav-item-link:hover i {
    animation: wiggle 0.35s ease infinite;
}

/* Juicy 3D game-like buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), hsl(var(--primary-h), var(--primary-s), 60%)) !important;
    border: none !important;
    box-shadow: 0 4px 0 hsl(var(--primary-h), var(--primary-s), 45%), 0 8px 15px rgba(255, 93, 124, 0.25) !important;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border-radius: var(--border-radius-md) !important;
    color: white !important;
    font-weight: 600 !important;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 hsl(var(--primary-h), var(--primary-s), 45%), 0 10px 20px rgba(255, 93, 124, 0.3) !important;
}
.btn-primary:active {
    transform: translateY(4px) !important;
    box-shadow: 0 0px 0 hsl(var(--primary-h), var(--primary-s), 45%), 0 3px 8px rgba(255, 93, 124, 0.1) !important;
}

.btn-success {
    background: linear-gradient(135deg, var(--teal-color), hsl(var(--teal-h), var(--teal-s), 44%)) !important;
    border: none !important;
    box-shadow: 0 4px 0 hsl(var(--teal-h), var(--teal-s), 35%), 0 8px 15px rgba(54, 214, 158, 0.25) !important;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border-radius: var(--border-radius-md) !important;
    color: white !important;
    font-weight: 600 !important;
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 hsl(var(--teal-h), var(--teal-s), 35%), 0 10px 20px rgba(54, 214, 158, 0.3) !important;
}
.btn-success:active {
    transform: translateY(4px) !important;
    box-shadow: 0 0px 0 hsl(var(--teal-h), var(--teal-s), 35%), 0 3px 8px rgba(54, 214, 158, 0.1) !important;
}

.btn-info {
    background: linear-gradient(135deg, var(--blue-color), hsl(var(--blue-h), var(--blue-s), 56%)) !important;
    border: none !important;
    box-shadow: 0 4px 0 hsl(var(--blue-h), var(--blue-s), 45%), 0 8px 15px rgba(72, 167, 255, 0.25) !important;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border-radius: var(--border-radius-md) !important;
    color: white !important;
    font-weight: 600 !important;
}
.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 hsl(var(--blue-h), var(--blue-s), 45%), 0 10px 20px rgba(72, 167, 255, 0.3) !important;
}
.btn-info:active {
    transform: translateY(4px) !important;
    box-shadow: 0 0px 0 hsl(var(--blue-h), var(--blue-s), 45%), 0 3px 8px rgba(72, 167, 255, 0.1) !important;
}

/* Extra playful roundness for form fields */
.form-control, .form-select {
    border-radius: var(--border-radius-md) !important;
    padding: 0.75rem 1rem !important;
    border: 2px solid rgba(0,0,0,0.05) !important;
    transition: all 0.2s ease !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.2) !important;
}

/* Colorful, large navigation icons */
.nav-item-link i {
    font-size: 1.25rem !important;
    width: 38px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    margin-right: 0.5rem !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Individual playful pastel colors for icons */
.nav-item-link i.bi-grid-1x2-fill { background: rgba(74, 169, 255, 0.15) !important; color: var(--blue-color) !important; }
.nav-item-link i.bi-sliders { background: rgba(255, 179, 25, 0.15) !important; color: var(--secondary-color) !important; }
.nav-item-link i.bi-people-fill { background: rgba(255, 93, 124, 0.15) !important; color: var(--primary-color) !important; }
.nav-item-link i.bi-people { background: rgba(163, 112, 247, 0.15) !important; color: var(--purple-color) !important; }
.nav-item-link i.bi-door-closed-fill { background: rgba(255, 126, 54, 0.15) !important; color: var(--orange-color) !important; }
.nav-item-link i.bi-person-workspace { background: rgba(54, 214, 158, 0.15) !important; color: var(--teal-color) !important; }
.nav-item-link i.bi-envelope-paper-fill { background: rgba(255, 179, 25, 0.15) !important; color: var(--secondary-color) !important; }
.nav-item-link i.bi-images { background: rgba(74, 169, 255, 0.15) !important; color: var(--blue-color) !important; }
.nav-item-link i.bi-shop { background: rgba(255, 93, 124, 0.15) !important; color: var(--primary-color) !important; }
.nav-item-link i.bi-journal-check { background: rgba(163, 112, 247, 0.15) !important; color: var(--purple-color) !important; }
.nav-item-link i.bi-calendar2-check-fill { background: rgba(255, 126, 54, 0.15) !important; color: var(--orange-color) !important; }
.nav-item-link i.bi-qr-code-scan { background: rgba(54, 214, 158, 0.15) !important; color: var(--teal-color) !important; }
.nav-item-link i.bi-wallet2 { background: rgba(255, 93, 124, 0.15) !important; color: var(--primary-color) !important; }
.nav-item-link i.bi-chat-dots-fill { background: rgba(74, 169, 255, 0.15) !important; color: var(--blue-color) !important; }
.nav-item-link i.bi-bar-chart-line-fill { background: rgba(163, 112, 247, 0.15) !important; color: var(--purple-color) !important; }
.nav-item-link i.bi-calendar-range-fill { background: rgba(255, 126, 54, 0.15) !important; color: var(--orange-color) !important; }
.nav-item-link i.bi-graph-up-arrow { background: rgba(54, 214, 158, 0.15) !important; color: var(--teal-color) !important; }

/* Scale up icons slightly when hovered */
.nav-item-link:hover i {
    transform: scale(1.15) rotate(-5deg) !important;
}

/* Playful child-friendly backgrounds & decorative clouds */
.child-cloud-pattern {
    background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.7) 30px, transparent 31px),
                      radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.7) 45px, transparent 46px),
                      radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.7) 30px, transparent 31px);
    background-size: 300px 300px;
    background-repeat: repeat;
    opacity: 0.1;
    pointer-events: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
}

/* Soft floating animation for landing elements */
@keyframes float-soft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.floating-icon {
    animation: float-soft 4s ease-in-out infinite;
}

/* Bubbly child select buttons for parent portal */
.child-select-btn {
    border-radius: 2rem !important;
    padding: 0.6rem 1.5rem !important;
    font-weight: 600 !important;
    border: none !important;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.child-select-btn.btn-outline-secondary {
    background: #fff !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 0 #d1d5db, 0 6px 10px rgba(0,0,0,0.05) !important;
}

.child-select-btn.btn-outline-secondary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 0 #d1d5db, 0 8px 12px rgba(0,0,0,0.08) !important;
}

.child-select-btn.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), hsl(var(--primary-h), var(--primary-s), 60%)) !important;
    box-shadow: 0 4px 0 hsl(var(--primary-h), var(--primary-s), 45%), 0 8px 15px rgba(255, 93, 124, 0.25) !important;
    color: white !important;
}

/* Chalkboard panel design for greetings */
.chalkboard-panel {
    background: #2b3a4a !important;
    border: 8px solid #a0522d !important;
    border-radius: 1.5rem !important;
    padding: 1.5rem !important;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.4), 0 10px 25px rgba(0,0,0,0.15) !important;
    color: #fff !important;
    position: relative;
}

.chalkboard-panel::after {
    content: "";
    position: absolute;
    bottom: -15px; left: 50px;
    width: 60px; height: 10px;
    background: #f3f4f6;
    border-radius: 2px;
    box-shadow: 0 3px 5px rgba(0,0,0,0.2);
}

/* Wavy divider class */
.wavy-curve {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.wavy-curve svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.wavy-curve .shape-fill {
    fill: var(--secondary-color);
}

/* Custom background for hero */
.landing-hero {
    background: linear-gradient(180deg, #fff2e3 0%, #f4faee 100%) !important;
    padding: 8rem 0 7rem 0 !important;
    position: relative;
    overflow: hidden;
}

/* Image zoom & hover transitions for section cards */
.custom-card:hover img {
    transform: scale(1.08) rotate(1deg);
}

/* --- 3D Organigram Section Styles --- */
.organigram-section {
    position: relative;
    padding: 6rem 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.4) 0%, rgba(246, 248, 253, 1) 100%);
    overflow: hidden;
}

[data-bs-theme="dark"] .organigram-section {
    background: radial-gradient(circle at 50% 50%, rgba(30, 32, 41, 0.6) 0%, rgba(18, 19, 25, 1) 100%);
}

/* Floating background bubbles for 3D depth */
.organigram-bubble {
    position: absolute;
    border-radius: 50%;
    filter: blur(4px);
    opacity: 0.12;
    pointer-events: none;
    animation: floatBubble 12s ease-in-out infinite alternate;
}

@keyframes floatBubble {
    0% { transform: translateY(0) scale(1) rotate(0deg); }
    100% { transform: translateY(-40px) scale(1.1) rotate(360deg); }
}

/* 3D Perspective setup */
.organigram-perspective {
    perspective: 1800px;
    transform-style: preserve-3d;
    padding: 2rem 0;
    width: 100%;
}

.organigram-viewport {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
    border-radius: var(--border-radius-lg);
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    padding: 4rem 2rem;
    box-shadow: var(--card-shadow);
}

[data-bs-theme="dark"] .organigram-viewport {
    background: rgba(30, 32, 41, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* The layout container */
.organigram-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    transform-style: preserve-3d;
    z-index: 2;
}

/* The Root Node */
.organigram-root-node {
    transform: translateZ(60px);
    transform-style: preserve-3d;
    background: var(--card-bg);
    border: 3px solid var(--primary-color);
    box-shadow: 0 15px 35px rgba(255, 93, 124, 0.15);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 3rem;
    text-align: center;
    max-width: 480px;
    transition: all 0.3s ease;
    cursor: default;
    z-index: 10;
}

.organigram-root-node:hover {
    box-shadow: 0 20px 45px rgba(255, 93, 124, 0.25);
    border-color: var(--teal-color);
}

.organigram-root-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--teal-color));
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.35rem 1rem;
    border-radius: 2rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.organigram-root-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Connectors Container */
.organigram-connectors {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.organigram-connectors svg {
    width: 100%;
    height: 100%;
}

.connector-line {
    fill: none;
    stroke: rgba(113, 128, 150, 0.15);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke var(--transition-speed);
}

[data-bs-theme="dark"] .connector-line {
    stroke: rgba(255, 255, 255, 0.08);
}

.connector-pulse {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 12 120;
    stroke-dashoffset: 0;
    animation: pulseFlow 4s linear infinite;
}

/* Custom flow path colors per branch */
.pulse-left { stroke: var(--primary-color); }
.pulse-center { stroke: var(--teal-color); }
.pulse-right { stroke: var(--secondary-color); }

@keyframes pulseFlow {
    0% { stroke-dashoffset: 200; }
    100% { stroke-dashoffset: -200; }
}

/* Children Row */
.organigram-children-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 2rem;
    margin-top: 4.5rem;
    transform-style: preserve-3d;
}

/* Child Card styling */
.organigram-child-card {
    flex: 1;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    padding: 2.2rem 1.8rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    transform: translateZ(30px);
    transform-style: preserve-3d;
    cursor: pointer;
    position: relative;
}

.organigram-child-card::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: calc(var(--border-radius-lg) + 3px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Highlight colors on hover */
.card-secu:hover {
    border-color: var(--primary-color);
    box-shadow: 0 25px 50px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.18);
}
.card-educ:hover {
    border-color: var(--teal-color);
    box-shadow: 0 25px 50px hsla(var(--teal-h), var(--teal-s), var(--teal-l), 0.18);
}
.card-repa:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 25px 50px hsla(var(--secondary-h), var(--secondary-s), var(--secondary-l), 0.18);
}

.organigram-child-card:hover {
    transform: translateZ(75px) scale(1.03);
}

/* Node Elements 3D translation */
.node-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    font-size: 2rem;
    transition: transform 0.4s ease;
    transform: translateZ(10px);
}

.organigram-child-card:hover .node-icon-wrapper {
    transform: translateZ(35px) scale(1.15);
}

.node-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    transform: translateZ(15px);
}

.node-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
    transform: translateZ(5px);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .organigram-children-row {
        flex-direction: column;
        gap: 1.8rem;
        margin-top: 2rem;
    }
    .organigram-child-card {
        transform: translateZ(20px);
    }
    .organigram-child-card:hover {
        transform: translateZ(40px) scale(1.01);
    }
    .organigram-connectors {
        display: none; /* Hide svg lines on mobile since they stack vertically */
    }
}
