/* ── Layout ──────────────────────────────────────────────────────── */
body {
  font-size: 0.9rem;
  background-color: #f8f9fa;
}

#wrapper {
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
#sidebar {
  width: 240px;
  min-height: 100vh;
  background: #1a1d23;
  color: #adb5bd;
  flex-shrink: 0;
  transition: width 0.2s ease;
  overflow-x: hidden;
}

#sidebar.collapsed {
  width: 60px;
}

#sidebar.collapsed .sidebar-brand span,
#sidebar.collapsed .nav-link span,
#sidebar.collapsed .sidebar-user {
  display: none;
}

.sidebar-brand {
  color: #fff !important;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-brand i {
  font-size: 1.3rem;
  color: #4dabf7;
}

#sidebar .nav-link {
  color: #adb5bd;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  transition: background 0.15s;
  white-space: nowrap;
}

#sidebar .nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

#sidebar .nav-link.active {
  background: rgba(77, 171, 247, 0.2);
  color: #4dabf7;
}

.sidebar-user {
  font-size: 0.8rem;
}

.sidebar-user a {
  color: #adb5bd;
  text-decoration: none;
}

.sidebar-user a:hover {
  color: #fff;
}

#sidebar hr {
  border-color: rgba(255,255,255,0.1);
}

/* ── Page content ────────────────────────────────────────────────── */
#page-content-wrapper {
  min-width: 0;
  overflow-x: hidden;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  border-radius: 10px;
}

/* ── Tables ──────────────────────────────────────────────────────── */
.table th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6c757d;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-xs {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  font-weight: 500;
}

/* ── Font monospace ──────────────────────────────────────────────── */
.font-monospace {
  font-family: 'Courier New', monospace;
}

/* ── Print styles ────────────────────────────────────────────────── */
@media print {
  #sidebar,
  .navbar,
  .btn,
  .alert-dismissible .btn-close,
  form[method="POST"],
  nav.pagination {
    display: none !important;
  }

  #page-content-wrapper {
    margin: 0;
    padding: 0;
  }

  .card {
    border: 1px solid #dee2e6 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  body {
    background: white;
  }
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    z-index: 1050;
    transform: translateX(-100%);
    height: 100%;
  }

  #sidebar.show {
    transform: translateX(0);
  }
}

/* ── Transaction table highlights ───────────────────────────────── */
.txn-row.table-warning {
  --bs-table-bg: rgba(255, 193, 7, 0.08);
}

/* ── Collapse animation ──────────────────────────────────────────── */
.collapse.show {
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
