/* === RESET & VARIABEL === */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --bg-body: #f1f5f9;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg-body); color: var(--text-main); display: flex; min-height: 100vh; }
a { text-decoration: none; color: var(--primary); }

/* === LAYOUT UTAMA === */
.sidebar { width: 260px; background: var(--sidebar-bg); color: #fff; display: flex; flex-direction: column; position: fixed; height: 100vh; }
.sidebar-brand { padding: 24px; font-size: 20px; font-weight: bold; border-bottom: 1px solid #334155; display: flex; align-items: center; gap: 10px; color: #fff; }
.sidebar-menu { padding: 16px 0; flex: 1; overflow-y: auto; }
.sidebar-menu a { display: flex; align-items: center; gap: 12px; padding: 12px 24px; color: var(--sidebar-text); font-weight: 500; transition: 0.2s; }
.sidebar-menu a:hover, .sidebar-menu a.active { background: #334155; color: #fff; border-left: 4px solid var(--primary); }
.sidebar-footer { padding: 20px; border-top: 1px solid #334155; font-size: 13px; color: var(--sidebar-text); }

.main-content { margin-left: 260px; flex: 1; display: flex; flex-direction: column; }
.topbar { background: #fff; padding: 16px 32px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.topbar-user { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.container { padding: 32px; max-width: 1200px; width: 100%; }

/* === KOMPONEN UI === */
h1 { font-size: 24px; margin-bottom: 8px; }
h2 { font-size: 20px; margin: 24px 0 16px 0; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

.btn { padding: 10px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* === TABEL === */
.table-wrapper { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow-x: auto; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: #f8fafc; color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; }
tr:hover td { background: #f8fafc; }

.badge { padding: 4px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #e0e7ff; color: #3730a3; }

/* === STATISTIK KARTU === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card { background: #fff; padding: 24px; border-radius: 8px; border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.stat-card h3 { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }
.stat-card p { font-size: 28px; font-weight: bold; color: var(--primary); }

/* === FORM & SEARCH === */
.form-card, .card { background: #fff; padding: 24px; border-radius: 8px; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 24px; }
.form-card label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.form-card input, .form-card textarea, .form-card select { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; margin-bottom: 16px; font-family: inherit; }
.form-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.form-card h3 { margin: 16px 0; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 16px; }

.search-bar { display: flex; gap: 12px; margin-bottom: 20px; }
.search-bar input { flex: 1; padding: 10px 16px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; }
.search-bar button { padding: 10px 20px; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; cursor: pointer; font-weight: 600; }
.search-bar button:hover { background: #f8fafc; }

/* === LOGIN PAGE === */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--sidebar-bg); }
.login-box { background: #fff; padding: 32px; border-radius: 10px; width: 360px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.login-box h2 { text-align: center; margin-bottom: 24px; font-size: 22px; }
.login-box label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.login-box input { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; margin-bottom: 16px; }
.login-box button { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }