/* ============================================================================
 * Stylesheet Utama: Sistem Informasi Kas Keuangan
 * Desain bersih, responsif (mobile, tablet, desktop), dan siap cetak (print-friendly)
 * ============================================================================ */

:root {
  --sidebar-width: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: #2563eb;
  --topbar-height: 64px;
  --bg-canvas: #f8fafc;
  --border-color: #e2e8f0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-canvas);
  color: #0f172a;
  font-size: 0.925rem;
}

.font-mono,
.tabular-nums {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Halaman Login */
.login-page {
  background-color: #f1f5f9;
}

.login-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background-color: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Layout Utama (Sidebar + Main) */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  height: var(--topbar-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background-color: #2563eb;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: #ffffff;
  padding: 2px;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.25rem 0.75rem 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar-link.active {
  background-color: var(--sidebar-active);
  color: #ffffff;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #2563eb;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
}

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

.app-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
}

/* Kartu & Tabel */
.card {
  border-color: var(--border-color);
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  height: 100%;
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.table > :not(caption) > * > * {
  padding: 0.72rem 0.85rem;
  vertical-align: middle;
}

.table thead th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  background-color: #f8fafc;
  border-bottom-width: 1px;
}

/* Responsif Tablet & Mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1035;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-backdrop.show {
    display: block;
  }

  .app-main {
    margin-left: 0;
  }

  .app-content {
    padding: 1rem;
  }
}

/* Mode Cetak (Print-Friendly) */
@media print {
  body {
    background-color: #ffffff !important;
    font-size: 11pt;
  }

  .app-main {
    margin-left: 0 !important;
  }

  .app-content {
    padding: 0 !important;
  }

  .card {
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
  }

  .print-header {
    display: block !important;
  }
}

.print-header {
  display: none;
}
