:root {
  --primary-color: #f06742;
  --primary-light: #ffefea;
  --primary-gradient: linear-gradient(135deg, #f06742 0%, #e0562f 100%);
  --bg-main: #fff2ed;
  --bg-white: #ffffff;
  --text-main: #2d3436;
  --text-muted: #636e72;
  --border-color: #fcece6;
  --card-shadow: 0 10px 30px rgba(240, 103, 66, 0.05);
  --sidebar-width: 280px;
  --header-height: 70px;
  --border-radius: 16px;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: "Open Sans", "Inter", sans-serif;
  font-size: 0.95rem;
  margin: 0;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-white);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  border-right: 1px solid var(--border-color);
  transition: transform 0.3s ease;
  padding: 1rem 0.75rem;
}

.sidebar .brand {
  padding: 0 0.75rem;
  margin-bottom: 1.5rem;
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--primary-color);
  letter-spacing: -1px;
  display: flex;
  align-items: center;
}

.sidebar .brand::before {
  content: "";
  width: 8px;
  height: 20px;
  background: var(--primary-color);
  display: inline-block;
  margin-right: 10px;
  border-radius: 3px;
}

.sidebar .nav-link {
  color: var(--text-muted);
  padding: 10px 16px;
  margin: 2px 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.sidebar .nav-link i {
  font-size: 18px;
  margin-right: 12px;
}

.sidebar .nav-link:hover {
  background: var(--primary-light);
  color: var(--primary-color);
  transform: translateX(3px);
}

.sidebar .nav-link.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 10px rgba(240, 103, 66, 0.15);
}

.sidebar .nav-item-group {
  display: flex;
  flex-direction: column;
}

.sidebar .nav-link .bi-chevron-down {
  transition: transform 0.3s ease;
}

.sidebar .nav-link:not(.collapsed) .bi-chevron-down {
  transform: rotate(180deg);
}

.sidebar .nav-link.sub-link {
  padding-left: 3rem;
  font-size: 0.85rem;
  font-weight: 500;
}

@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .sidebar {
    width: 260px; /* Sedikit lebih ramping di mobile */
    padding: 0.75rem 0.5rem;
  }
  .sidebar .nav-link {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
}

/* Optimasi khusus untuk HP layar kecil (320px - 350px) */
@media (max-width: 350px) {
  .btn {
    padding: 6px 10px; /* Padding lebih kecil agar ringkas */
    font-size: 13px;
  }
  .main-content {
    padding: 0.5rem; /* Mengurangi padding utama agar ruang tabel lebih luas */
  }
  .card {
    padding: 12px;
  }
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 1.25rem;
  padding-top: calc(var(--header-height) + 1.25rem);
}

@media (max-width: 991px) {
  .main-content {
    margin-left: 0;
    padding: 0.75rem;
    padding-top: calc(var(--header-height) + 0.75rem);
  }
}

/* Header */
.header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  color: var(--text-main);
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  z-index: 999;
  border-bottom: 1px solid var(--border-color);
}

@media (max-width: 991px) {
  .header {
    left: 0;
    height: 60px; /* Header lebih pendek di mobile */
    padding: 0 1rem;
  }
  body {
    --header-height: 60px;
  }
}

/* Cards */
.card {
  background: var(--bg-white);
  border: none;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 20px;
  margin-bottom: 20px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(240, 103, 66, 0.08);
}
@media (max-width: 576px) {
  .card {
    padding: 15px;
    margin-bottom: 15px;
  }
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

/* Buttons */
.btn-primary {
  background: var(--primary-color);
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(240, 103, 66, 0.15);
}

.btn-primary:hover {
  background: #e0562f;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(240, 103, 66, 0.25);
}

/* Form Controls & Select Inputs */
.form-control,
.form-select {
  background: #ffffff;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: #1e293b;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  background: #ffffff;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 4px rgba(240, 103, 66, 0.15) !important;
  outline: none;
}

.form-label {
  color: #334155;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

/* ==========================================
   Modal Styling Enhancements (High Visibility)
   ========================================== */

/* Darker backdrop with blur effect to isolate modal visually */
.modal-backdrop.show {
  opacity: 0.65 !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* Crisp, elevated modal container */
.modal-content {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(240, 103, 66, 0.2) !important;
  border-radius: 20px !important;
  overflow: hidden;
}

/* Distinct Modal Header */
.modal-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 1.25rem 1.5rem !important;
}

.modal-header .modal-title {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 1.15rem;
  letter-spacing: -0.3px;
}

.modal-header .btn-close {
  background-color: #e2e8f0;
  border-radius: 50%;
  padding: 0.5rem;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.modal-header .btn-close:hover {
  opacity: 1;
  background-color: #cbd5e1;
}

/* Modal Body */
.modal-body {
  background-color: #ffffff !important;
  padding: 1.5rem !important;
}

/* Distinct Modal Footer */
.modal-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  padding: 1rem 1.5rem !important;
}

/* Modal Form Controls: distinct background & border for high readability */
.modal-content .form-control,
.modal-content .form-select {
  background-color: #f8fafc !important;
  border: 1.5px solid #94a3b8 !important;
  color: #0f172a !important;
  font-weight: 500;
}

.modal-content .form-control:focus,
.modal-content .form-select:focus {
  background-color: #ffffff !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(240, 103, 66, 0.25) !important;
}

/* Readonly & Disabled inputs inside modal */
.modal-content .form-control[readonly],
.modal-content .form-control:disabled,
.modal-content .form-select:disabled {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #64748b !important;
}

/* Modal Labels */
.modal-content .form-label {
  color: #1e293b !important;
  font-weight: 700 !important;
}


/* Badges */
.badge-role {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  background: var(--primary-light);
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Table */
.table-container {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.table thead th {
  background: var(--primary-light);
  border-bottom: none;
  color: var(--primary-color);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 12px 16px;
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 0.9rem;
}
@media (max-width: 576px) {
  .table thead th,
  .table tbody td {
    padding: 10px 8px; /* Rapatkan tabel */
    font-size: 0.85rem;
  }
}

/* Login Page Specific */
.login-bg {
  background: var(--bg-main);
  background-image:
    radial-gradient(
      circle at 10% 20%,
      rgba(240, 103, 66, 0.05) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(240, 103, 66, 0.05) 0%,
      transparent 40%
    );
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.login-card {
  width: 100%;
  max-width: 450px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(240, 103, 66, 0.1);
  padding: 50px;
}

@media (max-width: 576px) {
  .login-bg {
    padding: 1.5rem 0;
  }
  .login-card {
    padding: 25px 15px;
    border-radius: 20px;
  }
  .login-card h1.h2 {
    font-size: 1.5rem !important;
  }
}

/* Interactive Badges & Action Buttons */
button.badge,
.badge[onclick],
a.badge,
button[onclick],
.btn-xs {
  cursor: pointer !important;
  transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.badge:hover,
.badge[onclick]:hover,
a.badge:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

