/* --- admin.css: Responsive Font & Dynamic Header Sidebar --- */
body { 
  background-color: #f4f6fa !important; 
  overflow-x: hidden; 
}

.d-none { display: none !important; }

.nav-link.active {
  background-color: rgba(32, 107, 196, 0.1);
  color: #206bc4 !important;
  font-weight: 600;
  border-radius: 6px;
}

/* --- FONT RESPONSIF & TYPOGRAPHY --- */
.navbar-brand {
  font-size: clamp(0.85rem, 1.8vw, 1.15rem) !important;
  white-space: normal;
  line-height: 1.2;
}

.navbar-brand .badge {
  font-size: clamp(0.7rem, 1.4vw, 0.9rem) !important;
  padding: 0.3em 0.6em;
}

#admin-user-display {
  font-size: clamp(0.75rem, 1.2vw, 0.875rem) !important;
}

.page-title, h2.page-title {
  font-size: clamp(1.25rem, 2.5vw, 2rem) !important;
  line-height: 1.3 !important;
}

/* --- STRUKTUR FLEX DASHBOARD & SIDEBAR --- */
#section-dashboard {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  overflow: hidden !important;
}

#section-dashboard > header {
  flex-shrink: 0;
  z-index: 1050;
}

.admin-main-wrapper {
  display: flex !important;
  flex: 1 1 auto !important;
  position: relative !important;
  overflow: hidden !important;
}

#sidebar-container {
  position: absolute !important;
  top: 0; bottom: 0; left: 0;
  width: 70px;
  min-width: 70px;
  height: 100% !important;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
  white-space: nowrap;
  background-color: #ffffff;
  z-index: 1040;
  box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}

#sidebar-container:hover,
#sidebar-container.sidebar-mobile-open {
  width: 260px;
  box-shadow: 6px 0 20px rgba(0,0,0,0.12);
}

#sidebar-container .nav-link span.menu-text,
#sidebar-container .sidebar-title-text {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
  display: inline-block;
  width: 0;
  overflow: hidden;
}

#sidebar-container:hover .nav-link span.menu-text,
#sidebar-container.sidebar-mobile-open .nav-link span.menu-text,
#sidebar-container:hover .sidebar-title-text,
#sidebar-container.sidebar-mobile-open .sidebar-title-text {
  opacity: 1;
  visibility: visible;
  width: auto;
}

#sidebar-container .nav-link i {
  font-size: 1.25rem;
  min-width: 35px;
  text-align: center;
}

/* --- AREA KONTEN UTAMA --- */
#main-content-area {
  position: relative !important;
  flex: 1 1 auto !important;
  width: calc(100% - 70px) !important;
  margin-left: 70px !important;
  padding: 20px !important;
  height: 100% !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

/* --- KOMPONEN KHUSUS (PAIRING & MATRIX) --- */
.pairing-code-box {
  font-size: clamp(1.2rem, 4vw, 2.2rem);
  letter-spacing: clamp(2px, 1vw, 6px);
  font-weight: 800;
  color: #0d6efd;
  background: #eef5ff;
  border: 2px dashed #0d6efd;
  border-radius: 10px;
  padding: 8px 16px;
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
}

.matrix-split-cell {
  background: linear-gradient(135deg, #f59f00 50%, #d63939 50%);
  color: #fff !important;
  position: relative;
}

#tab-finances .avatar {
  width: 3rem !important;
  height: 3rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

#tab-finances .avatar i {
  font-size: 1.5rem !important;
  line-height: 1 !important;
}

/* --- FOOTER --- */
.footer { padding: 1rem 0; }
.footer small { font-size: 0.85rem; }

/* --- MEDIA QUERIES (MOBILE) --- */
@media (max-width: 768px) {
  #main-content-area { padding: 12px !important; }
  
  #sidebar-container .nav-link i {
    font-size: 1.1rem !important;
    min-width: 28px !important;
  }
  
  .card .ti, .btn .ti { font-size: 1rem !important; }

  .table th, .table td {
    padding: 0.5rem 0.4rem !important;
    font-size: 0.85rem !important;
  }

  .badge {
    font-size: 0.7rem !important;
    padding: 0.25em 0.5em !important;
  }

  .card-title, .h2, h2 { font-size: 1.15rem !important; }
  .display-5 { font-size: 1.75rem !important; }

  #section-dashboard > footer, .footer {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
  
  .footer small, .footer .container-fluid { font-size: 0.7rem !important; }
}

/* --- BOOTSTRAP 5 DARK MODE --- */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] #main-content-area {
  background-color: #121212 !important;
  color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .card {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
  border-color: #2c2c2c !important;
}

[data-bs-theme="dark"] #sidebar-container {
  background-color: #1e1e1e !important;
  border-color: #2c2c2c !important;
}

[data-bs-theme="dark"] #sidebar-container .nav-link {
  color: #e0e0e0 !important;
}

[data-bs-theme="dark"] #sidebar-container .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .bg-white {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
  border-color: #2c2c2c !important;
}

[data-bs-theme="dark"] .bg-light {
  background-color: #181818 !important;
  color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .table {
  color: #e0e0e0 !important;
  border-color: #2c2c2c !important;
}

[data-bs-theme="dark"] .table-bordered th, 
[data-bs-theme="dark"] .table-bordered td {
  border-color: #2c2c2c !important;
}


