/* =====================================================
   ADMIN GLOBAL STYLE
===================================================== */

body {
  background: #f5f7fa;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

/* =====================================================
   LAYOUT
===================================================== */

.sidebar {
  width: 260px;
  min-height: 100vh;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 2px 0 8px rgba(0,0,0,0.05);
  padding: 24px 0;
  position: sticky;
  top: 0;
  transition: all 0.3s ease;
  z-index: 1001;
}

.sidebar h5 {
  font-weight: 700;
  font-size: 1.25rem;
  color: #0d6efd;
  padding: 0 20px;
  margin-bottom: 32px;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar a {
  color: #4b5563;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-weight: 500;
  transition: 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar a:hover {
  background: #f3f4f6;
  color: #0d6efd;
}

.sidebar a.active {
  background: #eff6ff;
  color: #0d6efd;
  font-weight: 600;
}

.content {
  flex: 1;
  padding: 32px;
  width: calc(100% - 260px);
  transition: all 0.3s ease;
}

/* =====================================================
   SIDEBAR OVERLAY (MOBILE)
===================================================== */

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
}

/* =====================================================
   TOPBAR (MOBILE)
===================================================== */

.admin-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.topbar-title {
  font-weight: 600;
  color: #111827;
  font-size: 1.1rem;
}

#sidebarToggle {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #374151;
}

#sidebarToggle:hover {
  background: #f9fafb;
}

/* =====================================================
   DESKTOP: COLLAPSIBLE SIDEBAR
===================================================== */

@media (min-width: 769px) {
  /* Sidebar collapsed state */
  .sidebar-open .sidebar {
    width: 80px;
  }
  
  .sidebar-open .sidebar h5 {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
  }
  
  .sidebar-open .sidebar hr {
    margin: 10px 0;
    opacity: 0.5;
  }
  
  .sidebar-open .sidebar a {
    justify-content: center;
    padding: 12px 8px;
  }
  
  .sidebar-open .sidebar a span {
    display: none;
  }
  
  .sidebar-open .sidebar a i {
    margin-right: 0;
    font-size: 1.2rem;
  }
  
  .sidebar-open .sidebar form {
    padding: 0 10px;
  }
  
  .sidebar-open .sidebar .btn {
    padding: 6px;
    font-size: 0.9rem;
  }
  
  /* Content adjustment when sidebar collapsed */
  .sidebar-open .content {
    width: calc(100% - 80px);
  }
}

/* =====================================================
   MOBILE: HAMBURGER MENU
===================================================== */

@media (max-width: 768px) {
  .admin-topbar {
    display: flex;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    transform: translateX(-100%);
    z-index: 1001;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  }
  
  /* Sidebar open state on mobile */
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  
  .content {
    width: 100%;
    padding: 20px 16px;
    margin-top: 0;
  }
  
  /* Adjust content when sidebar is open on mobile */
  .sidebar-open .content {
    transform: translateX(260px);
  }
  
  /* Hide scrollbar when sidebar is open */
  .sidebar-open {
    overflow: hidden;
  }
}

/* =====================================================
   RESPONSIVE ADJUSTMENTS
===================================================== */

@media (max-width: 768px) {
  .content {
    padding: 20px 16px;
  }
  
  .stat-card h3 {
    font-size: 1.8rem;
  }
  
  .table-responsive {
    font-size: 0.9rem;
  }
  
  .table thead th,
  .table tbody td {
    padding: 12px 10px;
  }
}

/* =====================================================
   GLOBAL CARD (USER & PAYMENT SAFE)
===================================================== */

.card {
  background: white;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.card-body {
  padding: 24px;
}

/* =====================================================
   TABLE (USER / PAYMENT)
===================================================== */

.table {
  width: 100%;
}

.table thead th {
  background: #f9fafb;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  padding: 14px;
}

.table tbody td {
  padding: 14px;
  vertical-align: middle;
}

/* =====================================================
   BUTTON
===================================================== */

.btn {
  border-radius: 8px;
  font-weight: 500;
}

.btn-sm {
  padding: 6px 12px;
}

/* =====================================================
   BADGE
===================================================== */

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }

