.hidden {
    display: none !important;
}

:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-accent: #6366f1;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.05);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --glass: rgba(30, 41, 59, 0.7);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* ─── Layout ─── */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background-color: #020617;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.main-content {
    margin-left: 260px;
    padding-bottom: 80px; /* Space for mobile nav */
    min-height: 100vh;
}

.content-wrapper {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ─── Typography & UI Elements ─── */

.sidebar-brand {
    padding: 32px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon { font-size: 24px; }
.brand-text {
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.5px;
}
.brand-accent { color: var(--accent); }

.nav-item {
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-item.active {
    border-left-color: var(--accent);
}

.topbar {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 90;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
}

/* ─── Dashboard Cards ─── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.stat-change {
    font-size: 13px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.up { color: var(--success); }
.down { color: var(--danger); }

/* ─── Grid & Tables ─── */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-weight: 700;
    font-size: 18px;
}

.card-body {
    padding: 24px;
}

.table-container {
    overflow-x: auto;
}

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

th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

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

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

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* ─── Forms & Inputs ─── */

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--border);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    outline: none;
    transition: var(--transition);
}

input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-block { width: 100%; justify-content: center; }

/* ─── Mobile ─── */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 0 16px;
}

@media (max-width: 1024px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .bottom-nav { display: flex; justify-content: space-around; align-items: center; }
    .topbar { padding: 0 20px; }
    .content-wrapper { padding: 16px; }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    gap: 4px;
}

.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-icon { font-size: 20px; }
.bottom-nav-label { font-size: 11px; font-weight: 600; }

.demo-banner {
    background: var(--accent);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ─── Animations ─── */

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

.fade-in { animation: fadeIn 0.4s ease-out forwards; }

.hidden { display: none; }

.toast {
    position: fixed;
    bottom: 90px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}
