/* ==========================================================================
   1. DESIGN SYSTEM & CSS VARIABLES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* HSL Colors tailored for premium cybernetic aesthetics */
    --bg: #030712;
    --bg-dark: #010307;
    
    /* Frosted glass cards */
    --card: rgba(13, 20, 38, 0.45);
    --card-hover: rgba(13, 20, 38, 0.65);
    
    /* Thin crisp borders */
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    
    /* Neon Accents */
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    
    /* Semantic Fills */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning: #fbbf24;
    --warning-glow: rgba(251, 191, 36, 0.15);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    
    /* Typography */
    --text: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Layout Constants */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 16px;
    --glass: blur(20px);
    --bottom-nav-height: 60px;
    
    /* Shadows & Glows */
    --shadow-sm: 0 4px 12px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px 0 rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px 0 rgba(99, 102, 241, 0.18);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 40%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.08) 0px, transparent 40%),
        radial-gradient(circle at 50% 30%, #0d1222 0%, #030712 100%);
    background-attachment: fixed;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: -1;
}

h1, h2, h3, h4, h5, h6, .page-title, .logo, .auth-title, .section-title {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    letter-spacing: -0.3px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.35); }

/* Global Utilities */
.glass {
    background: var(--card);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.text-accent { color: #818cf8; text-shadow: 0 0 10px rgba(129, 140, 248, 0.2); }
.text-danger { color: #f43f5e; }
.text-success { color: #34d399; }
.text-muted { color: var(--text-muted); }

/* ==========================================================================
   2. CORE APPLICATION LAYOUT (Sidebar, Topbar, Bottom Nav)
   ========================================================================== */

/* Utility: card description text */
.card-description {
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.55;
    margin-bottom: 16px;
    margin-top: 6px;
}

/* Utility: icon-only button in topbar */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 18px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    color: var(--text);
}

/* Utility: back button (mobile messages) */
.back-button {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}
.back-button:hover { background: rgba(255,255,255,0.05); }
@media (max-width: 768px) { .back-button { display: flex; align-items: center; } }


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

.sidebar {
    width: var(--sidebar-width);
    background: rgba(3, 7, 18, 0.82);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 19px;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.25));
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-group {
    margin-bottom: 24px;
}

.nav-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
    padding: 0 16px;
    margin-bottom: 8px;
    font-weight: 700;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    margin: 4px 8px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.12) 0%, rgba(59, 130, 246, 0.04) 100%);
    color: #a5b4fc;
    font-weight: 600;
    border-left: 3px solid #6366f1;
    box-shadow: inset 4px 0 12px rgba(99, 102, 241, 0.05);
}

.nav-icon { 
    font-size: 16px; 
    width: 20px; 
    text-align: center; 
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: rgba(3, 7, 18, 0.3);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name { 
    font-size: 13px; 
    font-weight: 600; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.user-role { 
    font-size: 11px; 
    color: var(--text-muted); 
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: margin-left 0.3s ease;
}

.top-bar {
    height: var(--header-height);
    background: rgba(3, 7, 18, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.toggle-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
}

.mobile-logo {
    display: none;
    font-size: 18px;
    font-weight: 850;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-title { 
    font-size: 18px; 
    font-weight: 700; 
    color: #ffffff;
    position: relative;
}

.page-title::before {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 20px;
    height: 2.5px;
    background: #6366f1;
    border-radius: 2px;
}

/* Top bar action cluster */
.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-wrapper {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Global Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 12px;
}

.card-title { 
    font-size: 15px; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    color: #ffffff;
}

/* ==========================================================================
   3. FORM ELEMENTS & BUTTONS
   ========================================================================== */
.form-group { 
    margin-bottom: 22px; 
    position: relative; 
}
.form-label { 
    display: block; 
    font-size: 12px; 
    font-weight: 600; 
    margin-bottom: 8px; 
    color: var(--text-muted); 
    letter-spacing: 0.5px;
}
.form-input {
    width: 100%;
    background: rgba(3, 7, 18, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14.5px;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-input::placeholder {
    color: #4b5563;
}
.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background: rgba(3, 7, 18, 0.8);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.35);
}
.btn-primary:hover { 
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%); 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.55);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}

/* ==========================================================================
   4. COMPONENT OVERRIDES & VIEW-SPECIFIC STYLES
   ========================================================================== */

/* Dashboard columns */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Grid sub-columns */
.left-col, .right-col { display: flex; flex-direction: column; gap: 0; }

/* Generic loading state */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.stats-grid, .stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 1024px) {
    .stats-grid, .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .stats-grid, .stats-row { grid-template-columns: 1fr; }
}

.stat-card, .stat-box {
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    padding: 22px !important;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover, .stat-box:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}
.stat-value {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 26px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 50%, #3b82f6 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
.stat-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
}

#map, #historyMap {
    height: 400px;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    filter: invert(1) hue-rotate(190deg) brightness(0.88) contrast(1.18) !important;
    z-index: 1;
}

