@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #4361ee;
  --primary-hover: #3a56d4;
  --bg-color: #f8fafc;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-border: #1e293b;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 15px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Global Typography Override */
body, h1, h2, h3, h4, h5, h6, p, a, span, div, td, th {
  font-family: 'Inter', sans-serif !important;
}

body {
  background-color: var(--bg-color) !important;
  color: var(--text-dark);
}

/* -----------------------------
   Premium Sidebar Redesign
----------------------------- */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper {
  background: var(--sidebar-bg) !important;
  box-shadow: 4px 0 20px rgba(0,0,0,0.05);
  border-right: 1px solid var(--sidebar-border);
  z-index: 9999 !important; /* Ensure it stays above sticky table headers */
}

.sidebar-wrapper ul {
  padding-left: 0;
  list-style: none;
}

.sidebar-wrapper .sidebar-link {
  display: flex;
  align-items: center;
  padding: 12px 20px !important;
  color: var(--sidebar-text) !important;
  border-radius: var(--radius-md);
  margin: 6px 16px !important;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
  text-decoration: none;
}

/* Fix massive SVG blobs */
.sidebar-wrapper .sidebar-link svg {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  margin-right: 14px !important;
  transition: all 0.3s ease;
}

/* Force SVG paths to inherit correct color */
.sidebar-wrapper .sidebar-link svg path {
  fill: currentColor !important;
}

/* Hover & Active States */
.sidebar-wrapper .sidebar-link:hover,
.sidebar-wrapper .sidebar-link.active {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--sidebar-text-active) !important;
  transform: translateX(4px);
}

.sidebar-wrapper .sidebar-link:hover svg,
.sidebar-wrapper .sidebar-link.active svg {
  color: var(--sidebar-text-active) !important;
}

/* Logo Area */
.sidebar-wrapper .logo-wrapper {
  padding: 20px 20px !important;
  border-bottom: 1px solid var(--sidebar-border) !important;
  margin-bottom: 15px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
}

.sidebar-wrapper .logo-wrapper a {
  display: flex;
  align-items: center;
  max-width: 70%;
}

.sidebar-wrapper .logo-wrapper img {
  max-width: 110px !important;
  height: auto;
}

/* Collapsed State Styling */
.sidebar-wrapper.close_icon .logo-wrapper {
  display: none !important;
}

.sidebar-wrapper:not(.close_icon) .logo-icon-wrapper {
  display: none !important;
}

.sidebar-wrapper.close_icon .logo-icon-wrapper {
  display: flex !important;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-wrapper.close_icon .sidebar-link span {
  display: none !important;
}

.sidebar-wrapper.close_icon .sidebar-link {
  justify-content: center !important;
  padding: 14px !important;
}

.sidebar-wrapper.close_icon .sidebar-link svg {
  margin-right: 0 !important;
}

/* Submenu Styling */
.sidebar-submenu {
  background: transparent !important;
  padding-top: 5px;
  padding-bottom: 5px;
}

.sidebar-submenu li a {
  color: var(--sidebar-text) !important;
  padding: 8px 15px 8px 55px !important;
  display: block;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.3s ease;
}

.sidebar-submenu li a:hover {
  color: var(--sidebar-text-active) !important;
  padding-left: 60px !important;
}

/* Toggle & Back Button Fixes */
.sidebar-wrapper .toggle-sidebar {
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 8px !important;
  padding: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  position: static !important;
  margin: 0 !important;
  width: 36px !important;
  height: 36px !important;
}
.sidebar-wrapper .toggle-sidebar:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

/* Hide the duplicate toggle button in the white Navbar on desktop */
@media (min-width: 992px) {
  .header-logo-wrapper {
    display: none !important;
  }
}

.toggle-sidebar svg {
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
}

.toggle-sidebar svg path {
  fill: var(--sidebar-text) !important;
  transition: 0.3s;
}

.toggle-sidebar:hover svg path {
  fill: var(--sidebar-text-active) !important;
}

/* Hide mobile back buttons & useless horizontal arrows */
.back-btn, 
li.back-btn, 
.mobile-back,
.left-arrow,
.right-arrow {
  display: none !important;
}

/* Force hide all angle right arrows from sidebar JS injections */
.according-menu, 
.fa-angle-right, 
.fa-angle-down {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 991px) {
  .back-btn, 
  li.back-btn, 
  .mobile-back {
    display: flex !important;
  }
}

/* -----------------------------
   Page Header (Navbar)
----------------------------- */
.page-header {
  background: #ffffff !important;
  box-shadow: var(--shadow-sm) !important;
  border-bottom: 1px solid var(--border-color);
  padding: 15px 30px !important;
}

/* -----------------------------
   Cards & Layout
----------------------------- */
.card {
  border: none !important;
  box-shadow: var(--shadow-sm) !important;
  border-radius: var(--radius-lg) !important;
  background: #ffffff !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 24px;
}

.card:hover {
  box-shadow: var(--shadow-md) !important;
}

.card-header {
  border-bottom: 1px solid var(--border-color) !important;
  background: transparent !important;
  padding: 20px 24px !important;
}

.card-header h5 {
  font-weight: 600 !important;
  color: var(--text-dark) !important;
  font-size: 18px;
  margin: 0;
}

.card-body {
  padding: 24px !important;
}

/* -----------------------------
   Buttons
----------------------------- */
.btn-primary {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  padding: 10px 20px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 10px rgba(67, 97, 238, 0.2) !important;
}

.btn-primary:hover {
  background-color: var(--primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(67, 97, 238, 0.3) !important;
}

/* -----------------------------
   Forms & Inputs
----------------------------- */
.form-control, .form-select {
  border-radius: 8px !important;
  border: 1px solid var(--border-color) !important;
  padding: 12px 16px !important;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: #f8fafc !important;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1) !important;
  background-color: #ffffff !important;
}

label {
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 8px;
}

/* -----------------------------
   Dashboard KPI SVGs
----------------------------- */
.dashboard-default .card img[src$=".svg"] {
  width: 48px !important;
  height: 48px !important;
  border-radius: 12px;
  padding: 10px;
  background: rgba(67, 97, 238, 0.1);
}

/* -----------------------------
   Data Tables
----------------------------- */
.table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 8px !important;
}

.table thead th {
  background: #f8fafc !important;
  border: none !important;
  color: var(--text-muted) !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 15px 20px !important;
}

.table tbody tr {
  box-shadow: var(--shadow-sm);
  background: #fff;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.table tbody td {
  border: none !important;
  padding: 15px 20px !important;
  vertical-align: middle;
  color: var(--text-dark);
}

/* Action Icons in Tables */
.table a svg {
  width: 18px !important;
  height: 18px !important;
  transition: all 0.2s ease;
}
.table a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  margin-right: 6px;
  color: var(--text-muted) !important;
  transition: all 0.2s ease;
}
.table a:hover {
  background: var(--primary-color);
  color: #fff !important;
}
.table a:hover svg path {
  fill: #fff !important;
}

