:root {
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
    --bg-color: #f4f7f6;
    --bg-mesh-1: radial-gradient(at 10% 20%, rgba(16, 185, 129, 0.15) 0px, transparent 50%);
    --bg-mesh-2: radial-gradient(at 80% 80%, rgba(14, 165, 233, 0.15) 0px, transparent 50%);
    --surface: rgba(255, 255, 255, 0.6);
    --surface-solid: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: rgba(226, 232, 240, 0.8);
    --success: #10b981;
    
    /* Modern Glassmorphism Tokens */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --shadow-soft: 0 8px 30px rgba(0,0,0,0.06), 0 4px 10px rgba(0,0,0,0.03);
    --shadow-hover: 0 15px 35px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.05);
    --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.03);
}

body[data-theme="sandy"] {
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --bg-color: #f0f9ff;
    --bg-mesh-1: radial-gradient(at 20% 20%, rgba(14, 165, 233, 0.15) 0px, transparent 50%);
    --bg-mesh-2: radial-gradient(at 80% 80%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    --surface: rgba(255, 255, 255, 0.6);
    --surface-solid: #ffffff;
    --border: rgba(186, 230, 253, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.7);
}
body[data-theme="brown"] {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-gradient: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%);
    --bg-color: #f5f3ff;
    --bg-mesh-1: radial-gradient(at 10% 20%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    --bg-mesh-2: radial-gradient(at 90% 80%, rgba(244, 63, 94, 0.15) 0px, transparent 50%);
    --surface: rgba(255, 255, 255, 0.6);
    --surface-solid: #ffffff;
    --border: rgba(221, 214, 254, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.7);
}
body[data-theme="dark"] {
    --primary: #10b981;
    --primary-hover: #34d399;
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
    --bg-color: #050505;
    --bg-mesh-1: radial-gradient(at 20% 20%, rgba(16, 185, 129, 0.12) 0px, transparent 50%);
    --bg-mesh-2: radial-gradient(at 80% 80%, rgba(14, 165, 233, 0.1) 0px, transparent 50%);
    --surface: rgba(20, 20, 20, 0.6);
    --surface-solid: #121212;
    --border: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --glass-bg: rgba(20, 20, 20, 0.5);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.5);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.7);
    --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    background-color: var(--bg-color);
    background-image: var(--bg-mesh-1), var(--bg-mesh-2);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease, background-image 0.4s ease;
}