.status-list { display: flex; flex-direction: column; gap: 12px; }
.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 12px !important;
    margin-bottom: 0 !important;
    grid-template-columns: unset !important;
}
.status-row:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    transform: translateX(4px);
    transition: all 0.2s;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.green { background: var(--success); box-shadow: 0 0 10px var(--success); }
.dot.blue { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s infinite; }
.dot.red { background: var(--danger); box-shadow: 0 0 10px var(--danger); }

.activity-feed { display: flex; flex-direction: column; gap: 12px; }
.activity-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px !important;
    background: rgba(255,255,255,0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 12px !important;
    align-items: center;
    transition: all 0.2s;
}
.activity-item:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    transform: translateX(4px);
}
.act-icon { font-size: 20px; }
.act-content { flex: 1; }
.act-title { font-family: 'Plus Jakarta Sans', sans-serif !important; font-size: 14px; font-weight: 600; color: #ffffff !important; }
.act-sub { font-size: 12px; color: var(--text-muted) !important; margin-top: 2px; }
.act-time { font-size: 11px; color: var(--text-muted); }

/* 4.2 Actions view */
.actions-container { max-width: 1000px; margin: 0 auto; }
.section-title { font-size: 18px; font-weight: 750; color: var(--text); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 32px; }
.action-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.action-card:hover { transform: translateY(-4px); border-color: rgba(99, 102, 241, 0.25); box-shadow: var(--shadow-md), var(--shadow-glow); }
.action-card.disabled { opacity: 0.55; pointer-events: none; }
.action-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.action-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.action-title { font-size: 15px; font-weight: 700; color: var(--text); }
.action-badge { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; margin-left: 8px; }
.badge-active { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-coming-soon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.action-description { color: var(--text-muted); font-size: 13px; line-height: 1.5; margin-bottom: 16px; }
.action-btn { width: 100%; padding: 12px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-disabled { background: rgba(255,255,255,0.03); color: var(--text-muted); border: 1px solid var(--border); cursor: not-allowed; }

.history-section { margin-top: 32px; }
.history-table { width: 100%; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-md); }
.history-table table { width: 100%; border-collapse: collapse; }
.history-table th { background: rgba(3, 7, 18, 0.2); padding: 14px 18px; text-align: left; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.2px; }
.history-table td { padding: 16px 18px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text); }
.history-table tr:hover td { background: rgba(255,255,255,0.02); }

.status-pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-completed { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-failed { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Modals */
.modal-overlay, .modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(1, 2, 4, 0.75);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}
.modal-overlay.active, .modal-bg.show { display: flex; }
.modal-content, .modal-box {
    background: rgba(13, 20, 38, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 19px; font-weight: 750; color: var(--text); margin-bottom: 12px; }
.modal-text { color: var(--text-muted); font-size: 14.5px; line-height: 1.5; margin-bottom: 24px; }
.modal-actions, .modal-btns { display: flex; gap: 12px; }
.modal-btn { flex: 1; padding: 12px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-cancel { background: rgba(255,255,255,0.03); color: var(--text-muted); border: 1px solid var(--border); }
.btn-cancel:hover { background: rgba(255,255,255,0.06); }
.btn-confirm { background: var(--accent-gradient); color: white; }

/* Toasts */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 20, 38, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text);
    z-index: 2000;
    display: none;
    box-shadow: var(--shadow-md);
}
.toast.success { border-color: #10b981; color: #10b981; }
.toast.error { border-color: #ef4444; color: #ef4444; }
.toast.show { display: block; animation: fadeInOut 3s ease; }

/* 4.3 Call Logs & Filters */
.call-logs-container { max-width: 1200px; margin: 0 auto; }
.filters-section { margin-bottom: 24px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-btn {
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13.5px;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    transition: all 0.2s ease;
}
.filter-btn:hover { background: rgba(255,255,255,0.06); color: white; }
.filter-btn.active { background: var(--accent-gradient); color: white; border-color: transparent; box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25); }

.search-input {
    width: 100%;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(3, 7, 18, 0.4);
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s;
}
.search-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }

.call-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.call-item:hover { transform: translateY(-3px); border-color: var(--border-hover); box-shadow: var(--shadow-md), var(--shadow-glow); }

.call-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.04);
}
.call-icon.incoming { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.call-icon.outgoing { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.call-icon.missed { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.call-icon.rejected { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

.call-info { flex: 1; min-width: 0; }
.call-contact { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; color: var(--text); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-number { color: var(--text-muted); font-size: 13px; margin-top: 3px; }

.call-meta { text-align: right; flex-shrink: 0; }
.call-time { color: var(--text); font-size: 13.5px; font-weight: 600; }
.call-duration { color: var(--text-muted); font-size: 12px; margin-top: 3px; }

/* 4.4 Clipboard history */
.clipboard-container { max-width: 1000px; margin: 0 auto; }
.clip-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.clip-item:hover { transform: translateY(-4px); border-color: rgba(99, 102, 241, 0.2); box-shadow: var(--shadow-md), var(--shadow-glow); }
.clip-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.clip-type { display: inline-block; padding: 4px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.clip-type.text { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.clip-type.uri { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.clip-type.html { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.clip-time { font-size: 12px; color: var(--text-muted); }
.clip-text {
    background: rgba(3, 7, 18, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 14px;
    color: var(--text);
    line-height: 1.6;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 13.5px;
}
.clip-actions { margin-top: 14px; display: flex; gap: 8px; }
.clip-btn { padding: 8px 16px; border: none; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all 0.2s; font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif; }
.clip-btn.copy { background: var(--accent); color: white; }
.clip-btn.copy:hover { opacity: 0.9; }

/* Generic stats bar (used in clipboard, etc.) */
.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.stats-bar .stat-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 22px;
    text-align: center;
    min-width: 120px;
    flex: 1;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stats-bar .stat-item:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-2px);
}

/* 4.5 Device Health page */
.health-container { max-width: 1200px; margin: 0 auto; }
.current-status { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-md); }
.status-header { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.battery-ring { width: 120px; height: 120px; position: relative; }
.battery-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.2)); }
.battery-ring circle { fill: none; stroke-width: 8; }
.battery-ring .bg { stroke: rgba(255,255,255,0.04); }
.battery-ring .progress { stroke: #10b981; stroke-linecap: round; transition: stroke-dashoffset 0.5s; filter: drop-shadow(0 0 5px #10b981); }
.battery-ring .low { stroke: #ef4444 !important; filter: drop-shadow(0 0 5px #ef4444) !important; }
.battery-ring .medium { stroke: #f59e0b !important; filter: drop-shadow(0 0 5px #f59e0b) !important; }
.battery-percent { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 28px; font-weight: 800; color: var(--text); font-family: 'Plus Jakarta Sans', sans-serif; }
.status-details { flex: 1; }
.status-details .status-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.status-details .status-row:last-child { border-bottom: none; }
.status-details .status-label { color: var(--text-muted); }
.status-details .status-value { color: var(--text); font-weight: 600; }
.storage-section { margin-top: 24px; }
.storage-bar { height: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.02); border-radius: 8px; overflow: hidden; margin: 8px 0; }
.storage-fill { height: 100%; background: linear-gradient(90deg, #6366f1 0%, #3b82f6 100%); border-radius: 8px; transition: width 0.5s; box-shadow: 0 0 8px rgba(99, 102, 241, 0.5); }
.storage-info { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); }

.history-section .history-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 18px; }
.history-section .history-item { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.04); border-radius: 12px; margin-bottom: 8px; transition: all 0.2s ease; }
.history-section .history-item:hover { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); transform: translateX(4px); }
.history-battery { font-size: 16px; font-weight: 800; min-width: 50px; }
.history-details { flex: 1; font-size: 13px; color: var(--text-muted); }
.history-time { font-size: 12px; color: var(--text-muted); }
.charging { color: #10b981 !important; }
.discharging { color: #ef4444 !important; }

/* 4.6 History trips view */
.history-container { display: grid; grid-template-columns: 350px 1fr; gap: 24px; height: calc(100vh - 140px); }
@media (max-width: 1024px) { .history-container { grid-template-columns: 1fr; height: auto; display: block; } }

.trips-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; height: 100%; box-shadow: var(--shadow-md); }
@media (max-width: 1024px) { .trips-panel { height: 400px; margin-bottom: 24px; } }
.trips-header { padding: 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-family: 'Plus Jakarta Sans', sans-serif; display: flex; justify-content: space-between; align-items: center; }
.trips-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.trip-item { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); border-radius: 14px; padding: 16px; cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.trip-item:hover { background: rgba(255, 255, 255, 0.04); border-color: rgba(99, 102, 241, 0.2); }
.trip-item.active { background: rgba(99, 102, 241, 0.1); border-color: #6366f1; box-shadow: inset 4px 0 10px rgba(99, 102, 241, 0.05); }

.trip-item .trip-header { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 13px; }
.trip-date { font-weight: 700; color: var(--text); }
.trip-duration { color: var(--text-muted); }
.trip-route { display: flex; gap: 12px; margin-bottom: 12px; }
.trip-dots { display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.trip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px var(--success); }
.trip-dot.end { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.trip-line { width: 2px; flex: 1; background: var(--border); margin: 4px 0; }
.trip-places { flex: 1; display: flex; flex-direction: column; justify-content: space-between; font-size: 13px; gap: 8px; }
.trip-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); padding-top: 12px; border-top: 1px solid var(--border); }

.map-panel { height: 100%; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: relative; z-index: 1; }
@media (max-width: 1024px) { .map-panel { height: 400px; } }

/* 4.7 Installed Apps View */
.apps-container { max-width: 1200px; margin: 0 auto; }
.tabs { display: flex; gap: 10px; margin-bottom: 24px; overflow-x: auto; padding-bottom: 5px; }
.tab-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.tab-btn:hover { background: rgba(255, 255, 255, 0.06); color: white; }
.tab-btn.active { background: var(--accent-gradient); color: white; border-color: transparent; box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25); }

.filter-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.sort-select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(3, 7, 18, 0.4);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.sort-select:focus { outline: none; border-color: #6366f1; }

.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.app-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-item:hover { transform: translateY(-3px); border-color: rgba(99, 102, 241, 0.2); box-shadow: var(--shadow-md), var(--shadow-glow); }
.app-item.suspicious { border-color: #ef4444; background: rgba(239, 68, 68, 0.05); }

.app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px !important;
    background: rgba(3, 7, 18, 0.3) !important;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    overflow: hidden;
}
.app-info { flex: 1; min-width: 0; }
.app-name { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Plus Jakarta Sans', sans-serif; }
.app-package { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.app-version { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

.app-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700; margin-left: 6px; }
.app-badge.system { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.app-badge.user { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.counter-chips { display: flex; gap: 6px; margin-top: 8px; }
.counter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.counter-chip.installs { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.counter-chip.uninstalls { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.counter-chip.suspicious { background: rgba(239, 68, 68, 0.25); color: #fbbf24; animation: pulse 2s infinite; }

.usage-list { display: flex; flex-direction: column; gap: 10px; }
.usage-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}
.usage-item:hover { transform: translateY(-2px); border-color: rgba(99, 102, 241, 0.2); }
.usage-time { font-weight: 800; color: #a5b4fc; font-size: 18px; font-family: 'Plus Jakarta Sans', sans-serif; }
.usage-last { font-size: 11px; color: var(--text-muted); }

.changes-list { display: flex; flex-direction: column; gap: 10px; }
.change-item { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; gap: 12px; align-items: center; transition: all 0.2s ease; }
.change-item:hover { transform: translateY(-2px); border-color: rgba(99, 102, 241, 0.2); }
.change-item.suspicious { border-color: #f59e0b; background: rgba(245, 158, 11, 0.05); }
.change-icon { font-size: 26px; width: 40px; text-align: center; }
.change-type.install { color: #10b981; font-weight: 700; }
.change-type.uninstall { color: #ef4444; font-weight: 700; }

.last-sync { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }

.suspicious-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.suspicious-banner.hidden { display: none; }
.suspicious-banner-icon { font-size: 24px; }
.suspicious-banner-text { flex: 1; }
.suspicious-banner-title { font-weight: 700; color: #fbbf24; font-family: 'Plus Jakarta Sans', sans-serif; }
.suspicious-banner-desc { font-size: 13px; color: var(--text-muted); }

/* 4.8 Messages View */
.messages-container { display: flex; gap: 24px; height: calc(100vh - 140px); margin: -24px; padding: 24px; }
.threads-sidebar { width: 320px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-md); }
.threads-header { padding: 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: rgba(3, 7, 18, 0.2); }
.threads-title { font-weight: 700; font-size: 14.5px; font-family: 'Plus Jakarta Sans', sans-serif; }
.mark-all-read-btn { background: none; border: none; color: #818cf8; font-size: 12.5px; cursor: pointer; font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif; }
.mark-all-read-btn:disabled { opacity: 0.5; cursor: default; }

#threadsContainer { flex: 1; overflow-y: auto; }
.thread-item { padding: 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.03); cursor: pointer; transition: background 0.2s; }
.thread-item:hover { background: rgba(255, 255, 255, 0.02); }
.thread-item.active { background: rgba(99, 102, 241, 0.1); border-left: 3px solid #6366f1; }
.thread-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.thread-contact { font-weight: 700; font-size: 14px; color: var(--text); font-family: 'Plus Jakarta Sans', sans-serif; }
.thread-unread-badge {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.4) !important;
    color: white; font-size: 10px; padding: 2px 6px; border-radius: 8px; min-width: 18px; text-align: center; font-weight: 700;
}
.thread-preview { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.thread-time { font-size: 11px; color: var(--text-muted); opacity: 0.7; }

.messages-view { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-md); }
.messages-header { padding: 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; background: rgba(13, 20, 38, 0.8); backdrop-filter: blur(15px); }
.messages-list { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.message-bubble { max-width: 70%; padding: 12px 18px; border-radius: 16px; word-wrap: break-word; font-size: 14.5px; line-height: 1.5; box-shadow: var(--shadow-sm); }
.message-bubble.sent { align-self: flex-end; background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%); color: white; border-bottom-right-radius: 4px; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25); }
.message-bubble.received { align-self: flex-start; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.04); color: var(--text); border-bottom-left-radius: 4px; }
.message-time { font-size: 11px; opacity: 0.7; margin-top: 5px; text-align: right; }

/* 4.9 Notifications Panel */
.notifications-container { max-width: 1200px; margin: 0 auto; }
.filters-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 12px; font-family: 'Plus Jakarta Sans', sans-serif; }
.filter-count { margin-left: 6px; opacity: 0.8; font-size: 11px; font-weight: 700; }
.search-section { margin-bottom: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; box-shadow: var(--shadow-sm); }
.clear-all-btn { padding: 10px 20px; background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s; font-family: 'Plus Jakarta Sans', sans-serif; }
.clear-all-btn:hover { background: rgba(239, 68, 68, 0.22); }
.mark-read-btn { padding: 10px 20px; background: #10b981; color: white; border: none; border-radius: 10px; cursor: pointer; font-weight: 600; white-space: nowrap; display: none; font-family: 'Plus Jakarta Sans', sans-serif; transition: background 0.2s; }
.mark-read-btn:hover { background: #059669; }

.notifications-list { display: flex; flex-direction: column; gap: 12px; }
.notification-item { background: var(--card); border-radius: 14px; padding: 18px; border: 1px solid var(--border); transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.notification-item:hover { transform: translateY(-2px); border-color: rgba(99, 102, 241, 0.25); box-shadow: var(--shadow-md), var(--shadow-glow); }
.notification-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.notification-app { display: flex; align-items: center; gap: 8px; }
.app-icon-badge { width: 24px; height: 24px; border-radius: 6px; background: var(--accent); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 12px; }
.app-name-label { font-weight: 700; color: var(--text); font-size: 14px; font-family: 'Plus Jakarta Sans', sans-serif; }
.notification-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.notification-title { font-weight: 700; color: var(--text); margin-bottom: 4px; font-size: 15px; font-family: 'Plus Jakarta Sans', sans-serif; }
.notification-text { color: var(--text-muted); line-height: 1.5; font-size: 14.5px; }
.notification-sender { color: #818cf8; font-size: 13px; margin-top: 6px; font-weight: 600; }

/* 4.10 Passwords lists */
.passwords-container { max-width: 1200px; margin: 0 auto; }
.password-item { background: var(--card); border-radius: 14px; padding: 18px; margin-bottom: 12px; border-left: 4px solid var(--warning); border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: all 0.2s ease; }
.password-item:hover { transform: translateY(-2px); border-color: rgba(251, 191, 36, 0.25); box-shadow: var(--shadow-md); }
.pwd-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pwd-app { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-family: 'Plus Jakarta Sans', sans-serif; }
.pwd-time { font-size: 12px; color: var(--text-muted); }
.pwd-text { color: var(--text); font-family: monospace; font-size: 15px; background: rgba(3, 7, 18, 0.45); padding: 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.03); word-break: break-all; margin-bottom: 8px; }
.pwd-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.mode-tabs-pwd, .passwords-container .mode-tabs { display: flex; gap: 4px; background: rgba(255, 255, 255, 0.03); padding: 4px; border-radius: 12px; border: 1px solid var(--border); }
.mode-tab-pwd, .passwords-container .mode-tab { border: none; background: transparent; color: var(--text-muted); padding: 8px 18px; border-radius: 8px; cursor: pointer; font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif; transition: 0.2s; font-size: 13px; }
.mode-tab-pwd.active, .passwords-container .mode-tab.active { background: var(--accent-gradient); color: white; box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2); }

/* 4.11 Photos Gallery */
.photos-container { max-width: 1600px; margin: 0 auto; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.photo-item { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; position: relative; aspect-ratio: 1; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: var(--shadow-sm); }
.photo-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg), var(--shadow-glow); border-color: rgba(99, 102, 241, 0.35); }
.photo-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.photo-item:hover .photo-img { transform: scale(1.06); }
.photo-meta { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(3, 7, 18, 0.95), transparent); padding: 20px 12px 12px; font-size: 11px; color: white; display: flex; justify-content: space-between; align-items: flex-end; opacity: 0; transition: opacity 0.2s; font-family: 'Plus Jakarta Sans', sans-serif; }
.photo-item:hover .photo-meta { opacity: 1; }
.lightbox { position: fixed; inset: 0; background: rgba(3, 7, 18, 0.85); z-index: 1000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(25px); }
.lightbox.active { display: flex; animation: fadeIn 0.2s ease; }
.lightbox-content { max-width: 90%; max-height: 90vh; position: relative; }
.lightbox-img { max-width: 100%; max-height: 85vh; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: var(--shadow-lg), 0 0 50px rgba(0,0,0,0.8); }
.lightbox-close { position: absolute; top: 20px; right: 20px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); color: white; font-size: 24px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.lightbox-close:hover { background: rgba(255,255,255,0.1); }
.lightbox-info { position: absolute; bottom: -40px; left: 0; right: 0; text-align: center; color: var(--text-muted); font-size: 13.5px; }

/* 4.12 Settings panel */
.settings-container { max-width: 800px; margin: 0 auto; }
.code-block { background: rgba(3, 7, 18, 0.45); padding: 14px; border-radius: 10px; font-family: monospace; color: #a5b4fc; margin-bottom: 14px; word-break: break-all; font-size: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-block { width: 100%; display: block; text-align: center; margin-bottom: 10px; padding: 12px; }
.export-section { margin-bottom: 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.03); padding-bottom: 12px; }
.export-section:last-child { border: none; }
.export-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; font-family: 'Plus Jakarta Sans', sans-serif; }
.danger-zone { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 14px; padding: 18px; margin-top: 24px; }
.danger-title { color: #f43f5e; font-weight: 700; margin-bottom: 8px; font-family: 'Plus Jakarta Sans', sans-serif; }
.warning-box { background: rgba(251, 191, 36, 0.08); border-left: 4px solid #fbbf24; padding: 14px; border-radius: 10px; margin-bottom: 18px; }
.warning-title { color: #fbbf24; font-weight: 700; font-size: 14px; margin-bottom: 4px; font-family: 'Plus Jakarta Sans', sans-serif; }
.settings-container .status-item { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.settings-container .status-item:last-child { border-bottom: none; }
.settings-container .status-label { color: var(--text-muted); font-size: 14px; text-transform: none; display: inline; font-weight: 400; font-family: inherit; letter-spacing: normal; }
.settings-container .status-value { color: var(--text); font-weight: 500; font-size: 14px; }

/* 4.13 Client Status Page */
.status-container { max-width: 1000px; margin: 0 auto; }
.status-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.status-indicator { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; font-family: 'Plus Jakarta Sans', sans-serif; }
.status-dot-big { width: 16px; height: 16px; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
.status-dot-big.online { background: var(--success); box-shadow: 0 0 12px var(--success); }
.status-dot-big.offline { background: var(--danger); box-shadow: 0 0 12px var(--danger); animation: none; }
.refresh-btn { background: var(--accent-gradient); color: white; border: none; padding: 8px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.refresh-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
.status-item-card, .status-grid .status-item { background: rgba(255,255,255,0.02) !important; border: 1px solid var(--border) !important; border-radius: 14px !important; padding: 18px !important; }
.status-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; display: block; font-weight: 700; font-family: 'Plus Jakarta Sans', sans-serif; }
.status-value { font-size: 15.5px; font-weight: 600; color: var(--text); }
.battery { display: inline-flex; align-items: center; gap: 8px; }
.battery-bar { width: 40px; height: 16px; border: 2px solid var(--text); border-radius: 4px; position: relative; display: inline-block; }
.battery-bar::after { content: ''; position: absolute; right: -4px; top: 4px; width: 2px; height: 4px; background: var(--text); border-radius: 0 2px 2px 0; }
.battery-fill { height: 100%; background: var(--success); border-radius: 1px; transition: width 0.3s ease, background 0.3s ease; }
.battery-fill.warning { background: var(--warning); }
.battery-fill.danger { background: var(--danger); }
.troubleshoot-list { color: var(--text-muted); padding-left: 20px; margin-top: 14px; font-size: 14px; }
.troubleshoot-list li { margin-bottom: 10px; }

/* 4.14 Text Inputs View */
.text-inputs-container { max-width: 1200px; margin: 0 auto; }
.mode-tabs-ti, .text-inputs-container .mode-tabs { display: flex; gap: 0; margin-bottom: 24px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 4px; }
.mode-tab-ti, .text-inputs-container .mode-tab { flex: 1; padding: 12px 20px; border: none; background: transparent; color: var(--text-muted); font-size: 14px; font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif; cursor: pointer; border-radius: 10px; transition: all 0.2s; text-align: center; }
.mode-tab-ti:hover, .text-inputs-container .mode-tab:hover { background: rgba(255,255,255,0.03); color: var(--text); }
.mode-tab-ti.active, .text-inputs-container .mode-tab.active { background: var(--accent-gradient); color: white; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2); }
.mode-tab-ti .tab-count, .text-inputs-container .mode-tab .tab-count { display: inline-block; margin-left: 8px; padding: 2px 8px; background: rgba(255,255,255,0.15); border-radius: 10px; font-size: 11px; font-weight: 700; }
.smart-info { background: rgba(99, 102, 241, 0.08) !important; color: #a5b4fc !important; border: 1px solid rgba(99, 102, 241, 0.15) !important; border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; font-size: 13.5px; }
.raw-info { background: rgba(251, 191, 36, 0.08) !important; color: #fcd34d !important; border: 1px solid rgba(251, 191, 36, 0.15) !important; border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; font-size: 13.5px; }
.text-input-item { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 14px; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.text-input-item:hover { transform: translateY(-3px); border-color: rgba(99, 102, 241, 0.25); box-shadow: var(--shadow-md), var(--shadow-glow); }
.input-header { border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important; padding-bottom: 10px !important; margin-bottom: 12px !important; }
.input-app { font-family: 'Plus Jakarta Sans', sans-serif !important; font-weight: 700 !important; color: #ffffff !important; display: flex; align-items: center; gap: 8px; }
.input-time { font-size: 12px; color: var(--text-muted); }
.input-text { font-size: 15px; line-height: 1.6; white-space: pre-wrap; margin-bottom: 12px; padding: 14px; background: rgba(3, 7, 18, 0.45); border: 1px solid rgba(255,255,255,0.03); border-radius: 10px; font-family: monospace; color: var(--text); }
.metadata-tag { font-size: 11px; padding: 4px 10px; background: rgba(255, 255, 255, 0.03) !important; border: 1px solid rgba(255, 255, 255, 0.05) !important; border-radius: 6px; color: var(--text-muted); }

/* 4.15 WiFi details */
.wifi-container { max-width: 1000px; margin: 0 auto; }
.current-wifi { background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%) !important; border: 1px solid rgba(255, 255, 255, 0.15) !important; border-radius: 20px; padding: 24px; margin-bottom: 24px; color: white; box-shadow: 0 12px 30px rgba(79, 70, 229, 0.3) !important; }
.current-wifi.disconnected { background: var(--card) !important; color: var(--text) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow-md) !important; }
.current-wifi.disconnected .wifi-icon { background: rgba(255, 255, 255, 0.02) !important; border: 1px solid rgba(255,255,255,0.04); }
.current-wifi.disconnected .wifi-detail { background: rgba(255, 255, 255, 0.02) !important; border: 1px solid rgba(255,255,255,0.04); }
.current-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.wifi-icon { font-size: 32px; background: rgba(255, 255, 255, 0.12) !important; backdrop-filter: blur(5px) !important; border: 1px solid rgba(255, 255, 255, 0.15) !important; width: 76px !important; height: 76px !important; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.current-ssid { font-family: 'Plus Jakarta Sans', sans-serif !important; font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.current-status { font-size: 15px; opacity: 0.9; display: flex; align-items: center; gap: 6px; }
.wifi-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.wifi-detail { background: rgba(255, 255, 255, 0.08) !important; border: 1px solid rgba(255, 255, 255, 0.06) !important; border-radius: 12px; padding: 14px 16px; backdrop-filter: blur(5px); }
.detail-label { font-size: 11px; opacity: 0.8; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.detail-value { font-family: 'Plus Jakarta Sans', sans-serif !important; font-size: 18px; font-weight: 700; }
.wifi-container .history-section { background: var(--card) !important; border: 1px solid var(--border) !important; border-radius: 20px !important; padding: 24px; }
.wifi-container .history-item { background: rgba(255, 255, 255, 0.02) !important; border: 1px solid rgba(255, 255, 255, 0.04) !important; border-radius: 12px; padding: 16px; margin-bottom: 10px !important; display: flex; align-items: center; gap: 16px; border: 1px solid var(--border); transition: all 0.2s ease; }
.wifi-container .history-item:hover { background: rgba(255, 255, 255, 0.04) !important; border-color: rgba(255, 255, 255, 0.08) !important; transform: translateX(4px); }
.wifi-container .history-icon { font-size: 20px; width: 40px; height: 40px; background: rgba(255, 255, 255, 0.03) !important; border: 1px solid rgba(255, 255, 255, 0.04) !important; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.history-info { flex: 1; }
.history-ssid { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; color: var(--text); font-size: 15px; }
.history-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.history-time { font-size: 12px; color: var(--text-muted); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-icon { font-size: 44px; margin-bottom: 16px; opacity: 0.5; }

/* Loading and error states */
.loading-msg {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
    animation: pulse 1.8s ease-in-out infinite;
}
.error-msg {
    text-align: center;
    padding: 20px;
    color: #fca5a5;
    font-size: 14px;
}



/* Bottom Navigation (Mobile Only, Hidden on Desktop) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 8px;
}

.bottom-nav .nav-item:hover, .bottom-nav .nav-item.active {
    color: #a5b4fc;
}

.bottom-nav .nav-item .nav-icon {
    font-size: 20px;
    transition: transform 0.2s;
}

.bottom-nav .nav-item.active .nav-icon {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.5));
}

/* Mobile Menu Overlay (Hidden on Desktop) */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(1, 3, 6, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: flex-end;
}

.mobile-menu-overlay.active {
    display: flex !important;
    opacity: 1;
}

.mobile-menu-content {
    width: 100%;
    background: rgba(13, 20, 38, 0.95);
    border-top: 1px solid var(--border);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom)) 20px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateY(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mobile-menu-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.close-menu {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item:hover, .menu-item:active {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    color: var(--text);
}

.menu-item .icon {
    font-size: 20px;
}


/* ==========================================================================
   5. RESPONSIVE MEDIA OVERRIDES
   ========================================================================== */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; padding-bottom: calc(var(--bottom-nav-height) + 20px); }
    .toggle-sidebar { display: block; }
    .mobile-logo { display: block; }
    .page-title { display: none; }
    .bottom-nav { display: flex; }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.65);
        z-index: 45;
        display: none;
        backdrop-filter: blur(4px);
    }
    .sidebar-overlay.active { display: block; }
}

@media (max-width: 768px) {
    .content-wrapper { padding: 20px 16px; }
    .top-bar { padding: 0 20px; }
    
    /* Responsive message layout */
    .messages-view-container { margin: -16px; height: calc(100vh - 120px); }
    .threads-sidebar-panel { width: 100%; border-radius: 0; border: none; }
    .messages-view-panel { display: none; width: 100%; border-radius: 0; border: none; }
    .messages-view-panel.active { display: flex; position: absolute; inset: 0; z-index: 10; margin-top: var(--header-height); height: calc(100% - var(--bottom-nav-height) - var(--header-height)); }
    .threads-sidebar-panel.hidden { display: none; }
    /* .back-button handled globally with media query */

    /* Call logs list responsive */
    .call-item { flex-wrap: wrap; }
    .call-meta { width: 100%; text-align: left; margin-top: 8px; display: flex; justify-content: space-between; }
    
    /* Notifications mobile filter button bar */
    .filters-section { margin: 0 -12px 20px -12px; border-radius: 0; }
    .filter-buttons { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
    .filter-btn { flex-shrink: 0; }
}

/* ==========================================================================
   6. AUTHENTICATION PAGES (Login / Register)
   ========================================================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    z-index: 0;
    pointer-events: none;
}

.auth-container::after {
    content: "";
    position: absolute;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
    bottom: -15%;
    right: -10%;
    z-index: 0;
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 32px;
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    z-index: 10;
    position: relative;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    font-size: 36px;
    margin-bottom: 12px;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(99,102,241,0.4));
    animation: float 3s ease-in-out infinite;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ffffff 50%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle, .auth-sub {
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-link {
    color: #818cf8;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #a5b4fc;
}

.auth-card .form-group {
    margin-bottom: 20px;
}

.auth-card .btn-primary {
    width: 100%;
    margin-top: 10px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.2);
}


@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50% { transform: scale(1.1); opacity: 0.85; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(8px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

