:root {
    --primary: #1a237e; --primary-light: #283593; --primary-dark: #0d1442;
    --secondary: #3949ab; --accent: #5c6bc0; --background: #0a0e27;
    --surface: #121836; --surface-light: #1a2147; --border: #2a3158;
    --text: #e8eaf6; --text-muted: #9fa8da;
    --success: #4caf50; --warning: #ff9800; --danger: #f44336; --info: #2196f3;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--background); color: var(--text); line-height: 1.6; min-height: 100vh; }
.app-container { display: flex; min-height: 100vh; }

.sidebar { width: 240px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; height: 100vh; left: 0; top: 0; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); }
.sidebar-header h1 { font-size: 18px; font-weight: 600; }
.sidebar-nav { flex: 1; padding: 16px 0; }
.nav-item { display: flex; align-items: center; padding: 12px 20px; color: var(--text-muted); text-decoration: none; cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent; }
.nav-item:hover { background: var(--surface-light); color: var(--text); }
.nav-item.active { background: var(--primary-dark); color: var(--text); border-left-color: var(--accent); }
.nav-item svg { width: 20px; height: 20px; margin-right: 12px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.user-details { flex: 1; }
.user-name { font-size: 14px; font-weight: 500; }
.user-role { font-size: 12px; color: var(--text-muted); }

.main-content { flex: 1; margin-left: 240px; padding: 24px; min-height: 100vh; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; font-size: 14px; font-weight: 500; border: none; border-radius: 6px; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--text); }
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary { background: var(--surface-light); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); }
.btn-danger { background: var(--danger); color: white; }
.btn-icon { padding: 6px; background: none; border: none; color: var(--text-muted); cursor: pointer; border-radius: 4px; transition: all 0.2s; }
.btn-icon:hover { background: var(--surface-light); color: var(--text); }
.btn-icon.danger:hover { color: var(--danger); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-title { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }

.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 500; color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; background: var(--surface-light); }
tr:hover { background: var(--surface-light); }
tr.clickable { cursor: pointer; }
.actions { display: flex; gap: 8px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--text-muted); }
.form-control { width: 100%; padding: 10px 12px; font-size: 14px; color: var(--text); background: var(--surface-light); border: 1px solid var(--border); border-radius: 6px; transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: var(--accent); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.search-box { position: relative; max-width: 300px; }
.search-box input { padding-left: 40px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 18px; height: 18px; }

.badge { display: inline-block; padding: 4px 10px; font-size: 12px; font-weight: 500; border-radius: 4px; }
.badge-success { background: rgba(76, 175, 80, 0.2); color: var(--success); }
.badge-warning { background: rgba(255, 152, 0, 0.2); color: var(--warning); }
.badge-danger { background: rgba(244, 67, 54, 0.2); color: var(--danger); }
.badge-info { background: rgba(33, 150, 243, 0.2); color: var(--info); }
.badge-neutral { background: var(--surface-light); color: var(--text-muted); }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.2s; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; transform: translateY(-20px); transition: transform 0.2s; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; font-size: 24px; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 600; }
.stat-value.success { color: var(--success); }

.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.3); animation: slideIn 0.2s ease-out; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 40px; width: 100%; max-width: 400px; }
.login-title { font-size: 24px; font-weight: 600; margin-bottom: 8px; text-align: center; }
.login-subtitle { color: var(--text-muted); text-align: center; margin-bottom: 32px; }

@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-header h1, .nav-item span, .user-details { display: none; }
    .nav-item { justify-content: center; padding: 16px; }
    .nav-item svg { margin-right: 0; }
    .main-content { margin-left: 60px; }
    .form-row { grid-template-columns: 1fr; }
}
