:root {
  --bg-body: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-muted: #eef1f5;
  --bg-hover: #e8ecf1;

  --border: #d1d9e6;
  --border-light: #e5eaf0;

  --text-primary: #0b1a33;
  --text-secondary: #3a4a62;
  --text-muted: #7a8ba3;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.08);

  --success: #059669;
  --success-hover: #047857;
  --success-light: rgba(5, 150, 105, 0.08);

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-light: rgba(220, 38, 38, 0.08);

  --warning: #d97706;
  --warning-hover: #b45309;
  --warning-light: rgba(217, 119, 6, 0.08);

  --info: #0891b2;
  --info-hover: #067394;
  --info-light: rgba(8, 145, 178, 0.08);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
}

html,
body {
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.content-wrapper {
  flex: 1;
}

/* ── Navbar ── */
.top-navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  min-height: 56px !important;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.top-navbar .navbar-brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary) !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-navbar .navbar-brand i {
  font-size: 20px;
  color: var(--accent);
}
.top-navbar .nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: 5px 12px !important;
  border-radius: 6px;
  transition: all 0.15s;
  font-size: 13px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  line-height: 1.2;
  gap: 5px;
}
.top-navbar .nav-link.dropdown-toggle {
  justify-content: space-between;
}
.top-navbar .nav-link.dropdown-toggle::after {
  vertical-align: middle !important;
  margin-left: 6px !important;
  font-size: 12px;
}
.top-navbar .nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary) !important;
}
.top-navbar .nav-link.active {
  background: var(--accent-light);
  color: var(--accent) !important;
}
.navbar-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  align-items: center;
}
.navbar-nav::-webkit-scrollbar {
  display: none;
}
.top-navbar .dropdown-menu {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: 12px;
  padding: 6px;
  margin-top: 8px;
  min-width: 200px;
}
.top-navbar .dropdown-item {
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.1s;
}
.top-navbar .dropdown-item:hover {
  background: var(--bg-hover);
}
.top-navbar .dropdown-item i {
  width: 18px;
  color: var(--text-secondary);
}

/* ── User menu ── */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.user-menu:hover {
  background: var(--bg-hover);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}
.user-info {
  line-height: 1.3;
}
.user-name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
}
.user-role {
  color: var(--text-secondary);
  font-size: 11px;
}
.navbar-toggler {
  border: none;
  padding: 8px;
  color: var(--text-primary);
}
.navbar-toggler:focus {
  box-shadow: none;
}

