:root {
    --bg-color: #0d0f14;
    --card-bg: rgba(23, 27, 34, 0.7);
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --secondary: #8b5cf6;
    --text-main: #f3f4f6;
    --text-dim: #9ca3af;
    --accent: #10b981;
    --error: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

/* App Containers */
#app {
    width: 100%;
    height: 100vh;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
}

.screen.active {
    display: flex;
}

/* Login Screen */
#login-screen, #mfa-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.1), transparent),
                radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.1), transparent);
}

.login-card {
    width: 400px;
    padding: 40px;
    animation: slideUp 0.6s ease-out;
}

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

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.icon-circle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px;
    box-shadow: 0 0 20px var(--primary-glow);
}

.icon-circle svg {
    color: white;
    width: 30px;
    height: 30px;
}

h1 {
    font-size: 24px;
    font-weight: 700;
}

h1 span {
    color: var(--primary);
    font-weight: 400;
    margin-left: 5px;
}

.logo-section p {
    color: var(--text-dim);
    font-size: 14px;
    margin-top: 8px;
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-group label svg {
    width: 14px;
    height: 14px;
}

input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-family: inherit;
    transition: all 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 14px;
}

.error-msg {
    color: var(--error);
    font-size: 13px;
    text-align: center;
    margin-top: 15px;
    min-height: 20px;
}

/* Dashboard Layout */
#dashboard-screen {
    display: flex;
}

.sidebar {
    width: 260px;
    height: 100vh;
    background: rgba(13, 15, 20, 0.8);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 50px;
    padding: 0 10px;
}

.sidebar-logo svg {
    color: var(--primary);
    width: 28px;
    height: 28px;
}

.sidebar-logo span {
    font-size: 20px;
    font-weight: 700;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.nav-links a svg {
    width: 18px;
    height: 18px;
}

.nav-links a.active, .nav-links a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.logout-link {
    background: transparent;
    border: none;
    color: var(--error);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    transition: all 0.3s;
    border-radius: 12px;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
}

.content-header {
    height: 80px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: var(--text-dim);
    font-size: 14px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-dim);
}

#page-content {
    padding: 40px;
    overflow-y: auto;
}

/* Cards & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-card .label {
    color: var(--text-dim);
    font-size: 14px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
}

.stat-card .trend {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.trend.up { color: var(--accent); }

/* Tables */
.table-container {
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--text-dim);
    font-weight: 400;
    font-size: 14px;
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 15px;
}

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

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.badge-active { background: rgba(16, 185, 129, 0.1); color: var(--accent); }
.badge-expired { background: rgba(239, 68, 68, 0.1); color: var(--error); }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    width: 500px;
    padding: 40px;
    position: relative;
}

#mfa-qr-container {
    text-align: center;
    margin: 20px 0;
}

#mfa-qr-container img {
    border: 8px solid white;
    border-radius: 10px;
    width: 200px;
}
