/* Design Tokens & Theme Setup */
:root {
    --bg-base: #0B0A11;
    --bg-surface: #12111A;
    --bg-card: rgba(26, 24, 38, 0.65);
    
    --primary: #8B5CF6;
    --primary-hover: #7C3AED;
    --primary-glow: rgba(139, 92, 246, 0.3);
    
    --success: #10B981;
    --success-hover: #059669;
    --success-glow: rgba(16, 185, 129, 0.2);
    
    --warning: #F59E0B;
    --warning-glow: rgba(245, 158, 11, 0.2);
    
    --danger: #EF4444;
    --danger-hover: #DC2626;
    
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --border-color: rgba(255, 255, 255, 0.06);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Reset & Basic Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.d-none {
    display: none !important;
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.highlight-green { color: var(--success); font-weight: 600; }
.font-semibold { font-weight: 600; }
.border-danger { border-color: rgba(239, 68, 68, 0.3) !important; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger-hover:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Login Page Styling */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at top, rgba(139, 92, 246, 0.15) 0%, transparent 60%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

.logo {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
}

.logo-accent {
    background: linear-gradient(135deg, #FFB800 0%, #FFA200 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.login-form .input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.input-wrapper input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 14px 16px 14px 44px;
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 15px;
    transition: all 0.3s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background: rgba(255, 255, 255, 0.07);
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.login-footer {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 24px;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    animation: fadeIn 0.4s ease-out;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(18, 17, 26, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
}

.logo-light {
    color: #fff;
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-profile {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
}

.admin-main {
    flex: 1;
    padding: 30px 40px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* Metrics Dashboard Panel */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.metric-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.card-highlight {
    background: radial-gradient(circle at right, rgba(139, 92, 246, 0.15), var(--bg-card));
    border-color: rgba(139, 92, 246, 0.25);
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.icon-green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.icon-emerald { background: rgba(5, 150, 105, 0.15); color: #34d399; }
.icon-orange { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.icon-purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

/* Pulse animation for Live Users */
.pulse-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 var(--primary);
    animation: pulse 1.5s infinite;
}

/* Tabs System */
.admin-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    padding-bottom: 1px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #fff;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn svg {
    transition: transform 0.3s;
}

.tab-btn:hover svg {
    transform: translateY(-1px);
}

/* Tab Panes */
.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-pane.active {
    display: block;
}

/* Pane Header & Filters */
.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.pane-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
}

.pane-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 13px;
    width: 200px;
    transition: all 0.3s;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
}

/* Tables Styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.admin-table th, .admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: rgba(0, 0, 0, 0.15);
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-heading);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-device {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

/* Actions in tables */
.actions-cell {
    display: flex;
    gap: 6px;
}

/* Simulator Pane Grid */
.simulation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.sim-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sim-card h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.sim-card p {
    color: var(--text-muted);
    font-size: 13.5px;
    flex: 1;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1e1b29;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    max-width: 380px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-message {
    font-size: 14px;
    font-family: var(--font-body);
}

.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .admin-header {
        padding: 15px 20px;
    }
    
    .admin-main {
        padding: 20px;
    }
    
    .pane-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pane-filters {
        width: 100%;
    }
    
    .filter-input {
        flex: 1;
    }
}
