/* Central place for UI-only page overrides.
   Keep backend logic/variables untouched; consolidate inline <style> blocks here. */

/* ===== Tabs: Students list / Payments ===== */
.students-list-tabs,
.payments-index-tabs {
  position: relative;
  padding: 0.85rem;
  gap: 0.75rem;
  border-bottom: 0;
  margin-bottom: 1.5rem;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 28%),
    linear-gradient(135deg, #f8fafc 0%, #eef5f7 100%);
  border: 1px solid #dbe7ee;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.students-list-tabs .nav-item,
.payments-index-tabs .nav-item {
  margin-bottom: 0;
}

.students-list-tabs .nav-link,
.payments-index-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 58px;
  color: #1f2937;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid transparent;
  border-radius: 18px;
  font-weight: 700;
  padding: 0.9rem 1.25rem;
  letter-spacing: 0.01em;
  transition: all 0.25s ease;
}

.students-list-tabs .nav-link:hover,
.students-list-tabs .nav-link:focus,
.payments-index-tabs .nav-link:hover,
.payments-index-tabs .nav-link:focus {
  color: #3D3260;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 118, 110, 0.16);
  transform: translateY(-1px);
}

.students-list-tabs .nav-link.active,
.students-list-tabs .show > .nav-link,
.payments-index-tabs .nav-link.active,
.payments-index-tabs .show > .nav-link {
  color: #fff;
  background: linear-gradient(135deg, #3D3260 0%, #5B4B8A 52%, #6B5A9A 100%);
  border-color: transparent;
  box-shadow: 0 16px 30px rgba(61, 50, 93, 0.22);
}

.students-list-tabs .dropdown.show .dropdown-toggle,
.students-list-tabs .dropdown-toggle[aria-expanded="true"],
.payments-index-tabs .dropdown.show .dropdown-toggle,
.payments-index-tabs .dropdown-toggle[aria-expanded="true"] {
  color: #fff;
  background: linear-gradient(135deg, #3D3260 0%, #5B4B8A 52%, #6B5A9A 100%);
  border-color: transparent;
}

.students-list-tabs .dropdown-menu,
.payments-index-tabs .dropdown-menu {
  border: 1px solid #dbe3f0;
  border-radius: 0.9rem;
  padding: 0.5rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.students-list-tabs .dropdown-item,
.payments-index-tabs .dropdown-item {
  color: #1f2937;
  border-radius: 0.7rem;
  font-weight: 500;
  padding: 0.65rem 0.85rem;
}

.students-list-tabs .dropdown-item:hover,
.students-list-tabs .dropdown-item:focus,
.payments-index-tabs .dropdown-item:hover,
.payments-index-tabs .dropdown-item:focus {
  color: #0f172a;
  background: #edf6f5;
}

@media (max-width: 767.98px) {
  .students-list-tabs,
  .payments-index-tabs {
    padding: 0.7rem;
    gap: 0.6rem;
    border-radius: 22px;
  }

  .students-list-tabs .nav-item,
  .students-list-tabs .dropdown,
  .payments-index-tabs .nav-item,
  .payments-index-tabs .dropdown {
    width: 100%;
  }

  .students-list-tabs .nav-link,
  .students-list-tabs .dropdown-toggle,
  .payments-index-tabs .nav-link,
  .payments-index-tabs .dropdown-toggle {
    width: 100%;
  }

  .students-list-tabs .dropdown-menu,
  .payments-index-tabs .dropdown-menu {
    width: 100%;
    max-width: 100%;
  }
}

/* ===== Tables: mobile-friendly defaults (Bootstrap/Limitless + DataTables) ===== */
.app-table-shell.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* DataTables sometimes wraps table without .table-responsive */
.dataTables_wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Ensure the table can scroll instead of breaking layout */
.dataTables_wrapper table,
.app-table-shell table {
  width: 100%;
}

/* Sticky first + last column on small screens (helps wide tables) */
@media (max-width: 767.98px) {
  .app-table-shell {
    position: relative;
  }

  .app-table-shell .table th:first-child,
  .app-table-shell .table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 8px 0 18px rgba(15, 23, 42, 0.06);
  }

  .app-table-shell .table thead th:first-child {
    z-index: 4;
    background: var(--theme-table-header, linear-gradient(135deg, var(--app-primary-dark) 0%, var(--app-primary) 100%));
  }

  .app-table-shell .table th:last-child,
  .app-table-shell .table td:last-child {
    position: sticky;
    right: 0;
    z-index: 3;
    background: #fff;
    box-shadow: -8px 0 18px rgba(15, 23, 42, 0.06);
  }

  .app-table-shell .table thead th:last-child {
    z-index: 5;
    background: var(--theme-table-header, linear-gradient(135deg, var(--app-primary-dark) 0%, var(--app-primary) 100%));
  }
}

.app-table-scroll-hint {
  display: none;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  border: 1px dashed rgba(29, 85, 100, 0.28);
  background: rgba(230, 241, 244, 0.65);
  color: rgba(29, 43, 54, 0.9);
  font-weight: 600;
  font-size: 0.9rem;
}

@media (max-width: 767.98px) {
  .app-table-scroll-hint {
    display: flex;
    align-items: center;
    gap: 0.55rem;
  }
  .app-table-scroll-hint i {
    color: var(--app-primary, #1d5564);
  }
}

/* Improve tap/scan on small devices without forcing nowrap everywhere */
@media (max-width: 575.98px) {
  .table th,
  .table td {
    padding: 0.7rem 0.75rem;
  }
}

/* Global fixes for table header flexbox conflicts and card-header rows */
thead.card-header,
table thead {
  display: table-header-group !important;
}

table thead tr {
  display: table-row !important;
}

table thead th {
  display: table-cell !important;
}

.card-header .row {
  width: 100% !important;
}

/* ===== SweetAlert2 Icon Fix for Limitless Theme Conflict ===== */
.swal2-icon {
  font-size: 1rem !important;
  box-sizing: content-box !important;
}

.swal2-icon.swal2-warning {
  border-color: #f97316 !important;
  color: #f97316 !important;
  font-size: 1rem !important;
  line-height: normal !important;
}

.swal2-icon.swal2-warning .swal2-icon-content {
  font-size: 3.75rem !important;
  line-height: 5rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: inherit !important;
  font-weight: 700 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

.swal2-icon.swal2-error .swal2-icon-content,
.swal2-icon.swal2-info .swal2-icon-content,
.swal2-icon.swal2-question .swal2-icon-content {
  font-size: 3.75rem !important;
  line-height: 5rem !important;
}

.swal2-popup {
  border-radius: 16px !important;
  padding: 1.5rem !important;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22) !important;
}



/* ==========================================================================
   Global Centralized Theme Overrides for Reports, Cards & Tables
   All page headers, hero sections, and report theads inherit from theme.css
   ========================================================================== */

/* Report & Profile Heroes & Banners */
.student-profile-hero,
.user-profile-hero,
.student-report-hero,
.staff-attendance-hero,
.attendance-hero,
.student-attendance-hero,
.certificate-bulk-form-head,
.hostel-detail-hero,
.vehicle-hero,
.arc-hero,
.ar-hero {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 28%),
        var(--theme-gradient-main, linear-gradient(135deg, #3D3260 0%, #5B4B8A 58%, #6B5A9A 100%)) !important;
    box-shadow: 0 20px 50px rgba(61, 50, 93, 0.2) !important;
    color: #ffffff !important;
}

/* Report & Page Card Headers */
.attendance-monthly-card > .print-area > .card-header,
.staff-attendance-monthly-card .card-header,
.salary-slip-report-card > .card-header,
.concession-report-page .card-header,
.card-header.bg-primary,
.card-header.bg-dark,
.card-header.header-elements-inline,
.card-header.dashboard-theme-surface,
.notice-card-header,
.card > .card-header:not(.bg-white):not(.bg-transparent):not(.bg-info):not(.bg-success):not(.bg-danger):not(.bg-warning) {
    background: var(--theme-gradient-main, linear-gradient(135deg, #3D3260 0%, #5B4B8A 58%, #6B5A9A 100%)) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.card > .card-header:not(.bg-white):not(.bg-transparent):not(.bg-info):not(.bg-success):not(.bg-danger):not(.bg-warning) *,
.card-header.bg-primary *,
.card-header.bg-dark * {
    color: #ffffff !important;
}

/* Report & Table Headers (thead) */
.attendance-monthly-card .app-table-shell .table thead th,
.staff-attendance-monthly-card .staff-attendance-monthly-table thead th,
.salary-slip-report-card .salary-slip-report-table thead th,
.concession-report-page .report-table th,
.student-report-page .table thead th,
.staff-attendance-page .table thead th,
.attendance-report-page .table thead th,
.student-attendance-page .table thead th,
.table thead,
.table thead th,
.table thead tr,
table thead.bg-primary,
table thead.bg-primary th,
table thead.card-header,
table thead.card-header th,
.table thead th.bg-primary,
.table thead th.card-header {
    background: var(--theme-gradient-main, linear-gradient(135deg, #3D3260 0%, #5B4B8A 58%, #6B5A9A 100%)) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Action Buttons & Primary Buttons */
.btn.bg-primary,
.btn.btn-primary,
button.bg-primary,
button.btn-primary,
.btn-action.btn-color,
.salary-slip-btn,
.btn-action.btn-theme,
.btn-theme-view,
.concession-report-page .btn-theme-view {
    background: var(--theme-gradient-main, linear-gradient(135deg, #3D3260 0%, #5B4B8A 58%, #6B5A9A 100%)) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 16px rgba(61, 50, 93, 0.24) !important;
}

.btn.bg-primary:hover,
.btn.btn-primary:hover,
button.bg-primary:hover,
button.btn-primary:hover,
.btn-action.btn-color:hover,
.salary-slip-btn:hover,
.btn-theme-view:hover {
    background: linear-gradient(135deg, #352960 0%, #4A3D75 58%, #5B4B8A 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(61, 50, 93, 0.32) !important;
}