/* =====================================================
   ADMIN DASHBOARD ONLY
===================================================== */

.admin-dashboard {
  background: linear-gradient(135deg,#f8fafc,#f1f5f9);
  min-height: 100vh;
}

.admin-container {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 1rem;
  padding-bottom: 4rem;
}

/* HEADER */
.admin-header h2 {
  font-weight: 800;
  margin-bottom: 4px;
}

.admin-header p {
  color: #64748b;
}

/* =====================================================
   STAT CARD
===================================================== */

.stat-card {
  height: 100%;
  background: white;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  transition: 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card:hover {
  transform: translateY(-6px);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.stat-primary .stat-icon { background: #6366f1; }
.stat-success .stat-icon { background: #10b981; }
.stat-warning .stat-icon { background: #f59e0b; }
.stat-info    .stat-icon { background: #0ea5e9; }

.stat-card span {
  font-size: 0.9rem;
  color: #64748b;
}

.stat-card h3 {
  font-size: 2.3rem;
  font-weight: 800;
  margin: 0;
}

/* =====================================================
   QUICK ACCESS
===================================================== */

.quick-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: 0.25s ease;
}

.quick-link:hover {
  background: #f1f5f9;
  transform: translateX(6px);
}

.quick-link i {
  font-size: 1.6rem;
  color: #6366f1;
}

/* =====================================================
   ACTIVITY
===================================================== */

.activity-item {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.activity-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
}

.dot.success { background: #10b981; }
.dot.failed  { background: #ef4444; }
.dot.waiting { background: #f59e0b; }

/* =====================================================
   BOOTSTRAP GRID FIX (DASHBOARD ONLY)
===================================================== */

.admin-dashboard .row > [class*="col-"] {
  display: flex;
}

.admin-dashboard .row > [class*="col-"] > * {
  width: 100%;
}

/* =====================================================
   USER STATS
===================================================== */

.user-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: #374151;
}

.stat-label i {
  font-size: 1.1rem;
}

.stat-value {
  font-weight: 700;
  font-size: 1.2rem;
  color: #111827;
}

/* SYSTEM INFO */
.system-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 500;
  color: #6b7280;
  font-size: 0.95rem;
}

.info-value {
  font-weight: 600;
  color: #111827;
  font-size: 0.95rem;
}

/* PENDING PAYMENTS TABLE */
.table-responsive {
  border-radius: 12px;
  overflow: hidden;
}

.table {
  margin: 0;
}

.table thead th {
  background: #f9fafb;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 20px;
  border: none;
}

.table tbody td {
  padding: 16px 20px;
  vertical-align: middle;
  border-top: 1px solid #f3f4f6;
  border-bottom: none;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background: #f9fafb;
}

/* BUTTON GROUP FOR ACTIONS */
.btn-group-sm .btn {
  padding: 4px 8px;
  font-size: 0.875rem;
}

/* EMPTY STATE */
.text-center.py-5 {
  padding: 3rem 0;
}

.text-center.py-5 i {
  opacity: 0.6;
}



/* =====================================================
   TABLE ACTION FIX
===================================================== */

/* Memastikan action column tetap rapi */
.table td:last-child {
    white-space: nowrap;
}

/* Responsive actions */
@media (max-width: 768px) {
    .table-responsive {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Compact table on mobile */
    .table {
        min-width: 600px; /* Minimum width untuk scroll horizontal */
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        vertical-align: middle;
    }
    
    /* Action buttons lebih compact */
    .d-flex.gap-1 {
        gap: 0.25rem !important;
    }
    
    .btn-sm {
        min-width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.25rem;
    }
    
    .btn-sm i {
        font-size: 0.875rem;
    }
    
    /* Hide text on very small screens */
    @media (max-width: 576px) {
        .btn-sm span {
            display: none;
        }
        
        .btn-sm i {
            margin: 0 !important;
        }
    }
}

/* Tooltip untuk tombol aksi */
[title] {
    position: relative;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}