 /* --- Global Reset & Variables --- */
    :root {
      --primary: #2563eb;
      --primary-hover: #1d4ed8;
      --bg-main: #f3f4f6;
      --bg-drawer: #0f172a;
      --text-main: #1e293b;
      --text-muted: #64748b;
      --surface: #ffffff;
      --border: #e2e8f0;
      --danger: #ef4444;
      --success: #22c55e;
      --transition-speed: 0.3s;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg-main); color: var(--text-main); overflow: hidden; height: 100vh; width: 100vw; }

    /* --- Loading / Splash --- */
    #splash-screen {
      position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
      background: var(--bg-drawer); color: white;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      z-index: 9999; transition: opacity 0.5s ease, visibility 0.5s ease;
    }
    
    .spinner { width: 50px; height: 50px; border: 4px solid rgba(255,255,255,0.1); border-left-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 1rem; }
    @keyframes spin { to { transform: rotate(360deg); } }
    .logo-brand { font-size: 2.5rem; font-weight: bold; letter-spacing: 2px; margin-bottom: 2rem; color: #f8fafc; }
    .logo-brand span { color: var(--primary); }

    /* --- View Management --- */
    .view-container { display: none; flex-direction: column; height: 100vh; width: 100vw; }
    .view-active { display: flex; animation: fadeIn 0.4s ease; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

    /* --- Login View --- */
    .login-view { align-items: center; justify-content: center; background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%); }
    .login-card { background: var(--surface); padding: 2.5rem; border-radius: 12px; width: 100%; max-width: 420px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); border-top: 4px solid var(--primary); }
    .login-header { margin-bottom: 2rem; text-align: center; }
    .login-header i { font-size: 3rem; color: var(--primary); margin-bottom: 0.5rem; }
    .input-group { position: relative; margin-bottom: 1.2rem; display: flex; align-items: center; }
    .input-group i { position: absolute; left: 1rem; color: var(--text-muted); }
    .input-group input { width: 100%; padding: 0.75rem 1rem 0.75rem 2.8rem; border-radius: 6px; border: 1px solid var(--border); font-size: 1rem; }
    .input-group input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
    
    .btn-primary { width: 100%; padding: 0.8rem; background: var(--primary); color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 1.05rem; transition: 0.2s; }
    .btn-primary:hover { background: var(--primary-hover); }

    /* --- Dashboard & Header --- */
    .dashboard-view { background: var(--bg-main); overflow-y: auto; }
    .dashboard-header { background: var(--surface); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.03); border-bottom: 1px solid var(--border); }
    .brand-name { font-size: 1.5rem; font-weight: bold; color: var(--text-main); }
    .brand-name span { color: var(--primary); }
    .user-profile { display: flex; align-items: center; gap: 1rem; }
    .user-email { color: var(--text-muted); font-size: 0.9rem; font-weight: 600; }
    
    .btn-icon { background: none; border: none; font-size: 1.2rem; color: var(--text-muted); cursor: pointer; transition: 0.2s; padding: 0.5rem; border-radius: 6px; }
    .btn-icon:hover { color: var(--primary); background: rgba(37,99,235,0.1); }
    
    .btn-danger { padding: 0.5rem 1rem; background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 6px; cursor: pointer; font-weight: 600; }
    .btn-danger:hover { background: var(--danger); color: white; }

    /* --- App Center Grid --- */
    /* --- App Center Grid --- */
    .main-content { flex: 1; padding: 2.5rem; max-width: 1200px; margin: 0 auto; width: 100%; }
    .section-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 2rem; }
    
    /* Flexbox layout for an app launcher look */
    .app-grid { display: flex; flex-wrap: wrap; gap: 2.5rem; }
    
    /* Entire card is the clickable app */
    .app-card { 
      display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
      text-decoration: none; color: inherit; width: 120px; transition: transform 0.2s; 
    }
    .app-card:hover { transform: translateY(-5px); }
    
    /* The Icon Box */
    .app-icon-wrapper {
      background: var(--surface); width: 85px; height: 85px; border-radius: 20px;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 4px 10px rgba(0,0,0,0.05); border: 1px solid var(--border);
      margin-bottom: 0.8rem; transition: all 0.3s ease;
    }
    .app-icon { font-size: 2.5rem; color: var(--primary); transition: 0.3s; margin: 0; }
    
    /* Hover effects for the Icon Box */
    .app-card:hover .app-icon-wrapper { 
      background: var(--primary); 
      box-shadow: 0 12px 20px -5px rgba(37,99,235,0.4); 
      border-color: var(--primary); 
    }
    .app-card:hover .app-icon { color: white; }
    
    /* App Name */
    .app-name { font-weight: 700; font-size: 0.9rem; text-align: center; color: var(--text-main); line-height: 1.2; }
    
    /* --- Modals (Admin & Settings) --- */
    .modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 10000; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(4px); }
    .modal-active { opacity: 1; visibility: visible; }
    
    .modal-content { background: var(--surface); padding: 2rem; border-radius: 12px; width: 100%; max-width: 450px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); transform: translateY(20px); transition: 0.3s; }
    .modal-active .modal-content { transform: translateY(0); }
    
    /* Dark Theme specifically for Admin Modal */
    .admin-modal-content { background: var(--bg-drawer); color: #f8fafc; max-width: 650px; border: 1px solid rgba(255,255,255,0.1); }
    .admin-modal-content .modal-header { border-bottom: 1px solid rgba(255,255,255,0.1); }
    .admin-modal-content h3 { color: white; }
    .admin-modal-content p { color: #94a3b8; }
    
    /* Dropdown Styling */
    .admin-modal-content select { width: 100%; padding: 0.8rem 1rem 0.8rem 2.8rem; border-radius: 6px; font-size: 1rem; background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); appearance: none; cursor: pointer; }
    .admin-modal-content select:focus { outline: none; border-color: var(--primary); }
    .admin-modal-content select option { background: var(--bg-drawer); color: white; }
    .admin-modal-content .input-group i { color: #94a3b8; }
    
    .admin-modal-content label { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; color: #cbd5e1; cursor: pointer; }
    .admin-modal-content .modal-close { color: #94a3b8; }
    .admin-modal-content .modal-close:hover { color: white; }

    .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
    .modal-header h3 { font-size: 1.2rem; font-weight: bold; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
    .modal-close { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }
    .modal-close:hover { color: var(--danger); }

    .btn-success { background: var(--success); color: white; font-weight: bold; padding: 0.7rem 1.5rem; border-radius: 6px; border: none; cursor: pointer; margin-top: 1rem; transition: 0.2s; }
    .btn-success:hover { background: #16a34a; }

    .msg-text { margin-top: 1rem; font-weight: bold; font-size: 0.9rem; }
    .error-msg { color: var(--danger); font-weight: bold; font-size: 0.9rem; margin-top: 1rem; text-align: center; display: none; }
    .hidden-state { display: none !important; }