/* Remove loader visually entirely */
.loader-wrapper {
  display: none !important;
}

/* -----------------------------
   Premium Dashboard KPI Cards
----------------------------- */
.dashboard-default .card {
  background: #ffffff !important;
  border-radius: 16px !important;
  border: 1px solid rgba(226, 232, 240, 0.6) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  padding: 8px !important;
  position: relative;
  overflow: hidden;
}

.dashboard-default .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(103, 58, 183, 0.08) !important;
  border-color: rgba(103, 58, 183, 0.2) !important;
}

/* Soft purple gradient line on top of cards on hover */
.dashboard-default .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dashboard-default .card:hover::before {
  opacity: 1;
}

.dashboard-default .card-header {
  padding: 20px !important;
}

/* Title Badge Styling */
.dashboard-default .card-header p.header-text-primary {
  color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.1) !important;
  padding: 6px 12px !important;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600 !important;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 12px !important;
  position: relative;
  z-index: 2;
}

/* Hide the ugly circle icon injected by the template */
.dashboard-default .card-header p.header-text-primary i.fa-circle {
  display: none !important;
}

/* Force hide all legacy template shapes/blobs behind the text */
.dashboard-default .card-header p.square-after::before,
.dashboard-default .card-header p.square-after::after,
.square-after::before,
.square-after::after {
  content: none !important;
  display: none !important;
  opacity: 0 !important;
}

/* Big Number Styling */
.dashboard-default .card-header h4 {
  font-size: 28px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
  letter-spacing: -0.5px;
}

/* Icon Container */
.dashboard-default .static-widget {
  background: transparent !important;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-default .card:hover .static-widget {
  transform: translateY(-4px) scale(1.05);
}

.dashboard-default .static-widget img {
  width: 55px !important;
  height: auto !important;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.06));
}

/* Page Title Overrides */
.page-title h3 {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.5px;
}

/* -----------------------------
   Premium SaaS Form Design
----------------------------- */

/* Form Labels */
label, .form-label {
  font-weight: 600 !important;
  color: #334155 !important;
  font-size: 14px !important;
  margin-bottom: 8px !important;
  letter-spacing: 0.2px;
}

/* Inputs, Selects, and Textareas */
.form-control, .form-select, select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], textarea {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  color: #0f172a !important;
  transition: all 0.2s ease-in-out !important;
  box-shadow: none !important;
}

/* Hover State */
.form-control:hover, .form-select:hover, select:hover, input:hover, textarea:hover {
  border-color: #cbd5e1 !important;
  background-color: #ffffff !important;
}