/* ── Buttons ── */
.btn {
  font-weight: 500;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  line-height: 1.4;
  transition: all 0.15s;
}
.btn-sm {
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.4;
  margin: 0 2px;
}
.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-success {
  background-color: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn-success:hover,
.btn-success:focus {
  background-color: var(--success-hover);
  border-color: var(--success-hover);
}
.btn-info {
  background-color: var(--info);
  border-color: var(--info);
  color: #fff;
}
.btn-info:hover,
.btn-info:focus {
  background-color: var(--info-hover);
  border-color: var(--info-hover);
}
.btn-danger {
  background-color: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover,
.btn-danger:focus {
  background-color: var(--danger-hover);
  border-color: var(--danger-hover);
}
.btn-warning {
  background-color: var(--warning);
  border-color: var(--warning);
  color: #fff;
}
.btn-warning:hover,
.btn-warning:focus {
  background-color: var(--warning-hover);
  border-color: var(--warning-hover);
}
.btn-secondary {
  background-color: #e2e8f0;
  border-color: #e2e8f0;
  color: var(--text-primary);
}
.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #cbd5e1;
  border-color: #cbd5e1;
}

.btn-outline-primary {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline-primary:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-outline-success {
  color: var(--success);
  border-color: var(--success);
}
.btn-outline-success:hover {
  background-color: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn-outline-danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline-danger:hover {
  background-color: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-outline-warning {
  color: var(--warning);
  border-color: var(--warning);
}
.btn-outline-warning:hover {
  background-color: var(--warning);
  border-color: var(--warning);
  color: #fff;
}
.btn-outline-info {
  color: var(--info);
  border-color: var(--info);
}
.btn-outline-info:hover {
  background-color: var(--info);
  border-color: var(--info);
  color: #fff;
}
.btn-outline-secondary {
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline-secondary:hover {
  background-color: var(--bg-hover);
  border-color: #cbd5e1;
  color: var(--text-primary);
}

/* ── Cards ── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
}
.card-header {
  background-color: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  padding: 14px 20px;
  color: var(--text-primary);
}
.card-body {
  padding: 20px;
}
.card:hover {
  box-shadow: var(--shadow);
}

/* ── Tables ── */
.table {
  border-color: var(--border);
  margin-bottom: 0;
}
.table thead th {
  background-color: var(--bg-muted);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 12px;
  padding: 8px 10px;
  vertical-align: middle;
  text-align: center;
  color: var(--text-primary);
}
.table td {
  padding: 6px 10px;
  vertical-align: middle;
  font-size: 13px;
  color: var(--text-primary);
}
.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #f8fafc;
}
.table-hover > tbody > tr:hover {
  background-color: var(--accent-light);
}
.table-bordered {
  border: 1px solid var(--border);
}
.table-bordered th,
.table-bordered td {
  border: 1px solid var(--border-light);
}
.table-actions {
  white-space: nowrap;
  display: flex;
  gap: 3px;
  justify-content: flex-end;
}
.table-actions .btn {
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.3;
  border-radius: 4px;
}
.table-actions .btn i {
  font-size: 11px;
}
@media (max-width: 576px) {
  .table-actions .btn {
    padding: 3px 7px;
    font-size: 10px;
  }
  .table-actions .btn i {
    font-size: 10px;
  }
}

/* ── Modals ── */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  background-color: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 16px 20px;
}
.modal-footer {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
}
.modal-title {
  font-weight: 600;
}

/* ── Forms ── */
.form-control,
.form-select {
  border-color: var(--border);
  border-radius: var(--radius-sm);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-label {
  font-weight: 500;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.input-group-text {
  background-color: var(--bg-muted);
  border-color: var(--border);
}

/* ── Alerts ── */
.alert {
  border: none;
  border-radius: var(--radius-sm);
}
.alert-primary {
  background-color: #dbeafe;
  color: #1d4ed8;
}
.alert-success {
  background-color: #d1fae5;
  color: #065f46;
}
.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
}
.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
}
.alert-info {
  background-color: #cffafe;
  color: #155e75;
}

/* ── Badges ── */
.badge {
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
}
.bg-primary {
  background-color: var(--accent) !important;
}
.bg-success {
  background-color: var(--success) !important;
  color: #fff !important;
}
.bg-info {
  background-color: var(--info) !important;
  color: #fff !important;
}
.bg-warning {
  background-color: var(--warning) !important;
  color: #fff !important;
}
.bg-danger {
  background-color: var(--danger) !important;
}
.bg-secondary {
  background-color: #94a3b8 !important;
}
.bg-dark {
  background-color: #334155 !important;
}
.bg-light {
  background-color: var(--bg-muted) !important;
  color: var(--text-primary) !important;
}

/* ── Pagination ── */
.pagination {
  margin-bottom: 0;
}
.page-link {
  color: var(--text-primary);
  background-color: var(--bg-card);
  border-color: var(--border);
  padding: 6px 14px;
  font-size: 14px;
  transition: all 0.15s ease;
}
.page-link:hover {
  color: var(--primary);
  background-color: var(--bg-muted);
  border-color: var(--primary);
  z-index: 2;
}
.page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.page-item.disabled .page-link {
  color: var(--text-muted);
  pointer-events: none;
  background-color: var(--bg-card);
  border-color: var(--border);
}
.page-link:hover {
  background-color: var(--bg-hover);
  border-color: var(--border);
  color: var(--text-primary);
}
.page-item.active .page-link {
  background-color: var(--accent);
  border-color: var(--accent);
}
.page-item.disabled .page-link {
  color: var(--text-muted);
  border-color: var(--border);
}

/* ── Breadcrumbs ── */
.breadcrumb {
  --bs-breadcrumb-divider: none;
  list-style: none;
  font-size: 12px;
  margin-bottom: 14px;
  background: var(--bg-muted);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.breadcrumb-item::before {
  content: none !important;
}
.breadcrumb-sep {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 0 4px;
}
.breadcrumb-item {
  display: flex;
  align-items: center;
}
.breadcrumb-item a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb-item a:hover {
  color: var(--accent);
}
.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}
.breadcrumb-item:first-child a {
  color: var(--accent);
}
.breadcrumb-item:first-child a .fa-home {
  font-size: 12px;
  margin-right: 6px;
}

/* ── Dropdowns ── */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.dropdown-item {
  font-size: 14px;
  padding: 8px 16px;
  color: var(--text-primary);
}
.dropdown-item:hover {
  background-color: var(--bg-hover);
}
.dropdown-item i {
  width: 18px;
  color: var(--text-secondary);
}
.dropdown-header {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dropdown-divider {
  border-color: var(--border);
}

/* ── Tabs / Nav pills ── */
.nav-tabs {
  border-bottom-color: var(--border);
}
.nav-tabs .nav-link {
  color: var(--text-secondary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.nav-tabs .nav-link:hover {
  border-color: var(--border);
}
.nav-tabs .nav-link.active {
  color: var(--accent);
  border-color: var(--border) var(--border) #fff;
  font-weight: 600;
}
.nav-pills .nav-link {
  color: var(--text-secondary);
  border-radius: 8px;
}
.nav-pills .nav-link.active {
  background-color: var(--accent);
  color: #fff;
}

/* ── Progress ── */
.progress {
  background-color: var(--bg-muted);
  border-radius: 100px;
}
.progress-bar {
  background-color: var(--accent);
}

/* ── List groups ── */
.list-group-item {
  border-color: var(--border);
}
.list-group-item.active {
  background-color: var(--accent);
  border-color: var(--accent);
}

/* ── Footer ── */
footer.bg-light {
  background-color: var(--bg-surface) !important;
  border-top: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
}

/* ── Section cards (payroll) ── */
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.section-card .card-header {
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
}
.section-card .card-body {
  padding: 20px;
}

/* ── Stat cards (dashboard) ── */
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg-surface);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.stat-card.clickable {
  cursor: pointer;
}
.stat-card .icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-card .stat-number {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

/* ── Quick action cards (dashboard) ── */
.quick-action-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: all 0.2s ease;
  text-decoration: none !important;
  color: inherit !important;
  display: flex;
  align-items: center;
}
.quick-action-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.quick-action-card .action-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.quick-action-card .action-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}
.quick-action-card .action-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── Dashboard header ── */
.dashboard-header {
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  color: white;
  padding: 28px 28px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

/* ── Role items (dashboard sidebar) ── */
.role-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 6px;
}
.role-item:hover {
  background: var(--bg-hover);
}
.role-item:last-child {
  border-bottom: none;
}
.role-item .role-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-right: 12px;
  flex-shrink: 0;
}
.role-item .role-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}
.role-item .role-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Department badges ── */
.department-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  margin: 3px;
  transition: all 0.15s ease;
  cursor: pointer;
  text-decoration: none !important;
}
.department-badge:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateX(3px);
}

