/* Arya Green Pamulang — Custom Styles */
:root {
  --sidebar-width: 260px;
  --sidebar-bg: #1a3c2e;
  --sidebar-hover: #2d6a4f;
  --topbar-height: 56px;
  --page-bg: #f5f7fa;
  --surface: #ffffff;
  --surface-muted: #f8f9fa;
  --border-color: #e9ecef;
  --text-color: #212529;
  --muted-color: #6c757d;
}

html[data-bs-theme="dark"] {
  --page-bg: #121a17;
  --surface: #1d2924;
  --surface-muted: #25352e;
  --border-color: #35483f;
  --text-color: #e5ebe8;
  --muted-color: #aab8b1;
}

/* ── Layout ───────────────────────────────────── */
body { background: var(--page-bg); color: var(--text-color); font-size: .9rem; }

.wrapper { min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  min-height: 0;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  z-index: 1040;
  transition: transform .25s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* nav-scroll: area menu yang bisa di-scroll */
.sidebar .nav-scroll {
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.35) transparent;
}

.sidebar .nav-scroll::-webkit-scrollbar { width: 5px; }
.sidebar .nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.35); border-radius: 999px; }
.sidebar .nav-scroll::-webkit-scrollbar-track { background: transparent; }

/* user-info + logout: selalu terlihat di bawah */
.sidebar .sidebar-footer { flex-shrink: 0; background: var(--sidebar-bg); }

.sidebar-brand { background: rgba(0,0,0,.2); }
.sidebar-logo { height: 48px; width: auto; object-fit: contain; }

.sidebar .nav-link { border-radius: 6px; margin-bottom: 2px; font-size: .875rem; }
.sidebar .nav-link:hover  { background: var(--sidebar-hover); }
.sidebar .nav-link.active { background: #198754; }

.content-wrapper {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  position: sticky; top: 0; z-index: 1030;
}

.main-content { flex: 1; padding: 1.5rem; }

/* ── Cards ────────────────────────────────────── */
.card { border: 1px solid var(--border-color); background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card-header { background: var(--surface-muted); border-bottom: 1px solid var(--border-color); font-weight: 600; }

.stat-card { border-radius: 10px; }
.stat-card .stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Tables ───────────────────────────────────── */
.table th { font-size: .78rem; text-transform: uppercase;
            letter-spacing: .04em; color: var(--muted-color); font-weight: 600; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--surface-muted); }

/* ── Badges ───────────────────────────────────── */
.badge { font-size: .75rem; padding: .35em .65em; }

/* ── Forms ────────────────────────────────────── */
.form-label { font-weight: 500; font-size: .85rem; }
.form-control:focus, .form-select:focus {
  border-color: #198754;
  box-shadow: 0 0 0 .2rem rgba(25,135,84,.2);
}
.form-control, .form-select {
  background: var(--surface);
  border-color: var(--border-color);
  color: var(--text-color);
}

/* ── Auth pages ───────────────────────────────── */
.auth-wrapper {
  min-height: 100vh; background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--sidebar-hover) 100%);
  display: flex; align-items: center; justify-content: center;
}
.auth-card { border-radius: 14px; border: 0; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.auth-logo-img { height: 80px; width: auto; object-fit: contain; }

/* ── Dark mode toggle ─────────────────────────── */
.dark-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: .8rem;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.dark-toggle:hover { background: var(--border-color); }
.dark-toggle i { pointer-events: none; }

/* Sidebar theme toggle - override */
.sidebar-theme-toggle {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
}
.sidebar-theme-toggle:hover { background: rgba(255,255,255,.15); }

/* ── Responsive sidebar ───────────────────────── */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .content-wrapper { margin-left: 0; width: 100%; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 1039;
  }
  .sidebar-overlay.show { display: block; }
}

/* ── Misc ─────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.fs-7 { font-size: .8rem; }
.text-green { color: #198754; }
.avatar-sm { width: 32px; height: 32px; }