/* Focus / Active State */
.form-control:focus, .form-select:focus, select:focus, input:focus, textarea:focus {
  background-color: #ffffff !important;
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15) !important;
  outline: none !important;
}

/* Placeholder Text */
.form-control::placeholder, input::placeholder, textarea::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

/* Select Dropdown specific styling */
select.form-control, .form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px !important;
  padding-right: 40px !important;
}

/* Checkboxes and Radios */
.form-check-input {
  width: 18px !important;
  height: 18px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.form-check-input:checked {
  background-color: #8b5cf6 !important;
  border-color: #8b5cf6 !important;
}

/* Premium Buttons */
.btn-primary, button[type="submit"] {
  background: linear-gradient(135deg, #8b5cf6, #ec4899) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  padding: 12px 24px !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25) !important;
  transition: all 0.3s ease !important;
}

.btn-primary:hover, button[type="submit"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35) !important;
  background: linear-gradient(135deg, #7c3aed, #db2777) !important;
}

.btn-secondary {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  font-weight: 600 !important;
  padding: 12px 24px !important;
  border-radius: 10px !important;
  transition: all 0.2s ease !important;
}

.btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Card wrappers for forms */
.card-body form {
  padding: 10px !important;
}

/* -----------------------------
   Premium SaaS Table Design
----------------------------- */

/* Table Wrapper for beautiful border radius */
.table-responsive {
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  background: #ffffff !important;
  margin-bottom: 24px !important;
}

/* Base Table */
table.dataTable, .table, table.display {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  width: 100% !important;
  border: none !important;
  margin: 0 !important;
  display: table !important;
  table-layout: auto !important;
}

table.dataTable thead, .table thead, table.display thead {
  display: table-header-group !important;
}

table.dataTable tbody, .table tbody, table.display tbody {
  display: table-row-group !important;
}

table.dataTable tr, .table tr, table.display tr {
  display: table-row !important;
}

table.dataTable th, .table th, table.display th, table.dataTable td, .table td, table.display td {
  display: table-cell !important;
}

/* Table Header (th) */
table.dataTable thead th, .table thead th, table.display thead th {
  background-color: #f8fafc !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 18px 24px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  white-space: nowrap !important;
  text-align: left !important;
}

/* Fix DataTable sorting icons overlapping text */
table.dataTable thead th.sorting, 
table.dataTable thead th.sorting_asc, 
table.dataTable thead th.sorting_desc,
table.display thead th.sorting,
table.display thead th.sorting_asc,
table.display thead th.sorting_desc {
  background-position: right 12px center !important;
  padding-right: 32px !important;
}

/* Table Body Cells (td) */
table.dataTable tbody td, .table tbody td, table.display tbody td {
  padding: 18px 24px !important;
  color: #1e293b !important;
  font-size: 14px !important;
  font-weight: 500;
  vertical-align: middle !important;
  border-bottom: 1px solid #f1f5f9 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  background-color: #ffffff !important;
  transition: background-color 0.15s ease;
  text-align: left !important;
  white-space: nowrap !important;
}

/* Hover Effect for Rows */
table.dataTable tbody tr:hover td, .table tbody tr:hover td, table.display tbody tr:hover td {
  background-color: #f8fafc !important;
}

/* Remove Borders on edges */
table.dataTable tbody tr:last-child td, .table tbody tr:last-child td, table.display tbody tr:last-child td {
  border-bottom: none !important;
}

/* DataTables Pagination & Info */
.dataTables_wrapper {
  padding: 0 !important;
}

.dataTables_wrapper .dataTables_info {
  color: #64748b !important;
  font-size: 13px;
  padding-top: 15px;
  font-weight: 500;
  padding-left: 8px;
}

.dataTables_wrapper .dataTables_paginate {
  padding-top: 15px !important;
  padding-right: 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #475569 !important;
  border-radius: 6px !important;
  padding: 6px 14px !important;
  margin: 0 4px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #8b5cf6 !important;
  color: #ffffff !important;
  border-color: #8b5cf6 !important;
  box-shadow: 0 4px 6px rgba(139, 92, 246, 0.2) !important;
}

/* DataTables Search & Length (Top Controls) */
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 20px !important;
  margin-top: -10px !important;
}

.dataTables_wrapper .dataTables_length {
  margin-bottom: 20px !important;
  margin-top: -10px !important;
}

.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  margin-left: 8px !important;
  font-size: 14px;
  width: 250px;
  transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
  outline: none !important;
}

.dataTables_wrapper .dataTables_length select {
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 14px;
}

/* Empty State Styling (DataTables generic class) */
.dataTables_empty {
  padding: 60px 40px !important;
  color: #94a3b8 !important;
  font-size: 15px !important;
  font-weight: 500;
  background: #ffffff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="%23e2e8f0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>') no-repeat center 20px !important;
  padding-top: 100px !important;
  border-bottom: none !important;
}

