:root {
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --success: #27ae60;
  --warning: #f39c12;
  --info: #3498db;
  --bg: #f8f9fa;
  --card: #ffffff;
  --text: #2c3e50;
  --text-muted: #6c757d;
  --border: #e9ecef;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── Top Navigation ─── */
.topbar {
  background: var(--primary);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar h1 span { opacity: 0.8; font-weight: 400; }

.topbar-actions { display: flex; gap: 12px; align-items: center; }

.hamburger {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: none;
}

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: 220px;
  height: calc(100vh - 56px);
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 12px 0;
  overflow-y: auto;
  z-index: 50;
  transition: transform 0.3s;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.sidebar a:hover { background: #f0f0f0; }
.sidebar a.active {
  background: var(--primary);
  color: white;
  font-weight: 500;
}
.sidebar a .icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar .badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ─── Main Content ─── */
.main {
  margin-left: 220px;
  padding: 24px;
  min-height: calc(100vh - 56px);
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

/* ─── Cards ─── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 { font-size: 16px; font-weight: 600; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.orange { background: #fef3e2; }
.stat-icon.green { background: #e2f5ea; }
.stat-icon.blue { background: #e1f0fa; }
.stat-icon.red { background: #fde8e8; }

.stat-info h3 { font-size: 24px; font-weight: 700; }
.stat-info p { font-size: 12px; color: var(--text-muted); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #219a52; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: #f0f0f0; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: var(--primary); color: white; }
.btn-danger:hover { background: var(--primary-dark); }

/* ─── Tables ─── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:hover td { background: #fafafa; }

/* ─── Status Badges ─── */
.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-aktif { background: #d4edda; color: #155724; }
.status-nonaktif { background: #f8d7da; color: #721c24; }
.status-pending { background: #fff3cd; color: #856404; }
.status-selesai { background: #d4edda; color: #155724; }
.status-batal { background: #f8d7da; color: #721c24; }

/* ─── Forms ─── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: border 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(231,76,60,0.12);
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ─── Modal ─── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal h2 {
  font-size: 18px;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ─── Toast / Alert ─── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ─── Toast Notification ─── */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 999;
}

.toast {
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; margin-bottom: 4px; color: var(--text); }
.empty-state p { font-size: 13px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hamburger { display: block; }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
    padding: 16px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}
