:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --secondary: #6c757d;
  --success: #0f9d58;
  --warning: #f4b400;
  --danger: #db4437;
  --info: #4285f4;
  --dark: #202124;
  --light: #f8f9fa;
  --body-bg: #f0f2f5;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --card-shadow-hover: 0 10px 40px rgba(0,0,0,0.08);
  --font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-family);
  background: var(--body-bg);
  color: #333;
  line-height: 1.6;
}

/* Modern Card */
.modern-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: all 0.2s ease;
  border: none;
   overflow: hidden;
}
.modern-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

/* Stats Card */
.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--primary);
  transition: all 0.2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.stat-card .stat-value { font-size: 32px; font-weight: 800; line-height: 1.2; }
.stat-card .stat-label { font-size: 14px; color: #5f6368; font-weight: 600; }

/* Gradient backgrounds for stat cards */
.stat-card.pending { border-left-color: #ea4335; }
.stat-card.pending .stat-icon { background: #fce8e6; color: #ea4335; }
.stat-card.inprogress { border-left-color: #fbbc04; }
.stat-card.inprogress .stat-icon { background: #fef7e0; color: #f9ab00; }
.stat-card.resolved { border-left-color: #34a853; }
.stat-card.resolved .stat-icon { background: #e6f4ea; color: #34a853; }
.stat-card.forwarded { border-left-color: #4285f4; }
.stat-card.forwarded .stat-icon { background: #e8f0fe; color: #4285f4; }

/* Table Modern */
.table-modern {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.table-modern thead th {
  background: #f8f9fa;
  color: #5f6368;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  border-bottom: 2px solid #e8eaed;
}
.table-modern tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}
.table-modern tbody tr { transition: background 0.15s ease; }
.table-modern tbody tr:hover { background: #f8f9fa; }
.table-modern tbody tr:last-child td { border-bottom: none; }

/* Badge Modern */
.badge-modern {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-modern.open { background: #fce8e6; color: #c5221f; }
.badge-modern.in-progress { background: #fef7e0; color: #e37400; }
.badge-modern.resolved { background: #e6f4ea; color: #1e8e3e; }
.badge-modern.closed { background: #e8eaed; color: #5f6368; }

/* Button Modern */
.btn-modern {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-modern-primary { background: var(--primary); color: #fff; }
.btn-modern-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,115,232,0.3); }
.btn-modern-success { background: var(--success); color: #fff; }
.btn-modern-success:hover { background: #0b8043; transform: translateY(-1px); }
.btn-modern-danger { background: var(--danger); color: #fff; }
.btn-modern-danger:hover { background: #c5221f; transform: translateY(-1px); }
.btn-modern-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-modern-outline:hover { background: var(--primary-light); }

/* Sidebar Modern */
.sidebar-modern {
  background: #1e293b;
  color: #cbd5e1;
  min-height: 100vh;
  width: 260px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: all 0.3s ease;
}
.sidebar-modern .sidebar-brand {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-modern .sidebar-brand img { height: 40px; }
.sidebar-modern .sidebar-brand span { font-size: 18px; font-weight: 800; color: #fff; }
.sidebar-modern .nav-item { padding: 0; }
.sidebar-modern .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 600;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.sidebar-modern .nav-link:hover, .sidebar-modern .nav-link.active {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border-left-color: var(--primary);
}
.sidebar-modern .nav-link i { width: 20px; text-align: center; font-size: 16px; }

/* Navbar Modern */
.navbar-modern {
  background: #fff;
  padding: 12px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main content area */
.main-content {
  margin-left: 260px;
  padding: 24px;
  min-height: 100vh;
}

/* Page header */
.page-header {
  margin-bottom: 24px;
}
.page-header h2 { font-size: 24px; font-weight: 800; color: #1e293b; margin: 0; }
.page-header p { color: #64748b; margin: 4px 0 0; font-size: 14px; }

/* Grid */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h4 { font-weight: 700; margin-bottom: 8px; color: #64748b; }

/* Responsive */
@media (max-width: 992px) {
  .sidebar-modern { transform: translateX(-100%); }
  .sidebar-modern.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
}

/* ============================================
   GLOBAL OVERFLOW PREVENTION
   ============================================ */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}
.container-scroller {
  overflow-x: hidden;
  max-width: 100%;
}
.main-panel, .main-content {
  overflow-x: hidden;
  min-width: 0;
}
.table-responsive {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
.card, .modern-card {
  overflow: hidden;
}

/* Login page unified */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 20px;
}
.login-card-modern {
  background: #fff;
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.15);
}
.login-card-modern .login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-card-modern .login-logo img { height: 64px; }
.login-card-modern .login-logo h2 { font-size: 22px; font-weight: 800; margin: 16px 0 4px; color: #1e293b; }
.login-card-modern .login-logo p { color: #64748b; font-size: 14px; margin: 0; }

/* Form elements */
.form-group-modern { margin-bottom: 20px; }
.form-group-modern label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}
.form-group-modern .input-wrap {
  position: relative;
}
.form-group-modern .input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}
.form-control-modern {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  background: #f8fafc;
  transition: all 0.2s;
  outline: none;
}
.form-control-modern:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(26,115,232,0.1);
}
.form-control-modern.no-icon { padding-left: 16px; }

.btn-login {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,115,232,0.3); }

/* Loader overlay */
.loader-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.4);
  backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 9999;
}
.spinner-modern { width: 48px; height: 48px; border-radius: 50%; border: 5px solid #e2e8f0; border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast notification */
.toast-modern {
  position: fixed; top: 20px; right: 20px; z-index: 10000;
  padding: 16px 24px; border-radius: 12px; font-weight: 700;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  display: none; align-items: center; gap: 10px;
  animation: slideIn 0.3s ease;
}
.toast-modern.success { background: #e6f4ea; color: #1e8e3e; border-left: 4px solid #34a853; }
.toast-modern.error { background: #fce8e6; color: #c5221f; border-left: 4px solid #ea4335; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================
   NAVBAR MODERN - Full Implementation
   ============================================ */
.navbar-modern {
  background: #fff;
  padding: 0 24px;
  height: 64px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e8eaed;
}
.navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.sidebar-toggle-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #475569;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}
.sidebar-toggle-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.navbar-brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.navbar-brand-text {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
}
@media (max-width: 576px) {
  .navbar-brand-text { display: none; }
}
.navbar-date {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
  padding: 6px 12px;
  background: #f8fafc;
  border-radius: 8px;
  white-space: nowrap;
}
@media (max-width: 576px) {
  .navbar-date { display: none; }
}
.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 4px 12px 4px 4px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}
.profile-btn:hover { background: #f1f5f9; }
.profile-btn img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}
.profile-name {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}
.profile-btn .fa-chevron-down {
  font-size: 10px;
  color: #94a3b8;
}

/* ============================================
   SIDEBAR MODERN - Full Implementation
   ============================================ */
.sidebar-modern {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #cbd5e1;
  width: 260px;
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-modern .sidebar-brand {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.sidebar-modern .sidebar-brand img { height: 36px; }
.sidebar-modern .sidebar-brand span {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex: 1;
}
.sidebar-close-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.sidebar-nav-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}
.sidebar-nav-wrap::-webkit-scrollbar { width: 4px; }
.sidebar-nav-wrap::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-nav .nav-item { margin: 1px 0; }
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  margin: 0 8px;
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px;
  border-left: none;
}
.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
}
.sidebar-nav .nav-link.active {
  background: rgba(26,115,232,0.15);
  color: #60a5fa;
}
.sidebar-nav .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}
.sidebar-nav .nav-link.nav-logout {
  color: #f87171;
}
.sidebar-nav .nav-link.nav-logout:hover {
  background: rgba(248,113,113,0.1);
  color: #fca5a5;
}
.nav-divider {
  padding: 8px 20px 4px;
  margin: 8px 0;
  list-style: none;
}
.nav-divider span {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ============================================
   MAIN PANEL & CONTENT
   ============================================ */
.main-panel {
  margin-left: 260px;
  margin-top: 64px;
  width: calc(100% - 260px);
  min-height: calc(100vh - 64px);
  min-width: 0;
  overflow-x: hidden;
  transition: margin-left 0.3s ease;
}
.content-wrapper {
  padding: 24px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
@media (max-width: 992px) {
  .content-wrapper {
    padding: 20px;
  }
}
@media (max-width: 767px) {
  .content-wrapper {
    padding: 16px;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
  .sidebar-modern {
    transform: translateX(-100%);
  }
  .sidebar-modern.show {
    transform: translateX(0);
  }
  .sidebar-modern.show + .sidebar-overlay.show {
    display: block;
  }
  .main-panel {
    margin-left: 0;
    width: 100%;
  }
}
@media (min-width: 993px) {
  .sidebar-overlay { display: none !important; }
}
@media (max-width: 576px) {
  .content-wrapper { padding: 16px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 26px; }
}

/* ============================================
   EXISTING VIEW OVERRIDES - make old views modern
   ============================================ */
.card-custom {
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06) !important;
  overflow: hidden;
}
.card-custom .card-header {
  border-bottom: 1px solid #f0f2f5 !important;
  font-weight: 700;
}
.card-custom .card-body { padding: 24px; }
.card-custom h4, .card-custom h5 {
  font-weight: 800 !important;
  color: #1e293b;
}

/* Improve default Bootstrap cards in admin */
.card {
  border-radius: 16px;
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  overflow: hidden;
}
.card-header:first-child {
  border-radius: 16px 16px 0 0;
}
.card-header.bg-primary {
  background: linear-gradient(135deg, #1a73e8, #4f46e5) !important;
}

/* Form controls - modernize existing ones */
.form-control {
  border: 2px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  transition: all 0.2s !important;
  background: #f8fafc !important;
  box-shadow: none !important;
}
.form-control:hover {
  border-color: #6366f1 !important;
}
.form-control:focus {
  border-color: #1a73e8 !important;
  box-shadow: 0 0 0 4px rgba(26,115,232,0.1) !important;
  background: #fff !important;
}
select.form-control {
  appearance: auto !important;
  background-image: none !important;
}
textarea.form-control {
  min-height: 80px;
}

/* Better labels */
.form-label, label:not(.form-check-label):not(.sidebar-label) {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  margin-bottom: 6px !important;
}

/* Modern buttons */
.btn {
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  padding: 10px 20px !important;
  transition: all 0.2s ease !important;
}
.btn-primary {
  background: linear-gradient(135deg, #1a73e8, #4f46e5) !important;
  border: none !important;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,115,232,0.3) !important;
}
.btn-outline-primary {
  border: 2px solid #1a73e8 !important;
  color: #1a73e8 !important;
}
.btn-outline-primary:hover {
  background: #e8f0fe !important;
  color: #1557b0 !important;
}
.btn-outline-danger {
  border: 2px solid #db4437 !important;
  color: #db4437 !important;
}
.btn-outline-danger:hover {
  background: #fce8e6 !important;
  color: #c5221f !important;
}
.btn-sm { padding: 6px 12px !important; font-size: 13px !important; }

/* Modern tables */
.table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.table thead th {
  background: #f8f9fa !important;
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  padding: 14px 16px !important;
  border-bottom: 2px solid #e2e8f0 !important;
  border-top: none !important;
}
.table td {
  padding: 14px 16px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #f0f2f5 !important;
  font-size: 14px;
}
.table tbody tr:hover {
  background: #f8fafc !important;
}
.table-bordered {
  border: 1px solid #e2e8f0 !important;
}
.table-bordered th, .table-bordered td {
  border: 1px solid #e2e8f0 !important;
}

/* DataTables integration */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 16px;
}
.dataTables_wrapper .dataTables_filter input {
  border: 2px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  font-size: 14px;
  margin-left: 8px;
  outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #1a73e8 !important;
  box-shadow: 0 0 0 4px rgba(26,115,232,0.1) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important;
  padding: 6px 12px !important;
  margin: 0 2px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(135deg, #1a73e8, #4f46e5) !important;
  border: none !important;
  color: #fff !important;
}

/* Page content spacing */
.page-content {
  padding: 0;
}
.container-fluid.page-content {
  padding: 0 !important;
}

/* Badge improvements */
span.badge.rounded-pill {
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 6px 14px !important;
}

/* Fix card-header spacing */
.card-header h5, .card-header h4, .card-header h3 {
  margin-bottom: 0 !important;
}

/* Login page footer link */
.footer-link {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: #64748b;
}
.footer-link a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.footer-link a:hover {
  text-decoration: underline;
}

/* Mobile body state */
body.sidebar-open { overflow: hidden; }

/* ============================================
   TABLE UI STANDARD - Consistent across portal
   ============================================ */

/* Ensure modern-card contains its content */


/* Table responsive wrapper - master rule */
.table-responsive {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

/* Table base - ensure no overflow */
.table {
  margin-bottom: 0 !important;
  min-width: 100%;
}
.table thead th {
  white-space: nowrap;
  vertical-align: middle;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8f9fa;
}
.table tbody td {
  vertical-align: middle;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Action buttons should never overflow */
.table .btn-sm {
  padding: 4px 10px !important;
  font-size: 12px !important;
  white-space: nowrap;
  flex-shrink: 0;
}
.table .d-flex.gap-1 {
  flex-wrap: nowrap;
}

/* Badge alignment in tables */
.table .badge {
  white-space: nowrap;
}

/* Responsive: on small screens, stack table buttons */
@media (max-width: 767px) {
  .table-responsive {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
  }
  .table .btn-sm {
    padding: 3px 6px !important;
    font-size: 11px !important;
  }
  .table thead th {
    font-size: 11px;
    padding: 10px 8px !important;
  }
  .table td {
    font-size: 12px;
    padding: 10px 8px !important;
  }
  .card-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start !important;
  }
}

/* DataTables wrapper should also respect overflow */
.dataTables_wrapper {
  overflow-x: auto;
}

/* Fix for table-dark headers (Official panel) */
.table-dark thead th {
  background: #1e293b !important;
  color: #fff !important;
  border-color: #334155 !important;
  white-space: nowrap;
}