/* Card Body padding fix for tables */
.card-body:has(.table-responsive) {
  padding: 24px !important;
}

table.dataTable tbody td img {
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  object-fit: cover;
}

/* -----------------------------
   Premium SaaS Badges & Actions
----------------------------- */

/* Modern Status Badges */
.badge {
  padding: 6px 12px !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  border-radius: 20px !important;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-primary, .badge-success {
  background: rgba(139, 92, 246, 0.1) !important;
  color: #8b5cf6 !important;
  border: 1px solid rgba(139, 92, 246, 0.2) !important;
}

.badge-danger {
  background: rgba(236, 72, 153, 0.1) !important;
  color: #ec4899 !important;
  border: 1px solid rgba(236, 72, 153, 0.2) !important;
}

.badge-warning, .badge-pending {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.2) !important;
}

/* Compact Actions (Edit/Delete SVGs) */
.tabledit-toolbar .btn-group a, .tabledit-edit-button, .tabledit-delete-button, .btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin: 0 4px !important;
  transition: all 0.2s ease;
  padding: 0 !important;
}

.tabledit-toolbar .btn-group a:hover, .tabledit-edit-button:hover, .tabledit-delete-button:hover {
  background: #ffffff;
  border-color: #8b5cf6;
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.15);
  transform: translateY(-1px);
}

.tabledit-toolbar .btn-group a svg, .tabledit-edit-button svg, .tabledit-delete-button svg {
  width: 16px !important;
  height: 16px !important;
}

/* Subtitle for all page titles */
.page-title h3::after {
  content: "Manage and organize your platform records efficiently.";
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #64748b;
  margin-top: 6px;
  text-transform: none;
  letter-spacing: normal;
}

/* Sticky Header */
.table-responsive {
  max-height: 70vh;
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
}

table.dataTable thead th, .table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f8fafc !important;
}

/* Empty State Styling (DataTables generic class) */
.dataTables_empty {
  padding: 40px !important;
  color: #94a3b8 !important;
  font-size: 15px !important;
  font-weight: 500;
  background: #f8fafc url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="%23cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>') no-repeat center 20px !important;
  padding-top: 80px !important;
  border-bottom: none !important;
}

/* -----------------------------
   Global Table Scrolling Support
----------------------------- */
.table-responsive {
  max-height: 70vh; /* Limits table height to allow vertical scrolling */
  overflow-y: auto !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  /* Scrollbar styling for a cleaner look */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.table-responsive::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
}

/* Sticky Headers so they stay visible when scrolling down */
.table-responsive table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

/* -----------------------------
   Staff Permissions - Professional Custom Checkboxes
----------------------------- */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 6px;
  padding: 8px 0 16px 0;
}

/* Hide the ugly native checkboxes */
.checkbox-group input[type="checkbox"] {
  display: none !important;
}

/* The Label */
.checkbox-group label {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: #64748b; /* Slate 500 */
  cursor: pointer;
  user-select: none;
  margin: 0 !important;
  transition: color 0.2s ease;
}

/* The Custom Checkbox Box */
.checkbox-group label::before {
  content: '';
  width: 22px;
  height: 22px;
  border: 1.5px solid #cbd5e1; /* Slate 300 */
  border-radius: 6px;
  background-color: #fff;
  transition: all 0.2s ease;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Add margin-right only if the label has text (not empty) */
.checkbox-group label:not(:empty)::before {
  margin-right: 10px;
}

/* Hover State */
.checkbox-group label:hover::before {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}
.checkbox-group label:hover {
  color: var(--text-dark);
}

/* Checked State */
.checkbox-group input[type="checkbox"]:checked + label::before {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');
  background-size: 14px;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 2px 5px rgba(67, 97, 238, 0.3);
}

.checkbox-group input[type="checkbox"]:checked + label {
  color: var(--text-dark);
  font-weight: 600;
}

/* Professional Section Titles */
.form-group label:first-child {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8; /* Slate 400 */
  margin-bottom: 2px;
  display: block;
}

/* -----------------------------
   Permissions Table Premium Styling
----------------------------- */
.permissions-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
}

.permissions-table thead th {
  background-color: #f8fafc !important;
  padding: 16px 20px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 2px solid #e2e8f0 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
}

.permissions-table tbody td {
  padding: 16px 20px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  color: #475569 !important;
  vertical-align: middle;
}

.permissions-table tbody tr {
  transition: background-color 0.2s ease;
}

.permissions-table tbody tr:hover {
  background-color: #f8fafc;
}

.permissions-table tbody tr:last-child td {
  border-bottom: none !important;
}

/* Adjust row headers (Module names) */
.permissions-table tbody td:first-child {
  font-weight: 600 !important;
  color: #1e293b !important;
  font-size: 14px !important;
}
