:root {
    --primary: #e6007e;
    --primary-glow: rgba(230, 0, 126, 0.4);
    --secondary: #00aeef;
    --background: #f4f7f6;
    --surface: #ffffff;
    --surface-light: #e9ecef;
    --text: #212529;
    --text-muted: #6c757d;
    --glass-border: rgba(0, 0, 0, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { 
    font-family: 'Outfit', sans-serif; 
    background-color: var(--background); 
    color: var(--text); 
    min-height: 100vh;
    touch-action: manipulation;
}

.container { display: flex; min-height: 100vh; }

/* SIDEBAR */
aside {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

main { flex: 1; padding: 2rem; display: flex; flex-direction: column; }

.glass-panel { background: var(--surface); border: 1px solid var(--glass-border); border-radius: 20px; padding: 1rem; }

.btn { 
    display: inline-flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1.2rem; 
    border-radius: 15px; font-weight: 800; text-transform: uppercase; 
    cursor: pointer; transition: 0.2s; border: none; font-size: 0.75rem;
}
.btn:active { transform: scale(0.96); opacity: 0.8; }

.btn-primary { background: var(--primary); color: #ffffff; box-shadow: 0 0 15px var(--primary-glow); }

input { 
    width: 100%; background: #ffffff; border: 2px solid var(--glass-border); 
    padding: 0.8rem; border-radius: 15px; color: var(--text); outline: none; font-size: 1rem;
}

/* --- PREMIUM MOBILE & SPEED OPTIMIZATION --- */
@media (max-width: 1024px) {
    .container { flex-direction: column; }
    aside { 
        width: 100%; padding: 1rem; border-right: none; border-bottom: 1px solid var(--glass-border);
        position: sticky; top: 0; z-index: 999; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px);
    }
    aside .logo-wrap { justify-content: center; margin-bottom: 1rem; }
    aside .summary-section, aside nav { 
        display: flex !important; flex-direction: row !important; overflow-x: auto; gap: 10px; padding-bottom: 5px;
    }
    aside .summary-section > div, aside .summary-section > button, aside .nav-link { 
        flex: 0 0 auto !important; padding: 0.8rem 1rem !important; white-space: nowrap;
    }
    aside #digital-clock, aside .logout-btn { display: none; }
    main { padding: 1rem; }
    
    .stats-grid { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr !important; }
    .table-container { overflow-x: auto; border-radius: 12px; }
    table { min-width: 600px; } /* Force horizontal scroll for data integrity */
    
    .glass-form [style*="display: grid"], 
    .glass-panel [style*="display: grid"] {
        grid-template-columns: 1fr !important;
    }
    
    .btn { width: 100%; justify-content: center; padding: 1rem; }
}

/* TOUCH OPTIMIZATION */
.btn, .nav-link, input, select {
    min-height: 48px; /* Apple/Android standard */
    cursor: pointer;
}

/* HARDWARE ACCELERATION FOR SPEED */
.view-section, .glass-panel, .card {
    will-change: transform, opacity;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* CUSTOM SCROLLBAR FOR PREMIUM FEEL */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(230, 0, 126, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* STATUS INDICATOR GLOW */
.sync-glow {
    position: relative;
}
.sync-glow::after {
    content: '';
    position: absolute;
    top: 50%; right: -15px;
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 10px var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translateY(-50%) scale(0.9); opacity: 0.7; }
    50% { transform: translateY(-50%) scale(1.2); opacity: 1; }
    100% { transform: translateY(-50%) scale(0.9); opacity: 0.7; }
}
