/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --sidebar-w: 230px;
  --bg:        #F0F2F5;
  --surface:   #FFFFFF;
  --surface2:  #F8F9FA;
  --border:    #E2E6EA;
  --text:      #1A202C;
  --text-muted:#6B7280;
  --primary:   #2563EB;
  --primary-h: #1D4ED8;
  --green:     #16A34A;
  --red:       #DC2626;
  --purple:    #7C3AED;
  --blue:      #2563EB;
  --teal:      #0891B2;
  --amber:     #D97706;
  --input-bg:  #FFFFFF;
  --radius:    8px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
}
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
code {
  font-family: 'Cascadia Code', 'Consolas', monospace;
  font-size: 12px;
  background: #EFF2F7;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary);
}

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

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #1E293B;
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 14px;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid #334155;
}
.sidebar-brand i { color: #60A5FA; font-size: 20px; }

.pt-switcher {
  padding: 12px 14px;
  border-bottom: 1px solid #334155;
}
.pt-label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: #64748B; margin-bottom: 5px; }
.pt-select {
  width: 100%;
  padding: 6px 8px;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 6px;
  color: #E2E8F0;
  font-size: 13px;
  cursor: pointer;
}
.pt-select:focus { outline: none; border-color: #60A5FA; }

.sidebar-nav { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: #94A3B8;
  font-size: 13px;
  transition: background .15s, color .15s;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-item:hover { background: #334155; color: #E2E8F0; }
.nav-item.active { background: #2563EB; color: #FFFFFF; font-weight: 500; }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px;
  background: #3B82F6;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; color: #E2E8F0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: #64748B; }
.logout-btn {
  padding: 6px 8px;
  border-radius: 6px;
  color: #94A3B8;
  transition: background .15s, color .15s;
  font-size: 14px;
}
.logout-btn:hover { background: #334155; color: #F87171; }

/* ── Main ─────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--text); }
.topbar-pt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  background: #EFF6FF;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #BFDBFE;
}
.topbar-pt i { color: var(--primary); }
.content-wrap { padding: 20px 24px; flex: 1; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.card-header h2 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.card-header h2 i { color: var(--primary); }
.card-body { padding: 18px; }
.mb-4 { margin-bottom: 16px; }

/* ── Stats Grid ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #EFF6FF; color: var(--blue); }
.stat-icon.green  { background: #F0FDF4; color: var(--green); }
.stat-icon.red    { background: #FEF2F2; color: var(--red); }
.stat-icon.purple { background: #F5F3FF; color: var(--purple); }
.stat-icon.teal   { background: #ECFEFF; color: var(--teal); }
.stat-val  { font-size: 24px; font-weight: 700; line-height: 1; color: var(--text); }
.stat-label{ font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.stat-card-link { text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.stat-card-link:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.12); border-color: var(--accent,#6c63ff); }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #F8FAFF; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-green  { color: var(--green); font-weight: 500; }
.text-red    { color: var(--red); font-weight: 500; }
.text-purple { color: var(--purple); font-weight: 500; }
.empty { text-align: center; color: var(--text-muted); padding: 32px 0 !important; font-style: italic; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green  { background: #DCFCE7; color: #15803D; }
.badge-red    { background: #FEE2E2; color: #B91C1C; }
.badge-purple { background: #EDE9FE; color: #6D28D9; }
.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-amber  { background: #FEF3C7; color: #B45309; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-h); }
.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: #15803D; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--surface2); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--surface2); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-lg { padding: 10px 22px; font-size: 14px; }

/* ── Forms ────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.field input, .field select, .field textarea {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.input-disabled { background: var(--surface2) !important; color: var(--text-muted) !important; cursor: not-allowed; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  align-items: end;
}
.form-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.form-filter .field { min-width: 140px; }
.form-inline { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.field-full { grid-column: 1 / -1; }
.field-action { justify-content: flex-end; }
.search-form { display: flex; gap: 6px; align-items: center; }
.search-form input { padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--input-bg); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }
.alert-danger  { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }

/* ── Jenis Info Bar ───────────────────────────────────────── */
.jenis-info-bar {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.hint-box {
  padding: 8px 13px;
  border-radius: var(--radius);
  font-size: 12px;
  border: 1px solid transparent;
}
.hint-green  { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }
.hint-red    { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.hint-purple { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }

/* ── Export sections ──────────────────────────────────────── */
.export-section { padding: 4px 0 16px; }
.export-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 5px; display: flex; align-items: center; gap: 7px; }
.export-section h3 i { color: var(--green); }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Login ────────────────────────────────────────────────── */
.login-body { background: linear-gradient(135deg, #1E3A5F 0%, #1E293B 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 100%; display: flex; justify-content: center; padding: 24px; }
.login-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 36px 32px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  margin-bottom: 18px;
}
.login-title { font-size: 20px; font-weight: 700; color: #1A202C; margin-bottom: 5px; }
.login-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }
.login-card .field { margin-bottom: 14px; }
.btn-login {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s;
  margin-top: 4px;
}
.btn-login:hover { background: var(--primary-h); }
.login-hint { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 16px; }
