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

:root {
    --brand: #f97316;
    --brand-light: #fb923c;
    --brand-glow: rgba(249, 115, 22, 0.4);
    --bg-main: #0f172a; /* Sleek Dark for Premium Contrast */
    --surface: rgba(255, 255, 255, 0.03);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --sidebar-w: 280px;
}

/* Light mode overrides if needed - but we're going for a Deep Premium look */
[data-theme="light"] {
    --brand: #f97316;
    --bg-main: #f8fafc;
    --surface: rgba(255, 255, 255, 0.8);
    --surface-border: rgba(0, 0, 0, 0.05);
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

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

/* Dynamic Mesh Background */
.mesh-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
    background: var(--bg-main);
    overflow: hidden;
}

.mesh-bg::after {
    content: '';
    position: absolute;
    width: 150%; height: 150%;
    top: -25%; left: -25%;
    background: 
        radial-gradient(circle at 70% 20%, rgba(249, 115, 22, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 10% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(251, 146, 60, 0.12) 0%, transparent 35%);
    filter: blur(80px);
    animation: mesh-move 20s ease-in-out infinite alternate;
}

@keyframes mesh-move {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(5%, 5%) rotate(5deg); }
}

/* Glassmorphism Card core */
.premium-card {
    background: var(--surface);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--surface-border);
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.premium-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6), 0 0 20px rgba(249, 115, 22, 0.1);
}

/* Floating Sidebar */
.sidebar-floating {
    width: var(--sidebar-w);
    height: calc(100vh - 40px);
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: 2rem;
    z-index: 1000;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    box-shadow: 20px 0 50px rgba(0,0,0,0.3);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem 2.5rem;
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-link i {
    font-size: 1.25rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(5px);
}

.nav-link.active {
    background: var(--brand);
    color: white;
    box-shadow: 0 10px 20px -5px var(--brand-glow);
}

/* Main Layout */
.app-container {
    margin-left: calc(var(--sidebar-w) + 60px);
    padding: 3rem 4rem 4rem 0;
    max-width: 1400px;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.kpi-card {
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; width: 100px; height: 100px;
    background: radial-gradient(circle at top right, var(--brand-glow), transparent 70%);
}

.kpi-val {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.kpi-label {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* Typography & Layout */
h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.section-title {
    margin-bottom: 2rem;
}

/* Forms & UI */
.form-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--surface-border);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    color: white;
    width: 100%;
    outline: none;
    transition: border-color 0.3s ease;
}

select.form-input option {
    background-color: #0f172a;
    color: white;
}

.form-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-glow);
}

.btn-wow {
    background: var(--brand);
    border: none;
    padding: 1rem 2rem;
    border-radius: 1rem;
    color: white;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    box-shadow: 0 10px 20px -5px var(--brand-glow);
}

.btn-wow:hover {
    transform: scale(1.05);
    background: var(--brand-light);
}

/* Tables */
.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.premium-table th {
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    text-align: left;
}

.premium-table tr td {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.25rem 1rem;
}

.premium-table tr td:first-child { border-radius: 1rem 0 0 1rem; }
.premium-table tr td:last-child { border-radius: 0 1rem 1rem 0; }

/* Login Page Overhaul */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
}

.login-glass {
    width: 100%;
    max-width: 450px;
    padding: 4rem 3rem;
    text-align: center;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .sidebar-floating {
        width: 80px;
    }
    .sidebar-logo span, .nav-link span {
        display: none;
    }
    .app-container {
        margin-left: 140px;
        padding-right: 20px;
    }
}

@media (max-width: 768px) {
    .sidebar-floating {
        height: 60px;
        width: calc(100% - 40px);
        flex-direction: row;
        top: auto;
        bottom: 20px;
        padding: 0 1rem;
        align-items: center;
        justify-content: space-around;
    }
    .sidebar-logo, .sidebar-footer { display: none; }
    .nav-menu {
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        margin: 0;
    }
    .app-container {
        margin-left: 20px;
        padding: 2rem 1rem 100px 1rem;
    }
}

.fw-800 { font-weight: 800 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-600 { font-weight: 600 !important; }

.text-brand { color: var(--brand) !important; }
.bg-brand { background-color: var(--brand) !important; }

/* Custom Scrollbar for Premium Feel */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* Animation for loading/transitions */
.fade-in { animation: fadeIn 0.5s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
