/* === Reset dan Dasar === */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: 'Segoe UI', sans-serif;
  background-color: #ffffff;
}

/* === LOGIN PAGE STYLES === */
.login-wrapper {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, #e60000 0%, #b30000 100%);
}

.left-side {
  flex: 1;
  background: url('../img/bg-login.jpg') center/cover;
  position: relative;
}

.left-side::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(230, 0, 0, 0.7);
}

.right-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 2rem;
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.btn-pmi {
  background-color: #e60000;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 5px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-pmi:hover {
  background-color: #b30000;
  color: white;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .login-wrapper {
    flex-direction: column;
  }
  
  .left-side {
    min-height: 200px;
  }
  
  .right-side {
    padding: 1rem;
  }
}

/* === ADMIN LAYOUT STYLES === */
.wrapper {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.admin-wrapper {
  display: flex;
  flex: 1;
}

/* === Sidebar === */
.sidebar {
  width: 240px;
  background-color: #e60000;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: all 0.3s ease;
  padding-top: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Desktop Collapsed */
.sidebar.collapsed {
  width: 90px;
}

/* Mobile Hidden */
.sidebar.mobile-hidden {
  transform: translateX(-100%);
}

/* Mobile Show */
.sidebar.mobile-show {
  transform: translateX(0);
}

/* === Logo === */
.sidebar .logo-container {
  text-align: center;
  padding: 0 1rem 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .logo-img {
  width: 150px;
  margin: 0 auto 1rem;
  transition: all 0.3s ease;
  display: block;
}

.sidebar.collapsed .logo-img {
  width: 50px;
}

.sidebar .logo-text {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.5rem;
  opacity: 1;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.sidebar.collapsed .logo-text {
  opacity: 0;
  transform: scale(0);
  height: 0;
  margin: 0;
}

/* === Navigation - HILANGKAN BULLET POINT === */
.sidebar .nav-menu,
.sidebar ul,
.sidebar ol {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0;
  padding: 0;
}

.sidebar .nav-menu {
  flex-grow: 1;
  padding: 0 0.5rem;
}

.sidebar .nav-item {
  margin-bottom: 0.25rem;
  position: relative;
  list-style: none !important;
  list-style-type: none !important;
}

.sidebar .nav-link {
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: 500;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.sidebar .nav-link:hover {
  background-color: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar .nav-link.active {
  background-color: #fff;
  color: #e60000;
  font-weight: 600;
}

.sidebar .nav-link i {
  font-size: 1rem;
  margin-right: 8px;
  min-width: 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.sidebar.collapsed .nav-link i {
  margin-right: 0;
}

.sidebar .nav-link .label {
  opacity: 1;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.sidebar.collapsed .nav-link .label {
  opacity: 0;
  display: none;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 8px;
  margin: 0 0.25rem 0.25rem;
}

/* === Sub Menu Styles === */
.sidebar .has-sub {
  position: relative;
}

/* Panah untuk sub menu */
.sidebar .has-sub > .nav-link {
  position: relative;
}

.sidebar .has-sub > .nav-link .arrow {
  margin-left: auto;
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.sidebar .has-sub.open > .nav-link .arrow {
  transform: rotate(180deg);
}

/* Sub menu container */
.sidebar .submenu {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background-color: rgba(0,0,0,0.1);
  border-radius: 4px;
  margin-top: 4px;
}

.sidebar .has-sub.open .submenu {
  max-height: 300px;
  padding: 4px 0;
}

.sidebar .submenu li {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0;
  padding: 0;
}

.sidebar .submenu .nav-link {
  padding: 6px 12px 6px 40px;
  font-size: 0.85rem;
  font-weight: 400;
  position: relative;
}

.sidebar .submenu .nav-link::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background-color: rgba(255,255,255,0.6);
  border-radius: 50%;
}

.sidebar .submenu .nav-link:hover::before,
.sidebar .submenu .nav-link.active::before {
  background-color: #fff;
  width: 6px;
  height: 6px;
}

/* Collapsed state untuk submenu */
.sidebar.collapsed .has-sub > .nav-link .arrow {
  display: none;
}

.sidebar.collapsed .submenu {
  display: none;
}

/* === Main Content === */
.main-content {
  margin-left: 240px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f8f9fa;
}

.sidebar.collapsed ~ .main-content {
  margin-left: 90px;
}

/* === Topbar === */
.topbar {
  background-color: #fff;
  border-bottom: 4px solid #e60000;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.toggle-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #333;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.toggle-btn:hover {
  background-color: #f8f9fa;
  color: #e60000;
}

/* === Content Area === */
.content-area {
  flex: 1;
  padding: 1rem;
  overflow-x: auto;
}

/* === Mobile Overlay === */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 999;
}

.mobile-overlay.show {
  display: block;
}

/* === Footer === */
footer {
  background-color: #fff;
  border-top: 4px solid #e60000;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
  margin-top: auto;
  position: relative;
  z-index: 50;
}

/* Untuk halaman yang tidak menggunakan sidebar */
.no-sidebar footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}

.no-sidebar .main-content {
  margin-left: 0;
  padding-bottom: 60px; /* Space untuk footer */
}

/* === DataTable === */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 1rem;
}

table.dataTable {
  width: 100% !important;
  min-width: 800px;
}

table.dataTable thead th {
  background-color: #e60000;
  color: white;
  border-color: #b30000;
}

table.dataTable tbody tr:hover {
  background-color: #f8f9fa;
}

/* === Cards === */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}

.card-header {
  background-color: #e60000;
  color: white;
  border-radius: 10px 10px 0 0 !important;
  font-weight: 600;
}

/* === Buttons === */
.btn-primary {
  background-color: #e60000;
  border-color: #e60000;
}

.btn-primary:hover {
  background-color: #b30000;
  border-color: #b30000;
}

.btn-outline-primary {
  color: #e60000;
  border-color: #e60000;
}

.btn-outline-primary:hover {
  background-color: #e60000;
  border-color: #e60000;
}

/* === Alerts === */
.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.alert-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

/* === Forms === */
.form-control:focus {
  border-color: #e60000;
  box-shadow: 0 0 0 0.2rem rgba(230, 0, 0, 0.25);
}

.form-select:focus {
  border-color: #e60000;
  box-shadow: 0 0 0 0.2rem rgba(230, 0, 0, 0.25);
}

/* === Responsive === */
@media (min-width: 769px) {
  .sidebar {
    transform: translateX(0) !important;
    display: flex !important;
  }
  
  .mobile-overlay {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    z-index: 1001;
  }

/* Biarkan submenu tersembunyi dulu */
.sidebar.collapsed .has-sub .submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  width: 200px;
  background-color: #c00;
  border-radius: 0 4px 4px 0;
  z-index: 2000;
}

/* Tampilkan submenu saat has-sub open */
.sidebar.collapsed .has-sub.open .submenu {
  display: block;
}


  
  .sidebar.mobile-show {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  .sidebar .nav-link .label {
    display: block !important;
    opacity: 1 !important;
  }
  
  .sidebar .logo-text {
    display: block !important;
    opacity: 1 !important;
  }
  
  .topbar {
    padding: 0.5rem;
  }
  
  .content-area {
    padding: 0.75rem;
  }
  
  .toggle-btn {
    z-index: 1002;
  }
  
  /* Table responsive di mobile */
  table.dataTable {
    min-width: 600px;
  }
}

@media (max-width: 576px) {
  .sidebar {
    width: 260px;
  }
  
  .login-box {
    padding: 1.5rem;
  }
  
  table.dataTable {
    min-width: 500px;
    font-size: 0.85rem;
  }
}

/* === Utilities === */
.text-pmi {
  color: #e60000 !important;
}

.bg-pmi {
  background-color: #e60000 !important;
}

.border-pmi {
  border-color: #e60000 !important;
}

/* === Loading States === */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

  .is-invalid {
    border-color: #dc3545 !important;
  }

/* === Custom Scroll