/* ── Page actions toolbar ── */
@media (max-width: 576px) {
  .page-actions .d-flex {
    gap: 4px !important;
  }
  .page-actions .btn {
    font-size: 11px;
    padding: 3px 8px;
  }
  .page-actions .btn i {
    font-size: 11px;
  }
}

/* ── Swap bell notifications ── */
.swap-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 16px;
}
.swap-bell:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.swap-bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--bg-surface);
}
.swap-bell-menu {
  width: 360px;
  max-height: 400px;
  overflow-y: auto;
  padding: 0;
}
.swap-bell-menu .dropdown-header {
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
}
.swap-bell-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.swap-bell-item:last-child {
  border-bottom: none;
}
.swap-bell-item .swap-bell-info {
  flex: 1;
}
.swap-bell-item .swap-bell-info strong {
  font-size: 13px;
}
.swap-bell-item .swap-bell-info .text-muted {
  font-size: 11px;
}
.swap-bell-item .btn {
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.4;
}
.swap-bell-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.swap-bell-empty i {
  font-size: 24px;
  display: block;
  margin-bottom: 6px;
  color: var(--border);
}

/* ── Toast notifications ── */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  min-width: 300px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

/* ── Mobile responsive ── */
@media (max-width: 991px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-responsive > .table {
    margin-bottom: 0;
  }
  .top-navbar {
    padding: 0 16px;
  }
  .top-navbar .navbar-brand span {
    display: none;
  }
  .user-info {
    display: none;
  }
  .offcanvas-lg#mainNav {
    --bs-offcanvas-width: 300px;
  }
  .offcanvas-lg#mainNav .offcanvas-body {
    padding: 16px !important;
  }
  .offcanvas-lg#mainNav .navbar-nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .offcanvas-lg#mainNav .nav-link {
    padding: 12px 16px !important;
    border-radius: 8px;
    align-items: center;
    justify-content: flex-start;
  }
  .offcanvas-lg#mainNav .nav-link.dropdown-toggle::after {
    margin-left: auto;
  }
  .offcanvas-lg#mainNav .dropdown-menu {
    position: static;
    float: none;
    background: var(--bg-muted);
    border: none;
    border-radius: 8px;
    padding: 4px;
    margin-top: 4px;
    width: 100%;
    box-shadow: none;
  }
  .offcanvas-lg#mainNav .dropdown-item {
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 8px 16px;
  }
  .offcanvas-lg#mainNav .dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
  }
  .offcanvas-lg#mainNav .dropdown-item i {
    color: var(--text-muted);
  }
}

