/* ========== ROOT & VARIABLES ========== */
:root {
  --primary: #9e63f1;
  --primary-dark: #9046e5;
  --secondary: #ec4899;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #1f2937;
  --dark-light: #374151;
  --gray: #6b7280;
  --gray-light: #f3f4f6;
  --border: #e5e7eb;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ========== GENERAL STYLES ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--gray-light);
  color: var(--dark);
  overflow-x: hidden;
}

body.sidebar-open {
  overflow: hidden;
}

html,
body {
  width: 100%;
  height: 100%;
}

/* ========== AUTH CHECK STYLING ========== */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.auth-loader {
  text-align: center;
  color: var(--white);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ========== ADMIN PANEL LAYOUT ========== */
.admin-panel {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  z-index: 1000;
}

.sidebar-overlay {
  display: none;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  text-decoration: none;
}

.admin-brand .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.admin-brand .logo-word {
  display: inline-block;
  color: var(--primary);
}

.admin-brand .logo-word span {
  color: #a78bfa;
}

.admin-brand .logo-mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 0;
  display: block;
}

.logo-subtitle {
  display: block;
  font-size: 12px;
  color: var(--gray);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-menu {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 20px;
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--gray);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--gray-light);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  border-left-color: var(--primary);
}

.nav-link i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-light);
  border: 2px solid var(--border);
  object-fit: cover;
}

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
}

.user-email {
  font-size: 12px;
  color: var(--gray);
  word-break: break-word;
}

.logout-btn {
  width: 100%;
  padding: 10px;
  background: var(--danger);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.3s ease;
}

.logout-btn:hover {
  background: #dc2626;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.top-bar-primary {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.mobile-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  color: var(--dark);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: var(--shadow-sm);
}

.mobile-menu-btn:hover {
  color: var(--primary);
  border-color: rgba(158, 99, 241, 0.35);
}

.search-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-light);
  padding: 10px 16px;
  border-radius: 8px;
  flex: 0 1 300px;
  min-width: 0;
}

.search-container i {
  color: var(--gray);
}

.search-container input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--dark);
}

.search-container input::placeholder {
  color: var(--gray);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.top-refresh-btn {
  padding: 9px 14px;
  white-space: nowrap;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  background: var(--gray-light);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: var(--border);
  color: var(--primary);
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: var(--white);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.theme-toggle {
  cursor: pointer;
  width: 40px;
  height: 40px;
  background: var(--gray-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 18px;
  transition: color 0.3s ease, background 0.3s ease;
}

.theme-toggle:hover {
  color: var(--primary);
  background: var(--border);
}

/* ========== CONTENT SECTIONS ========== */
.content-section {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  min-width: 0;
}

.content-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.section-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
}

.subtitle {
  color: var(--gray);
  font-size: 14px;
  margin: 0;
}

/* ========== DASHBOARD STATS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--white);
}

.stat-icon.revenue {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.stat-icon.users {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.stat-icon.sites {
  background: linear-gradient(135deg, var(--secondary) 0%, #be185d 100%);
}

.stat-icon.health {
  background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.stat-label {
  font-size: 13px;
  color: var(--gray);
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-change {
  font-size: 12px;
  margin: 4px 0 0 0;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.neutral {
  color: var(--gray);
}

/* ========== CHARTS & RECENT ORDERS ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.chart-card h3 {
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
}

.chart-placeholder {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-light);
  border-radius: 8px;
  color: var(--gray);
  font-size: 14px;
}

.recent-list {
  max-height: 500px;
  overflow-y: auto;
}

.recent-list .empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--gray);
}

/* ========== FILTERS ========== */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  color: var(--dark);
  transition: border-color 0.3s ease;
  flex: 1;
  min-width: 180px;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ========== TABLES ========== */
.table-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--gray-light);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: top;
}

.data-table tbody tr:hover {
  background: var(--gray-light);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.empty-state {
  padding: 40px 16px;
  text-align: center;
  color: var(--gray);
}

.table-actions-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== PROJECTS GRID ========== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.project-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark);
  word-break: break-word;
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.project-meta {
  font-size: 13px;
  color: var(--gray);
  margin: 4px 0;
}

.projects-section-group {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.projects-section-group h3 {
  color: var(--dark);
  font-size: 18px;
}

.project-detail-grid {
  display: grid;
  gap: 16px;
}

.project-detail-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: var(--gray-light);
}