@keyframes pulseWatermark {
    0% { opacity: 0.02; transform: translate3d(-50%, -50%, 0) scale(0.97); }
    100% { opacity: 0.05; transform: translate3d(-50%, -50%, 0) scale(1.03); }
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(20px); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.stat-card { animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.view.active { animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);
    width: 80vw;
    height: 80vh;
    max-width: 600px;
    max-height: 600px;
    background-image: url('logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
    animation: pulseWatermark 8s ease-in-out infinite alternate;
    will-change: transform, opacity;
    mix-blend-mode: multiply;
}

body[data-theme="dark"]::before {
    mix-blend-mode: screen;
    opacity: 0.02;
}

/* Hide watermark on Landing Page */
body:has(#view-landing.active)::before { display: none; }

#floating-bg-icons {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.float-icon {
    position: absolute;
    color: var(--primary);
    opacity: 0.15;
    animation: drift 30s infinite linear;
    mix-blend-mode: multiply;
}

body[data-theme="dark"] .float-icon {
    opacity: 0.05;
    mix-blend-mode: screen;
}

.float-icon:nth-child(1) { top: 10%; left: 10%; width: 60px; height: 60px; animation-duration: 35s; animation-delay: 0s; }
.float-icon:nth-child(2) { top: 20%; right: 15%; width: 80px; height: 80px; animation-duration: 40s; animation-delay: -5s; }
.float-icon:nth-child(3) { bottom: 15%; left: 20%; width: 50px; height: 50px; animation-duration: 45s; animation-delay: -10s; }
.float-icon:nth-child(4) { bottom: 25%; right: 10%; width: 70px; height: 70px; animation-duration: 38s; animation-delay: -2s; }
.float-icon:nth-child(5) { top: 45%; left: 35%; width: 40px; height: 40px; animation-duration: 50s; animation-delay: -20s; }
.float-icon:nth-child(6) { bottom: 40%; right: 30%; width: 45px; height: 45px; animation-duration: 42s; animation-delay: -15s; }

@keyframes drift {
    0% { transform: translateY(0) rotate(0deg) translateX(0); }
    25% { transform: translateY(-50px) rotate(45deg) translateX(20px); }
    50% { transform: translateY(-100px) rotate(90deg) translateX(-10px); }
    75% { transform: translateY(-50px) rotate(135deg) translateX(30px); }
    100% { transform: translateY(0) rotate(180deg) translateX(0); }
}

/* Screen UI */
.screen-only { display: block; }
.print-only { display: none; }

#app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.app-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 1.2rem 2rem;
    border-radius: 24px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 1rem;
    z-index: 1000;
}

/* Tabs */
.nav-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.nav-btn {
    background: transparent;
    border: none;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-btn:hover { background: rgba(100,116,139,0.1); color: var(--text-main); }
.nav-btn.active { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }

.view { display: none; }
.view.active { display: block; }

/* Landing Page */
.landing-container.active { display: flex !important; }
.landing-container {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.landing-logo {
    width: 220px;
    height: 220px;
    margin-bottom: 1.5rem;
    object-fit: contain;
    mix-blend-mode: multiply;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.05));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
body[data-theme="dark"] .landing-logo { mix-blend-mode: screen; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5)); }
.landing-logo:hover { transform: scale(1.05) rotate(-2deg); }
.landing-title {
    font-size: 3.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
}
.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 3rem 2.5rem;
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}
.login-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* Glass Modular Sections */
.group-section, .form-grid, .students-section, .admin-layout {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
}

.group-section { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

/* Modern Inputs */
.form-input {
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    background: var(--surface-solid);
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-inner);
}
.form-input:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 4px rgba(16,185,129,0.15), var(--shadow-inner); 
    transform: translateY(-1px);
}

/* Forms Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.mt-2 { margin-top: 1rem; }
@media (min-width: 600px) { .form-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .form-grid { grid-template-columns: 1fr 1fr 1fr 1fr; } }

.input-group { display: flex; flex-direction: column; gap: 0.6rem; position: relative; }
.input-group label { font-weight: 700; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.input-group input, .input-group select {
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--surface-solid);
    color: var(--text-main);
    box-shadow: var(--shadow-inner);
}
.input-group input:focus, .input-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(16,185,129,0.15), var(--shadow-inner); }
.readonly-input { background-color: var(--bg-color) !important; cursor: not-allowed; opacity: 0.7; }

/* 12 Slots UI */
.students-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.students-header h3 { color: var(--text-main); font-size: 1.4rem; font-weight: 800; }
.section-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.8rem; }
.slots-grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
@media (min-width: 768px) { .slots-grid { grid-template-columns: 1fr 1fr; } }

.student-slot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    background: var(--surface);
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.student-slot:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-3px) scale(1.01);
    border-color: var(--primary);
}
.student-slot:focus-within { border-color: var(--primary); background-color: var(--surface); box-shadow: 0 0 0 4px rgba(16,185,129,0.1); }
.student-slot.active-check { 
    background-color: var(--surface);
    border-color: var(--success); 
    box-shadow: 0 4px 15px rgba(16,185,129,0.15);
}

.slot-number { font-weight: 800; width: 20px; color: var(--primary); font-size: 1.1rem; opacity: 0.6; }
.slot-name { flex-grow: 1; padding: 0.6rem; border: 1px solid var(--border); background: transparent; border-radius: 10px; font-size: 1rem; font-weight: 600; color: var(--text-main); transition: all 0.2s; width: 0; min-width: 120px; text-overflow: ellipsis; overflow: hidden; }
.slot-name:focus { outline: none; border-color: var(--primary); background: var(--bg); }
.slot-present-label { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: 700; user-select: none; color: var(--text-main); padding-left: 0.5rem; }
.slot-present-box {
    appearance: none;
    -webkit-appearance: none;
    width: 50px;
    height: 28px;
    background: var(--border);
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}
.slot-present-box::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.slot-present-box:checked {
    background: var(--primary-gradient);
}
.slot-present-box:checked::after {
    transform: translateX(22px);
}
.slot-present-box:active::after {
    width: 30px;
}
.slot-present-box:checked:active::after {
    transform: translateX(16px);
}

