/* ============================================
   HOMEBETHE ADMIN PANEL - SHARED CSS
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f4f8;
  color: #1a202c;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #1e293b;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #334155;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 18px;
  font-weight: 700;
}

.logo-icon {
  font-size: 24px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
  padding: 0 6px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  color: #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.menu-item:hover {
  background: #334155;
  color: white;
}

.menu-item.active {
  background: #334155;
  color: #38bdf8;
  border-left-color: #38bdf8;
}

.menu-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

.menu-arrow {
  margin-left: auto;
  font-size: 11px;
  transition: transform 0.2s;
}

.menu-item.expanded .menu-arrow {
  transform: rotate(90deg);
}

.submenu {
  background: #0f172a;
  display: none;
  overflow: hidden;
}

.submenu.show {
  display: block;
}

.submenu .menu-item {
  padding-left: 56px;
  font-size: 13px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #334155;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: #94a3b8;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-wrapper {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: white;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #1a202c;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a202c;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-user {
  font-size: 14px;
  color: #4a5568;
  font-weight: 500;
}

.btn-logout {
  background: #ef4444;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
}

.btn-logout:hover {
  background: #dc2626;
}

.page-content {
  flex: 1;
  padding: 24px;
}

/* ============================================
   DASHBOARD CARDS
   ============================================ */
.welcome-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 26px 30px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.welcome-card h1 {
  font-size: 22px;
  margin-bottom: 6px;
}

.welcome-card p {
  opacity: 0.95;
  font-size: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  padding: 22px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 4px solid;
}

.stat-blue   { border-left-color: #3b82f6; }
.stat-green  { border-left-color: #10b981; }
.stat-purple { border-left-color: #8b5cf6; }
.stat-orange { border-left-color: #f59e0b; }

.stat-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7fafc;
  border-radius: 12px;
}

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 12px;
  color: #718096;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #1a202c;
}

.stat-meta {
  font-size: 12px;
  color: #a0aec0;
  margin-top: 2px;
}

.info-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.info-card {
  background: white;
  padding: 22px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info-card h3 {
  font-size: 16px;
  margin-bottom: 14px;
  color: #1a202c;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
}

.info-table td {
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid #edf2f7;
}

.info-table td:first-child {
  color: #718096;
  font-weight: 500;
  width: 40%;
}

.info-table td:last-child {
  color: #2d3748;
  font-weight: 600;
}

.info-table tr:last-child td {
  border-bottom: none;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quick-action {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #2d3748;
  transition: all 0.15s;
}

.quick-action:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-1px);
}

.quick-action span {
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
}

.phase-banner {
  background: #fffbea;
  border: 2px dashed #f6ad55;
  color: #7b341e;
  padding: 18px 22px;
  border-radius: 12px;
  text-align: center;
}

.phase-banner h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.phase-banner p {
  font-size: 14px;
}

/* ============================================
   COMING SOON PAGE
   ============================================ */
.coming-soon-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  flex-direction: column;
  text-align: center;
  padding: 40px 20px;
}

.coming-soon-page .icon {
  font-size: 80px;
  margin-bottom: 20px;
}

.coming-soon-page h1 {
  font-size: 28px;
  color: #1a202c;
  margin-bottom: 10px;
}

.coming-soon-page p {
  color: #718096;
  font-size: 15px;
  max-width: 500px;
  line-height: 1.6;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .hamburger {
    display: block;
  }

  .sidebar-close {
    display: block;
  }

  .topbar-user {
    display: none;
  }
}

@media (max-width: 600px) {
  .page-content {
    padding: 16px;
  }

  .welcome-card {
    padding: 20px;
  }

  .welcome-card h1 {
    font-size: 18px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 20px;
  }
}

/* ============================================
   DATA TABLE & LIST PAGE STYLES
   ============================================ */

.list-toolbar {
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.search-box input:focus { border-color: #667eea; }

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

.filter-select {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  outline: none;
}

.filter-select:focus { border-color: #667eea; }

.btn {
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary { background: #667eea; color: white; }
.btn-primary:hover { background: #5a67d8; }

.btn-success { background: #10b981; color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }

.btn-secondary { background: #e2e8f0; color: #2d3748; }
.btn-secondary:hover { background: #cbd5e1; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.data-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.data-table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: #f7fafc;
  color: #4a5568;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f7;
  color: #2d3748;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: #f7fafc; }

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.user-cell-info { min-width: 0; }

.user-cell-name {
  font-weight: 600;
  color: #1a202c;
  font-size: 13px;
  white-space: nowrap;
}

.user-cell-meta {
  font-size: 11px;
  color: #718096;
  margin-top: 2px;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-pending  { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-suspended { background: #ffedd5; color: #9a3412; }
.status-active   { background: #d1fae5; color: #065f46; }
.status-blocked  { background: #fee2e2; color: #991b1b; }
.status-inactive { background: #e2e8f0; color: #475569; }
.status-online   { background: #d1fae5; color: #065f46; }
.status-offline  { background: #e2e8f0; color: #475569; }

.actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: #f1f5f9;
  color: #475569;
  transition: all 0.1s;
}

.action-btn:hover { background: #e2e8f0; }
.action-btn.view { background: #dbeafe; color: #1e40af; }
.action-btn.view:hover { background: #bfdbfe; }
.action-btn.approve { background: #d1fae5; color: #065f46; }
.action-btn.approve:hover { background: #a7f3d0; }
.action-btn.reject { background: #fee2e2; color: #991b1b; }
.action-btn.reject:hover { background: #fecaca; }
.action-btn.block { background: #ffedd5; color: #9a3412; }
.action-btn.block:hover { background: #fed7aa; }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: #a0aec0;
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }

.pagination-bar {
  background: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #edf2f7;
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-info { font-size: 13px; color: #718096; }
.pagination-controls { display: flex; gap: 6px; }

.page-btn {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: #2d3748;
}

.page-btn:hover:not(:disabled) { background: #f7fafc; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn.active { background: #667eea; color: white; border-color: #667eea; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 17px; font-weight: 600; color: #1a202c; }

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #94a3b8;
  padding: 0 6px;
}

.modal-close:hover { color: #1a202c; }
.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f7;
  font-size: 14px;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  flex: 0 0 35%;
  color: #718096;
  font-weight: 500;
}

.detail-value { flex: 1; color: #2d3748; font-weight: 600; }

/* Toast notification */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: white;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  font-size: 14px;
  min-width: 250px;
  max-width: 400px;
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
}

.toast-success { border-left-color: #10b981; color: #065f46; }
.toast-error { border-left-color: #ef4444; color: #991b1b; }
.toast-info { border-left-color: #3b82f6; color: #1e40af; }

@keyframes slideIn {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 600px) {
  .data-table th, .data-table td {
    padding: 10px 12px;
    font-size: 12px;
  }
  .pagination-bar { flex-direction: column; align-items: stretch; }
  .modal { margin: 10px; }
}