.project-detail-section h4 {
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--dark);
}

.project-detail-block + .project-detail-block,
.project-detail-row + .project-detail-block,
.project-detail-block + .project-detail-row {
  margin-top: 14px;
}

.project-detail-block h5 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-detail-subgrid {
  display: grid;
  gap: 10px;
}

.project-detail-subitem {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.project-detail-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(229, 231, 235, 0.8);
}

.project-detail-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.project-detail-row span {
  color: var(--gray);
  font-size: 13px;
}

.project-detail-row strong {
  color: var(--dark);
  font-size: 13px;
  text-align: left;
  max-width: 100%;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.6;
}

.project-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.project-status-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.project-status-ongoing {
  background: rgba(99, 102, 241, 0.14);
  color: #4338ca;
}

.project-status-completed {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.project-card-controls {
  margin-top: 14px;
}

.project-status-select {
  min-width: 180px;
}

.payment-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.payment-status.paid {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.payment-status.unpaid {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

/* ========== BUTTONS ========== */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--gray-light);
  color: var(--dark);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  padding: 6px 12px;
  font-size: 12px;
}

.btn-danger:hover {
  background: #dc2626;
}

/* ========== MODALS ========== */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--white);
  border-radius: 10px;
  min-width: 400px;
  max-width: 600px;
  width: 90%;
  max-height: calc(100vh - 40px);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  display: flex;
  flex-direction: column;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--dark);
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: var(--dark);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--gray-light);
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--dark);
  transition: border-color 0.3s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
  color: var(--gray);
}

textarea.form-control {
  resize: vertical;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
}

.config-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.config-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--dark);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .top-bar {
    flex-wrap: wrap;
  }

  .search-container {
    flex: 1 1 100%;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .project-card-top {
    flex-direction: column;
  }

  .project-detail-row {
    grid-template-columns: 1fr;
  }

  .modal-content {
    min-width: auto;
  }

  .filters {
    gap: 8px;
  }

  .filter-input {
    min-width: 150px;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .admin-panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, 86vw);
    height: 100vh;
    max-width: 100%;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 1001;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    z-index: 1000;
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .top-bar {
    padding: 16px 20px;
    gap: 14px;
    flex-wrap: wrap;
  }

  .top-bar-primary {
    flex: 1 1 100%;
  }

  .search-container {
    flex: 1 1 auto;
  }

  .top-bar-actions {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }

  .content-section {
    padding: 24px 20px;
  }

  .section-header {
    gap: 14px;
  }

  .section-header h2 {
    font-size: 24px;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 640px) {
  .top-bar {
    padding: 14px 16px;
  }

  .top-bar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: stretch;
  }

  .top-bar-actions > * {
    flex: none;
  }

  .top-refresh-btn,
  .icon-btn,
  .theme-toggle,
  .mobile-menu-btn {
    min-height: 42px;
  }

  .icon-btn,
  .mobile-menu-btn {
    width: 42px;
  }

  .top-refresh-btn {
    width: 100%;
    justify-content: center;
  }

  .content-section {
    padding: 18px 16px 24px;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .section-header .btn {
    width: 100%;
    justify-content: center;
  }

  .filters {
    flex-direction: column;
    gap: 10px;
  }

  .filter-input {
    width: 100%;
    min-width: 0;
  }

  .stat-card,
  .chart-card,
  .config-card,
  .project-card,
  .project-detail-section {
    padding: 16px;
  }

  .project-card-top {
    gap: 10px;
  }

  .project-status-select {
    min-width: 0;
  }

  .modal {
    padding: 12px;
  }

  .modal.show {
    align-items: flex-end;
  }

  .modal-content {
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: calc(100vh - 24px);
    border-radius: 16px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-header {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .modal-body {
    max-height: calc(100vh - 180px);
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .table-container {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 12px;
  }

  .data-table tbody tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
  }

  .data-table tbody tr:hover {
    background: var(--white);
  }

  .data-table td {
    padding: 8px 0;
    border-bottom: none;
    display: grid;
    grid-template-columns: minmax(88px, 104px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .data-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray);
  }

  .data-table td.empty-state {
    display: block;
    padding: 24px 12px;
    text-align: center;
  }

  .data-table td.empty-state::before {
    content: none;
  }

  .data-table code {
    word-break: break-all;
  }

  .table-actions-wrap {
    justify-content: flex-start;
  }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-light);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray);
}
