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

:root {
    /* Main Colors */
    --primary: #2563eb;       /* Professional Blue */
    --primary-hover: #1d4ed8;
    --secondary: #0ea5e9;    /* Sky Blue/Celeste */
    --accent: #14b8a6;       /* Sea Green */
    --accent-hover: #0d9488;
    
    /* Neutral / Backgrounds */
    --bg-dark: #0f172a;      /* Deep Navy */
    --bg-card: rgba(30, 41, 59, 0.5);
    --bg-input: rgba(15, 23, 42, 0.6);
    
    /* Text */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    
    /* Feedback */
    --danger: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    
    /* Decorative */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-glow: rgba(37, 99, 235, 0.1);
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.1) 0, transparent 40%),
        radial-gradient(at 100% 0%, rgba(20, 184, 166, 0.05) 0, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Glassmorphism Refined */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

/* Auth Layout */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 48px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

.logo img {
    filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.3));
}

.logo-auth {
    justify-content: center;
    margin-bottom: 40px;
}

h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

h2 { font-size: 1.8rem; }

/* Forms Modern */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s;
}

input, select, textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s;
}

.toggle-password:hover {
    color: var(--secondary);
}

/* Buttons Modern */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
    filter: brightness(1.1);
}

button:active {
    transform: translateY(1px);
}

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

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

/* Links & Alerts */
.links {
    margin-top: 28px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.links a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.links a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-danger {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: #fda4af;
}

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

/* Dashboard Structure Professional */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    height: 100vh;
    padding: 40px 24px;
    border-right: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.4);
}

.main-content {
    padding: 48px;
    background: rgba(15, 23, 42, 0.2);
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.15);
    color: var(--secondary);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Stats Cards Modern */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

.stat-card {
    padding: 32px;
    transition: transform 0.3s ease;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.4) 100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(37, 99, 235, 0.3);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

/* Tables Professional */
.table-container {
    padding: 32px;
    margin-top: 32px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    text-align: left;
    padding: 16px 20px;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 2px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.2);
}

td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.95rem;
    color: var(--text-light);
}

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

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

/* Badges Re-envisioned */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-admin { background: rgba(37, 99, 235, 0.15); color: #60a5fa; border: 1px solid rgba(37, 99, 235, 0.2); }
.badge-superadmin { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.2); }
.badge-user { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.2); }

@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none; /* Mobile menu needed but out of scope for immediate CSS update */
    }
}