/* Buttons */
.action-bar { display: flex; justify-content: center; margin-top: 1.5rem; }
.btn { padding: 0.8rem 1.5rem; border-radius: 14px; font-weight: 700; font-family: inherit; border: none; cursor: pointer; font-size: 1.05rem; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.btn:active { transform: scale(0.94); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: white; box-shadow: 0 4px 12px rgba(16,185,129,0.25); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(16,185,129,0.35); transform: translateY(-2px); }
.btn-secondary { background: var(--surface); color: var(--text-main); border: 1px solid var(--border); box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.btn-secondary:hover { background: var(--bg); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; box-shadow: 0 4px 12px rgba(239,68,68,0.2); }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(239,68,68,0.3); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; border-radius: 10px; }
.btn-large { padding: 1.2rem 3rem; font-size: 1.15rem; }

/* Badges */
.badge { display: inline-block; padding: 0.3rem 0.8rem; font-size: 0.75rem; font-weight: 800; border-radius: 9999px; text-transform: uppercase; letter-spacing: 0.5px; vertical-align: middle; }
.badge-group { background: var(--primary); color: white; }
.badge-unassigned { background: var(--border); color: var(--text-muted); }
.badge-role { background: #3b82f6; color: white; }
.badge-admin { background: #8b5cf6; color: white; }

/* Admin Layout & Lists */
@media (min-width: 768px) {
    .admin-layout { flex-direction: row; }
    .admin-sidebar { width: 260px; flex-shrink: 0; padding-right: 2rem; border-right: 1px solid var(--glass-border); }
    .admin-content { flex-grow: 1; min-width: 0; }
    #admin-mobile-nav { display: none; }
    #admin-desktop-nav { display: flex; flex-direction: column; gap: 0.8rem; }
}
.admin-tab-btn { width: 100%; text-align: left; justify-content: flex-start; padding: 1rem; }

/* Analytics */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.stat-card { background: var(--surface); padding: 2rem; border-radius: 20px; border: 1px solid var(--border); text-align: center; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary); }
.stat-card h4 { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 2.5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.list-container { display: flex; flex-direction: column; gap: 1rem; }
.list-item { background: var(--surface); padding: 1.2rem; border-radius: 16px; border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; transition: all 0.3s; box-shadow: 0 2px 6px rgba(0,0,0,0.02); }
.list-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); border-color: var(--primary); }

/* Nav Greeting Animation */
@keyframes shimmeringText {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.nav-greeting-text {
    font-size: 1.35rem;
    font-weight: 800;
    margin-left: 57px;
    margin-top: -6px;
    background: linear-gradient(270deg, var(--primary), #3b82f6, #8b5cf6, var(--primary));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmeringText 8s ease infinite;
    letter-spacing: -0.5px;
}

/* Admin Roster Folders */
details.group-folder {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    transition: all 0.3s;
}
details.group-folder:hover {
    box-shadow: var(--shadow-soft);
    border-color: var(--primary);
}
details.group-folder[open] { padding-bottom: 0.5rem; }
summary.group-folder-summary {
    padding: 1.2rem;
    cursor: pointer;
    list-style: none; 
    display: flex;
    align-items: center;
    background: var(--surface);
    transition: background 0.3s;
    font-weight: 800;
    font-size: 1.1rem;
}
summary.group-folder-summary::-webkit-details-marker { display: none; }

/* Dashboard UI & Analogue Clock */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
@media (min-width: 768px) { .dashboard-grid { grid-template-columns: 1fr 1.5fr; } }

.dash-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 2.5rem;
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.dash-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.welcome-text { font-size: 2.4rem; color: var(--text-main); margin-bottom: 0.5rem; font-weight:800; letter-spacing: -1px; line-height: 1.1; }

.user-stats { display: flex; gap: 2rem; margin-top: 2rem; }
.stat-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 6px solid var(--border);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.03), 0 10px 20px rgba(0,0,0,0.06);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stat-bubble:hover { transform: scale(1.05); border-color: var(--primary); }
.stat-bubble .stat-number { font-size: 2.2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-bubble .stat-label { font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; text-align: center; margin-top: 6px; letter-spacing: 0.5px; }

/* Analogue Clock */
.clock-card { display: flex; align-items: center; justify-content: center; }
.analog-clock {
    width: 220px;
    height: 220px;
    background: var(--surface);
    border-radius: 50%;
    border: 10px solid var(--border);
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.05), var(--shadow-soft);
}
.clock-face { width: 100%; height: 100%; position: relative; }
.clock-face::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-image: radial-gradient(circle at center, transparent 65%, rgba(0,0,0,0.02) 66%);
}
.hand { position: absolute; bottom: 50%; left: 50%; transform-origin: bottom; border-radius: 6px; z-index: 10; }
.hour-hand { width: 8px; height: 25%; background: var(--text-main); margin-left: -4px; transition: transform 0.5s cubic-bezier(0.4, 2.08, 0.55, 0.44); }
.min-hand { width: 6px; height: 38%; background: var(--text-muted); margin-left: -3px; transition: transform 0.5s cubic-bezier(0.4, 2.08, 0.55, 0.44); }
.sec-hand { width: 3px; height: 45%; background: #ef4444; margin-left: -1.5px; z-index: 11; }
.clock-center { position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; background: var(--primary); border-radius: 50%; transform: translate(-50%, -50%); z-index: 12; box-shadow: 0 4px 8px rgba(0,0,0,0.15); }


/* --- PRINT EXACT LAYOUT --- */
@media print {
    /* Set margin to 0 to completely disable browser default headers & footers */
    @page { margin: 0 !important; size: letter portrait; }
    
    body, * { 
        background: #ffffff !important; 
        font-family: Arial, sans-serif !important; 
        color: #000000 !important;
        text-shadow: none !important;
        box-shadow: none !important;
        border-color: #000 !important;
        -webkit-print-color-adjust: exact !important; 
        print-color-adjust: exact !important; 
    }
    body {
        margin: 0 !important; 
        padding: 0.5cm !important; 
        box-sizing: border-box;
    }
    body::before, .aurora, .side-leaves { display: none !important; }
    
    .screen-only { display: none !important; height: 0 !important; overflow: hidden !important; margin: 0 !important; padding: 0 !important; }
    .print-only { display: block !important; visibility: visible !important; page-break-inside: avoid; }
    
    /* Normal Form Print Mechanism */
    body:not(.printing-analytics):not(.printing-reflections) header, 
    body:not(.printing-analytics):not(.printing-reflections) nav, 
    body:not(.printing-analytics):not(.printing-reflections) .view, 
    body:not(.printing-analytics):not(.printing-reflections) #app-container,
    body:not(.printing-analytics):not(.printing-reflections) .no-print { display: none !important; }
    
    body:not(.printing-analytics):not(.printing-reflections) #print-view { 
        display: block !important; width: 100% !important; visibility: visible !important; position: static !important;
    }

    /* Analytics Overriding Print Mechanism */
    body.printing-analytics { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; height: auto !important; overflow: visible !important; }
    body.printing-analytics #print-view, body.printing-analytics #print-reflections-view { display: none !important; }
    body.printing-analytics header, body.printing-analytics nav, body.printing-analytics .no-print { display: none !important; }
    body.printing-analytics #app-container { display: block !important; height: auto !important; overflow: visible !important; }
    body.printing-analytics .view { display: none !important; height: auto !important; overflow: visible !important; }
    body.printing-analytics #view-analytics { display: block !important; width: 100% !important; visibility: visible !important; margin: 0 !important; padding: 0 !important; }
    body.printing-analytics #analytics-charts-container { display: block !important; }
    
    /* Decouple Grids for Printing */
    body.printing-analytics .stats-grid { display: block !important; }
    body.printing-analytics .stat-card { border: 1px solid #ccc !important; box-shadow: none !important; page-break-inside: avoid; margin-bottom: 25px; display: block !important; width: 100% !important; padding: 20px !important; overflow: visible !important; height: auto !important; }
    
    /* Reveal details natively during print */
    body.printing-analytics details { display: block !important; border: none !important; }
    body.printing-analytics .print-hide { display: none !important; }
    body.printing-analytics .print-expand { max-height: none !important; overflow: visible !important; display: block !important; border: none !important; margin: 0 !important; padding: 0 !important; }
    body.printing-analytics details > summary::marker { color: transparent; content: ""; }
    
    body.printing-analytics .print-only { display: block !important; }

    /* Reflections Overriding Print Mechanism */
    body.printing-reflections #print-view, body.printing-reflections #app-container, body.printing-reflections .no-print { display: none !important; }
    body.printing-reflections #print-reflections-view { display: block !important; width: 100% !important; visibility: visible !important; }
    .reflection-page { page-break-after: always; position: relative; width: 100%; }
    .reflection-page img { display:block; width:100%; height:auto; }
    .reflection-name-overlay { position: absolute; font-family: Arial, sans-serif; font-size: 14pt; font-weight: bold; color: #000; background: transparent; border: none; }
    
    #print-view { width: 100%; margin: 0 auto; padding: 0; box-sizing: border-box; }
    .print-logo-container { margin-bottom: 5px; display: flex; }
    .print-header-box { border: 1px solid #000; padding: 10px; margin-bottom: 10px; }
    .print-title { font-size: 15px; font-weight: bold; text-align: center; margin-bottom: 10px; }
    .row { display: flex; align-items: center; margin-bottom: 10px; font-size: 14px; font-weight: bold; }
    .items-center { align-items: center; }
    .gap-4 { gap: 1rem; }
    .mt-2 { margin-top: 15px; }
    .label { font-weight: bold; white-space: nowrap; margin-right: 5px; }
    .underline { border-bottom: 1px solid #000; display: inline-block; min-height: 20px; text-align: center; padding-bottom: 2px; font-weight: normal; }
    .print-table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .print-table th, .print-table td { border: 1px solid #000; padding: 2px 4px; height: 22px; font-weight: bold; }
    .print-table th { text-align: center; }
}

/* --- CHIC SUCCESS ANIMATION --- */
#chic-success-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; }
#chic-success-overlay.show { opacity: 1; }
.chic-content { text-align: center; transform: scale(0.8); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
#chic-success-overlay.show .chic-content { transform: scale(1); }
.chic-check { width: 120px; height: 120px; display: block; margin: 0 auto; margin-bottom: 20px; }
.chic-check-circle { stroke-width: 3; stroke: var(--success); fill: transparent; stroke-dasharray: 166; stroke-dashoffset: 166; transition: stroke-dashoffset 0.8s cubic-bezier(0.65, 0, 0.45, 1) 0.1s forwards; }
.chic-check-path { transform-origin: 50% 50%; stroke: var(--success); stroke-width: 3; stroke-dasharray: 48; stroke-dashoffset: 48; transition: stroke-dashoffset 0.5s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards; }
#chic-success-overlay.show .chic-check-circle { stroke-dashoffset: 0; filter: drop-shadow(0 0 12px rgba(16,185,129,0.5)); }
#chic-success-overlay.show .chic-check-path { stroke-dashoffset: 0; filter: drop-shadow(0 0 8px rgba(16,185,129,0.5)); }
.chic-text { font-size: 2.8rem; font-weight: 800; color: var(--text-main); letter-spacing: -1px; opacity: 0; transform: translateY(20px); transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.8s forwards; margin:0; }
#chic-success-overlay.show .chic-text { opacity: 1; transform: translateY(0); text-shadow: 0 4px 10px rgba(0,0,0,0.1); }

/* --- STATIC DECORATIVE LEAVES --- */
.side-leaves {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: -2;
    background-color: var(--primary);
    opacity: 0.12;
    -webkit-mask-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg transform='rotate(25 50 50)'%3E%3Cpath d='M50,10 C80,30 85,70 50,95 C15,70 20,30 50,10 Z'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg transform='rotate(-35 50 50)'%3E%3Cpath d='M50,10 C80,30 85,70 50,95 C15,70 20,30 50,10 Z'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg transform='rotate(60 50 50)'%3E%3Cpath d='M50,10 C80,30 85,70 50,95 C15,70 20,30 50,10 Z'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg transform='rotate(-15 50 50)'%3E%3Cpath d='M50,10 C80,30 85,70 50,95 C15,70 20,30 50,10 Z'/%3E%3C/g%3E%3C/svg%3E");
    mask-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg transform='rotate(25 50 50)'%3E%3Cpath d='M50,10 C80,30 85,70 50,95 C15,70 20,30 50,10 Z'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg transform='rotate(-35 50 50)'%3E%3Cpath d='M50,10 C80,30 85,70 50,95 C15,70 20,30 50,10 Z'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg transform='rotate(60 50 50)'%3E%3Cpath d='M50,10 C80,30 85,70 50,95 C15,70 20,30 50,10 Z'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg transform='rotate(-15 50 50)'%3E%3Cpath d='M50,10 C80,30 85,70 50,95 C15,70 20,30 50,10 Z'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 
        calc(0% - 100px) 15%, 
        calc(100% + 150px) 30%, 
        calc(0% - 80px) 80%,
        calc(100% + 100px) 70%;
    mask-position: 
        calc(0% - 100px) 15%, 
        calc(100% + 150px) 30%, 
        calc(0% - 80px) 80%,
        calc(100% + 100px) 70%;
    -webkit-mask-size: 
        300px 300px,
        450px 450px,
        250px 250px,
        350px 350px;
    mask-size: 
        300px 300px,
        450px 450px,
        250px 250px,
        350px 350px;
    transition: background-color 0.4s ease;
}

@media print {
    .side-leaves { display: none !important; }
}

/* --- MAGNETIC HOVER & MICRO-INTERACTIONS --- */
.dash-card, .glass-card, .stat-box {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
}
.dash-card:hover, .glass-card:hover, .stat-box:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.btn-primary:active, .nav-btn:active, .login-btn:active {
    transform: scale(0.96);
}

/* --- ANIMATED AURORA ORBS --- */
.aurora {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
    z-index: -3;
    pointer-events: none;
    animation: breathe 15s infinite alternate ease-in-out;
}
.aurora.orb-1 {
    width: 60vw;
    height: 60vw;
    background: var(--primary);
    top: -10vw;
    left: -20vw;
    animation-delay: 0s;
}
.aurora.orb-2 {
    width: 50vw;
    height: 50vw;
    background: var(--success);
    bottom: -10vw;
    right: -15vw;
    animation-delay: -5s;
}

@keyframes breathe {
    0% { transform: scale(0.8) translate(0, 0); opacity: 0.08; }
    50% { transform: scale(1.1) translate(5%, 5%); opacity: 0.15; }
    100% { transform: scale(0.9) translate(-5%, -2%); opacity: 0.10; }
}

/* --- BREATHING SYSTEM LIVE DOT --- */
.live-dot {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    position: absolute;
    top: 5px;
    right: -15px;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* --- SKELETON SHIMMER SIMULATION --- */
.skeleton-shimmer {
    position: relative;
    overflow: hidden;
    pointer-events: none;
}
.skeleton-shimmer * {
    opacity: 0.1 !important;
}
.skeleton-shimmer::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 1s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* --- GLOBAL SIDEBAR OVERHAUL --- */
.app-header {
    padding: 0.8rem 1.5rem !important;
}
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.global-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 300px;
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 1100;
    box-shadow: var(--shadow-hover);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#left-sidebar {
    left: 0;
    transform: translateX(-100%);
    border-right: 1px solid var(--border);
}
#left-sidebar.open { transform: translateX(0); }

#right-sidebar {
    right: 0;
    transform: translateX(100%);
    border-left: 1px solid var(--border);
}
#right-sidebar.open { transform: translateX(0); }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-close {
    background: var(--bg);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.sidebar-close:hover { background: #fee2e2; color: #ef4444; transform: rotate(90deg); }

.sidebar-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    margin-top: 1.5rem;
    letter-spacing: 1px;
}
.sidebar-nav-btn {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    margin-bottom: 0.4rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidebar-nav-btn:hover { background: var(--bg); color: var(--primary); transform: translateX(4px); }
.sidebar-nav-btn.active { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(16,185,129,0.3); transform: none; }

/* Hamburger Icon styling */
.header-icon-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s;
}
.header-icon-btn:hover {
    background: var(--bg);
}

@media (max-width: 768px) {
    .global-sidebar { width: 85%; }
    .chic-floating-bar { 
        width: 95%; max-width: 100%; border-radius: 20px; 
        padding: 0.8rem 1rem; flex-wrap: wrap; justify-content: center;
        bottom: clamp(1rem, calc(env(safe-area-inset-bottom) + 1rem), 3rem);
    }
}

/* --- CHIC FLOATING ACTION BAR & TOASTS --- */
.chic-floating-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15), inset 0 2px 5px rgba(255,255,255,0.3);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 30px);
}
.chic-floating-bar.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}
.chic-counter {
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}
.chic-toast {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translate(-50%, -20px);
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
}
.chic-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
/* --- Dashboard Weather & Sync UI --- */
.weather-sync-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.weather-sky-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    background: linear-gradient(135deg, #38bdf8, #3b82f6);
    color: white;
    transition: background 0.5s ease;
}
.weather-sky-box.night-mode {
    background: linear-gradient(135deg, #1e293b, #0f172a);
}
.sky-icon {
    font-size: 2.5rem;
    animation: float-icon 3s ease-in-out infinite;
}
@keyframes float-icon {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px) rotate(5deg); }
    100% { transform: translateY(0px); }
}
.weather-temp {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}
.weather-desc {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: capitalize;
}
.network-status-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg);
    border-radius: 6px;
    justify-content: center;
}
.ping-pulse {
    animation: pulse-dot 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px currentColor; }
    50% { opacity: .6; transform: scale(1.3); box-shadow: 0 0 15px currentColor; }
}
}

