:root {
  --primary: #0288D1;
  --primary-dark: #01579B;
  --primary-light: #B3E5FC;
  --success: #2E7D32;
  --error: #C62828;
  --warning: #F57C00;
  --bg-dark: #0A1929;
  --bg-surface: #132F4C;
  --text-main: #F3F6F9;
  --text-muted: #90CAF9;
  --border: #1E4976;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
}

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-light); }

/* Utility */
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.text-success { color: #81C784; }
.text-error { color: #E57373; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.mt-4 { margin-top: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Grid */
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* Login Page */
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #0A1929, #0288D1); }
.login-wrap { width: 100%; max-width: 380px; padding: 1rem; }
.login-card { background: var(--bg-surface); border-radius: 12px; padding: 2rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-icon { background: linear-gradient(to right, #4FC3F7, #0288D1); color: #fff; width: 60px; height: 60px; line-height: 60px; border-radius: 12px; font-size: 24px; font-weight: 800; margin: 0 auto 1rem; }
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 0.25rem; }
.login-sub { color: var(--text-muted); font-size: 13px; }
.login-hint { text-align: center; margin-top: 1.5rem; color: var(--text-muted); font-size: 12px; }
.login-hint code { background: #0A1929; padding: 2px 6px; border-radius: 4px; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 13px; }
.form-input { width: 100%; padding: 0.75rem 1rem; background: var(--bg-dark); border: 1px solid var(--border); color: var(--text-main); border-radius: 8px; font-family: inherit; font-size: 14px; transition: border-color 0.2s; }
.form-input:focus { outline: none; border-color: var(--primary); }
.input-wrap { position: relative; }
.eye-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 5px; }
.eye-btn:hover { color: #fff; }

/* Buttons */
.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: 8px; border: none; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-full { width: 100%; padding: 0.75rem; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 12px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #1B5E20; }
.btn-error { background: var(--error); color: #fff; }
.btn-error:hover { background: #B71C1C; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 13px; font-weight: 500; }
.alert-success { background: rgba(46,125,50,0.2); color: #81C784; border: 1px solid rgba(46,125,50,0.5); }
.alert-error { background: rgba(198,40,40,0.2); color: #E57373; border: 1px solid rgba(198,40,40,0.5); }

/* Layout */
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 260px; background: var(--bg-surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; transition: transform 0.3s; }
.sidebar-brand { padding: 1.5rem; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--border); }
.brand-icon { background: linear-gradient(to right, #4FC3F7, #0288D1); color:#fff; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.brand-name { display: block; font-weight: 700; font-size: 16px; }
.brand-sub { display: block; font-size: 11px; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 1.5rem 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; padding: 0.75rem 1.5rem; color: var(--text-muted); transition: all 0.2s; }
.nav-icon { margin-right: 12px; font-size: 18px; width: 24px; text-align: center; }
.nav-item:hover, .nav-item.active { background: rgba(2,136,209,0.1); color: #fff; border-right: 3px solid var(--primary); }

.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.user-info { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar { width: 32px; height: 32px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: var(--text-muted); }
.logout-btn { background: rgba(198,40,40,0.1); color: #E57373; width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.logout-btn:hover { background: var(--error); color: #fff; }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; overflow-x: hidden; }
.topbar { padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: var(--bg-dark); }
.sidebar-toggle { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }
.page-title { font-size: 20px; font-weight: 700; }
.topbar-time { font-size: 13px; color: var(--text-muted); }

.content { padding: 2rem; flex: 1; overflow-y: auto; }

/* Cards */
.card { background: var(--bg-surface); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.stat-card { padding: 1.5rem; display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.stat-val { font-size: 24px; font-weight: 800; color: #fff; line-height: 1.2; }
.stat-lbl { font-size: 13px; color: var(--text-muted); }

.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.card-title { font-size: 16px; font-weight: 600; }
.card-body { padding: 1.5rem; }

/* Tables */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 1rem 0.5rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.badge { padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-primary { background: rgba(2,136,209,0.2); color: #4FC3F7; }
.badge-success { background: rgba(46,125,50,0.2); color: #81C784; }
.badge-error { background: rgba(198,40,40,0.2); color: #E57373; }

/* Pagination */
.pagination { display: flex; gap: 0.5rem; margin-top: 1.5rem; justify-content: flex-end; }
.page-btn { padding: 0.5rem 0.75rem; background: var(--bg-dark); border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.page-btn:hover { background: var(--bg-surface); border-color: var(--primary); color: #fff; }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Mobile */
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 100; height: 100vh; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; margin-right: 1rem; }
  .topbar { padding: 1rem; justify-content: flex-start; }
  .topbar-right { margin-left: auto; }
  .content { padding: 1rem; }
}
