:root {
    --primary: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    --secondary-gradient: linear-gradient(135deg, #0ea5e9, #6366f1);
    --success-gradient: linear-gradient(135deg, #10b981, #059669);
    --dark-bg: #0f172a;
    --sidebar-bg: rgba(15, 23, 42, 0.96);
    --surface-bg: #ffffff;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: #0f172a;
    min-height: 100vh;
    display: flex;
    color: var(--text-primary);
}

/* Sidebar Layout */
.sidebar {
    width: 270px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.brand {
    font-size: 1.35rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 30px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.25s ease;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
}

/* Content Area */
.main-content {
    margin-left: 270px;
    flex: 1;
    background: #f8fafc;
    border-top-left-radius: 28px;
    border-bottom-left-radius: 28px;
    padding: 36px;
    min-height: 100vh;
}

.header-banner {
    background: var(--primary-gradient);
    color: white;
    padding: 28px 32px;
    border-radius: 20px;
    margin-bottom: 28px;
    box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.3);
}

.header-banner h2 { font-size: 1.6rem; margin-bottom: 4px; }
.header-banner p { opacity: 0.9; font-size: 0.95rem; }

/* Dashboard Cards & Layout */
.grid-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.metric-card .val {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--dark-bg);
    margin-top: 6px;
}

.card {
    background: var(--surface-bg);
    border-radius: 20px;
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Structured Forms */
.form-section-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 24px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #f1f5f9;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

input, select, textarea {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    outline: none;
    font-size: 0.95rem;
    background: #fdfdfd;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: #fff;
}

/* Action Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Modern Data Table */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-class { background: #e0e7ff; color: #4338ca; }