* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f3f4f6; color: #1f2937; }

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

.sidebar {
  width: 240px; background: #0f172a; color: #e2e8f0; padding: 20px 0;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0;
  transition: left 0.2s; z-index: 1000; overflow-y: auto;
}
.brand { font-size: 18px; font-weight: 700; padding: 0 20px; }
.brand-sub { font-size: 11px; color: #94a3b8; padding: 4px 20px 20px; }
.sidebar nav { display: flex; flex-direction: column; flex: 1; }
.sidebar nav a {
  color: #cbd5e1; text-decoration: none; padding: 12px 20px; font-size: 14px;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #1e293b; }
.sidebar nav a.active { background: #1e293b; border-left-color: #f59e0b; color: #fff; font-weight: 600; }
.nav-divider { font-size: 11px; color: #64748b; padding: 16px 20px 6px; letter-spacing: 0.5px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #1e293b; }
.user-chip { font-size: 13px; margin-bottom: 8px; }
.logout-link { color: #f87171; text-decoration: none; font-size: 13px; }

.hamburger {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 1100;
  background: #0f172a; color: #fff; border: none; border-radius: 8px;
  width: 40px; height: 40px; font-size: 18px; cursor: pointer;
}

.content { flex: 1; margin-left: 240px; padding: 28px 32px; max-width: 1200px; }

@media (max-width: 900px) {
  .sidebar { left: -240px; box-shadow: 4px 0 20px rgba(0,0,0,0.3); }
  .sidebar.open { left: 0; }
  .content { margin-left: 0; padding: 70px 16px 24px; }
  .hamburger { display: block; }
}

/* --- Common components --- */
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: #6b7280; font-size: 14px; margin-bottom: 24px; }

.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.stat-card .label { font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-card .value { font-size: 26px; font-weight: 800; margin-top: 6px; }

.panel { background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 24px; }
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
th { color: #6b7280; font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:hover td { background: #f9fafb; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-aman { background: #dcfce7; color: #15803d; }
.badge-menipis { background: #fef3c7; color: #b45309; }
.badge-habis { background: #fee2e2; color: #b91c1c; }
.badge-masuk { background: #dbeafe; color: #1d4ed8; }
.badge-keluar { background: #fee2e2; color: #b91c1c; }
.badge-dibayar { background: #dcfce7; color: #15803d; }
.badge-draft { background: #f3f4f6; color: #6b7280; }

.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; border: none; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-primary { background: #0f172a; color: #fff; }
.btn-primary:hover { background: #1e293b; }
.btn-outline { background: #fff; border: 1px solid #d1d5db; color: #1f2937; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;
}

.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fee2e2; color: #b91c1c; }
.alert-success { background: #dcfce7; color: #15803d; }

/* Login page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0f172a; }
.login-card { background: #fff; border-radius: 18px; padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .sub { color: #6b7280; font-size: 13px; margin-bottom: 24px; }