@media (max-width: 576px) {
  .swap-bell-menu {
    width: calc(100vw - 32px);
    min-width: 260px;
  }
  .table-stack-sm thead {
    display: none;
  }
  .table-stack-sm tbody tr {
    display: block;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-surface);
  }
  .table-stack-sm tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    text-align: right;
  }
  .table-stack-sm tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    font-size: 0.8rem;
    padding-right: 12px;
  }
  .table-stack-sm tbody td.name-cell {
    display: block;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 6px;
    padding-bottom: 8px;
  }
  .table-stack-sm tbody td.name-cell::before {
    display: none;
  }
}

/* ── DataTables ── */
.table.dataTable {
  margin-bottom: 0 !important;
}
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 14px;
  background-color: var(--bg-input);
  color: var(--text-primary);
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 14px;
  background-color: var(--bg-input);
  color: var(--text-primary);
}
.dataTables_info {
  color: var(--text-muted);
  font-size: 13px;
}

/* DT1 sort arrows */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
  overflow: visible !important;
}
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead th.sorting_desc::after {
  opacity: .5 !important;
}
table.dataTable thead th.sorting_asc::before {
  opacity: 1 !important;
}
table.dataTable thead th.sorting_desc::after {
  opacity: 1 !important;
}
/* Length menu — hide text, show only select */
.dataTables_length label {
  font-size: 0;
  margin-bottom: 0;
}
.dataTables_length label select {
  font-size: .875rem;
  min-width: 4.5rem;
}

/* Search with icon */
.dataTables_filter {
  position: relative;
}
.dataTables_filter label {
  font-size: 0;
  margin-bottom: 0;
}
.dataTables_filter input {
  padding-left: 2rem !important;
  font-size: .875rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.6rem center;
  background-size: 1rem;
}

/* Make length select and search same height in the toolbar */
.row.mb-2 .dataTables_length,
.row.mb-2 .dataTables_filter {
  display: flex;
  align-items: center;
}

/* Processing spinner overlay */
div.dataTables_wrapper {
  position: relative;
}
div.dataTables_processing {
  position: absolute !important;
  z-index: 20 !important;
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: none !important;
  inset: 0 !important;
  height: 100% !important;
  width: 100% !important;
  pointer-events: none;
}
div.dataTables_processing > * {
  display: none !important;
}
div.dataTables_processing::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  margin: -1.25rem 0 0 -1.25rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dt-spin 0.7s linear infinite;
}
@keyframes dt-spin {
  to { transform: rotate(360deg); }
}
[data-theme="dark"] div.dataTables_processing {
  background: rgba(46, 52, 64, 0.8);
}

/* Pagination styling */
.dataTables_paginate {
  text-align: right;
}
.dataTables_paginate .pagination {
  justify-content: end;
  margin-bottom: 0;
}
.dataTables_paginate .pagination .page-link {
  padding: .2rem .55rem;
  font-size: .8rem;
  line-height: 1.3;
  min-width: 1.6rem;
}
.dataTables_paginate .pagination .page-item.active .page-link {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
}
.dataTables_paginate .pagination .page-item.disabled .page-link {
  color: var(--text-muted) !important;
  background-color: transparent;
  border-color: var(--border) !important;
}

/* DataTable row height */
table.dataTable.table > :not(caption) > * > * {
  padding: .25rem .5rem;
}

/* ── Modal backdrop ── */
.modal-backdrop {
  z-index: 1040 !important;
}
.modal {
  z-index: 1050 !important;
}

/* ── Summernote in modal ── */
.note-editor.note-frame {
  border-color: var(--border);
}
.note-toolbar {
  background: var(--bg-muted);
}
.note-btn-group {
  display: inline-block !important;
}
.note-btn-group .note-btn {
  border-color: var(--border);
  color: var(--text-primary);
  background: var(--bg-surface);
  float: none !important;
  display: inline-block !important;
}
.note-btn-group .note-btn:hover {
  background: var(--bg-hover);
}
.note-btn-group .note-btn:focus {
  box-shadow: none;
}
.note-dropdown-menu {
  z-index: 1070 !important;
}
.note-modal {
  z-index: 1080 !important;
}

/* ── Misc ── */
.loading {
  display: none;
}
.greeting-time {
  font-size: 14px;
  opacity: 0.85;
  margin-top: 4px;
}
