/**
 * ELITE SAAS DESIGN SYSTEM - PSYCOGEST INSPIRED
 */
:root {
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.4);
    --dark-bg: #0F172A;
    --dark-card: #1E293B;
    --bg-light: #F8FAFC;
    --white: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --glass: rgba(255, 255, 255, 0.8);
    --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.03);
}

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

/* Critical Utilities (Tailwind-like fallback) */
.flex { display: flex !important; }
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.gap-4 { gap: 1rem !important; }
.mb-12 { margin-bottom: 3rem !important; }
.mt-8 { margin-top: 2rem !important; }
.w-full { width: 100% !important; }
.hidden { display: none !important; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Master Header */
.master-header {
    background-color: var(--dark-bg);
    padding: 1.25rem 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.user-profile-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 6px 6px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logout-btn-power {
    width: 44px;
    height: 44px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn-power:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Navigation Bar */
.nav-bar-horizontal {
    background-color: var(--dark-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 4rem;
    display: flex;
    gap: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav-link i { font-size: 14px; opacity: 0.7; }

.nav-link:hover, .nav-link.active {
    color: white;
}

.nav-link.active {
    border-bottom-color: var(--primary);
}

/* Content Area */
.main-viewport {
    padding: 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.page-title-modern {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #0F172A;
    margin-bottom: 0.5rem;
}

.page-title-modern span {
    color: var(--primary);
}

.page-subtitle {
    color: #64748B;
    font-size: 16px;
    margin-bottom: 3rem;
    font-weight: 500;
}

/* Elite Cards */
.kpi-card {
    background: white;
    border-radius: 32px;
    padding: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover { transform: translateY(-8px); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.06); }

.kpi-label { font-size: 11px; font-weight: 900; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.kpi-value { font-size: 42px; font-weight: 900; color: #0f172a; line-height: 1; }

.kpi-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* Dark Widget */
.dark-widget {
    background-color: var(--dark-bg);
    border-radius: 40px;
    padding: 3rem;
    color: white;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.2);
}

/* Icons Global Fix */
i {
    display: inline-block !important;
    color: inherit;
    line-height: 1;
}

/* --- MASTER NAVIGATION SYSTEM --- */
.master-header {
    background: #0f172a;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-bar-horizontal {
    background: #1e293b;
    padding: 0 3rem;
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    padding: 1.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s;
    position: relative;
    border-bottom: 3px solid transparent;
}

.nav-link i {
    font-size: 16px;
    opacity: 0.6;
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.02);
}

.nav-link.active {
    color: #38bdf8;
    border-bottom-color: #38bdf8;
    background: rgba(56, 189, 248, 0.05);
}

.nav-link.active i {
    opacity: 1;
    color: #38bdf8;
}

.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 6px 6px 6px 16px;
    transition: all 0.3s;
}

.logout-btn-power {
    width: 44px;
    height: 44px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.logout-btn-power:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.primary-btn-modern {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white !important;
    padding: 1.25rem 2rem;
    border-radius: 20px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

/* --- LEGACY MODERNIZATION BRIDGE (Catch-all) --- */
.card, .container > div:not([class]), .auth-card {
    background: white;
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.03);
    border: 1px solid #f1f5f9;
    margin-bottom: 2rem;
}

.card h2, .card h3 {
    font-size: 24px;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 1.25rem;
}

.muted { color: #94a3b8; font-size: 14px; font-weight: 600; }

input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="date"], input[type="datetime-local"], select, textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.5rem;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.08);
}

.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    padding-left: 4px;
}

.btn, button[type="submit"] {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    padding: 1.15rem 2.5rem;
    border-radius: 18px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.25);
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover, button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.4);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th {
    padding: 1.5rem 1rem;
    font-size: 11px;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 2px solid #f1f5f9;
    text-align: left;
}

.table td {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Generic Form Grid */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Elite Form System (Specifics) */
.elite-form-container { background: white; border-radius: 40px; padding: 4rem; box-shadow: 0 40px 100px rgba(0,0,0,0.04); border: 1px solid #f1f5f9; }
.form-section-title { font-size: 20px; font-weight: 900; color: #0f172a; margin-bottom: 2.5rem; display: flex; align-items: center; gap: 12px; }
.input-elite { width: 100%; padding: 1.25rem 1.5rem; background: #f8fafc !important; border: 2px solid #f1f5f9; border-radius: 20px; font-size: 15px; font-weight: 600; color: #1e293b; outline: none; transition: all 0.2s; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.btn-elite-save { background: linear-gradient(135deg, #2563eb, #3b82f6); color: white; padding: 1.25rem 2.5rem; border-radius: 20px; font-weight: 800; border: none; cursor: pointer; box-shadow: 0 20px 40px rgba(37, 99, 235, 0.3); transition: all 0.2s; display: inline-flex; align-items: center; gap: 12px; }
.btn-elite-cancel { background: #f1f5f9; color: #64748b; padding: 1.25rem 2.5rem; border-radius: 20px; font-weight: 800; text-decoration: none; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; }

/* Layout Utilities */
.grid-gap-xl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem; }
.flex-row-gap { display: flex; gap: 2.5rem; }
.w-2-3 { width: 66.666%; }
.w-1-3 { width: 33.333%; }

@media (max-width: 1200px) {
    .grid-gap-xl { grid-template-columns: repeat(2, 1fr); }
    .flex-row-gap { flex-direction: column; }
}

@media (max-width: 768px) {
    .master-header, .nav-bar-horizontal { padding: 1rem 1.5rem; }
    .nav-bar-horizontal { overflow-x: auto; white-space: nowrap; }
    .page-title-modern { font-size: 32px; }
    .main-viewport { padding: 2rem 1.5rem; }
    .grid, .grid-form { grid-template-columns: 1fr; }
    .elite-form-container { padding: 2rem; }
}