:root {
    /* Color Palette */
    --primary: #4A148C;
    --primary-light: #7B1FA2;
    --primary-ultra-light: #F3E5F5;
    --secondary: #FFD700;
    --divine-purple: #4B0082;
    --gilded-gold: #C5A059;
    --dark: #1A1A1A;
    --light: #F8F9FA;
    --white: #FFFFFF;
    --success: #2E7D32;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Layout Constants */
    --sidebar-width: 260px;
    --top-nav-height: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background-color: #f4f7fe;
    color: var(--dark);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Purple Top Header (Main-Header) --- */
.main-header {
    background: var(--divine-purple);
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1001;
}

.logo-area { display: flex; align-items: center; gap: 15px; }
.logo-img { height: 45px; border-radius: 50%; border: 2px solid var(--gilded-gold); background: white; }
.header-title h1 { font-size: 1.2rem; margin: 0; letter-spacing: 1px; font-weight: 700; }
.header-title small { font-size: 0.7rem; color: var(--gilded-gold); display: block; }

.user-meta { display: flex; align-items: center; gap: 20px; }
.user-info { text-align: right; border-right: 1px solid rgba(255,255,255,0.2); padding-right: 15px; }
.user-name { display: block; font-size: 0.9rem; font-weight: 600; }
.logout-btn { 
    color: var(--white); background: rgba(255,255,255,0.1); 
    width: 35px; height: 35px; display: flex; align-items: center; 
    justify-content: center; border-radius: 8px; transition: 0.3s;
}
.logout-btn:hover { background: #d32f2f; }

/* --- Layout Wrapper & Viewport --- */
.portal-wrapper { display: flex; min-height: 100vh; position: relative; }

.main-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: var(--transition);
}

.top-navbar {
    height: var(--top-nav-height);
    background: white;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 70px; /* Sits below main-header */
    z-index: 99;
}

.content-padding { padding: 25px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* --- Sidebar Logic --- */
#sidebar-container { 
    width: var(--sidebar-width); 
    background: var(--white);
    transition: var(--transition); 
    z-index: 1000; 
}

/* --- Components: Cards, Tables, Stats --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card {
    background: white; padding: 20px; border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); border-bottom: 4px solid var(--primary);
}

.adm-reg-container { background: var(--white); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.adm-reg-section { padding: 30px; }

#customers { width: 100%; border-collapse: collapse; }
#customers th { background: #f8f9fa; color: var(--primary); padding: 15px; text-align: left; font-size: 0.8rem; }
#customers td { padding: 15px; border-bottom: 1px solid #eee; }

/* --- GLOBAL MOBILE SHIELD --- */
@media (max-width: 768px) {
    .user-info { display: none; }
    
    #sidebar-container {
        position: fixed; left: -260px; top: 0; height: 100vh;
        box-shadow: 10px 0 30px rgba(0,0,0,0.2);
    }
    #sidebar-container.open { left: 0; }

    .sidebar-overlay {
        display: none; position: fixed; inset: 0;
        background: rgba(0,0,0,0.6); z-index: 999; backdrop-filter: blur(2px);
    }
    .sidebar-overlay.active { display: block; }

    .portal-wrapper { display: block; }
    .main-viewport { width: 100% !important; }
    .content-padding { padding: 15px; }
    
    .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* In assets/style.css */
.mobile-toggle {
    display: none; /* Hidden on desktop */
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--gilded-gold);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    margin-right: 10px;
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block; /* Shows up only on mobile screens */
    }
}