/* style.css - Tema Hijau Tua */
:root {
  --hijau-tua: #1a4d2e;
  --hijau-tua-light: #2d6a4f;
  --hijau-tua-lighter: #40916c;
  --hijau-tua-bg: #1b3a2a;
  --hijau-tua-card: #2d5a3d;
  --hijau-tua-border: #3a7a52;
  --hijau-tua-soft: #e8f5ed;
}
body {
  background-color: #f0f7f3;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.ajax-loader-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 54, 35, 0.35);
  backdrop-filter: blur(1px);
  z-index: 2200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ajax-loader-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  cursor: wait;
}

.ajax-loader-card {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 0.8rem;
  background: #ffffff;
  border: 1px solid var(--hijau-tua-border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.ajax-loader-spinner {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  border: 3px solid #d8eadf;
  border-top-color: var(--hijau-tua);
  animation: ajax-spin 0.7s linear infinite;
}

.ajax-loader-text {
  color: var(--hijau-tua);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.2px;
}

@keyframes ajax-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Navbar fixed top */
.navbar-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  background-color: var(--hijau-tua);
  box-shadow: 0 2px 8px rgba(0,20,0,0.2);
  padding: 0.5rem 1rem;
  border-bottom: 2px solid var(--hijau-tua-border);
  height: 70px;
}
.navbar-fixed .navbar-brand {
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.3px;
}
.navbar-fixed .btn-toggle {
  border: none;
  background: transparent;
  font-size: 1.7rem;
  color: #ffffff;
  padding: 0 0.25rem;
  line-height: 1;
}
.navbar-fixed .btn-toggle:hover {
  color: #b8e0c8;
}
.navbar-fixed .btn-toggle:focus {
  box-shadow: none;
}
.dropdown-user .dropdown-toggle::after {
  display: none;
}
.dropdown-user .dropdown-toggle {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.6rem;
  padding: 0 0.2rem;
}
.dropdown-user .dropdown-toggle:hover {
  color: #b8e0c8;
}
.dropdown-user .dropdown-menu {
  min-width: 140px;
  border: 1px solid var(--hijau-tua-border);
  background: white;
}
.dropdown-user .dropdown-item {
  color: var(--hijau-tua);
}
.dropdown-user .dropdown-item:hover {
  background-color: var(--hijau-tua-soft);
  color: var(--hijau-tua);
}

/* Sidebar kiri fixed */
.sidebar-fixed {
  position: fixed;
  top: 70px;
  left: 0;
  bottom: 0;
  width: 280px;
  background-color: #1e4d32;
  border-right: 2px solid var(--hijau-tua-border);
  overflow-y: auto;
  padding: 1rem 0.5rem;
  z-index: 1020;
  height: calc(100% - 70px);
  box-shadow: 2px 0 12px rgba(0,20,0,0.15);
  transition: transform 0.3s ease, margin-left 0.3s ease;
}
.sidebar-fixed .nav-link {
  color: #c8e6d9;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin-bottom: 2px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: all 0.2s;
}
.sidebar-fixed .nav-link i {
  font-size: 1.3rem;
  width: 1.6rem;
  text-align: center;
}
.sidebar-fixed .nav-link:hover {
  background-color: #2d6a4f;
  color: #ffffff;
}
.sidebar-fixed .nav-link.active {
  background-color: #40916c;
  color: #ffffff;
  font-weight: 600;
}

.sidebar-fixed .nav-link.parent,
.sidebar-fixed .nav-link.nav-parent {
  position: relative;
  cursor: pointer;
}

.sidebar-fixed .nav-link.parent::after,
.sidebar-fixed .nav-link.nav-parent::after {
  content: "\F282";
  font-family: "bootstrap-icons";
  margin-left: auto;
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.sidebar-fixed .nav-link.parent.expanded::after,
.sidebar-fixed .nav-link.nav-parent.expanded::after {
  transform: rotate(90deg);
}

.sidebar-fixed .nav-link.nav-sub {
  display: none;
  margin-left: 1.6rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-size: 0.95rem;
  color: #b8dac8;
}

.sidebar-fixed .nav-link.nav-sub i {
  font-size: 1rem;
  width: 1.2rem;
}

.sidebar-fixed .nav-link.nav-sub.submenu-open,
.sidebar-fixed .nav-link.nav-sub.active {
  display: flex;
}

/* Main content */
.main-content {
  margin-left: 280px;
  padding: 10px;
  margin-top: 70px;
  min-height: calc(100vh - 70px);
  background-color: #f8fbf9;
  transition: margin-left 0.3s ease;
}

/* Sidebar hidden state */
.sidebar-fixed.hidden {
  transform: translateX(-100%);
}

.sidebar-fixed.hidden ~ .main-content {
  margin-left: 0;
}

/* Responsive */
@media (max-width: 512px) {
  .sidebar-fixed {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 4px 0 16px rgba(0,0,0,0.15);
  }
  .sidebar-fixed.show {
    transform: translateX(0);
  }
  .sidebar-fixed.hidden {
    transform: translateX(-100%);
  }
  .main-content {
    margin-left: 0 !important;
    padding: 5px !important;
  }
  .sidebar-fixed.show ~ .main-content {
    margin-left: 0 !important;
  }
}

@media (min-width: 513px) {
  .sidebar-fixed {
    transform: translateX(0) !important;
    display: block !important;
  }
  .sidebar-fixed.hidden {
    transform: translateX(-100%) !important;
  }
  .sidebar-fixed.hidden ~ .main-content {
    margin-left: 0 !important;
  }
  .sidebar-fixed.show {
    transform: translateX(0) !important;
  }
  .sidebar-fixed.show ~ .main-content {
    margin-left: 280px !important;
  }
}

/* Scroll sidebar */
.sidebar-fixed::-webkit-scrollbar {
  width: 4px;
}
.sidebar-fixed::-webkit-scrollbar-thumb {
  background: #40916c;
  border-radius: 20px;
}
.sidebar-fixed::-webkit-scrollbar-track {
  background: #1a4d2e;
}

/* Komponen dengan tema hijau tua */
.component-card {
  border: 1px solid #c5d9ce;
  background: white;
  border-radius: 14px;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,40,0,0.04);
  margin-bottom: 1.8rem;
}
.component-card h5 {
  color: var(--hijau-tua);
  border-bottom: 2px solid #d4e8dd;
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}
.badge-hijau-tua {
  background-color: var(--hijau-tua-lighter);
  color: #ffffff;
}
.btn-hijau-tua {
  background-color: var(--hijau-tua);
  border-color: var(--hijau-tua-border);
  color: #ffffff;
}
.btn-hijau-tua:hover {
  background-color: var(--hijau-tua-light);
  border-color: var(--hijau-tua-lighter);
  color: #ffffff;
}
.btn-outline-hijau-tua {
  border-color: var(--hijau-tua);
  color: var(--hijau-tua);
}
.btn-outline-hijau-tua:hover {
  background-color: var(--hijau-tua);
  color: #ffffff;
}
.table-hijau-tua {
  --bs-table-striped-bg: #eaf3ee;
}
.table-hijau-tua th {
  background-color: var(--hijau-tua);
  color: white;
}
.progress-hijau-tua {
  background-color: #d4e8dd;
}
.progress-hijau-tua .progress-bar {
  background-color: var(--hijau-tua);
}
.list-group-item-hijau-tua {
  background-color: #eaf3ee;
  border-color: #c5d9ce;
}
.card-header-hijau-tua {
  background-color: var(--hijau-tua);
  border-bottom: 2px solid var(--hijau-tua-border);
  color: #ffffff;
  font-weight: 600;
}
.border-hijau-tua {
  border-color: var(--hijau-tua-border) !important;
}
.text-hijau-tua {
  color: var(--hijau-tua) !important;
}
.bg-hijau-tua {
  background-color: var(--hijau-tua) !important;
}
.bg-hijau-tua-soft {
  background-color: #eaf3ee;
}
.alert-hijau-tua {
  background-color: #d4e8dd;
  border-color: var(--hijau-tua-border);
  color: var(--hijau-tua);
}
.alert-hijau-tua .btn-close {
  filter: brightness(0.3);
}
.pagination-hijau-tua .page-item.active .page-link {
  background-color: var(--hijau-tua);
  border-color: var(--hijau-tua-border);
}
.pagination-hijau-tua .page-link {
  color: var(--hijau-tua);
}
.pagination-hijau-tua .page-link:hover {
  color: var(--hijau-tua-light);
}
.form-control:focus, .form-select:focus {
  border-color: var(--hijau-tua);
  box-shadow: 0 0 0 0.25rem rgba(26, 77, 46, 0.25);
}
.form-check-input:checked {
  background-color: var(--hijau-tua);
  border-color: var(--hijau-tua);
}

/* Tambahan untuk demo */
.component-section {
  margin-bottom: 2rem;
}
.component-section h4 {
  color: var(--hijau-tua);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--hijau-tua-border);
}
.demo-box {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.flying-right-bottom {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}
