/* ── Buku Kas — Modern UI ──────────────────────────────────────────── */
/* Bootstrap 5.3 override + custom polish                          */

:root {
  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 14px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 30px rgba(0,0,0,.09), 0 4px 12px rgba(0,0,0,.06);
  --transition: 0.18s cubic-bezier(.4,0,.2,1);
  --fg: #1f2937;
  --fg-muted: #6b7280;
  --bg: #f4f5f7;
  --card-bg: #fff;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Navbar ── */
.navbar {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
  box-shadow: var(--shadow);
  padding: 0.7rem 0;
}
.navbar-brand {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.nav-link {
  font-weight: 500;
  padding: 0.45rem 0.9rem !important;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: rgba(255,255,255,.12); }
.nav-link.active {
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
}

/* ── Layout ── */
main.container-fluid { padding: 1.5rem 1.25rem 2.5rem; }
.page-header { margin-bottom: 1.25rem; }
.page-header h4 { font-weight: 700; font-size: 1.35rem; margin: 0; }

/* ── Cards ── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card.border-0 { border-color: transparent; }

/* Stat cards (dashboard) */
.card.bg-primary, .card.bg-success, .card.bg-info {
  border: none;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-info:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0 !important;
  padding: 0.875rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.card-body { padding: 1.25rem; }

/* ── Tables ── */
.table {
  margin-bottom: 0;
  font-size: 0.875rem;
}
.table thead th {
  background: #f9fafb;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  padding: 0.75rem 1rem;
}
.table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: #f0f5ff; }
.table th.text-end, .table td.text-end { text-align: right !important; }
.table .fw-semibold { font-weight: 600; }

/* Sticky first col for pivot tables */
.sticky-col {
  position: sticky;
  left: 0;
  background: var(--card-bg);
  z-index: 1;
  border-right: 2px solid var(--border);
}
.table thead th.sticky-col { z-index: 2; }

/* tfoot */
.table tfoot td {
  background: #f9fafb;
  font-weight: 600;
  border-top: 2px solid var(--border);
}

/* ── Badge (pill) ── */
.badge {
  font-weight: 500;
  padding: 0.25em 0.7em;
  border-radius: 9999px;
  font-size: 0.75rem;
}
.badge.bg-secondary {
  background: #e5e7eb !important;
  color: #374151 !important;
}

/* ── Buttons ── */
.btn {
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 0.45rem 1rem;
  transition: all var(--transition);
}
.btn-primary {
  background: #0d6efd;
  border-color: #0d6efd;
}
.btn-primary:hover {
  background: #0b5ed7;
  border-color: #0a58ca;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13,110,253,.35);
}
.btn-outline-secondary {
  border-color: var(--border);
  color: var(--fg);
}
.btn-outline-secondary:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-lg.rounded-pill.shadow {
  box-shadow: 0 4px 14px rgba(13,110,253,.3) !important;
  transition: all var(--transition);
}
.btn-lg.rounded-pill.shadow:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13,110,253,.4) !important;
}

/* ── Forms ── */
.form-label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--fg);
  margin-bottom: 0.3rem;
}
.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}
.form-control::placeholder { color: #9ca3af; }

/* ── Modal ── */
.modal-content {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-radius: var(--radius) var(--radius) 0 0 !important;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header.bg-primary {
  border-bottom: none;
}
.modal-title { font-weight: 600; font-size: 1.05rem; }
.modal-body { padding: 1.25rem; }
.modal-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
}

/* ── Alerts ── */
.alert {
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem 1.2rem;
  font-size: 0.9rem;
}
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info { background: #eff6ff; color: #1e40af; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--fg-muted);
}
.empty-state i.bi {
  font-size: 2.5rem;
  opacity: 0.4;
  margin-bottom: 0.75rem;
  display: block;
}
.empty-state h5 {
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.35rem;
}
.empty-state p { margin: 0; font-size: 0.9rem; }

/* ── Footer ── */
footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  margin-top: 2.5rem;
}
footer .text-muted { font-size: 0.825rem; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Print ── */
@media print {
  .navbar, .btn, .modal, footer, .alert { display: none !important; }
  .card { box-shadow: none; border: 1px solid var(--border); }
  main.container-fluid { padding: 0; }
  .table thead th { background: #f3f4f6 !important; -webkit-print-color-adjust: exact; }
}

/* ── Responsive ── */
@media (max-width: 767.98px) {
  main.container-fluid { padding: 1rem 0.75rem 2rem; }
  .page-header h4 { font-size: 1.15rem; }
  .card-body { padding: 1rem; }
  .table { font-size: 0.8rem; }
  .table thead th, .table td { padding: 0.5rem 0.65rem; }
}