/* --- Holographic Alerts --- */
.neon-pulse-alert {
    background: rgba(255, 237, 213, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(249, 115, 22, 0.4) !important;
    border-left: 4px solid #f97316 !important;
    animation: neon-breathe 3s ease-in-out infinite;
}

@keyframes neon-breathe {
    0%, 100% { box-shadow: 0 0 5px rgba(249, 115, 22, 0.1), inset 0 0 0px rgba(249, 115, 22, 0.0); border-color: rgba(249,115,22,0.3); }
    50% { box-shadow: 0 0 15px rgba(249, 115, 22, 0.4), inset 0 0 10px rgba(249, 115, 22, 0.1); border-color: rgba(249,115,22,0.8); }
}

.mini-ticker {
    max-height: 50px;
    overflow-y: hidden;
    padding-right: 5px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #9a3412;
    border-left: 2px solid #fdba74;
    padding-left: 8px;
}
.mini-ticker-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: scroll-ticker 10s linear infinite;
}
.mini-ticker-inner:hover {
    animation-play-state: paused;
}
@keyframes scroll-ticker {
    0% { transform: translateY(0); }
    100% { transform: translateY(calc(-100% + 50px)); }
}

/* --- ANTI-SCREENSHOT OBUSCATION FRAMEWORK --- */
body.hipaa-obfuscation-active::after {
    content: "HIPAA PRIVACY LOCK: TERMINAL OUT OF FOCUS";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 99999999;
    color: #ef4444;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    padding: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#identity-watermark {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999998;
    display: none;
    opacity: 0.05;
}
