@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #0f0c1b 0%, #15102a 50%, #090611 100%);
    --panel-bg: rgba(22, 17, 45, 0.45);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --primary: #8a5cf6;
    --primary-glow: rgba(138, 92, 246, 0.4);
    --primary-hover: #9d76f8;
    
    --accent: #d946ef;
    --accent-glow: rgba(217, 70, 239, 0.3);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-main);
    display: flex;
    overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Core Dashboard Layout */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background: rgba(13, 9, 29, 0.7);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--panel-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2.5rem;
    padding: 0.5rem;
}

.sidebar-logo span {
    color: var(--text-main);
    -webkit-text-fill-color: var(--text-main);
    font-weight: 300;
}

.menu-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.menu-item:hover, .menu-item.active {
    color: var(--text-main);
    background: rgba(138, 92, 246, 0.12);
    border-color: rgba(138, 92, 246, 0.25);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.menu-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.2s ease;
}

.menu-item:hover svg {
    transform: translateX(3px);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--panel-border);
    padding-top: 1.5rem;
}

/* Main Content Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    padding: 2.5rem;
    min-width: 0;
}

/* Topbar Header */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.admin-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 0.5rem 1rem;
    border-radius: 50px;
}

.admin-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--panel-bg);
    backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--panel-shadow);
    margin-bottom: 2rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}

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

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(138, 92, 246, 0.15);
    border: 1px solid rgba(138, 92, 246, 0.2);
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card.blue .stat-icon {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.stat-card.emerald .stat-icon {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.stat-card.rose .stat-icon {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.2);
    color: var(--danger);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Beautiful Interactive Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--panel-border);
}

td {
    padding: 1.15rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.95rem;
    color: var(--text-main);
    vertical-align: middle;
}

tr {
    transition: background-color 0.2s ease;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.mono-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--panel-border);
}

/* Badge Layouts */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.active {
    background: var(--success-glow);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

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

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

/* Beautiful Forms */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-control {
    width: 100%;
    background: rgba(13, 9, 29, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(13, 9, 29, 0.6);
}

.input-control::placeholder {
    color: var(--text-dark);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 15px rgba(138, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 92, 246, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Alert Notification Overlays */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: var(--success-glow);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.alert-danger {
    background: var(--danger-glow);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Flag & Geolocation styling */
.flag-img {
    height: 12px;
    width: auto;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Auth Portal Styling */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

/* Responsive Viewports */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
        padding: 1.5rem;
    }
}
