:root {
  --primary: #FF2D2D;
  --primary-dark: #CC1A1A;
  --sidebar-bg: #1A1A2E;
  --sidebar-text: #8A8D91;
  --sidebar-active: #FF2D2D;
  --bg: #F4F5F7;
  --card: #FFF;
  --text: #1A1A2E;
  --text-secondary: #65676B;
  --border: #E4E6EB;
  --success: #28A745;
  --warning: #FFC107;
  --danger: #DC3545;
  --info: #007BFF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); }

/* LOGIN */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1A1A2E, #2D2D44); }
.login-box { background: #FFF; border-radius: 16px; padding: 48px 40px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-box h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.login-box .subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 32px; }
.login-box .logo-area { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-box .logo-area img { width: 40px; height: 40px; border-radius: 10px; }
.login-box .logo-area span { font-size: 22px; font-weight: 800; color: var(--primary); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-group input { width: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; transition: border .2s; }
.form-group input:focus { outline: none; border-color: var(--primary); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border: none; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all .2s; font-family: inherit; }
.btn-primary { background: var(--primary); color: #FFF; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: 8px 14px; font-size: 12px; border-radius: 8px; }
.btn-danger { background: var(--danger); color: #FFF; }
.btn-success { background: var(--success); color: #FFF; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-full { width: 100%; justify-content: center; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 8px; display: none; }

/* LAYOUT */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--sidebar-bg); color: var(--sidebar-text); padding: 24px 0; position: fixed; height: 100vh; overflow-y: auto; }
.sidebar .logo-area { display: flex; align-items: center; gap: 10px; padding: 0 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 16px; }
.sidebar .logo-area img { width: 32px; height: 32px; border-radius: 8px; }
.sidebar .logo-area span { color: #FFF; font-weight: 800; font-size: 18px; }
.sidebar .nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--sidebar-text); text-decoration: none; font-size: 14px; font-weight: 500; transition: all .2s; cursor: pointer; border-left: 3px solid transparent; }
.sidebar .nav-item:hover { color: #FFF; background: rgba(255,255,255,0.05); }
.sidebar .nav-item.active { color: #FFF; background: rgba(255,45,45,0.1); border-left-color: var(--sidebar-active); }
.sidebar .nav-item svg { width: 18px; height: 18px; opacity: 0.7; }
.sidebar .nav-item.active svg { opacity: 1; }
.sidebar .nav-section { padding: 16px 20px 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.3); }
.main { flex: 1; margin-left: 240px; padding: 32px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.topbar h1 { font-size: 24px; font-weight: 800; }
.topbar .user-info { display: flex; align-items: center; gap: 10px; }
.topbar .user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #FFF; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card { background: var(--card); border-radius: 14px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 12px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* TABLE */
.card { background: var(--card); border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); overflow: hidden; }
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 16px; font-weight: 700; }
.card-body { padding: 24px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover { background: rgba(0,0,0,0.015); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-success { background: rgba(40,167,69,0.1); color: var(--success); }
.badge-warning { background: rgba(255,193,7,0.1); color: #E67E00; }
.badge-danger { background: rgba(220,53,69,0.1); color: var(--danger); }
.badge-info { background: rgba(0,123,255,0.1); color: var(--info); }
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--text-secondary); }
.user-cell .name { font-weight: 600; }
.user-cell .email { font-size: 12px; color: var(--text-secondary); }
.actions { display: flex; gap: 8px; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal { background: #FFF; border-radius: 16px; padding: 32px; width: 500px; max-height: 80vh; overflow-y: auto; }
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 24px; }

/* EMPTY */
.empty { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* SEARCH */
.search-bar { display: flex; gap: 12px; margin-bottom: 24px; }
.search-bar input { flex: 1; padding: 10px 16px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.search-bar input:focus { outline: none; border-color: var(--primary); }

/* RESPONSIVE */
@media (max-width: 1024px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr; }
}
