/* Edman SMS - Premium Sleek UI (Anchor Button Hover Text Color Fix) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Strict Brand Color Palette (Derived dynamically from --primary) */
  --primary: #0803B7;
  /* Deep Brand Blue default */
  --primary-hover: color-mix(in srgb, var(--primary, #0803B7) 85%, #000);
  --primary-light: color-mix(in srgb, var(--primary, #0803B7) 12%, #fff);
  --primary-accent: color-mix(in srgb, var(--primary, #0803B7) 85%, #fff);

  --secondary: #00E599;
  /* Vibrant Brand Mint Green */
  --secondary-hover: #00E599;
  --secondary-light: #e6fcf3;

  --bg-primary: #ffffff;
  /* Pure White Body Background */
  --bg-surface: #ffffff;
  --bg-surface-hover: #f8fafc;
  --bg-sidebar: #f8fafc;
  /* Light Grey Sidebar Background */
  --bg-card: #ffffff;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;

  --border-color: #e2e8f0;
  --border-focus: #0803B7;

  --success: #00E599;
  --success-bg: #e6fcf3;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;

  --radius-xs: 4px;
  --radius-sm: 5px;
  --radius-md: 7px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-2xl: 18px;
  --radius-3xl: 22px;
  --radius-full: 9999px;
  --radius-round: 50%;

  --font-global: 'Plus Jakarta Sans', sans-serif;

  --sidebar-width: 260px;
  --header-height: 64px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}



*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  box-shadow: none;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

body,
button,
input,
select,
textarea,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div,
a,
td,
th,
label,
badge {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* ========================================================= */
/* GLOBAL ROOT RADIUS ENFORCEMENT LAYER                      */
/* ========================================================= */
.card,
.panel,
.box,
.stat-card,
.metric-card,
.metric-card-sleek,
.table-card,
.dashboard-grid-layout>.card,
.dashboard-three-grid>.card {
  border-radius: var(--radius-xl) !important;
}

.modal,
.modal-content,
.dialog-box,
.bottom-sheet-modal {
  border-radius: var(--radius-2xl) !important;
}

.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea,
.custom-select-wrap,
.custom-dropdown-btn,
.search-input-wrap input {
  border-radius: var(--radius-md) !important;
}

.btn,
button.btn,
a.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-outline-primary,
.btn-success,
.btn-danger,
.btn-action,
.btn-save,
.btn-filter,
.btn-export {
  border-radius: var(--radius-md) !important;
}

.btn-sm,
.btn-compact,
.top-icon-flat-btn {
  border-radius: var(--radius-sm) !important;
}

.badge,
.tag,
.status-badge {
  border-radius: var(--radius-sm) !important;
}

.btn-pill,
.pill,
.badge-pill,
.term-pill-badge,
.date-pill-badge,
.status-pill,
.floating-support-btn,
.summary-line-track,
.summary-line-fill,
.toast-progress-fill {
  border-radius: var(--radius-full) !important;
}

.dropdown-menu,
.user-dropdown-menu,
.section-switcher-menu,
.custom-dropdown-menu,
.autocomplete-items {
  border-radius: var(--radius-lg) !important;
}

.dropdown-item,
.section-switcher-item,
.custom-dropdown-item {
  border-radius: var(--radius-sm) !important;
}

.nav-item {
  border-radius: var(--radius-md) !important;
}

.nav-child-item {
  border-radius: var(--radius-sm) !important;
}

.table-responsive {
  border-radius: var(--radius-lg) !important;
}

.toast,
.toast-notice {
  border-radius: var(--radius-xl) !important;
}

.toast-icon-wrap,
.toast-icon,
.toast-close-btn {
  border-radius: var(--radius-md) !important;
}

.alert,
.notice-box,
.banner-box,
.empty-state-box {
  border-radius: var(--radius-lg) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-primary);
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 1.15rem 1.25rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
}

/* Square Proportion Tenant Logo */
.tenant-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  border: none;
  transition: all 0.25s ease;
}

.sidebar-header.logo-only {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 64px;
}

.sidebar-header.logo-only .tenant-logo-img {
  height: 38px;
  max-height: 40px;
  width: auto;
  max-width: 145px;
  object-fit: contain;
  object-position: left center;
}

.tenant-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.tenant-title-group {
  overflow: hidden;
}

.tenant-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.tenant-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.85rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.sidebar-nav::-webkit-scrollbar,
.custom-dropdown-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track,
.custom-dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.custom-dropdown-menu::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

/* Menu Items Icons Guarantee */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  color: #334155;
  border-radius: var(--radius-md);
  font-size: 0.925rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-item i,
.nav-item svg {
  width: 19px !important;
  height: 19px !important;
  min-width: 19px !important;
  min-height: 19px !important;
  stroke-width: 2;
  color: #475569;
  transition: var(--transition);
  flex-shrink: 0;
  display: inline-block;
}

.nav-item:hover {
  color: var(--primary);
  background: #e2e8f0;
}

.nav-item:hover i,
.nav-item:hover svg {
  color: var(--primary);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.nav-item.active i,
.nav-item.active svg {
  color: var(--primary);
}

/* Parent-Child Dropdown Collapsible Sub-menus */
.nav-parent-btn {
  width: 100%;
  background: transparent;
  border: none;
  justify-content: space-between;
  cursor: pointer;
  font-family: var(--font-global);
  text-align: left;
}

.nav-caret {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
  transition: transform 0.2s ease;
  color: #64748b !important;
  flex-shrink: 0;
}

.nav-group.open .nav-caret {
  transform: rotate(180deg);
}

.nav-child-menu {
  display: none;
  flex-direction: column;
  gap: 0.1rem;
  padding-left: 1.1rem;
  padding-top: 0.3rem;
  padding-bottom: 0.4rem;
  margin-left: 0.85rem;
  border-left: 2px solid var(--border-color);
}

.nav-group.open .nav-child-menu {
  display: flex;
}

.nav-child-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.48rem 0.75rem;
  font-size: 0.855rem;
  font-weight: 500;
  color: #475569;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-child-item i,
.nav-child-item svg {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
  stroke-width: 2;
  color: #94a3b8;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-child-item:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-child-item:hover i,
.nav-child-item:hover svg {
  color: var(--primary);
}

.nav-child-item.active {
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-light);
}

.nav-child-item.active i,
.nav-child-item.active svg {
  color: var(--primary);
}

.sidebar-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg-sidebar);
}

.sidebar-brand-bottom {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.powered-by-text {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.edman-bottom-logo {
  height: 18px;
  max-height: 20px;
  max-width: 95px;
  object-fit: contain;
}

/* Main Content */
.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
  background: var(--bg-primary);
}

/* Top Header Bar Layout */
.top-header {
  min-height: var(--header-height);
  height: auto;
  background: var(--bg-surface, #ffffff);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: none !important;
}

/* Mobile Hamburger Toggle Hidden by Default on PC */
#mobile-sidebar-toggle {
  display: none !important;
}

/* Session & Term Badge Styling */
.term-pill-badge {
  padding: 0.35rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.date-pill-badge {
  color: var(--text-muted);
  font-size: 0.775rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Session & Term Display Modes */
.mobile-term-subrow {
  display: none !important;
}

.desktop-badges {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
}

/* Usage and Billing Header Link */
.usage-plan-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  transition: var(--transition);
}

.usage-plan-link:hover {
  color: var(--primary);
}

.usage-plan-link svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

/* Un-enclosed Flat Icon Button */
.top-icon-flat-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.top-ic.toast-close-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}

/* Global Unified Button Utility Classes - Compact, Flat & Premium */
button,
.btn {
  box-shadow: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.42rem 0.88rem;
  height: 36px;
  border-radius: var(--radius-md);
  font-family: var(--font-global);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn i,
.btn svg {
  width: 15px !important;
  height: 15px !important;
  stroke-width: 2.2 !important;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary, #150089) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background: color-mix(in srgb, var(--primary, #150089) 85%, #000000) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: none !important;
}

.btn-outline {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}

.btn-outline:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  transform: translateY(-1px) !important;
  box-shadow: none !important;
}

.btn-outline-primary {
  background: #ffffff !important;
  color: var(--primary, #150089) !important;
  border: 1px solid color-mix(in srgb, var(--primary, #150089) 25%, #cbd5e1) !important;
  box-shadow: none !important;
}

.btn-outline-primary:hover {
  background: color-mix(in srgb, var(--primary, #150089) 8%, #ffffff) !important;
  border-color: var(--primary, #150089) !important;
  color: var(--primary, #150089) !important;
  transform: translateY(-1px) !important;
  box-shadow: none !important;
}

.btn-success,
.btn-payment {
  background: #10b981 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
}

.btn-success:hover,
.btn-payment:hover {
  background: #059669 !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: none !important;
}

.btn-danger,
.btn-expense {
  background: #ef4444 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
}

.btn-danger:hover,
.btn-expense:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: none !important;
}

.btn-secondary {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}

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

/* Header Top Page Action Buttons Grouping */
.page-title-block .btn,
.page-header-actions .btn,
.top-header-bar .btn,
.header-actions .btn,
.card-header .btn {
  padding: 0.4rem 0.85rem !important;
  font-size: 0.79rem !important;
  font-weight: 700 !important;
  height: 35px !important;
  border-radius: var(--radius-md) !important;
}

.phone-input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
  transition: var(--transition);
}

.phone-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: none !important;
}

.phone-prefix-addon {
  background: #f1f5f9;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-right: 1px solid var(--border-color);
  user-select: none;
  flex-shrink: 0;
}

.phone-input-field {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
  padding-left: 0.75rem !important;
}

.top-icon-flat-btn:hover {
  color: var(--primary);
  background: var(--bg-surface-hover);
}

/* Section Switcher for Multi-Campus / Combined Schools */
.section-switcher-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.section-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  background: transparent;
  color: var(--text-main, #0f172a);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.section-switcher-btn:hover {
  background: var(--bg-surface-hover, #f8fafc);
  border-color: #cbd5e1;
  color: var(--primary, #150089);
}

.section-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: 250px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md);
  padding: 0.45rem;
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.12), 0 4px 10px -4px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.section-switcher-menu.show {
  display: flex;
  animation: fadeIn 0.15s ease-out;
}

.section-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-main, #0f172a);
}

.section-switcher-item:hover {
  background: var(--bg-surface-hover, #f8fafc);
  color: var(--primary, #150089);
}

.section-switcher-item.active {
  background: color-mix(in srgb, var(--primary, #150089) 10%, #ffffff);
  color: var(--primary, #150089);
  font-weight: 800;
}

.section-switcher-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 2;
}

.sec-item-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.sec-item-title {
  font-size: 0.82rem;
  font-weight: 700;
}

.sec-item-sub {
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  margin-top: 1px;
}

.sec-label-mobile {
  display: none;
}

.sec-label-desktop {
  display: inline;
}

@media (max-width: 768px) {
  .sec-label-mobile {
    display: inline;
  }

  .sec-label-desktop {
    display: none;
  }

  .section-switcher-menu {
    width: 200px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

/* User Avatar Dropdown Menu */
.user-avatar-wrapper {
  position: relative;
}

.user-avatar-btn {
  padding: 0 0.65rem 0 0.85rem;
  height: 36px;
  border-radius: 9999px !important;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  border: 2px solid var(--primary-light);
  transition: var(--transition);
}

.user-avatar-btn.has-img {
  padding: 2px 0.65rem 2px 2px !important;
  border-radius: 9999px !important;
}

.user-avatar-btn img {
  border-radius: 50% !important;
}

.user-avatar-btn:hover {
  transform: scale(1.03);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 175px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.45rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  z-index: 1000;
}

.user-dropdown-menu.show {
  display: flex;
}

.dropdown-user-header {
  padding: 0.5rem 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.25rem;
}

.dropdown-user-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
}

.dropdown-user-role {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-surface-hover);
  color: var(--primary);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger:hover {
  background: var(--danger-bg);
}

/* Page Section Headers */
.section-header-title {
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  font-weight: 800;
  margin-bottom: 0.85rem;
}

.content-body {
  padding: 1.75rem 2rem 5rem 2rem;
  flex: 1;
  width: 100%;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  width: 100%;
}

.card:hover {
  border-color: #cbd5e1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Custom Clean Financial Metric Cards (User Preferred Style) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.metric-card {
  container-type: inline-size;
  background: #ffffff !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: var(--radius-xl) !important;
  padding: 1.15rem 1.25rem !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.2s ease !important;
}

.metric-card:hover {
  border-color: #cbd5e1 !important;
  transform: translateY(-1px) !important;
}

.metric-card .metric-label {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #64748b !important;
  margin-bottom: 0.45rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.metric-card .metric-val {
  font-size: clamp(0.85rem, 11.5cqw, 1.4rem) !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.2 !important;
  margin-bottom: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  letter-spacing: -0.02em !important;
}

white-space: nowrap !important;
}

.metric-card .metric-bar,
.metric-card .metric-icon {
  display: none !important;
}


.metric-card-sleek {
  background: linear-gradient(135deg, var(--primary, #150089), color-mix(in srgb, var(--primary, #150089) 80%, #000));
  color: white;
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.metric-card-sleek.variant-2 {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary, #150089) 85%, #000), var(--primary, #150089));
}

.metric-card-sleek.variant-3 {
  background: linear-gradient(135deg, var(--primary, #150089), color-mix(in srgb, var(--primary, #150089) 85%, #fff));
}

.metric-card-sleek.variant-4 {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary, #150089) 90%, #fff), color-mix(in srgb, var(--primary, #150089) 80%, #000));
}

.metric-card-sleek .m-label {
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: normal;
  opacity: 0.95;
}

.metric-card-sleek .m-value {
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  font-weight: 800;
  margin-top: 0.25rem;
  line-height: 1.1;
  word-break: break-word;
}

.metric-card-sleek .m-change {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 0.35rem;
}

.metric-card-sleek .m-watermark-icon {
  position: absolute;
  right: -10px;
  bottom: -10px;
  font-size: 4.5rem;
  opacity: 0.15;
  color: white;
  pointer-events: none;
}

.metric-card-sleek .m-watermark-icon svg {
  width: 80px;
  height: 80px;
}

/* Dashboard Grid Layout */
.dashboard-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 1.5rem;
  width: 100%;
  align-items: stretch;
}

.dashboard-grid-layout>.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

/* 3-Column Dashboard Row */
.dashboard-three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
  margin-top: 0.5rem;
}

.dashboard-three-grid>.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Sleek Financial Summary Styling */
.financial-summary-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.summary-label-val {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.summary-line-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.summary-line-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Flat & Anchor Buttons Styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-global);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  outline: none;
  text-decoration: none;
}

.btn svg,
.btn i {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

/* Primary Button & Link Guarantee White Text on Hover */
.btn-primary,
a.btn-primary {
  background: var(--primary);
  color: #ffffff !important;
}

.btn-primary:hover,
a.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff !important;
}

.btn-primary:hover span,
a.btn-primary:hover span,
.btn-primary:hover i,
a.btn-primary:hover i,
.btn-primary:hover svg,
a.btn-primary:hover svg {
  color: #ffffff !important;
}

.btn-secondary,
a.btn-secondary {
  background: var(--bg-surface-hover);
  color: var(--text-main) !important;
  border-color: var(--border-color);
}

.btn-secondary:hover,
a.btn-secondary:hover {
  background: #e2e8f0;
  color: var(--primary) !important;
}

.btn-outline-primary,
a.btn-outline-primary {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main) !important;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.btn-outline-primary:hover,
a.btn-outline-primary:hover {
  background: #f1f5f9;
  color: var(--primary) !important;
  border-color: var(--primary);
}

.btn-outline-primary svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

/* Compact Floating Support Button */
.floating-support-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: white;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.78rem;
  z-index: 999;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.floating-support-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

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

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.table th {
  background: var(--bg-surface-hover);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.85rem 1rem;
  text-transform: uppercase;
  font-size: 0.725rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tr:hover td {
  background: var(--bg-surface-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm) !important;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success {
  background: var(--secondary-light);
  color: #00ab68;
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-global);
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Bottom Sheet Modals System */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-sheet-backdrop.show,
.bottom-sheet-backdrop.active,
.bottom-sheet-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Desktop PC Layout: Centered Modal Dialog */
@media (min-width: 769px) {
  .bottom-sheet-backdrop {
    align-items: center !important;
    justify-content: center !important;
    padding: 1.5rem !important;
  }

  .bottom-sheet-modal {
    width: 100% !important;
    max-width: 680px !important;
    background: #ffffff !important;
    border-radius: var(--radius-2xl) !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28) !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    padding: 1.75rem !important;
    transform: scale(0.95) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
    position: relative !important;
    margin: 0 auto !important;
  }

  .bottom-sheet-backdrop.show .bottom-sheet-modal,
  .bottom-sheet-backdrop.active .bottom-sheet-modal,
  .bottom-sheet-backdrop.is-visible .bottom-sheet-modal {
    transform: scale(1) !important;
  }

  .bottom-sheet-handle {
    display: none !important;
  }
}

/* Mobile Viewport Layout: Slide-Up Bottom Sheet */
@media (max-width: 768px) {
  .bottom-sheet-backdrop {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .bottom-sheet-modal {
    width: 100% !important;
    max-width: 100% !important;
    background: #ffffff !important;
    border-radius: var(--radius-3xl) var(--radius-3xl) 0 0 !important;
    box-shadow: 0 -12px 36px rgba(15, 23, 42, 0.22) !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 0 1.25rem 1.5rem 1.25rem !important;
    transform: translateY(100%) !important;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease !important;
    position: relative !important;
    margin: 0 auto !important;
  }

  .bottom-sheet-backdrop.show .bottom-sheet-modal,
  .bottom-sheet-backdrop.active .bottom-sheet-modal,
  .bottom-sheet-backdrop.is-visible .bottom-sheet-modal {
    transform: translateY(0) !important;
  }

  .bottom-sheet-handle {
    display: block !important;
    width: 44px !important;
    height: 5px !important;
    background: #cbd5e1 !important;
    border-radius: 9999px !important;
    margin: 12px auto 14px auto !important;
    flex-shrink: 0 !important;
    cursor: grab !important;
  }
}

/* ========================================================= */
/* MOBILE & RESPONSIVE BREAKPOINTS */
/* ========================================================= */

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

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

@media (max-width: 992px) {

  html,
  body {
    overflow-x: clip !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .app-container {
    overflow-x: clip !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .top-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: var(--bg-surface, #ffffff) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0.65rem 1rem !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-bottom: none !important;
  }

  /* Reveal Hamburger Menu Button ONLY on Mobile / Tablet */
  #mobile-sidebar-toggle {
    display: inline-flex !important;
  }
}

@media (max-width: 768px) {

  .header-page-title,
  #page-title {
    display: none !important;
  }

  .content-body {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 1rem 1rem 4rem 1rem !important;
  }

  .top-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: var(--bg-surface, #ffffff) !important;
    padding: 0.75rem 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    border-bottom: none !important;
  }

  /* Desktop session badges hidden inside top right cluster */
  .desktop-badges {
    display: none !important;
  }

  /* Neat 100% width subrow directly under Dashboard title */
  .mobile-term-subrow {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.2rem;
    padding-top: 0.2rem;
  }

  .term-pill-badge {
    padding: 0.2rem 0.6rem !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
  }

  .date-pill-badge {
    font-size: 0.725rem !important;
    font-weight: 500 !important;
  }

  .usage-text {
    display: none;
  }

  /* 2x2 Metric Cards Grid on Mobile */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .metric-card-sleek {
    padding: 1rem 0.85rem !important;
    min-height: 110px !important;
  }

  .metric-card-sleek .m-label {
    font-size: 0.75rem !important;
  }

  .metric-card-sleek .m-value {
    font-size: 1.3rem !important;
  }

  .metric-card-sleek .m-change {
    font-size: 0.68rem !important;
  }

  .metric-card-sleek .m-watermark-icon svg {
    width: 50px !important;
    height: 50px !important;
  }

  /* All Sections Stack 1 per Row */
  .dashboard-grid-layout {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .dashboard-three-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* ========================================================= */
  /* MOBILE TABLE EMPTY STATES: CLEAN CARD UI WITHOUT COLUMNS   */
  /* ========================================================= */
  table:has(tbody tr td[colspan]) thead,
  .table:has(tbody tr td[colspan]) thead,
  .table-responsive:has(tbody tr td[colspan]) thead,
  .card:has(tbody tr td[colspan]) thead,
  table.table-empty thead,
  .table.table-empty thead,
  .table-card.table-empty thead,
  .card.table-empty thead,
  .is-empty thead {
    display: none !important;
  }

  table:has(tbody tr td[colspan]),
  .table:has(tbody tr td[colspan]),
  .table-responsive:has(tbody tr td[colspan]) table,
  .card:has(tbody tr td[colspan]) table,
  table.table-empty,
  .table.table-empty,
  .is-empty table,
  table.is-empty {
    min-width: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  table:has(tbody tr td[colspan]) tbody tr td[colspan],
  .table:has(tbody tr td[colspan]) tbody tr td[colspan],
  table.table-empty tbody tr td[colspan],
  .table.table-empty tbody tr td[colspan],
  .is-empty tbody tr td[colspan] {
    padding: 3rem 1.25rem !important;
    border-bottom: none !important;
    display: table-cell !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Prevent unnecessary horizontal scrolling container on mobile when empty */
  .table-responsive:has(tbody tr td[colspan]),
  .card:has(tbody tr td[colspan]) .table-responsive,
  .table-responsive:has(.table-empty),
  .card.table-empty .table-responsive,
  .table-responsive.table-empty {
    overflow-x: hidden !important;
  }
}

/* Global Title Back Button (Curved Return Arrow Style) */
.title-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  color: var(--primary);
  background: var(--bg-surface-hover, #f1f5f9);
  transition: var(--transition);
  text-decoration: none;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}

.title-back-btn:hover {
  background: var(--primary-light, #ece9ff);
  color: var(--primary);
  transform: translateX(-2px);
}

/* ========================================================= */
/* GLOBAL PREMIUM TOAST / ALERT NOTIFICATIONS UI SYSTEM      */
/* ========================================================= */
/* GLOBAL PREMIUM TOAST / ALERT NOTIFICATIONS UI SYSTEM      */
/* ========================================================= */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 99999999 !important;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 400px;
  width: calc(100vw - 3rem);
}

.toast,
.toast-notice {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', var(--font-global), sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow:
    0 20px 35px -10px rgba(15, 23, 42, 0.16),
    0 4px 12px -2px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  transform: scale(0.96) translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
  overflow: hidden;
  position: relative;
}

.toast.toast-show,
.toast-notice.toast-show {
  transform: scale(1) translateX(0);
  opacity: 1;
}

.toast-icon-wrap,
.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.toast-message {
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.toast-close-btn {
  background: rgba(241, 245, 249, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.8);
  color: #64748b;
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 0.35rem;
}

.toast-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: scale(1.05);
}

/* Success Toast */
.toast-success .toast-icon-wrap,
.toast-success .toast-icon {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Error Toast */
.toast-error .toast-icon-wrap,
.toast-error .toast-icon {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Warning Toast */
.toast-warning .toast-icon-wrap,
.toast-warning .toast-icon {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Info Toast */
.toast-info .toast-icon-wrap,
.toast-info .toast-icon {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Toast Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(15, 23, 42, 0.05);
}

.toast-progress-fill {
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  transition: width linear;
}

.toast-success .toast-progress-fill {
  background: linear-gradient(90deg, #10b981, #059669);
}

.toast-error .toast-progress-fill {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.toast-warning .toast-progress-fill {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.toast-info .toast-progress-fill {
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.toast-info .toast-progress-fill {
  background: var(--primary, #2500db);
}

/* ========================================================= */
/* TENANT SCHOOL LOGO PRELOADER                              */
/* ========================================================= */
.app-preloader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  opacity: 1;
  visibility: visible;
}

.app-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.preloader-logo-wrap {
  width: auto;
  height: 80px;
  max-width: 220px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  animation: preloaderPulse 2s infinite ease-in-out;
}

.preloader-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preloader-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  letter-spacing: -0.01em;
}

.preloader-sub {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light, #64748b);
  letter-spacing: 0.02em;
  margin-top: 0.2rem;
}

.preloader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid color-mix(in srgb, var(--primary, #150089) 15%, transparent);
  border-top-color: var(--primary, #150089);
  border-radius: 50%;
  animation: preloaderSpin 0.75s linear infinite;
  margin-top: 0.35rem;
}

@keyframes preloaderSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes preloaderPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

/* Global Action Button Spinner Animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ========================================================= */
/* SKELETAL PRELOADER COMPONENTS                             */
/* ========================================================= */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton-item {
  background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm, 6px);
  display: inline-block;
  vertical-align: middle;
}

.skeleton-text {
  height: 14px;
  width: 80%;
  border-radius: 4px;
}

.skeleton-title {
  height: 16px;
  width: 140px;
  border-radius: 4px;
}

.skeleton-subtext {
  height: 11px;
  width: 90px;
  border-radius: 4px;
}

.skeleton-badge {
  height: 22px;
  width: 60px;
  border-radius: 12px;
}

.skeleton-pill {
  height: 16px;
  width: 48px;
  border-radius: 10px;
}

.skeleton-action-btn {
  height: 28px;
  width: 28px;
  border-radius: 6px;
}

.skeleton-label {
  height: 13px;
  width: 85px;
  border-radius: 4px;
  margin-bottom: 6px;
  display: block;
}

.skeleton-input {
  height: 42px;
  width: 100%;
  border-radius: var(--radius-sm, 8px);
  display: block;
}

.skeleton-tr td {
  padding: 0.9rem 1rem !important;
  vertical-align: middle;
}

.spin,
.lucide-loader,
[data-lucide="loader"] {
  animation: spin 0.85s linear infinite !important;
}

.btn-loading {
  pointer-events: none !important;
  opacity: 0.85 !important;
  cursor: wait !important;
}

/* Global Page Titles & Subtext Compact Sizing */
.content-body h1,
.content-body h2:not(.family-empty-title),
.page-title-block h1,
.page-title-block h2,
.page-header h1,
.page-header h2,
.card-header h1,
.card-header h2 {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  margin-bottom: 0.2rem !important;
  line-height: 1.25 !important;
}

.content-body h1+p,
.content-body h2+p:not(.family-empty-desc),
.content-body h3+p,
.page-title-block p,
.page-subtitle,
.page-description,
.header-sub {
  font-size: 0.82rem !important;
  color: #64748b !important;
  margin-top: 0.15rem !important;
  margin-bottom: 1rem !important;
  line-height: 1.4 !important;
}

/* Mobile Page Titles & Subtext Font Size Optimization */
@media (max-width: 768px) {

  #page-title,
  .header-page-title,
  .page-title {
    font-size: 0.92rem !important;
  }

  .content-body h1,
  .content-body h2:not(.family-empty-title),
  .page-title-block h1,
  .page-title-block h2,
  .page-header h1,
  .page-header h2 {
    font-size: 1.1rem !important;
    line-height: 1.3 !important;
  }

  .content-body h3 {
    font-size: 1rem !important;
  }

  .content-body h1+p,
  .content-body h2+p:not(.family-empty-desc),
  .content-body h3+p,
  .top-header-bar p,
  .page-subtitle,
  .page-description,
  .header-sub {
    font-size: 0.76rem !important;
    line-height: 1.35 !important;
    margin-top: 0.15rem !important;
  }
}

@media (max-width: 480px) {

  #page-title,
  .header-page-title,
  .page-title {
    font-size: 0.88rem !important;
  }

  .content-body h1,
  .content-body h2:not(.family-empty-title),
  .page-title-block h1,
  .page-title-block h2,
  .page-header h1,
  .page-header h2 {
    font-size: 1.02rem !important;
  }

  .content-body h1+p,
  .content-body h2+p:not(.family-empty-desc),
  .content-body h3+p,
  .top-header-bar p,
  .page-subtitle,
  .page-description,
  .header-sub {
    font-size: 0.74rem !important;
  }
}

/* ========================================================= */
/* CONSISTENT GLOBAL TABLE ACTION ICON BUTTONS               */
/* ========================================================= */
.top-icon-flat-btn,
.btn-action-icon,
.btn-action-receipt,
.btn-action-view,
.btn-action-edit,
.btn-action-delete {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0.35rem !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease !important;
}

.top-icon-flat-btn:hover,
.btn-action-icon:hover,
.btn-action-receipt:hover,
.btn-action-view:hover,
.btn-action-edit:hover,
.btn-action-delete:hover {
  background-color: #f1f5f9 !important;
  transform: translateY(-1px) !important;
  opacity: 0.85 !important;
}

.btn-action-receipt,
.btn-action-view,
.btn-action-edit {
  color: #334155 !important;
}

.btn-action-delete {
  color: #ef4444 !important;
}

/* PC Desktop Layout: Standard Centered Modal Dialogs */
@media (min-width: 769px) {
  .modal-backdrop {
    align-items: center !important;
    justify-content: center !important;
    padding: 1.5rem !important;
  }

  .modal-backdrop .modal {
    border-radius: var(--radius-lg, 16px) !important;
    margin: 0 auto !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
    position: relative !important;
  }

  .modal-backdrop.show .modal,
  .modal-backdrop.active .modal {
    transform: scale(1) !important;
  }

  .modal-backdrop .modal::before {
    display: none !important;
    content: none !important;
  }

  .confirm-modal-drag-pill {
    display: none !important;
  }

  .modal-backdrop.modal-backdrop-confirm .modal,
  .modal-backdrop.modal-backdrop-confirm .confirm-modal,
  .modal-backdrop#confirm-modal-backdrop .confirm-modal,
  .modal-backdrop#global-confirm-modal-backdrop .confirm-modal {
    border-radius: 20px !important;
    max-width: 410px !important;
    width: 100% !important;
    padding: 2rem 1.75rem 1.75rem !important;
    margin: 0 auto !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  }
}

/* Mobile Viewport Layout: Slide-Up Bottom Sheets */
@media (max-width: 768px) {

  /* Position backdrop at bottom of viewport for bottom sheets on mobile */
  .modal-backdrop:not(.modal-backdrop-confirm):not(#confirm-modal-backdrop):not(#global-confirm-modal-backdrop) {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  /* Transform regular modals into bottom sheets on mobile */
  .modal-backdrop:not(.modal-backdrop-confirm):not(#confirm-modal-backdrop):not(#global-confirm-modal-backdrop) .modal:not(.modal-confirm):not(#confirm-modal):not(.confirm-modal) {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 24px !important;
    border-top-right-radius: 24px !important;
    max-height: 88vh !important;
    border-bottom: none !important;
    box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.28) !important;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease !important;
    position: relative;
  }

  /* Slide up when backdrop is shown/active */
  .modal-backdrop.show:not(.modal-backdrop-confirm):not(#confirm-modal-backdrop):not(#global-confirm-modal-backdrop) .modal:not(.modal-confirm):not(#confirm-modal):not(.confirm-modal),
  .modal-backdrop.active:not(.modal-backdrop-confirm):not(#confirm-modal-backdrop):not(#global-confirm-modal-backdrop) .modal:not(.modal-confirm):not(#confirm-modal):not(.confirm-modal) {
    transform: translateY(0) !important;
  }

  /* Interactive Top Drag Handle Pill */
  .modal-backdrop:not(.modal-backdrop-confirm):not(#confirm-modal-backdrop):not(#global-confirm-modal-backdrop) .modal:not(.modal-confirm):not(#confirm-modal):not(.confirm-modal)::before {
    content: '';
    display: block;
    width: 42px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 9999px;
    margin: 10px auto 4px auto;
    flex-shrink: 0;
  }

  /* Compact header on mobile bottom sheets */
  .modal-backdrop:not(.modal-backdrop-confirm):not(#confirm-modal-backdrop):not(#global-confirm-modal-backdrop) .modal:not(.modal-confirm):not(#confirm-modal):not(.confirm-modal) .modal-header {
    padding-top: 0.5rem !important;
  }

  /* Confirmation Modals as Bottom Sheets on Mobile */
  .modal-backdrop.modal-backdrop-confirm,
  .modal-backdrop#confirm-modal-backdrop,
  .modal-backdrop#global-confirm-modal-backdrop,
  .modal-backdrop:has(.modal-confirm),
  .modal-backdrop:has(#confirm-modal),
  .modal-backdrop:has(.confirm-modal) {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .modal-backdrop.modal-backdrop-confirm .modal,
  .modal-backdrop.modal-backdrop-confirm .confirm-modal,
  .modal-backdrop#confirm-modal-backdrop .confirm-modal,
  .modal-backdrop#global-confirm-modal-backdrop .confirm-modal {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 24px !important;
    border-top-right-radius: 24px !important;
    padding: 1.25rem 1.5rem 2.25rem !important;
    box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.28) !important;
    transform: translateY(100%);
  }

  .modal-backdrop.modal-backdrop-confirm.show .modal,
  .modal-backdrop.modal-backdrop-confirm.active .modal,
  .modal-backdrop.modal-backdrop-confirm.show .confirm-modal,
  .modal-backdrop.modal-backdrop-confirm.active .confirm-modal,
  .modal-backdrop#confirm-modal-backdrop.show .confirm-modal,
  .modal-backdrop#confirm-modal-backdrop.active .confirm-modal,
  .modal-backdrop#global-confirm-modal-backdrop.show .confirm-modal,
  .modal-backdrop#global-confirm-modal-backdrop.active .confirm-modal {
    transform: translateY(0) !important;
  }

  .confirm-modal-drag-pill {
    display: block !important;
  }
}


/* Parent Portal Accordion & Status Pills */
.status-pill-paid {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
}

.status-pill-owed {
  background: #fff1f2 !important;
  color: #be123c !important;
  border: 1px solid #fecdd3 !important;
}

.status-pill-partial {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

/* Parent Dashboard KPI Grid */
.parent-kpi-deck {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 1.25rem !important;
  margin-bottom: 1.5rem !important;
}

.parent-kpi-card {
  padding: 1.25rem 1.35rem !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  border: 1px solid #f1f5f9 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  text-align: left !important;
  justify-content: flex-start !important;
  gap: 1rem !important;
  transition: all 0.2s ease !important;
}

.parent-kpi-card:hover {
  border-color: #cbd5e1 !important;
}

.parent-kpi-icon-box {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  background: color-mix(in srgb, var(--primary, #150089) 10%, #ffffff) !important;
  color: var(--primary, #150089) !important;
}

.parent-kpi-icon-box i,
.parent-kpi-icon-box svg {
  width: 22px !important;
  height: 22px !important;
}

.parent-kpi-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  text-align: left !important;
}

.parent-kpi-value {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

.parent-kpi-label {
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
  margin-top: 0.1rem !important;
}

/* Mobile Responsive: Flat Premium 2x2 Grid with Compact Icon at the Top */
@media (max-width: 640px) {
  #parent-greeting-title {
    font-size: 1.3rem !important;
  }

  .parent-kpi-deck {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
  }

  .parent-kpi-card {
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.85rem 0.5rem !important;
    gap: 0.5rem !important;
    border-radius: 14px !important;
    border: 1px solid #f1f5f9 !important;
    box-shadow: none !important;
  }

  .parent-kpi-icon-box {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    margin: 0 auto !important;
  }

  .parent-kpi-icon-box i,
  .parent-kpi-icon-box svg {
    width: 15px !important;
    height: 15px !important;
  }

  .parent-kpi-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .parent-kpi-value {
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    word-break: break-word !important;
    line-height: 1.25 !important;
  }

  .parent-kpi-label {
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    margin-top: 0.15rem !important;
  }
}

/* Term Accordion Fee Cards & History Styling */
.term-fee-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: none !important;
  transition: border-color 0.2s ease;
}

.term-fee-card.active-term-card {
  border-color: #cbd5e1;
}

.term-card-header {
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.term-card-header:hover {
  background: #f8fafc;
}

.term-info {
  display: flex;
  flex-direction: column;
}

.term-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.term-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.active-term-pill {
  background: color-mix(in srgb, var(--primary, #150089) 10%, #ffffff);
  color: var(--primary, #150089);
  font-size: 0.64rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.term-sub {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  margin: 0.25rem 0 0 0;
}

.term-sub span {
  font-weight: 700;
  color: var(--primary, #150089);
}

.term-stats-and-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.mini-kpi-box {
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.mini-kpi-box.info {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.mini-kpi-box.success {
  background: #f0fdf4;
  border-color: #dcfce7;
}

.mini-kpi-box.danger {
  background: #fef2f2;
  border-color: #fee2e2;
}

.mini-kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mini-kpi-val {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 0.1rem;
}

.mini-kpi-val.text-success {
  color: #10b981;
}

.mini-kpi-val.text-danger {
  color: #ef4444;
}

/* Status Pills */
.status-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.status-pill i,
.status-pill svg {
  width: 14px !important;
  height: 14px !important;
  stroke-width: 2.2 !important;
}

.status-pill-owed {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.status-pill-partial {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-pill-cleared {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.btn-pay-owed {
  height: 38px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.accordion-chevron {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: transform 0.2s ease;
}

.term-fee-card.open .accordion-chevron i,
.term-fee-card.open .accordion-chevron svg {
  transform: rotate(180deg);
}

.term-card-body {
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}

.statement-table th {
  padding: 0.85rem 1.25rem !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  letter-spacing: 0.03em !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.statement-table td {
  padding: 0.95rem 1.25rem !important;
  font-size: 0.85rem !important;
  vertical-align: middle !important;
}

/* Premium Report Card Fee Paywall */
.report-paywall-card {
  border-radius: 20px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  max-width: 680px !important;
  margin: 1.5rem auto !important;
  overflow: hidden !important;
  box-shadow: none !important;
  position: relative !important;
}

.paywall-header-accent {
  height: 6px !important;
  background: linear-gradient(90deg, #be123c 0%, var(--primary, #150089) 50%, #f43f5e 100%) !important;
  width: 100% !important;
}

.paywall-body {
  padding: 3rem 2.25rem 2.5rem 2.25rem !important;
  text-align: center !important;
}

.paywall-lock-avatar {
  width: 68px !important;
  height: 68px !important;
  border-radius: 20px !important;
  background: color-mix(in srgb, #be123c 8%, #ffffff) !important;
  color: #be123c !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 1.25rem !important;
  border: 1px solid color-mix(in srgb, #be123c 20%, transparent) !important;
}

.paywall-lock-avatar i,
.paywall-lock-avatar svg {
  width: 32px !important;
  height: 32px !important;
  stroke-width: 2.2 !important;
}

.paywall-category-pill {
  display: inline-block !important;
  background: #fff1f2 !important;
  color: #be123c !important;
  border: 1px solid #fecdd3 !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  padding: 0.25rem 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  margin-bottom: 0.85rem !important;
}

.paywall-title {
  font-size: 1.4rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 0 0.5rem 0 !important;
  letter-spacing: -0.01em !important;
}

.paywall-desc {
  font-size: 0.9rem !important;
  color: #64748b !important;
  line-height: 1.6 !important;
  max-width: 520px !important;
  margin: 0 auto 1.75rem auto !important;
}

.paywall-kpi-container {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1.25rem !important;
  flex-wrap: wrap !important;
  margin-bottom: 1.85rem !important;
  background: #f8fafc !important;
  padding: 1.15rem 1.5rem !important;
  border-radius: 14px !important;
  border: 1px solid #e2e8f0 !important;
}

.paywall-kpi-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.2rem !important;
}

.paywall-kpi-label {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
}

.paywall-kpi-val {
  font-size: 1.1rem !important;
  font-weight: 800 !important;
}

.paywall-kpi-val.default {
  color: #0f172a !important;
}

.paywall-kpi-val.success {
  color: #059669 !important;
}

.paywall-kpi-val.danger {
  color: #be123c !important;
}

.paywall-kpi-divider {
  height: 32px !important;
  width: 1px !important;
  background: #cbd5e1 !important;
}

.paywall-actions-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.85rem !important;
  flex-wrap: wrap !important;
}

.btn-paywall-primary {
  height: 44px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  padding: 0 1.5rem !important;
  background: var(--primary, #150089) !important;
  color: #ffffff !important;
  border: none !important;
  transition: all 0.2s ease !important;
}

.btn-paywall-primary:hover {
  background: color-mix(in srgb, var(--primary, #150089) 85%, #000000) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.btn-paywall-secondary {
  height: 44px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  padding: 0 1.25rem !important;
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}

.btn-paywall-secondary:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  transform: translateY(-1px) !important;
}

@media (max-width: 640px) {
  .paywall-body {
    padding: 2rem 1.25rem !important;
  }

  .paywall-kpi-container {
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
  }

  .paywall-kpi-divider {
    width: 100% !important;
    height: 1px !important;
  }

  .paywall-actions-row,
  .btn-paywall-primary,
  .btn-paywall-secondary {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Banking App Mobile Transaction List & Slide-up Bottom Sheet */
.fin-banking-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.fin-banking-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.fin-banking-item:active {
  transform: scale(0.985);
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.fin-banking-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.fin-banking-item-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main, #0f172a);
  line-height: 1.3;
}

.fin-banking-item-amount {
  font-weight: 800;
  font-size: 0.925rem;
  white-space: nowrap;
}

.fin-banking-item-amount.inc {
  color: #10b981;
}

.fin-banking-item-amount.exp {
  color: #ef4444;
}

.fin-banking-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 500;
}

.fin-bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.fin-bottom-sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.fin-bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 1.25rem 1.5rem 2.25rem 1.5rem;
  z-index: 2001;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  max-height: 88vh;
  overflow-y: auto;
}

.fin-bottom-sheet.active {
  transform: translateY(0);
}

.fin-bottom-sheet-handle {
  width: 38px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 9999px;
  margin: 0 auto 1.25rem auto;
}

/* Custom Adaptive Dropdown Component System */
.custom-select-wrap {
  position: relative;
  display: inline-block;
  width: auto;
}

.custom-dropdown-container {
  position: relative;
  width: 100%;
}

.form-group .custom-select-wrap,
.form-group .custom-dropdown-container {
  width: 100%;
  display: block;
}

.form-group .custom-dropdown-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.custom-dropdown-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  height: 40px;
  padding: 0 0.85rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm, 5px);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main, #0f172a);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.custom-dropdown-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-dropdown-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease, color 0.15s ease;
  flex-shrink: 0;
  color: #64748b;
}

.custom-dropdown-btn:hover {
  border-color: var(--primary, #150089);
  color: var(--primary, #150089);
  background: #ffffff;
}

.custom-dropdown-btn:hover .custom-dropdown-icon {
  color: var(--primary, #150089);
}

.custom-dropdown-container.active .custom-dropdown-btn {
  border-color: var(--primary, #150089);
  color: var(--primary, #150089);
  box-shadow: 0 0 0 3px rgba(21, 0, 137, 0.12);
  background: #ffffff;
}

.custom-dropdown-container.active .custom-dropdown-icon {
  transform: rotate(180deg);
  color: var(--primary, #150089);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: auto;
  width: max-content;
  min-width: 100%;
  max-width: 220px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm, 5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 100;
  display: none;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.pay-filter-row .custom-select-wrap:last-child .custom-dropdown-menu,
.pay-filter-row .custom-select-wrap:last-of-type .custom-dropdown-menu,
.custom-dropdown-menu.dropdown-menu-end {
  right: 0;
  left: auto;
}

.custom-dropdown-menu::-webkit-scrollbar {
  width: 4px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

.custom-dropdown-container.active .custom-dropdown-menu {
  display: block;
}

.custom-dropdown-item {
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  border-radius: var(--radius-sm, 5px);
  cursor: pointer;
  transition: background 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
}

.custom-dropdown-item:hover {
  background: #f1f5f9;
  color: var(--primary, #150089);
}

.custom-dropdown-item.active {
  background: var(--primary-light, #eef2ff);
  color: var(--primary, #150089);
  font-weight: 700;
}

@media (max-width: 768px) {
  .custom-select-wrap {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
  }

  .custom-dropdown-btn {
    padding: 0 0.35rem 0 0.45rem !important;
    font-size: 0.775rem !important;
    height: 36px !important;
    width: 100% !important;
  }
}

.btn-load-results,
.btn-load-roster {
  background: var(--primary-light, #eef2ff) !important;
  color: var(--primary, #150089) !important;
  border: 1px solid color-mix(in srgb, var(--primary, #150089) 25%, #fff) !important;
  border-radius: 10px;
  font-weight: 700;
  padding: 0.65rem 1.35rem;
  min-height: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-load-results:hover,
.btn-load-roster:hover {
  background: var(--primary, #150089) !important;
  color: #ffffff !important;
  border-color: var(--primary, #150089) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(21, 0, 137, 0.15);
}

/* Remarks Filter Row Layout */
.remarks-filter-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
}

.remarks-actions-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  justify-content: space-between;
}

.remarks-actions-group>#save-all-container {
  margin-left: auto;
}

@media (max-width: 768px) {
  .remarks-filter-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .remarks-item-session,
  .remarks-item-term,
  .remarks-item-class {
    grid-column: span 1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .remarks-actions-group {
    grid-column: span 3 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    margin-left: 0 !important;
  }

  .remarks-actions-group>div,
  .remarks-actions-group>#save-all-container {
    flex: 0 0 auto !important;
    width: auto !important;
    margin-left: 0 !important;
  }

  .remarks-actions-group button,
  .remarks-actions-group #btn-save-all,
  .remarks-actions-group .btn-load-results {
    width: auto !important;
    min-width: 0 !important;
    font-size: 0.8rem !important;
    padding: 0 0.85rem !important;
    height: 38px !important;
    min-height: 38px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* Subject Results Filter Row Layout */
.sr-filter-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
}

.sr-actions-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  justify-content: space-between;
}

.sr-actions-group>div:last-child {
  margin-left: auto;
}

@media (max-width: 768px) {
  .sr-filter-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .sr-item-session {
    grid-column: 1 / 2 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .sr-item-term {
    grid-column: 2 / 3 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .sr-item-class {
    grid-column: 1 / 2 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .sr-item-student,
  .sr-item-subject {
    grid-column: 2 / 3 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .sr-actions-group {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    margin-left: 0 !important;
  }

  .sr-actions-group>div {
    flex: 0 0 auto !important;
    width: auto !important;
    margin-left: 0 !important;
  }

  .sr-actions-group button,
  .sr-actions-group #btn-print,
  .sr-actions-group .btn-load-results {
    width: auto !important;
    min-width: 0 !important;
    font-size: 0.8rem !important;
    padding: 0 0.85rem !important;
    height: 38px !important;
    min-height: 38px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* Cumulative Result Filter Row Layout */
.cr-filter-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
}

.cr-actions-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  justify-content: space-between;
}

.cr-actions-group>div:last-child {
  margin-left: auto;
}

@media (max-width: 768px) {
  .cr-filter-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .cr-item-session {
    grid-column: 1 / 2 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .cr-item-class {
    grid-column: 2 / 3 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .cr-actions-group {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    margin-left: 0 !important;
  }

  .cr-actions-group>div {
    flex: 0 0 auto !important;
    width: auto !important;
    margin-left: 0 !important;
  }

  .cr-actions-group button,
  .cr-actions-group #btn-print-report,
  .cr-actions-group .btn-load-results {
    width: auto !important;
    min-width: 0 !important;
    font-size: 0.8rem !important;
    padding: 0 0.85rem !important;
    height: 38px !important;
    min-height: 38px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* Enter Scores Filter Row Layout */
.es-filter-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
}

.es-actions-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

@media (max-width: 768px) {
  .es-filter-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .es-item-class {
    grid-column: 1 / 2 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .es-item-session {
    grid-column: 2 / 3 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .es-item-term {
    grid-column: 1 / 2 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .es-item-subject {
    grid-column: 2 / 3 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .es-actions-group {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    margin-left: 0 !important;
  }

  .es-actions-group>div {
    flex: 0 0 auto !important;
    width: auto !important;
    margin-left: 0 !important;
  }

  .es-actions-group button,
  .es-actions-group #btn-reset-scores,
  .es-actions-group #btn-save-grades {
    width: auto !important;
    min-width: 0 !important;
    font-size: 0.8rem !important;
    padding: 0 0.85rem !important;
    height: 38px !important;
    min-height: 38px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* Finance Overview Filter Row Layout */
.fin-filter-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
}

.fin-actions-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

@media (max-width: 768px) {
  .fin-filter-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.35rem !important;
    width: 100% !important;
  }

  .fin-item-session {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .fin-item-term {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .fin-actions-group {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: auto !important;
    margin-left: 0 !important;
  }

  .fin-actions-group>div {
    flex: 0 0 auto !important;
    width: auto !important;
    margin-left: 0 !important;
  }

  .fin-actions-group button,
  .fin-actions-group #btn-reset-fin-filter {
    width: auto !important;
    min-width: 0 !important;
    font-size: 0.76rem !important;
    padding: 0 0.55rem !important;
    height: 38px !important;
    min-height: 38px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .fin-filter-row .custom-dropdown-btn {
    padding: 0 0.45rem !important;
    font-size: 0.78rem !important;
    height: 38px !important;
    min-height: 38px !important;
  }
}

/* Payment Records Filter Container Layout */
.pay-filter-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.pay-filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 769px) {
  .pay-row-reset {
    margin-left: auto;
  }
}

@media (max-width: 768px) {
  .pay-filter-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    width: 100% !important;
  }

  .pay-filter-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.4rem !important;
    width: 100% !important;
  }

  .pay-item-search {
    flex: 1 1 0 !important;
    min-width: 0 !important;
  }

  .pay-item-category {
    flex: 0 0 auto !important;
    width: auto !important;
  }

  .pay-item-category .custom-dropdown-btn {
    width: auto !important;
    white-space: nowrap !important;
    padding: 0 0.65rem !important;
    font-size: 0.8rem !important;
  }

  .pay-row-2 .custom-select-wrap {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
  }

  .pay-row-2 .custom-dropdown-btn {
    padding: 0 0.4rem !important;
    font-size: 0.76rem !important;
    height: 38px !important;
    min-height: 38px !important;
  }

  .pay-row-reset {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    margin-left: 0 !important;
  }

  .pay-actions-group {
    width: auto !important;
    margin-left: auto !important;
  }

  .pay-actions-group button,
  .pay-actions-group #btn-reset-filters {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .pay-custom-dates-row {
    align-items: center !important;
    gap: 0.4rem !important;
    width: 100% !important;
  }

  .pay-custom-dates-row input {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* Micro, subtle Optional badge styling */
.badge-optional {
  background: #f8fafc;
  color: #94a3b8;
  font-size: 0.52rem;
  font-weight: 600;
  padding: 0.04rem 0.22rem;
  border-radius: 3px;
  margin-left: 0.25rem;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  border: 1px solid #e2e8f0;
  text-transform: lowercase;
  opacity: 0.75;
}

/* Responsive Modal Bottom Sheet for Mobile */
.modal-bottom-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-bottom-sheet-content {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  border: none;
  position: relative;
}

.bottom-sheet-pill {
  display: none;
  width: 38px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 999px;
  margin: -0.25rem auto 1rem auto;
}

@media (max-width: 576px) {
  .modal-bottom-sheet-backdrop {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .modal-bottom-sheet-content {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    margin-bottom: 0 !important;
    padding: 1.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) 1.25rem !important;
    animation: modalBottomSheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .bottom-sheet-pill {
    display: block !important;
  }
}

@keyframes modalBottomSheetSlideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}