:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --bg-light: #f8f9fa;
    --bg-dark: #1e293b;
    --card-light: #ffffff;
    --card-dark: #334155;
    --text-light: #1e293b;
    --text-dark: #f8f9fa;
    --border-light: #e2e8f0;
    --border-dark: #475569;
    --sidebar-width: 260px;
    --header-height: 70px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-light);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

/* Dark Mode Overrides */
[data-theme="dark"] body {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}
[data-theme="dark"] .card, 
[data-theme="dark"] .modal-content,
[data-theme="dark"] .table {
    background-color: var(--card-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}
[data-theme="dark"] .form-control, 
[data-theme="dark"] .form-select {
    background-color: var(--bg-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}
[data-theme="dark"] .sidebar {
    background-color: var(--card-dark);
    border-right: 1px solid var(--border-dark);
}
[data-theme="dark"] .sidebar-link {
    color: #94a3b8;
}
[data-theme="dark"] .sidebar-link.active, 
[data-theme="dark"] .sidebar-link:hover {
    background-color: var(--primary);
    color: white;
}

/* Layout */
.wrapper { display: flex; width: 100%; align-items: stretch; }
.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    background: white;
    transition: all 0.3s;
    z-index: 999;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}
.sidebar .sidebar-header { padding: 20px; border-bottom: 1px solid var(--border-light); font-weight: 700; color: var(--primary); font-size: 1.2rem; display: flex; align-items: center; gap: 10px;}
.sidebar ul { padding: 0; margin: 20px 0; list-style: none; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 25px; text-decoration: none;
    color: #64748b; font-weight: 500;
    transition: all 0.2s;
}
.sidebar-link.active, .sidebar-link:hover { background: #e0e7ff; color: var(--primary); border-right: 3px solid var(--primary); }

.main-content {
    width: 100%;
    min-height: 100vh;
    display: flex; flex-direction: column;
}

/* Stats Cards */
.stat-card {
    background: white; border: 1px solid var(--border-light);
    border-radius: 12px; padding: 20px;
    display: flex; align-items: center; justify-content: space-between;
    transition: transform 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: white; }
.bg-gradient-primary { background: linear-gradient(135deg, #4361ee, #3f37c9); }
.bg-gradient-success { background: linear-gradient(135deg, #4cc9f0, #4895ef); }
.bg-gradient-warning { background: linear-gradient(135deg, #f72585, #b5179e); }
.bg-gradient-info { background: linear-gradient(135deg, #4361ee, #7209b7); }

/* Table */
.table-responsive { border-radius: 12px; overflow: hidden; border: 1px solid var(--border-light); }
.table th { font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; background-color: #f1f5f9; }
[data-theme="dark"] .table th { background-color: var(--bg-dark); }

/* JSON Viewer */
.json-viewer { 
    background: #1e1e1e; color: #d4d4d4; 
    padding: 15px; border-radius: 8px; 
    font-family: 'Consolas', monospace; font-size: 0.85rem; 
    max-height: 400px; overflow-y: auto; 
    white-space: pre-wrap; word-break: break-all;
}

/* Utils */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }