/* Google Material Design 3 Design Tokens & Color Palette */
:root {
  --bg-color: #f0f4f9; /* Modern Google Workspace light grey-blue background */
  --surface-color: #ffffff;

  /* Google Brand Colors (M3) */
  --primary-color: #0b57d0; /* Rich Google Blue */
  --primary-hover: #0842a0;
  --primary-light: #d3e3fd; /* Active link pill tint */

  --red-color: #b3261e; /* Rich Google Red */
  --red-light: #f9dedc;

  --green-color: #146c2e; /* Rich Google Green */
  --green-light: #e6f4ea;

  --yellow-color: #b06000; /* Deep Google Yellow for text contrast */
  --yellow-light: #ffeebc;

  /* Layout Colors */
  --text-color: #1f1f1f; /* Near-black text */
  --text-secondary: #444746; /* Dark grey text */
  --border-color: #e0e2e6; /* Subtle divider grey */
  --hover-bg: #e1e3e1; /* Hover pill grey */

  /* Material Elevations (Shadows) */
  --shadow-elevation-1:
    0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --shadow-elevation-2:
    0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
  --shadow-elevation-3:
    0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px 0 rgba(0, 0, 0, 0.3);

  --nav-height: 64px;
  --sidebar-width: 256px;
  --transition-speed: 0.15s;
}

/* Dark Theme Variables (Workspace M3 shades) */
body.dark-theme {
  --bg-color: #0f0f10;
  --surface-color: #1e1f20;

  --primary-color: #a8c7fa; /* Google Dark Blue */
  --primary-hover: #c2e7ff;
  --primary-light: #004a77; /* Dark active pill tint */

  --red-color: #f28b82; /* Google Dark Red */
  --red-light: #3c2525;

  --green-color: #81c995; /* Google Dark Green */
  --green-light: #253c2a;

  --yellow-color: #fdd663; /* Google Dark Yellow */
  --yellow-light: #3c3825;

  --text-color: #e3e3e3;
  --text-secondary: #c4c7c5;
  --border-color: #444746;
  --hover-bg: #303134;

  --shadow-elevation-1: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-elevation-2: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-elevation-3: 0 8px 24px rgba(0, 0, 0, 0.6);

  /* Bootstrap 5 Theme Variable Overrides */
  --bs-body-bg: #0f0f10;
  --bs-body-color: #e3e3e3;
  --bs-emphasis-color: #ffffff;
  --bs-secondary-color: #c4c7c5;
  --bs-secondary-bg: #2b2c2e;
  --bs-tertiary-bg: #232425;
  --bs-card-bg: #1e1f20;
  --bs-card-color: #e3e3e3;
  --bs-card-border-color: #444746;
  --bs-table-bg: #1e1f20;
  --bs-table-color: #e3e3e3;
  --bs-table-border-color: #444746;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-striped-color: #e3e3e3;
  --bs-table-hover-bg: #303134;
  --bs-table-hover-color: #ffffff;
  --bs-border-color: #444746;
  --bs-modal-bg: #1e1f20;
  --bs-modal-color: #e3e3e3;
  --bs-dropdown-bg: #1e1f20;
  --bs-dropdown-color: #e3e3e3;
  --bs-dropdown-link-color: #e3e3e3;
  --bs-dropdown-link-hover-bg: #303134;
  --bs-form-control-bg: #1e1f20;
  --bs-list-group-bg: #1e1f20;
  --bs-list-group-color: #e3e3e3;
  --bs-list-group-border-color: #444746;

  color-scheme: dark;
}

/* Global resets & Typographic balance */
* {
  box-sizing: border-box;
  font-family: "Roboto", sans-serif;
  transition:
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease,
    border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Scrollbar customization (Google style) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-secondary);
}
::-webkit-scrollbar-track {
  background-color: transparent;
}

/* Sticky Top Navigation Bar */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-toggle-btn {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.menu-toggle-btn:hover {
  background-color: var(--hover-bg);
}

.logo-text {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.2px;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.brand-logo-img:hover {
  transform: scale(1.05);
}

/* Unified Top Search Bar & Overlay */
.search-bar-container {
  flex: 1;
  max-width: 540px;
  margin: 0 16px;
  position: relative;
}

.top-search-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 0 14px;
  height: 42px;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.top-search-bar:focus-within {
  background-color: var(--surface-color);
  border-color: var(--primary-color);
  box-shadow: 0 1px 6px rgba(11, 87, 208, 0.2);
}

.top-search-bar i.search-icon {
  color: var(--text-secondary);
  font-size: 20px;
  margin-right: 8px;
  flex-shrink: 0;
}

.top-search-bar input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: var(--text-color);
}

.top-search-bar input::placeholder {
  color: var(--text-secondary);
  opacity: 0.8;
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  flex-shrink: 0;
}

.search-clear-btn:hover {
  background-color: var(--hover-bg);
  color: var(--text-color);
}

/* Global Search Dropdown Overlay */
.global-search-overlay {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-elevation-3);
  max-height: 420px;
  overflow-y: auto;
  z-index: 1100;
  display: none;
  padding: 8px 0;
}

.global-search-overlay.show {
  display: block;
}

.global-search-section {
  padding: 6px 0;
}

.global-search-section:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

.global-search-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  padding: 6px 16px 4px;
}

.global-search-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.global-search-item:hover {
  background-color: var(--hover-bg);
}

.global-search-item i {
  color: var(--primary-color);
  font-size: 20px;
  flex-shrink: 0;
}

.theme-toggle-hdr-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  outline: none;
  flex-shrink: 0;
}

.theme-toggle-hdr-btn:hover {
  background-color: var(--hover-bg);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.theme-toggle-hdr-btn i {
  font-size: 20px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8, #34a853);
  color: white;
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  border: 1.5px solid var(--surface-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.avatar-dropdown {
  position: absolute;
  top: 44px;
  right: 0;
  width: 220px;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-elevation-3);
  display: none;
  flex-direction: column;
  padding: 8px 0;
  z-index: 1100;
}

.avatar-dropdown.show {
  display: flex;
}

.avatar-dropdown-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}

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

/* Left Sidebar Navigation Drawer */
.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background-color: transparent !important;
  border-right: 1px solid transparent !important;
  z-index: 1040;
  padding-top: 8px;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

/* Sidebar scrollbar customization (Gmail/Workspace style) */
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}
.sidebar:hover::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-secondary) !important;
}

/* Firefox scrollbar behavior on hover */
.sidebar:hover {
  scrollbar-color: var(--border-color) transparent;
}

/* Hide scrollbar for sidebar when collapsed and not hovered */
body.collapsed-sidebar .sidebar:not(:hover) {
  scrollbar-width: none;
}
body.collapsed-sidebar .sidebar:not(:hover)::-webkit-scrollbar {
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Gmail/Google Drive Style Sidebar Link Pills */
.sidebar-link {
  height: 40px;
  margin: 2px 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-left: 16px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border-radius: 20px !important;
  cursor: pointer;
  position: relative;
}

.sidebar-link i {
  color: var(--text-secondary);
  font-size: 20px;
}

.sidebar-link:hover {
  background-color: var(--hover-bg);
  color: var(--text-color);
}

.sidebar-link.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.sidebar-link.active i {
  color: var(--primary-color);
}

/* Sidebar Backdrop overlay on small screens */
.sidebar-backdrop {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.35);
  z-index: 1030;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-speed) ease;
}

/* Main Layout Canvas */
.main-canvas {
  margin-top: calc(var(--nav-height) + 16px);
  margin-left: var(--sidebar-width);
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  transition:
    margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.2s ease,
    margin 0.2s ease,
    border-radius 0.2s ease;
  background-color: var(--surface-color);
  border-radius: 24px;
  margin-right: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* SPA View Swapping Router targets */
.page-view {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.page-view.active-page {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Google Material Outlined Floating Input controls */
.form-floating {
  position: relative;
  margin-bottom: 4px;
}

.form-floating .form-control,
.form-floating .form-select {
  border: 1px solid var(--border-color) !important;
  border-radius: 4px !important;
  background-color: var(--surface-color) !important;
  color: var(--text-color) !important;
  height: 56px !important;
  padding: 1rem 0.75rem !important;
  box-shadow: none !important;
  font-size: 15px;
}

.form-floating .form-control:focus,
.form-floating .form-select:focus {
  border-color: var(--primary-color) !important;
  border-width: 2px !important;
  padding: calc(1rem - 1px) calc(0.75rem - 1px) !important; /* Prevent layout jitter */
}

.form-floating label {
  color: var(--text-secondary);
  padding: 1rem 0.75rem;
  pointer-events: none;
  transition:
    transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.15s ease,
    background-color 0.15s ease;
  background-color: transparent;
  transform-origin: 0 0;
}

/* Outlined border-mask floating effect on focus */
.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label,
.form-floating .form-select:focus ~ label,
.form-floating .form-select:not([value=""]) ~ label,
.form-floating .form-control:-webkit-autofill ~ label {
  transform: scale(0.75) translateY(-1.15rem) translateX(0.1rem);
  background-color: var(--surface-color);
  color: var(--primary-color);
  padding: 0 6px;
  height: auto;
  z-index: 5;
  font-weight: 500;
}

/* Textarea height tweaks */
.form-floating textarea.form-control {
  height: 100px !important;
}

/* Google Material Cards */
.material-card {
  background-color: var(--surface-color);
  border-radius: 16px; /* Modern M3 rounded corner styling */
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-elevation-1);
  padding: 24px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  transition: box-shadow var(--transition-speed) ease;
}

.material-card:hover {
  box-shadow: var(--shadow-elevation-2);
}

/* Summary Dashboard Cards specific styling - Google Keep styled */
/* Summary Dashboard Cards specific styling - Google M3 styled */
.summary-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 115px;
  height: auto;
  gap: 6px;
  background-color: var(--surface-color) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-elevation-1) !important;
  border-radius: 12px !important;
  transition:
    transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease !important;
  color: var(--text-color) !important;
  position: relative;
  overflow: hidden;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevation-2) !important;
}

.summary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary) !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  z-index: 1;
}

.summary-card-body {
  margin-top: 1px;
  z-index: 1;
}

.summary-card-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: var(--text-color) !important;
}

.summary-card-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 1px;
  z-index: 1;
}

/* Responsive card rules to prevent clipping on tablet and mobile */
@media (max-width: 1199.98px) {
  .summary-card {
    min-height: 105px;
    padding: 14px 16px !important;
  }
  .summary-card-value {
    font-size: 20px;
  }
}

@media (max-width: 575.98px) {
  .summary-card {
    min-height: 95px;
    padding: 12px 14px !important;
    gap: 4px;
  }
  .summary-card-value {
    font-size: 18px;
  }
  .summary-card-header {
    font-size: 9.5px;
  }
  .summary-card-footer {
    font-size: 9.5px;
  }
}

.summary-card-icon-bg {
  position: absolute;
  bottom: -15px;
  right: -10px;
  font-size: 72px;
  opacity: 0.035;
  pointer-events: none;
  color: var(--text-color) !important;
  z-index: 0;
}

body.dark-theme .summary-card-icon-bg {
  color: var(--text-color) !important;
  opacity: 0.04;
}

/* M3-style Outline Cards with color accents */
.summary-card.card-blue .summary-icon {
  color: var(--primary-color) !important;
}
.summary-card.card-red .summary-icon {
  color: var(--red-color) !important;
}
.summary-card.card-green .summary-icon {
  color: var(--green-color) !important;
}
.summary-card.card-yellow .summary-icon {
  color: var(--yellow-color) !important;
}

/* Keep-style amber & purple accents */
.summary-card.card-amber .summary-icon {
  color: #ff9100 !important;
}
.summary-card.card-purple .summary-icon {
  color: #8e24aa !important;
}

/* Custom Purple Badge Utility Classes */
.bg-purple-subtle {
  background-color: #f3e8ff !important;
}
.text-purple {
  color: #7c3aed !important;
}
.border-purple-subtle {
  border-color: #ddd6fe !important;
}

body.dark-theme .bg-purple-subtle {
  background-color: rgba(124, 58, 237, 0.22) !important;
}
body.dark-theme .text-purple {
  color: #c4b5fd !important;
}
body.dark-theme .border-purple-subtle {
  border-color: rgba(124, 58, 237, 0.4) !important;
}


/* Material Design Buttons - Modern M3 Pill Shapes */
.btn-google-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  font-weight: 500;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 24px; /* Pill shape */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition:
    background-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

.btn-google-primary:hover {
  background-color: var(--primary-hover);
  color: white;
  box-shadow: var(--shadow-elevation-1);
}

.btn-google-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--primary-color);
  font-weight: 500;
  font-size: 14px;
  padding: 9px 24px;
  border-radius: 24px; /* Pill shape */
  transition:
    background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}

.btn-google-outline:hover {
  background-color: var(--hover-bg);
  border-color: var(--border-color);
  color: var(--primary-color);
}

.btn-google-text {
  background-color: transparent;
  border: none;
  color: var(--primary-color);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 24px; /* Pill shape */
  transition: background-color var(--transition-speed) ease;
}

.btn-google-text:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

/* Floating Action Button (FAB) - Google M3 Squircle Shape */
.fab-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 16px !important; /* Modern Squircle Corner */
  background-color: #c2e7ff; /* Google M3 Primary Container color (Light Blue) */
  color: #001d35; /* On Primary Container color (Dark Blue) */
  box-shadow: var(--shadow-elevation-2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 990;
  cursor: pointer;
  font-family: "Outfit", sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition:
    background-color 0.2s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1),
    transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

body.dark-theme .fab-btn {
  background-color: #303134; /* Surface Container High in Dark Mode */
  color: #c2e7ff; /* On Primary Container color in Dark Mode */
  box-shadow: var(--shadow-elevation-2);
}

.fab-btn:hover {
  background-color: #b3e1ff; /* Slightly darker blue overlay on hover */
  color: #001d35;
  transform: scale(1.04);
  box-shadow: var(--shadow-elevation-3);
}

body.dark-theme .fab-btn:hover {
  background-color: #3c4043; /* Surface Container Highest on hover in dark mode */
  color: #c2e7ff;
  transform: scale(1.04);
  box-shadow: var(--shadow-elevation-3);
}

.fab-btn:active {
  background-color: #99d4ff;
  transform: scale(0.98);
  box-shadow: var(--shadow-elevation-1);
}

body.dark-theme .fab-btn:active {
  background-color: #4f5357;
  transform: scale(0.98);
  box-shadow: var(--shadow-elevation-1);
}

.fab-btn i {
  font-size: 24px;
}

.fab-extended {
  width: auto;
  height: 56px; /* Google M3 standard height is 56px */
  border-radius: 16px !important;
  padding: 0 24px 0 16px; /* Google M3 standard padding */
  gap: 12px;
}

/* Ensure SVG and material icons inside container align and scale correctly */
.fab-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.google-plus-icon {
  width: 24px;
  height: 24px;
  display: block;
}

/* Modals styled like Google Products details drawers */
.modal-content {
  background-color: var(--surface-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 16px; /* Modern M3 rounded corner styling */
  box-shadow: var(--shadow-elevation-3);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2.5rem);
  overflow: hidden;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-content > .tab-content,
.modal-dialog .tab-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-content .tab-pane,
.modal-dialog .tab-pane {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-content .tab-pane.active,
.modal-content .tab-pane.show,
.modal-dialog .tab-pane.active,
.modal-dialog .tab-pane.show {
  display: flex;
}

.modal-header-google,
.modal-header,
.modal-tabs-header,
.modal-footer {
  flex-shrink: 0;
}

.modal-header-google {
  border-top: none;
  padding: 20px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-google h5 {
  font-weight: 500;
  font-size: 18px;
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.modal-close-btn:hover {
  background-color: var(--hover-bg);
  color: var(--text-color);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Material Data Tables with sticky headers */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 16px; /* Rounded corners matching Workspace M3 */
  background-color: var(--surface-color);
  margin-bottom: 24px;
}

.material-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.material-table th {
  background-color: var(--bg-color);
  color: var(--text-secondary);
  font-weight: 500;
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}

.material-table th:hover {
  color: var(--text-color);
}

.material-table th i {
  font-size: 16px;
  vertical-align: middle;
  margin-left: 2px;
}

.material-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  vertical-align: middle;
}

.material-table tbody tr {
  cursor: pointer;
}

.material-table tbody tr:hover {
  background-color: var(--hover-bg);
}

.material-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.status-active {
  background-color: var(--primary-light);
  color: var(--primary-color);
}
.status-overdue {
  background-color: var(--red-light);
  color: var(--red-color);
}
.status-closed {
  background-color: var(--green-light);
  color: var(--green-color);
}
.status-pending {
  background-color: var(--yellow-light);
  color: var(--yellow-color);
}
.status-submitted {
  background-color: var(--primary-light);
  color: var(--primary-color);
}
.status-under-review {
  background-color: var(--yellow-light);
  color: var(--yellow-color);
}
.status-rejected {
  background-color: var(--red-light);
  color: var(--red-color);
}
.status-disbursed {
  background-color: var(--green-light);
  color: var(--green-color);
}

/* Autocomplete selectors and Search dropdowns */
.search-select-container {
  position: relative;
}

.search-select-dropdown {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: var(--shadow-elevation-2);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-select-dropdown.show {
  display: block;
}

.search-select-option {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color);
}

.search-select-option:hover {
  background-color: var(--hover-bg);
}

/* Google-style bottom-left Toast systems */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
}

.material-toast {
  min-width: 288px;
  max-width: 400px;
  background-color: #323232;
  color: #ffffff;
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-elevation-3);
  opacity: 0;
  transform: translateY(20px);
  animation: toast-in 0.2s forwards cubic-bezier(0, 0, 0.2, 1);
}

.material-toast.toast-success {
  border-left: 4px solid var(--green-color);
}
.material-toast.toast-error {
  border-left: 4px solid var(--red-color);
}
.material-toast.toast-info {
  border-left: 4px solid var(--primary-color);
}

.material-toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.material-toast-close {
  background: none;
  border: none;
  color: #b0b0b0;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.material-toast-close:hover {
  color: #ffffff;
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.material-toast.toast-out {
  animation: toast-out 0.2s forwards cubic-bezier(0.4, 0, 1, 1);
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Skeletal Animations */
.skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@keyframes skeleton-pulse {
  0% {
    background-color: rgba(0, 0, 0, 0.05);
  }
  50% {
    background-color: rgba(0, 0, 0, 0.12);
  }
  100% {
    background-color: rgba(0, 0, 0, 0.05);
  }
}

@keyframes skeleton-pulse-dark {
  0% {
    background-color: rgba(255, 255, 255, 0.05);
  }
  50% {
    background-color: rgba(255, 255, 255, 0.12);
  }
  100% {
    background-color: rgba(255, 255, 255, 0.05);
  }
}

.skeleton {
  animation: skeleton-pulse 1.5s infinite ease-in-out;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.08);
  border: none !important;
}

body.dark-theme .skeleton {
  animation: skeleton-pulse-dark 1.5s infinite ease-in-out;
  background-color: rgba(255, 255, 255, 0.08);
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  width: 50%;
  margin-bottom: 16px;
}

.skeleton-card {
  height: 140px;
  border-radius: 8px;
}

.skeleton-chart {
  height: 300px;
  border-radius: 8px;
}

.skeleton-row {
  height: 48px;
  margin-bottom: 8px;
}

/* ============================================================================
   PROFESSIONAL PRINT STYLESHEET
   Industry-standard financial document print styles
   ============================================================================ */

/* Global page setup for A4 printing */
@page {
  size: A4;
  margin: 12mm 15mm 18mm 15mm;
}

@media print {
  /* ── Base Reset ───────────────────────────────────────────────────────── */
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-family: "Segoe UI", "Roboto", "Arial", sans-serif !important;
    font-size: 11pt !important;
    line-height: 1.45 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* ── Hide all UI chrome ──────────────────────────────────────────────── */
  .top-nav,
  .sidebar,
  .sidebar-backdrop,
  .fab-btn,
  .btn-google-primary,
  .btn-google-outline,
  .btn-google-text,
  .search-container,
  .print-hide,
  .search-bar-container,
  .modal-backdrop,
  .modal-footer,
  .toast-container,
  [data-bs-toggle],
  .dropdown-menu,
  button:not(.no-print-hide),
  .pagination,
  .badge,
  .mobile-bottom-nav,
  .mobile-more-sheet,
  .mobile-more-sheet-backdrop,
  .nav-tabs,
  .google-tabs {
    display: none !important;
  }

  /* ── Main content area reset ─────────────────────────────────────────── */
  .main-canvas {
    margin-left: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .page-view {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* ── Cards & Tables ──────────────────────────────────────────────────── */
  .material-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 16pt !important;
    break-inside: avoid;
  }

  .table-container {
    border: none !important;
    overflow: visible !important;
  }

  .material-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9pt !important;
  }

  .material-table th,
  .material-table td {
    border: 0.75pt solid #333333 !important;
    padding: 5pt 8pt !important;
    color: #000 !important;
    background: transparent !important;
  }

  .material-table th {
    background-color: #e8e8e8 !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 8pt !important;
    letter-spacing: 0.3pt;
  }

  .material-table tbody tr:nth-child(even) td {
    background-color: #f6f6f6 !important;
  }

  /* ── Report Page Print Enhancements ──────────────────────────────────── */
  .report-print-header {
    display: block !important;
    text-align: center;
    border-bottom: 1.5pt solid #1a1a1a;
    padding-bottom: 6pt;
    margin-bottom: 10pt;
  }

  .report-print-header .company-name {
    font-size: 13pt;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
    margin: 0;
    color: #000;
  }

  .report-print-header .company-reg {
    font-size: 7.5pt;
    color: #555;
    margin: 1pt 0 0 0;
  }

  .report-print-header .company-address {
    font-size: 7.5pt;
    color: #333;
    margin: 1pt 0 0 0;
  }

  .report-print-header .report-title {
    font-size: 10.5pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
    margin: 6pt 0 2pt 0;
    border: 1pt solid #000;
    display: inline-block;
    padding: 2pt 12pt;
  }

  .report-print-header .report-date-range {
    font-size: 7.5pt;
    color: #444;
    margin: 4pt 0 0 0;
  }

  .report-print-footer {
    display: none !important;
  }

  /* Hide report header/footer in screen, show in print */
  .d-print-only {
    display: none;
  }
}

/* Unified Search Bar styling */
.search-bar-container {
  flex-grow: 1;
  max-width: 680px;
  margin: 0 32px;
  position: relative;
}

.top-search-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-color);
  border-radius: 24px;
  height: 46px;
  padding: 0 16px;
  gap: 12px;
  transition:
    background-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

.top-search-bar:focus-within {
  background-color: var(--surface-color);
  box-shadow: var(--shadow-elevation-2);
}

.top-search-bar input {
  border: none;
  background: none;
  width: 100%;
  height: 100%;
  outline: none;
  color: var(--text-color);
  font-size: 15px;
}

.top-search-bar input::placeholder {
  color: var(--text-secondary);
}

.top-search-bar .search-icon {
  color: var(--text-secondary);
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 50%;
}

.search-clear-btn:hover {
  background-color: var(--hover-bg);
  color: var(--text-color);
}

/* Global Search Dropdown Overlay */
.global-search-overlay {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-elevation-3);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1200;
  padding: 8px 0;
  display: none;
}

.global-search-overlay.show {
  display: block;
}

.global-search-section {
  padding: 4px 0;
}

.global-search-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 8px 16px 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border-color);
}

.global-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease;
}

.global-search-item:hover {
  background-color: var(--hover-bg);
  color: var(--text-color);
}

.global-search-item i {
  color: var(--text-secondary);
  font-size: 20px;
}

/* Core Layout Responsiveness Rules */
@media (max-width: 991.98px) {
  /* Tighten padding on mobile / tablet grids */
  .main-canvas {
    padding: 16px;
  }
  .search-bar-container {
    margin: 0 16px;
  }
}

@media (max-width: 767.98px) {
  /* Hide search bar on top nav for smaller screen estates */
  .search-bar-container {
    display: none !important;
  }

  /* Collapse left sidebar drawer to slide-over overlay */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-elevation-3);
    background-color: var(--surface-color) !important;
    border-right: 1px solid var(--border-color) !important;
  }
  .sidebar.show-sidebar {
    transform: translateX(0);
  }
  .sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }
  .main-canvas {
    margin-top: var(--nav-height) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* FAB icon-only toggle on mobile to maximize viewport */
  .fab-extended #fabText,
  .fab-btn #fabText {
    display: none !important;
  }
  .fab-btn,
  .fab-btn.fab-extended {
    width: 56px;
    height: 56px;
    border-radius: 16px !important;
    padding: 0 !important;
    gap: 0 !important;
    justify-content: center;
    align-items: center;
  }
  .fab-icon-container {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
  }
}

/* Amber Color Variable */
:root {
  --amber-color: #e65100;
}
body.dark-theme {
  --amber-color: #ffab40;
}

/* Summary Card Amber */
.summary-card.card-amber {
  background-color: #fff3e0;
  color: #e65100;
  border-color: transparent;
}
body.dark-theme .summary-card.card-amber {
  background-color: #3d2e14;
  color: #ffab40;
}
.summary-card.card-amber .summary-icon {
  color: var(--amber-color);
}

/* Status Chip (pill-shaped inline badges) */
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.status-chip.status-active {
  background-color: var(--green-light);
  color: var(--green-color);
}
.status-chip.status-closed {
  background-color: #f5f5f5;
  color: #757575;
}
body.dark-theme .status-chip.status-closed {
  background-color: #303134;
  color: #9aa0a6;
}

/* Ledger Team Staff Avatars */
.staff-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  user-select: none;
}

.staff-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
  user-select: none;
  box-shadow: var(--shadow-elevation-2);
}

/* Collapsed Sidebar rail mode */
body.collapsed-sidebar .sidebar {
  width: 72px;
}
body.collapsed-sidebar .sidebar-link span {
  display: inline-block;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition:
    opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    max-width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
body.collapsed-sidebar .sidebar-link {
  width: 40px;
  height: 40px;
  margin: 4px auto;
  border-radius: 50% !important; /* Perfect circular background when collapsed */
  padding-left: 0;
  justify-content: center;
  gap: 0; /* Remove gap to perfectly center the icon */
  transition:
    width 0.2s ease,
    margin 0.2s ease,
    border-radius 0.2s ease,
    padding 0.2s ease,
    justify-content 0.2s ease,
    gap 0.2s ease;
}
body.collapsed-sidebar .main-canvas {
  margin-left: 72px;
}

/* Collapsed Sidebar hover-expand state */
body.collapsed-sidebar .sidebar:hover {
  width: var(--sidebar-width);
  background-color: var(--surface-color) !important;
  border-right: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-elevation-2);
}
body.collapsed-sidebar .sidebar:hover .sidebar-link span {
  opacity: 1;
  max-width: 180px;
}
body.collapsed-sidebar .sidebar:hover .sidebar-link {
  width: auto;
  margin: 2px 12px;
  border-radius: 20px !important; /* Pill background when expanded */
  justify-content: flex-start;
  padding-left: 16px;
  gap: 16px;
}

/* Google Style Tabs in Modal */
.google-tabs {
  border-bottom: 1px solid var(--border-color) !important;
  display: flex;
  gap: 16px;
}
.google-tabs .nav-link {
  color: var(--text-secondary);
  border: none !important;
  background: transparent !important;
  padding: 12px 16px;
  font-weight: 500;
  font-size: 14px;
  border-radius: 0;
  position: relative;
}
.google-tabs .nav-link:hover {
  color: var(--text-color);
  background-color: var(--hover-bg) !important;
}
.google-tabs .nav-link.active {
  color: var(--primary-color) !important;
  font-weight: 600;
}
.google-tabs .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px 3px 0 0;
}

/* Google Form Replication Styles */
.google-form-container {
  max-width: 770px;
  margin: 0 auto;
  padding: 0;
  background-color: #f0f4f9;
  border-radius: 16px;
  color: #1f1f1f !important;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
body.dark-theme .google-form-container {
  background-color: #131314;
  color: #e3e3e3 !important;
  border-color: #444746;
}

/* Custom Vector Header Image Pattern */
.google-form-header-image {
  height: 140px;
  background: linear-gradient(135deg, #673ab7 0%, #ab8ce6 50%, #d8c8f6 100%);
  position: relative;
  overflow: hidden;
}
.google-form-header-image::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.25) 0%,
    transparent 60%
  );
  transform: rotate(-12deg);
}

.google-form-card {
  background-color: #ffffff;
  border: 1px solid #e0e2e6;
  border-radius: 12px;
  padding: 24px;
  margin: 12px;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background-color 0.2s;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.1);
}
body.dark-theme .google-form-card {
  background-color: #1e1f20;
  border-color: #444746;
  box-shadow: none;
}

.google-form-card.active {
  background-color: #faf8fd;
}
body.dark-theme .google-form-card.active {
  background-color: #25232a;
}

.google-form-card.has-error {
  border-color: var(--red-color) !important;
  background-color: #fffbfa;
}
body.dark-theme .google-form-card.has-error {
  border-color: var(--red-color) !important;
  background-color: #2c1a1a;
}

.google-form-header-card {
  padding-top: 24px;
  margin-top: -30px; /* pull up over the header image zone slightly */
  z-index: 2;
}

.google-form-header-bar {
  display: none; /* replaced by form header image banner */
}

.google-form-title {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #1f1f1f;
}
body.dark-theme .google-form-title {
  color: #e3e3e3;
}

.google-form-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #444746;
}
body.dark-theme .google-form-desc {
  color: #c4c7c5;
}

.google-form-question-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #1f1f1f;
  display: flex;
  align-items: center;
  gap: 4px;
}
body.dark-theme .google-form-question-title {
  color: #e3e3e3;
}

.google-form-question-desc {
  font-size: 12px;
  color: #444746;
  margin-bottom: 12px;
}
body.dark-theme .google-form-question-desc {
  color: #c4c7c5;
}

.google-form-required-star {
  color: #b3261e;
  font-weight: bold;
}

.google-form-input,
.google-form-select {
  border: none !important;
  border-bottom: 1px solid #c4c7c5 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  color: #1f1f1f !important;
  padding: 8px 0 !important;
  font-size: 14px !important;
  outline: none !important;
  transition: border-color 0.2s;
  width: 100%;
  box-shadow: none !important;
}
body.dark-theme .google-form-input,
body.dark-theme .google-form-select {
  color: #e3e3e3 !important;
  border-bottom-color: #444746 !important;
}

.google-form-input:focus,
.google-form-select:focus {
  border-bottom: 2px solid #673ab7 !important;
}
body.dark-theme .google-form-input:focus,
body.dark-theme .google-form-select:focus {
  border-bottom-color: #bb86fc !important;
}

.google-form-input[readonly] {
  border-bottom-style: dashed !important;
  cursor: not-allowed;
}

.google-form-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.google-form-radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 0;
  user-select: none;
}

.google-form-radio-option input[type="radio"],
.google-form-radio-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #673ab7;
  cursor: pointer;
}
body.dark-theme .google-form-radio-option input[type="radio"],
body.dark-theme .google-form-radio-option input[type="checkbox"] {
  accent-color: #bb86fc;
}

.google-form-err-msg {
  color: #b3261e;
  font-size: 12px;
  margin-top: 8px;
  display: none;
  align-items: center;
  gap: 8px;
}

.google-form-card.has-error .google-form-err-msg {
  display: flex;
}

.google-form-btn {
  background-color: #673ab7;
  color: #ffffff;
  border: none;
  border-radius: 20px; /* Highly rounded Material 3 Pill Corner */
  padding: 10px 24px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition:
    background-color 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
body.dark-theme .google-form-btn {
  background-color: #bb86fc;
  color: #121212;
}

.google-form-btn:hover {
  background-color: #512da8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
body.dark-theme .google-form-btn:hover {
  background-color: #d7b5fe;
}

.google-form-btn-outline {
  background-color: transparent;
  color: #673ab7;
  border: 1px solid #dadce0;
  border-radius: 20px; /* Highly rounded Material 3 Pill Corner */
  padding: 9px 24px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}
body.dark-theme .google-form-btn-outline {
  color: #bb86fc;
  border-color: #444746;
}

.google-form-btn-outline:hover {
  background-color: rgba(103, 58, 183, 0.04);
  border-color: #673ab7;
}
body.dark-theme .google-form-btn-outline:hover {
  background-color: rgba(187, 134, 252, 0.04);
  border-color: #bb86fc;
}

.google-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 16px 24px;
  border: 1px solid #e0e2e6;
  max-width: 100%;
  box-sizing: border-box;
}
body.dark-theme .google-form-footer {
  background-color: #1e1f20;
  border-color: #444746;
}

.google-form-progress-container {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-grow: 1;
}

.google-form-progress-bar-bg {
  width: 180px;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}
body.dark-theme .google-form-progress-bar-bg {
  background-color: #444746;
}

.google-form-progress-bar-fill {
  height: 100%;
  background-color: #673ab7;
  border-radius: 4px;
  width: 20%;
  transition: width 0.3s;
}
body.dark-theme .google-form-progress-bar-fill {
  background-color: #bb86fc;
}

.google-form-progress-text {
  font-size: 12px;
  color: #5f6368;
}
body.dark-theme .google-form-progress-text {
  color: #a8abaf;
}

/* Digital Form preview elements */
.digital-form-preview {
  color: #202124 !important;
}
body.dark-theme .digital-form-preview {
  color: #e3e3e3 !important;
}

.digital-form-preview .table-bordered td,
.digital-form-preview .table-bordered th {
  border-color: #dadce0 !important;
  color: #202124 !important;
}
body.dark-theme .digital-form-preview .table-bordered td,
body.dark-theme .digital-form-preview .table-bordered th {
  border-color: #444746 !important;
  color: #e3e3e3 !important;
}

.application-section-title {
  background-color: #f1f3f4;
  color: #1f1f1f;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid #dadce0;
  margin-top: 16px;
  margin-bottom: 12px;
}
body.dark-theme .application-section-title {
  background-color: #2a2b2d;
  color: #e3e3e3;
  border-color: #444746;
}

.tamil-text {
  font-size: 11px;
  font-weight: normal;
  color: #5f6368;
  display: block;
}
body.dark-theme .tamil-text {
  color: #a8abaf;
}

#loanPrintSection {
  display: none;
}

/* Loan Application Print CSS */
@media print {
  body.print-application-active {
    background-color: #ffffff !important;
    color: #000000 !important;
  }
  body.print-application-active .top-nav,
  body.print-application-active .sidebar,
  body.print-application-active .sidebar-backdrop,
  body.print-application-active .main-canvas,
  body.print-application-active .fab-btn,
  body.print-application-active .modal-backdrop,
  body.print-application-active .modal,
  body.print-application-active .mobile-bottom-nav,
  body.print-application-active .mobile-more-sheet,
  body.print-application-active .mobile-more-sheet-backdrop {
    display: none !important;
  }
  body.print-application-active #loanPrintSection {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background-color: #ffffff !important;
    color: #000000 !important;
    font-family: "Segoe UI", "Roboto", "Arial", sans-serif !important;
  }

  .print-form-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 6px !important;
    background: #fff;
    color: #000 !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    position: relative;
  }
  .print-form-container * {
    color: #000000 !important;
    border-color: #333333 !important;
    background-color: transparent !important;
  }

  /* ── Watermark ──────────────────────────────────────────────────────── */
  .print-form-container::before {
    content: "UNIQUE WEALTH";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 72px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.035) !important;
    letter-spacing: 12px;
    pointer-events: none;
    z-index: 0;
    white-space: nowrap;
  }

  /* ── Company Header ─────────────────────────────────────────────────── */
  .print-header {
    border: 2px solid #1a1a1a;
    padding: 12px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }
  .print-header img,
  .report-print-header img,
  .repayment-sheet-header img,
  .digital-form-preview img,
  .print-container img {
    height: 72px !important;
    max-height: 80px !important;
    width: auto !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
  }
  .print-header-logo {
    width: 72px;
    height: 72px;
    border: 2.5px solid #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 24px;
    letter-spacing: 1px;
    background-color: #f0f0f0 !important;
    flex-shrink: 0;
  }
  .print-header-details {
    text-align: center;
    flex-grow: 1;
    padding: 0 14px;
  }
  .print-header-details h1 {
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 1px 0;
    text-transform: uppercase;
    letter-spacing: 1.2px;
  }
  .print-header-details p {
    margin: 1px 0;
    font-size: 9.5px;
    color: #333 !important;
  }
  .print-title {
    display: inline-block;
    border: 1.5px solid #1a1a1a;
    padding: 4px 14px;
    font-weight: 700;
    font-size: 11px;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
  }

  /* ── Sections ───────────────────────────────────────────────────────── */
  .print-section {
    border: 1.5px solid #333;
    margin-bottom: 10px;
    break-inside: avoid;
  }
  .print-section-header {
    background-color: #2d2d2d !important;
    color: #fff !important;
    font-weight: 700;
    padding: 5px 10px;
    font-size: 10.5px;
    display: flex;
    justify-content: space-between;
    letter-spacing: 0.3px;
  }
  .print-section-header * {
    color: #fff !important;
    background-color: transparent !important;
  }
  .print-section-body {
    padding: 8px;
  }

  /* ── Grid & Cells ───────────────────────────────────────────────────── */
  .print-grid {
    display: grid;
    gap: 0;
  }
  .print-cell {
    border: 0.5px solid #444;
    padding: 4px 7px;
    min-height: 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .print-label {
    font-weight: 700;
    font-size: 8.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
    color: #444 !important;
    letter-spacing: 0.2px;
  }
  .print-value {
    font-size: 11px;
    min-height: 14px;
    font-weight: 500;
    color: #000 !important;
  }

  /* ── Tables ─────────────────────────────────────────────────────────── */
  .print-table {
    width: 100%;
    border-collapse: collapse;
  }
  .print-table th,
  .print-table td {
    border: 0.5px solid #444 !important;
    padding: 3px 6px !important;
    font-size: 9.5px !important;
    vertical-align: middle;
  }
  .print-table th {
    font-weight: 700;
    background-color: #e8e8e8 !important;
    text-transform: uppercase;
    font-size: 8.5px !important;
    letter-spacing: 0.2px;
  }

  /* ── Signatures ─────────────────────────────────────────────────────── */
  .print-signature-row {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding: 0 10px;
  }
  .print-sig-col {
    width: 30%;
    text-align: center;
    border-top: 1.5px solid #000;
    padding-top: 5px;
    font-size: 9.5px;
    font-weight: 600;
  }

  /* ── Page Breaks ────────────────────────────────────────────────────── */
  .print-page {
    width: 100%;
    min-height: 275mm;
    box-sizing: border-box;
    page-break-after: always;
  }
  .print-page:last-child {
    page-break-after: avoid;
  }

  /* ── Document Footer ────────────────────────────────────────────────── */
  .print-doc-footer {
    margin-top: 12px;
    padding-top: 6px;
    border-top: 1px solid #999;
    font-size: 8px;
    color: #888 !important;
    display: flex;
    justify-content: space-between;
  }
  .print-doc-footer * {
    color: #888 !important;
  }
}

/* ==========================================================================
   Google-Style Dark Theme Theme Overrides & Boostrap Utility Adapters
   ========================================================================== */

/* 1. General Bootstrap Utility Overrides for Dark Mode */
body.dark-theme .bg-light {
  background-color: var(--hover-bg) !important;
  color: var(--text-color) !important;
}

body.dark-theme .bg-light *,
body.dark-theme .bg-light span,
body.dark-theme .bg-light strong,
body.dark-theme .bg-light td,
body.dark-theme .bg-light th {
  color: var(--text-color) !important;
}

body.dark-theme .bg-light .text-muted {
  color: var(--text-secondary) !important;
}

body.dark-theme .text-dark {
  color: var(--text-color) !important;
}

body.dark-theme .text-dark *,
body.dark-theme .text-dark strong,
body.dark-theme .text-dark span {
  color: var(--text-color) !important;
}

body.dark-theme .border {
  border-color: var(--border-color) !important;
}

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

body.dark-theme .list-group-item {
  background-color: var(--surface-color) !important;
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
}

body.dark-theme .dropdown-menu {
  background-color: var(--surface-color) !important;
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
  box-shadow: var(--shadow-elevation-3) !important;
}

body.dark-theme .dropdown-item {
  color: var(--text-color) !important;
}

body.dark-theme .dropdown-item:hover,
body.dark-theme .dropdown-item:focus {
  background-color: var(--hover-bg) !important;
  color: var(--text-color) !important;
}

body.dark-theme .modal-content,
body.dark-theme .modal-body,
body.dark-theme .modal-header,
body.dark-theme .modal-footer {
  border-color: var(--border-color) !important;
  background-color: var(--surface-color) !important;
  color: var(--text-color) !important;
}

/* Comprehensive Table Dark Theme Adaptations */
body.dark-theme .table,
body.dark-theme .material-table,
body.dark-theme .official-table,
body.dark-theme .responsive-card-table {
  --bs-table-bg: var(--surface-color) !important;
  --bs-table-color: var(--text-color) !important;
  --bs-table-border-color: var(--border-color) !important;
  --bs-table-accent-bg: transparent !important;
  background-color: var(--surface-color) !important;
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
}

body.dark-theme .table > :not(caption) > *,
body.dark-theme .table > :not(caption) > * > *,
body.dark-theme .material-table td,
body.dark-theme .material-table th,
body.dark-theme .responsive-card-table td,
body.dark-theme .responsive-card-table th {
  background-color: var(--surface-color) !important;
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
}

body.dark-theme .table-hover > tbody > tr:hover > *,
body.dark-theme .material-table tbody tr:hover td {
  background-color: var(--hover-bg) !important;
  color: var(--text-color) !important;
}

body.dark-theme .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: var(--text-color) !important;
}

body.dark-theme .table-light,
body.dark-theme .table-light > th,
body.dark-theme .table-light > td,
body.dark-theme thead.table-light,
body.dark-theme thead.table-light th,
body.dark-theme .material-table th {
  background-color: #2b2c2e !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
}

body.dark-theme .table-danger,
body.dark-theme .table-danger > th,
body.dark-theme .table-danger > td,
body.dark-theme tr.table-danger > th,
body.dark-theme tr.table-danger > td {
  background-color: #3c2525 !important;
  color: var(--red-color) !important;
  border-color: var(--border-color) !important;
}

body.dark-theme table,
body.dark-theme th,
body.dark-theme td {
  border-color: var(--border-color) !important;
}

body.dark-theme hr {
  border-color: var(--border-color) !important;
  color: var(--border-color) !important;
  opacity: 0.6;
}

/* Alert Box Dark Mode Overrides */
body.dark-theme .alert-warning,
body.dark-theme [style*="background-color: #fef7e0"] {
  background-color: var(--yellow-light) !important;
  color: var(--yellow-color) !important;
  border-color: var(--yellow-color) !important;
}

body.dark-theme .alert-danger,
body.dark-theme [style*="background-color: #fce8e6"] {
  background-color: var(--red-light) !important;
  color: var(--red-color) !important;
  border-color: var(--red-color) !important;
}

body.dark-theme .alert-success {
  background-color: var(--green-light) !important;
  color: var(--green-color) !important;
  border-color: var(--green-color) !important;
}

body.dark-theme .alert-info {
  background-color: var(--primary-light) !important;
  color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

/* 2. Generic Bootstrap Form Control Overrides (Handles filters/searches outside form-floating) */
.form-control,
.form-select {
  background-color: var(--surface-color) !important;
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
  box-shadow: none !important;
  transition: border-color var(--transition-speed) ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color) !important;
  background-color: var(--surface-color) !important;
  color: var(--text-color) !important;
}

body.dark-theme select option {
  background-color: #1e1f20 !important;
  color: #e3e3e3 !important;
}

body.dark-theme .form-control::placeholder {
  color: var(--text-secondary) !important;
}

body.dark-theme .form-check-input {
  background-color: var(--hover-bg) !important;
  border-color: var(--border-color) !important;
}

body.dark-theme .form-check-input:checked {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

/* 3. Accordion Styling in Dark Mode */
body.dark-theme .accordion-button {
  background-color: var(--hover-bg) !important;
  color: var(--primary-color) !important;
  box-shadow: none !important;
  border-bottom: 1px solid var(--border-color) !important;
}

body.dark-theme .accordion-button.collapsed {
  background-color: transparent !important;
  color: var(--text-color) !important;
  border-bottom: none !important;
}

body.dark-theme .accordion-collapse {
  background-color: transparent !important;
  color: var(--text-color) !important;
}

body.dark-theme .accordion-item {
  background-color: transparent !important;
  border-color: var(--border-color) !important;
  color: var(--text-color) !important;
}

/* 4. Form Validation Overrides */
body.dark-theme .invalid-feedback {
  color: var(--red-color) !important;
}

body.dark-theme .form-control.is-invalid {
  border-color: var(--red-color) !important;
}

/* 5. Override inline light background colors in specific dynamic templates */
body.dark-theme tr[style*="background-color: #eaeaea"] {
  background-color: var(--hover-bg) !important;
  color: var(--text-color) !important;
}

body.dark-theme tr[style*="background-color: #eaeaea"] * {
  color: var(--text-color) !important;
}

/* 6. Text Utility Overrides — fixes fonts appearing invisible on dark backgrounds */
body.dark-theme .text-muted {
  color: var(--text-secondary) !important;
}

body.dark-theme .text-secondary {
  color: var(--text-secondary) !important;
}

body.dark-theme .text-body {
  color: var(--text-color) !important;
}

body.dark-theme .text-black,
body.dark-theme .text-body-secondary {
  color: var(--text-secondary) !important;
}

body.dark-theme p,
body.dark-theme span,
body.dark-theme label,
body.dark-theme li,
body.dark-theme small,
body.dark-theme strong,
body.dark-theme b {
  color: inherit;
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6,
body.dark-theme .h1,
body.dark-theme .h2,
body.dark-theme .h3,
body.dark-theme .h4,
body.dark-theme .h5,
body.dark-theme .h6 {
  color: var(--text-color);
}

/* 7. Breadcrumb Overrides */
body.dark-theme .breadcrumb {
  color: var(--text-secondary);
}

body.dark-theme .breadcrumb-item {
  color: var(--text-secondary);
}

body.dark-theme .breadcrumb-item.active {
  color: var(--text-secondary);
}

body.dark-theme .breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-secondary);
}

body.dark-theme .breadcrumb-item a {
  color: var(--primary-color);
}

/* 8. Alert Component Overrides */
body.dark-theme .alert {
  border-color: var(--border-color);
}

body.dark-theme .alert-danger {
  background-color: var(--red-light) !important;
  color: var(--red-color) !important;
  border-color: var(--red-color) !important;
}

body.dark-theme .alert-success {
  background-color: var(--green-light) !important;
  color: var(--green-color) !important;
  border-color: var(--green-color) !important;
}

body.dark-theme .alert-warning {
  background-color: var(--yellow-light) !important;
  color: var(--yellow-color) !important;
  border-color: var(--yellow-color) !important;
}

body.dark-theme .alert-info,
body.dark-theme .alert-primary {
  background-color: var(--primary-light) !important;
  color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

/* 9. Bootstrap Outline Button Overrides */
body.dark-theme .btn-outline-primary {
  color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  background-color: transparent !important;
}

body.dark-theme .btn-outline-primary:hover {
  background-color: var(--primary-light) !important;
  color: var(--primary-color) !important;
}

body.dark-theme .btn-outline-secondary {
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
  background-color: transparent !important;
}

body.dark-theme .btn-outline-secondary:hover {
  background-color: var(--hover-bg) !important;
  color: var(--text-color) !important;
}

body.dark-theme .btn-outline-danger {
  color: var(--red-color) !important;
  border-color: var(--red-color) !important;
}

body.dark-theme .btn-outline-danger:hover {
  background-color: var(--red-light) !important;
  color: var(--red-color) !important;
}

body.dark-theme .btn-outline-success {
  color: var(--green-color) !important;
  border-color: var(--green-color) !important;
}

body.dark-theme .btn-outline-success:hover {
  background-color: var(--green-light) !important;
  color: var(--green-color) !important;
}

/* 10. Card and Border Overrides */
body.dark-theme .card {
  background-color: var(--surface-color) !important;
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
}

body.dark-theme .card-header {
  background-color: var(--hover-bg) !important;
  border-bottom-color: var(--border-color) !important;
  color: var(--text-color) !important;
}

body.dark-theme .card-footer {
  background-color: var(--hover-bg) !important;
  border-top-color: var(--border-color) !important;
  color: var(--text-color) !important;
}

body.dark-theme .border-bottom {
  border-bottom-color: var(--border-color) !important;
}

body.dark-theme .border-top {
  border-top-color: var(--border-color) !important;
}

body.dark-theme .border-start {
  border-left-color: var(--border-color) !important;
}

body.dark-theme .border-end {
  border-right-color: var(--border-color) !important;
}

body.dark-theme [class*="border-"] {
  border-color: var(--border-color);
}

/* 11. Badge Overrides */
body.dark-theme .badge.bg-primary {
  background-color: var(--primary-color) !important;
}

body.dark-theme .badge.bg-danger {
  background-color: var(--red-color) !important;
}

body.dark-theme .badge.bg-success {
  background-color: var(--green-color) !important;
}

body.dark-theme .badge.bg-warning {
  background-color: var(--yellow-color) !important;
  color: #000 !important;
}

body.dark-theme .badge.bg-secondary {
  background-color: var(--hover-bg) !important;
  color: var(--text-secondary) !important;
}

/* 12. Pagination Overrides */
body.dark-theme .page-link {
  background-color: var(--surface-color) !important;
  border-color: var(--border-color) !important;
  color: var(--primary-color) !important;
}

body.dark-theme .page-link:hover {
  background-color: var(--hover-bg) !important;
}

body.dark-theme .page-item.active .page-link {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #ffffff !important;
}

body.dark-theme .page-item.disabled .page-link {
  background-color: var(--hover-bg) !important;
  color: var(--text-secondary) !important;
}

/* 13. Bootstrap text-primary override for dark */
body.dark-theme .text-primary {
  color: var(--primary-color) !important;
}

body.dark-theme .text-danger {
  color: var(--red-color) !important;
}

body.dark-theme .text-success {
  color: var(--green-color) !important;
}

body.dark-theme .text-warning {
  color: var(--yellow-color) !important;
}

/* 14. Nav-tabs override */
body.dark-theme .nav-tabs {
  border-bottom-color: var(--border-color) !important;
}

body.dark-theme .nav-tabs .nav-link {
  color: var(--text-secondary);
}

body.dark-theme .nav-tabs .nav-link:hover {
  border-color: var(--border-color);
  color: var(--text-color);
}

body.dark-theme .nav-tabs .nav-link.active {
  background-color: var(--surface-color) !important;
  border-color: var(--border-color) var(--border-color) var(--surface-color) !important;
  color: var(--primary-color) !important;
}

/* 15. Fix form-switch toggle track visibility in dark mode */
body.dark-theme .form-switch .form-check-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23999'/%3e%3c/svg%3e") !important;
}

body.dark-theme .form-switch .form-check-input:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
}

/* 16. Fix Bootstrap fw-bold and other inline-styled text in dynamic content */
body.dark-theme .fw-bold {
  color: inherit;
}

body.dark-theme .modal-body {
  color: var(--text-color);
}

body.dark-theme .modal-body p,
body.dark-theme .modal-body strong,
body.dark-theme .modal-body span,
body.dark-theme .modal-body label,
body.dark-theme .modal-body small,
body.dark-theme .modal-body h6 {
  color: inherit;
}

/* 17. Fix Bootstrap tooltip/popover in dark mode */
body.dark-theme .tooltip-inner {
  background-color: var(--surface-color) !important;
  color: var(--text-color) !important;
  border: 1px solid var(--border-color) !important;
}

/* 18. Fix the rounded-border bg-light preview containers in modals */
body.dark-theme .bg-light.border.rounded {
  background-color: var(--hover-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-color) !important;
}

/* 19. Inline Google Action Button Styling (Header Actions) */
.btn-google-action {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  border-radius: 16px !important;
  background-color: #c2e7ff;
  color: #001d35;
  border: none;
  padding: 0 16px;
  font-family: "Outfit", sans-serif;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-elevation-1);
  cursor: pointer;
  transition:
    background-color 0.2s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1),
    transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

body.dark-theme .btn-google-action {
  background-color: #303134;
  color: #c2e7ff;
  box-shadow: var(--shadow-elevation-1);
}

.btn-google-action:hover {
  background-color: #b3e1ff;
  transform: scale(1.02);
  box-shadow: var(--shadow-elevation-2);
  color: #001d35;
}

body.dark-theme .btn-google-action:hover {
  background-color: #3c4043;
  transform: scale(1.02);
  box-shadow: var(--shadow-elevation-2);
  color: #c2e7ff;
}

.btn-google-action:active {
  background-color: #99d4ff;
  transform: scale(0.98);
  box-shadow: var(--shadow-elevation-1);
}

body.dark-theme .btn-google-action:active {
  background-color: #4f5357;
  transform: scale(0.98);
  box-shadow: var(--shadow-elevation-1);
}

/* --- Apple ID Sleek Clean Authentication Screen Styles --- */
.apple-auth-wrapper {
  background-color: var(
    --surface-color
  ); /* Apple uses pure white background in light mode */
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  box-sizing: border-box;
}

body.dark-theme .apple-auth-wrapper {
  background-color: #000000; /* Pure black background for Apple dark mode */
  color: #f5f5f7;
}

.apple-login-container {
  width: 100%;
  max-width: 380px;
  padding: 40px 0;
  text-align: center;
  box-sizing: border-box;
  animation: appleFadeIn 0.4s ease;
}

.apple-signup-container {
  width: 100%;
  max-width: 460px;
  padding: 30px 0;
  box-sizing: border-box;
  animation: appleFadeIn 0.4s ease;
}

@keyframes appleFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.apple-logo-icon {
  color: var(--text-color);
  display: flex;
  justify-content: center;
}

body.dark-theme .apple-logo-icon {
  color: #f5f5f7;
}

.apple-title {
  font-family:
    "Outfit",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: var(--text-color);
}

body.dark-theme .apple-title {
  color: #f5f5f7;
}

.apple-subtitle {
  font-size: 14px;
  color: #86868b;
  margin-top: 6px;
}

/* Rounded Stacked Inputs */
.apple-input-group {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.apple-input {
  width: 100%;
  height: 52px;
  padding: 14px 48px 14px 16px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #d2d2d7;
  background-color: var(--surface-color);
  color: var(--text-color);
  outline: none;
  box-sizing: border-box;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

body.dark-theme .apple-input {
  border-color: #424245;
  background-color: #1d1d1f;
  color: #f5f5f7;
}

.apple-input:focus {
  border-color: #0066cc;
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15);
}

/* Apple style inline circle arrow button */
.apple-input-arrow-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #86868b;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    opacity 0.2s ease;
  padding: 0;
}

.apple-input-arrow-btn i {
  font-size: 18px;
  font-weight: bold;
}

.apple-input-arrow-btn:hover {
  background-color: #0066cc;
}

/* Password eye visibility button */
.apple-password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 48px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #86868b;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.apple-password-toggle-btn i {
  font-size: 20px;
}

.apple-password-toggle-btn:hover {
  color: var(--text-color);
}

body.dark-theme .apple-password-toggle-btn:hover {
  color: #ffffff;
}

/* Stacked inputs (collapsed borders) for Signup */
.apple-section-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #86868b;
  margin-left: 4px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.apple-input-card {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #d2d2d7;
  background-color: var(--surface-color);
}

body.dark-theme .apple-input-card {
  border-color: #424245;
  background-color: #1d1d1f;
}

.apple-card-input {
  width: 100%;
  height: 48px;
  padding: 12px 16px;
  font-size: 15px;
  border: none;
  border-bottom: 1px solid #d2d2d7;
  background-color: transparent;
  color: var(--text-color);
  outline: none;
  box-sizing: border-box;
}

body.dark-theme .apple-card-input {
  border-bottom-color: #424245;
  color: #f5f5f7;
}

.apple-card-input:last-child {
  border-bottom: none;
}

.apple-card-input:focus {
  background-color: rgba(0, 102, 204, 0.03);
}

/* Button & Checkbox Styling */
.btn-apple-primary {
  background-color: #000000; /* Apple style solid black button */
  color: #ffffff;
  border: none;
  font-size: 15px;
  font-weight: 500;
  height: 44px;
  padding: 0 24px;
  border-radius: 22px; /* Pill style */
  cursor: pointer;
  width: 100%;
  transition:
    opacity 0.2s ease,
    background-color 0.2s ease;
}

body.dark-theme .btn-apple-primary {
  background-color: #ffffff;
  color: #000000;
}

.btn-apple-primary:hover {
  opacity: 0.85;
}

.apple-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #0066cc;
  cursor: pointer;
}

.apple-checkbox-label {
  font-size: 14px;
  color: #1d1d1f;
  cursor: pointer;
}

body.dark-theme .apple-checkbox-label {
  color: #f5f5f7;
}

/* Dividers & Helper Texts */
.apple-divider {
  border: 0;
  border-top: 1px solid #e5e5ea;
  margin: 24px 0;
}

body.dark-theme .apple-divider {
  border-top-color: #323236;
}

.apple-helper-text {
  font-size: 12.5px;
  color: #86868b;
  line-height: 1.4;
}

.apple-link {
  color: #0066cc;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: opacity 0.15s ease;
}

.apple-link:hover {
  text-decoration: underline;
  opacity: 0.9;
}

/* Standard Clean Apple Footer */
.apple-auth-footer {
  width: 100%;
  border-top: 1px solid #d2d2d7;
  padding: 16px 0;
  font-size: 12px;
  color: #86868b;
  background-color: transparent;
}

body.dark-theme .apple-auth-footer {
  border-top-color: #424245;
}

.apple-auth-footer .footer-link {
  color: #515154;
  text-decoration: none;
  transition: color 0.15s ease;
}

body.dark-theme .apple-auth-footer .footer-link {
  color: #a1a1a6;
}

.apple-auth-footer .footer-link:hover {
  color: #0066cc;
  text-decoration: underline;
}

/* Custom fade animation stages */
.login-stage {
  opacity: 1;
  transition: opacity 0.15s ease-in-out;
}

.login-stage.fade-out {
  opacity: 0;
}

/* User management / Admin Console avatar list overrides */
.staff-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: white;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

.staff-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: white;
  font-weight: 600;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   redesigned Split-Pane Authentication Layout
   ========================================================================== */

/* ==========================================================================
   Full-Screen 50/50 Split-Screen Authentication Layout
   ========================================================================== */

.lms-fullscreen-auth {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background-color: var(--surface-color, #ffffff);
}

/* Left 50% Form Side */
.auth-fullscreen-form-side {
  width: 50%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 48px;
  box-sizing: border-box;
  background-color: var(--surface-color, #ffffff);
  overflow-y: auto;
  z-index: 2;
  position: relative;
}

body.dark-theme .auth-fullscreen-form-side {
  background-color: #0f1015;
  color: #e3e3e3;
}

.auth-form-inner {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 16px 0;
}

.auth-divider-span {
  background-color: var(--surface-color, #ffffff);
  color: var(--text-secondary, #6c757d);
}

body.dark-theme .auth-divider-span {
  background-color: #0f1015;
  color: #a0a0a0;
}

/* Brand Logo Badge */
.auth-brand-logo-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(108, 92, 231, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Input Fields Styling */
.auth-pill-input {
  height: 48px !important;
  background-color: #f5f5f8 !important;
  border: 1.5px solid transparent !important;
  border-radius: 12px !important;
  padding: 12px 18px !important;
  font-size: 14px !important;
  color: #1f1f1f !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

body.dark-theme .auth-pill-input {
  background-color: #1a1c26 !important;
  color: #ffffff !important;
  border-color: #2d303e !important;
}

.auth-pill-input:focus {
  background-color: #ffffff !important;
  border-color: #6c5ce7 !important;
  box-shadow: 0 0 0 3.5px rgba(108, 92, 231, 0.15) !important;
}

body.dark-theme .auth-pill-input:focus {
  background-color: #202330 !important;
  border-color: #9d8ec7 !important;
  box-shadow: 0 0 0 3.5px rgba(157, 142, 199, 0.2) !important;
}

/* Password Toggle Eye Button */
.auth-pass-toggle-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #8c8c8c;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

body.dark-theme .auth-pass-toggle-btn {
  color: #9c9fa6;
}

/* Primary Button with Vibrant Indigo/Purple Gradient */
.auth-submit-btn {
  height: 48px !important;
  background: linear-gradient(135deg, #6c5ce7 0%, #5a4bcf 100%) !important;
  border: none !important;
  font-size: 15px !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35) !important;
  transition: all 0.2s ease !important;
}

.auth-submit-btn:hover {
  background: linear-gradient(135deg, #5a4bcf 0%, #4839b8 100%) !important;
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.45) !important;
  transform: translateY(-1px);
}

.auth-link-primary {
  color: #6c5ce7;
}

body.dark-theme .auth-link-primary {
  color: #9d8ec7;
}

/* Quick Demo Box */
.lms-demo-login-box {
  background-color: rgba(108, 92, 231, 0.05);
  border: 1px dashed rgba(108, 92, 231, 0.25);
  border-radius: 12px;
}

body.dark-theme .lms-demo-login-box {
  background-color: rgba(157, 142, 199, 0.08);
  border-color: rgba(157, 142, 199, 0.25);
}

/* Right 50% Visual Side */
.auth-fullscreen-visual-side {
  width: 50%;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: #f8f9fe;
  z-index: 1;
}

body.dark-theme .auth-fullscreen-visual-side {
  background-color: #0c0d12;
}

/* Photo and Overlay */
.auth-visual-photo-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.auth-visual-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}

.auth-visual-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.45) 0%, rgba(15, 17, 25, 0.88) 100%);
}

/* Floating Shapes (Replicating exact user screenshot aesthetic!) */
.auth-shape {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.shape-arc-purple {
  top: -40px;
  right: -40px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
  opacity: 0.6;
}

.shape-circle-orange {
  top: -20px;
  right: 140px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
  opacity: 0.55;
}

.shape-pill-cyan {
  bottom: 80px;
  right: 80px;
  width: 160px;
  height: 160px;
  border-radius: 44px;
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  opacity: 0.6;
  transform: rotate(45deg);
}

.shape-blob-coral {
  bottom: 80px;
  left: 60px;
  width: 180px;
  height: 180px;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  background: linear-gradient(135deg, #ff7675 0%, #e84393 100%);
  opacity: 0.75;
}

/* Dot Matrix Grid Effect */
.auth-dot-matrix {
  position: absolute;
  top: 140px;
  right: 90px;
  width: 180px;
  height: 180px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  z-index: 2;
}

/* Hero Typography Overlay */
.auth-visual-hero-text {
  position: absolute;
  bottom: 64px;
  left: 56px;
  right: 56px;
  z-index: 3;
  color: #ffffff;
}

.auth-visual-hero-text .hero-chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.auth-visual-hero-text .hero-main-heading {
  font-family: "Outfit", sans-serif;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.8px;
  color: #ffffff;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.auth-visual-hero-text .hero-sub-heading {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

/* Floating Close Button */
.auth-close-floating-btn {
  position: absolute;
  top: 32px;
  right: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1e23;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.auth-close-floating-btn:hover {
  transform: scale(1.08);
  background: #ffffff;
}

/* Floating Animations */
@keyframes lmsOverlayFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}

.animate-float {
  animation: lmsOverlayFloat 5s ease-in-out infinite;
}

.animate-float-delayed {
  animation: lmsOverlayFloat 5s ease-in-out infinite;
  animation-delay: 2.5s;
}

/* Responsive Rules for Mobile/Tablets */
@media (max-width: 991px) {
  .lms-fullscreen-auth {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-direction: column !important;
    z-index: 9999 !important;
  }

  .auth-fullscreen-form-side {
    width: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    height: auto !important;
    padding: 28px 20px 40px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    box-sizing: border-box !important;
    overflow-y: visible !important;
  }

  .auth-form-inner {
    max-width: 400px !important;
    width: 100% !important;
    margin: auto !important;
    padding: 12px 0 !important;
  }

  .auth-fullscreen-visual-side {
    display: none !important;
  }

  .lms-demo-login-box {
    margin-bottom: 16px !important;
  }

  .lms-demo-login-box .d-flex {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .lms-demo-login-box .demo-role-btn {
    flex: 1 1 calc(50% - 6px) !important;
    font-size: 11.5px !important;
    padding: 6px 8px !important;
  }
}

/* Small Screen Mobile Adjustments (under 576px) */
@media (max-width: 576px) {
  .auth-fullscreen-form-side {
    padding: 20px 16px 32px 16px !important;
  }

  .auth-brand-header {
    margin-bottom: 16px !important;
  }

  .auth-brand-header img {
    height: 64px !important;
  }

  .auth-brand-header h3 {
    font-size: 17.5px !important;
  }

  .auth-brand-header p {
    font-size: 9.5px !important;
  }

  .auth-page-title {
    font-size: 22px !important;
  }
}

/* Short Height Screen Adjustments (Landscape mobile / small laptops) */
@media (max-height: 700px) {
  .auth-brand-header {
    margin-bottom: 12px !important;
  }

  .auth-brand-header img {
    height: 54px !important;
  }

  .auth-page-title {
    font-size: 20px !important;
    margin-bottom: 2px !important;
  }

  .auth-form-inner .mb-4 {
    margin-bottom: 12px !important;
  }

  .auth-form-inner .mb-3 {
    margin-bottom: 10px !important;
  }
}

.lms-visual-overlay-card .card-icon-sec i {
  font-size: 18px;
}

.lms-visual-overlay-card .card-title {
  font-size: 11px;
  font-weight: 700;
  color: #1a1e23;
  line-height: 1.2;
}

.lms-visual-overlay-card .card-time {
  font-size: 9.5px;
  color: #5f6368;
  margin-top: 2px;
}
}

.lms-visual-overlay-card .card-time {
  font-size: 10px;
  color: #5c6068;
  margin-top: 2px;
  margin-bottom: 8px;
}

.lms-visual-overlay-card .card-avatars {
  display: flex;
  gap: -6px;
}

.lms-visual-overlay-card .avatar-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 600;
  color: #ffffff;
  margin-left: -5px;
}

.lms-visual-overlay-card .avatar-sm:first-child {
  margin-left: 0;
}

.lms-visual-overlay-card .avatar-sm.bg-blue {
  background-color: #1e88e5;
}
.lms-visual-overlay-card .avatar-sm.bg-green {
  background-color: #43a047;
}
.lms-visual-overlay-card .avatar-sm.bg-orange {
  background-color: #fb8c00;
}

/* Responsive Layout rules */
@media (max-width: 991.98px) {
  .lms-auth-card {
    max-width: 460px;
    height: auto;
    flex-direction: column;
  }

  .lms-auth-form-pane {
    width: 100%;
    height: auto;
    padding: 36px 30px;
    gap: 32px;
  }

  .lms-auth-visual-pane {
    display: none; /* Hide visual pane on tablets and mobile devices */
  }
}

/* ── Modern Repayment Grid & Card UI System ────────────────────────────── */
.lms-modal-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 575.98px) {
  .lms-modal-summary-grid {
    grid-template-columns: 1fr;
  }
}

.lms-modal-summary-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 84px;
  box-shadow: var(--shadow-elevation-1);
  transition:
    transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.lms-modal-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevation-2);
}

.lms-modal-summary-card .card-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.lms-modal-summary-card .card-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1.2;
}

/* Card Accent Icon backgrounds */
.lms-modal-summary-card::after {
  content: "";
  position: absolute;
  right: -10px;
  bottom: -15px;
  font-family: "Material Icons";
  font-size: 64px;
  color: rgba(0, 0, 0, 0.03);
  pointer-events: none;
  z-index: 0;
}

body.dark-theme .lms-modal-summary-card::after {
  color: rgba(255, 255, 255, 0.035);
}

.lms-modal-summary-card.icon-id::after {
  content: "fingerprint";
}
.lms-modal-summary-card.icon-borrower::after {
  content: "person";
}
.lms-modal-summary-card.icon-principal::after {
  content: "account_balance_wallet";
}
.lms-modal-summary-card.icon-rate::after {
  content: "trending_up";
}
.lms-modal-summary-card.icon-total::after {
  content: "payments";
}
.lms-modal-summary-card.icon-paid::after {
  content: "check_circle";
}
.lms-modal-summary-card.icon-outstanding::after {
  content: "warning";
}
.lms-modal-summary-card.icon-investor::after {
  content: "business";
}
.lms-modal-summary-card.icon-guarantor::after {
  content: "group";
}

/* ── Repayment Schedule A4 Print Layout CSS ────────────────────────────── */
#schedulePrintSection {
  display: none;
}

@media print {
  body.print-schedule-active {
    background-color: #ffffff !important;
    color: #000000 !important;
  }

  body.print-schedule-active .top-nav,
  body.print-schedule-active .sidebar,
  body.print-schedule-active .sidebar-backdrop,
  body.print-schedule-active .main-canvas,
  body.print-schedule-active .fab-btn,
  body.print-schedule-active .modal-backdrop,
  body.print-schedule-active .modal,
  body.print-schedule-active .mobile-bottom-nav,
  body.print-schedule-active .mobile-more-sheet,
  body.print-schedule-active .mobile-more-sheet-backdrop {
    display: none !important;
  }

  body.print-schedule-active #schedulePrintSection {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background-color: #ffffff !important;
    color: #000000 !important;
    font-family: "Segoe UI", "Roboto", "Arial", sans-serif !important;
  }

  .print-schedule-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 6px !important;
    background: #fff;
    color: #000 !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    position: relative;
  }

  .print-schedule-container * {
    color: #000000 !important;
    border-color: #333333 !important;
    background-color: transparent !important;
  }

  /* Diagonal Watermark */
  .print-schedule-container::before {
    content: "UNIQUE WEALTH";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 72px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.035) !important;
    letter-spacing: 12px;
    pointer-events: none;
    z-index: 0;
    white-space: nowrap;
  }
}

/* ============================================================================
   MOBILE-FIRST RESPONSIVE UI SYSTEM
   Comprehensive responsive styles for all screen sizes
   ============================================================================ */

/* ── Mobile Bottom Navigation Bar ──────────────────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: var(--surface-color);
  border-top: 1px solid var(--border-color);
  z-index: 1060;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}

body.dark-theme .mobile-bottom-nav {
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
}

.mobile-bottom-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 0 4px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: color 0.15s ease;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
  font-family: "Roboto", sans-serif;
}

.mobile-nav-item i {
  font-size: 22px;
  position: relative;
  z-index: 1;
  transition: color 0.15s ease;
}

.mobile-nav-item span {
  position: relative;
  z-index: 1;
  letter-spacing: 0.1px;
}

/* Active pill indicator behind the icon */
.mobile-nav-item.active {
  color: var(--primary-color);
}

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

.mobile-nav-item.active::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 28px;
  background-color: var(--primary-light);
  border-radius: 14px;
  z-index: 0;
  animation: nav-pill-in 0.2s ease forwards;
}

@keyframes nav-pill-in {
  from {
    transform: translateX(-50%) scaleX(0.6);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
  }
}

/* Mobile "More" Bottom Sheet Overlay */
.mobile-more-sheet-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: 1070;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobile-more-sheet-backdrop.show {
  display: block;
  opacity: 1;
}

.mobile-more-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--surface-color);
  border-radius: 20px 20px 0 0;
  z-index: 1080;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 70vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-more-sheet.show {
  transform: translateY(0);
}

.mobile-more-sheet-handle {
  width: 40px;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
  margin: 10px auto 4px;
}

.mobile-more-sheet-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 20px 4px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.mobile-more-sheet-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.12s ease;
}

.mobile-more-sheet-item:hover,
.mobile-more-sheet-item:active {
  background-color: var(--hover-bg);
  color: var(--text-color);
}

.mobile-more-sheet-item i {
  color: var(--text-secondary);
  font-size: 22px;
  width: 28px;
  text-align: center;
}

.mobile-more-sheet-item.active {
  color: var(--primary-color);
  background-color: var(--primary-light);
}

.mobile-more-sheet-item.active i {
  color: var(--primary-color);
}

/* ── Responsive Breakpoints ────────────────────────────────────────────── */

/* === TABLET & SMALL DESKTOP (max 991.98px) === */
@media (max-width: 991.98px) {
  /* Page headers stack on smaller screens */
  .page-header-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }
}

/* === MOBILE LANDSCAPE & SMALL TABLETS (max 767.98px) === */
@media (max-width: 767.98px) {
  /* Show bottom nav */
  .mobile-bottom-nav {
    display: block;
  }

  /* Body needs bottom padding to clear bottom nav */
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
  }

  /* Reduced nav height for more content space */
  .top-nav {
    height: 56px;
    padding: 0 10px;
    gap: 6px;
  }

  .brand-logo-img {
    height: 32px !important;
    max-width: 90px !important;
  }

  .brand-full-text {
    font-size: 14px !important;
    letter-spacing: -0.2px !important;
  }

  /* Recalculate sidebar and canvas top to use 56px */
  .sidebar {
    top: 56px;
    padding-top: 12px;
    width: 280px;
  }

  .sidebar-backdrop {
    top: 56px;
  }

  .sidebar-link {
    height: 48px;
    font-size: 15px;
    margin: 2px 8px;
    padding-left: 20px;
  }

  .sidebar-link i {
    font-size: 22px;
  }

  /* Main canvas full-bleed on mobile with safe bottom space */
  .main-canvas {
    margin-top: 56px !important;
    padding: 14px 10px;
    padding-bottom: 104px !important;
  }

  /* FAB above bottom nav */
  .fab-btn {
    bottom: calc(72px + env(safe-area-inset-bottom, 0));
    right: 16px;
  }

  /* Toast system above bottom nav and centered */
  .toast-container {
    bottom: calc(76px + env(safe-area-inset-bottom, 0));
    left: 12px;
    right: 12px;
  }

  .material-toast {
    min-width: auto;
    max-width: 100%;
    width: 100%;
  }

  /* Chart containers reduce height */
  .material-card[style*="height: 380px"] {
    height: 280px !important;
  }

  /* Modals treatment on mobile screens */
  .modal-dialog {
    max-width: 100% !important;
    margin: 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    max-height: 92vh !important;
    transform: none !important;
  }

  .modal-dialog .modal-content {
    max-height: 92vh !important;
    height: auto !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .modal-dialog .modal-content form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .modal-dialog .modal-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .modal-dialog .tab-content {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }

  .modal-dialog .modal-footer,
  .modal-dialog .modal-header-google {
    flex-shrink: 0;
  }

  /* Modal header compact on mobile */
  .modal-header-google {
    padding: 16px;
  }

  .modal-header-google h5 {
    font-size: 16px;
  }

  /* Modal body padding reduced */
  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    flex-wrap: wrap;
  }

  /* Google form container edge-to-edge */
  .google-form-container {
    border-radius: 12px;
  }

  .google-form-card {
    padding: 16px;
    margin: 8px;
  }

  .google-form-header-image {
    height: 100px;
  }

  .google-form-title {
    font-size: 20px;
  }

  /* Material card spacing */
  .material-card {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
  }

  /* Table container */
  .table-container {
    border-radius: 12px;
    margin-bottom: 16px;
  }

  /* Avatar dropdown becomes bottom sheet on mobile */
  .avatar-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    z-index: 1200;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  }

  .avatar-dropdown::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    margin: 4px auto 8px;
  }

  .avatar-dropdown-item {
    padding: 14px 20px;
    font-size: 15px;
  }

  /* Page-level search containers full width */
  .search-container {
    width: 100% !important;
  }

  /* Breadcrumb compact */
  .breadcrumb {
    font-size: 13px;
  }

  /* Page title smaller */
  .h3,
  h3 {
    font-size: 1.35rem;
  }

  /* Google tabs scrollable on mobile */
  .google-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 4px;
    scrollbar-width: none;
  }

  .google-tabs::-webkit-scrollbar {
    display: none;
  }

  .google-tabs .nav-link {
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* === MOBILE PHONES (max 575.98px) === */
@media (max-width: 575.98px) {
  /* Main canvas padding & bottom clearance for mobile nav bar */
  .main-canvas {
    padding: 10px 8px;
    padding-bottom: 104px !important;
  }

  /* Page header action flex containers: stack & expand buttons */
  .d-flex.justify-content-between.align-items-center.mb-4 {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }

  .d-flex.justify-content-between.align-items-center.mb-4 > div:last-child {
    width: 100%;
  }

  .print-hide.d-flex.gap-2 {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px !important;
  }

  .print-hide.d-flex.gap-2 > button,
  .print-hide.d-flex.gap-2 > a {
    flex: 1 1 calc(50% - 4px);
    min-width: 110px;
    justify-content: center;
  }

  /* Repayment Sheet & Official Paper Responsiveness on Mobile */
  .repayment-sheet-header h4 {
    font-size: 16px !important;
  }

  .repayment-sheet-header p {
    font-size: 11px !important;
  }

  .repayment-meta-bar {
    padding: 8px 10px !important;
  }

  .repayment-meta-bar .col-6,
  .repayment-meta-bar .col-md-3 {
    width: 50% !important;
    font-size: 11px !important;
    margin-bottom: 4px;
  }

  .d-flex.justify-content-between.align-items-center.mb-4
    > div:last-child
    .btn-google-primary {
    width: 100%;
    justify-content: center;
  }

  /* Summary card value text size */
  .summary-card-value {
    font-size: 16px;
  }

  .summary-card {
    min-height: 88px;
    padding: 10px 12px !important;
    gap: 3px;
    border-radius: 10px !important;
  }

  .summary-card-icon-bg {
    font-size: 56px;
  }

  /* Buttons: ensure minimum touch targets */
  .btn-google-primary,
  .btn-google-outline,
  .btn-google-text {
    min-height: 44px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Modal footer buttons: stack */
  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn-google-primary,
  .modal-footer .btn-google-text,
  .modal-footer .btn-google-outline {
    width: 100%;
  }

  /* Material card tighter */
  .material-card {
    padding: 14px;
    border-radius: 10px;
  }

  /* Table container tighter */
  .table-container {
    border-radius: 10px;
  }

  /* Form floating controls slightly smaller */
  .form-floating .form-control,
  .form-floating .form-select {
    height: 52px !important;
    font-size: 14px;
  }

  /* Google form touch & mobile layout improvements */
  .google-form-container {
    border-radius: 12px;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
  }

  .google-form-card {
    padding: 14px 12px;
    margin: 8px 4px;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .google-form-header-card {
    margin-top: -20px;
    padding-top: 16px;
  }

  .google-form-input,
  .google-form-select {
    font-size: 14px !important;
    padding: 10px 0 !important;
  }

  .google-form-header-image {
    height: 90px;
  }

  .google-form-title {
    font-size: 18px;
    word-break: break-word;
  }

  .google-form-question-title {
    font-size: 13px;
    flex-wrap: wrap;
  }

  .google-form-footer {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
    margin: 8px 4px;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .google-form-progress-container {
    order: -1;
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .google-form-progress-bar-bg {
    flex: 1;
    width: auto;
    max-width: none;
    min-width: 60px;
  }

  .google-form-progress-text {
    font-size: 12px;
    white-space: nowrap;
    font-weight: 500;
  }

  .google-form-footer .google-form-btn,
  .google-form-footer .google-form-btn-outline {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 9px 12px;
    font-size: 13px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
  }

  /* Status badges slightly smaller */
  .status-badge,
  .status-chip {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* ── TABLE TO CARD RESPONSIVE TRANSFORMATION ──────────────────────────── */
  .material-table.responsive-card-table thead {
    display: none;
  }

  .material-table.responsive-card-table,
  .material-table.responsive-card-table tbody,
  .material-table.responsive-card-table tr,
  .material-table.responsive-card-table td {
    display: block;
    width: 100%;
  }

  .material-table.responsive-card-table tbody tr {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 12px 14px 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
  }

  .material-table.responsive-card-table tbody tr:hover {
    box-shadow: var(--shadow-elevation-1);
  }

  .material-table.responsive-card-table tbody tr:last-child td {
    border-bottom: none;
  }

  .material-table.responsive-card-table td {
    border-bottom: none;
    padding: 5px 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: right;
  }

  .material-table.responsive-card-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: left;
    flex-shrink: 0;
    margin-right: 12px;
    white-space: nowrap;
  }

  /* Show columns that were hidden at sm/md in card mode */
  .material-table.responsive-card-table td.d-none.d-sm-table-cell,
  .material-table.responsive-card-table td.d-none.d-md-table-cell {
    display: flex !important;
  }

  /* Actions cell styling in card mode */
  .material-table.responsive-card-table td[data-label="Actions"],
  .material-table.responsive-card-table td.print-hide {
    justify-content: flex-end;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid var(--border-color);
  }

  .material-table.responsive-card-table td[data-label="Actions"]::before,
  .material-table.responsive-card-table td.print-hide::before {
    display: none;
  }

  /* Search filter cards — stack */
  .material-card .row.align-items-center .col-md-8,
  .material-card .row.align-items-center .col-md-4 {
    width: 100%;
  }

  /* Auth page further adjustments */
  .lms-auth-card {
    border-radius: 20px;
  }

  .lms-auth-form-pane {
    padding: 28px 20px;
    gap: 24px;
  }
}

/* === VERY SMALL PHONES (max 375px) === */
@media (max-width: 375px) {
  .main-canvas {
    padding: 10px 8px;
    padding-bottom: 84px;
  }

  .top-nav {
    padding: 0 6px;
  }

  .logo-text {
    font-size: 17px;
  }

  .summary-card-value {
    font-size: 14px;
  }

  .summary-card {
    min-height: 80px;
    padding: 8px 10px !important;
  }

  .material-card {
    padding: 12px;
  }

  .google-form-card {
    padding: 10px 8px;
    margin: 4px 0;
  }

  .google-form-footer {
    padding: 8px 10px;
    margin: 4px 0;
    gap: 8px;
  }

  .google-form-title {
    font-size: 15px;
    line-height: 1.3;
  }

  .google-form-desc {
    font-size: 12px;
  }

  #btnFillDummyData {
    width: 100%;
    white-space: normal;
    text-align: center;
    font-size: 11px !important;
    padding: 6px 8px !important;
  }

  .mobile-nav-item {
    font-size: 10px;
  }

  .mobile-nav-item i {
    font-size: 20px;
  }

  .mobile-nav-item.active::before {
    width: 48px;
    height: 26px;
  }

  /* Buttons */
  .btn-google-primary,
  .btn-google-outline {
    padding: 10px 16px;
    font-size: 13px;
  }

  /* Auth */
  .lms-auth-form-pane {
    padding: 24px 16px;
    gap: 20px;
  }

  .lms-auth-card {
    border-radius: 16px;
  }
}

/* ── Touch & Interaction Improvements ──────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices - they cause sticky states */
  .sidebar-link:hover {
    background-color: transparent;
  }

  .sidebar-link:active {
    background-color: var(--hover-bg);
  }

  .material-table tbody tr:hover {
    background-color: transparent;
  }

  .material-table tbody tr:active {
    background-color: var(--hover-bg);
  }

  .summary-card:hover {
    transform: none;
  }

  .summary-card:active {
    transform: scale(0.98);
  }

  /* Larger touch targets for table action buttons */
  .material-table.responsive-card-table .btn-google-text {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ── Safe Area Insets for Notched Devices ───────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-bottom-nav {
    height: calc(64px + env(safe-area-inset-bottom, 0));
  }

  @media (max-width: 767.98px) {
    body {
      padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
    }
  }
}

/* ── Landscape Mobile Adjustments ──────────────────────────────────────── */
@media (max-height: 500px) and (max-width: 991.98px) {
  .mobile-bottom-nav {
    height: 48px;
  }

  .mobile-nav-item {
    font-size: 10px;
  }

  .mobile-nav-item i {
    font-size: 18px;
  }

  .mobile-nav-item span {
    display: none;
  }

  .mobile-nav-item.active::before {
    width: 36px;
    height: 24px;
    top: 4px;
  }

  .fab-btn {
    bottom: 56px;
    width: 48px;
    height: 48px;
  }

  .modal-header-google {
    padding: 10px 16px;
  }

  .modal-body {
    padding: 10px 16px;
  }
}

/* ── Mobile Navigation Bar & Drawer Sheet Specifications ──────────────── */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0));
  background-color: var(--surface-color);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

.mobile-bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  max-width: 600px;
  height: 100%;
  padding: 0 4px;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
  flex: 1;
  max-width: 80px;
}

.mobile-nav-item i {
  font-size: 22px;
  color: var(--text-secondary);
  transition:
    transform 0.15s ease,
    color 0.15s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus {
  color: var(--primary-color);
}

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

.mobile-nav-item.active i {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.mobile-nav-item.active::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 24px;
  background-color: var(--primary-light);
  border-radius: 12px;
  z-index: -1;
}

/* Mobile More Sheet */
.mobile-more-sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1054;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(2px);
}

.mobile-more-sheet-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.mobile-more-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--surface-color);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.2);
  z-index: 1055;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom, 0));
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-more-sheet.show {
  transform: translateY(0);
}

.mobile-more-sheet-handle {
  width: 36px;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
  margin: 0 auto 12px;
  flex-shrink: 0;
}

.mobile-more-sheet-title {
  font-family: "Outfit", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 8px;
  padding: 0 8px;
}

.mobile-more-sheet-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 12px;
  transition: background-color 0.15s ease;
}

.mobile-more-sheet-item:hover,
.mobile-more-sheet-item:active {
  background-color: var(--hover-bg);
}

.mobile-more-sheet-item.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 600;
}

.mobile-more-sheet-item i {
  font-size: 22px;
  color: var(--text-secondary);
}

.mobile-more-sheet-item.active i {
  color: var(--primary-color);
}

/* Sidebar Drawer & Mobile View Adjustments */
@media (max-width: 767.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background-color: var(--surface-color) !important;
    border-right: 1px solid var(--border-color) !important;
    z-index: 1060;
    padding-top: calc(var(--nav-height) + 8px);
    transform: translateX(-100%);
    box-shadow: var(--shadow-elevation-3);
  }

  .sidebar.show-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    z-index: 1059;
  }

  .sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }

  /* Main Canvas Mobile Viewport */
  .main-canvas {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: var(--nav-height) !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 16px 12px calc(84px + env(safe-area-inset-bottom, 0)) !important;
  }

  /* Header scaling on phones */
  .brand-full-text {
    display: none;
  }

  .search-bar-container {
    margin: 0 8px;
  }

  .top-search-bar {
    height: 38px;
    padding: 0 10px;
  }

  .top-search-bar input {
    font-size: 13px;
  }

  .global-search-overlay {
    position: fixed;
    top: var(--nav-height);
    left: 8px;
    right: 8px;
    width: auto;
  }

  /* Prevent iOS Safari input focus auto-zoom */
  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Borrower Profile Picture Styles */
.bor-avatar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--bg-surface, #f8f9fa);
  border: 2px dashed var(--border-color, #dee2e6);
  border-radius: 12px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.bor-avatar-wrapper:hover {
  border-color: var(--primary-color, #1a73e8);
  background: #f1f5fb;
}
.bor-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  background: #1a73e8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 24px;
  flex-shrink: 0;
}
.bor-table-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a73e8;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.08);
}
.bor-detail-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a73e8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 32px;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

/* Global LMS Alert Box Styling for All Modals & Dialogs */
.modal-content .alert,
.confirm-alert-modal .alert,
.alert {
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  padding: 10px 14px !important;
  border: 1px solid transparent !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all var(--transition-speed) ease !important;
}

.modal-content .alert i.material-icons,
.alert i.material-icons {
  font-size: 20px !important;
  flex-shrink: 0 !important;
}

/* Light Theme Alert Box Variants */
.alert-info {
  background-color: #e8f0fe !important;
  border-color: #c2e7ff !important;
  color: #041e49 !important;
}
.alert-info i.material-icons {
  color: #0b57d0 !important;
}

.alert-warning {
  background-color: #fef7e0 !important;
  border-color: #ffeebc !important;
  color: #7a4100 !important;
}
.alert-warning i.material-icons {
  color: #b06000 !important;
}

.alert-danger {
  background-color: #fce8e6 !important;
  border-color: #f8d7da !important;
  color: #601210 !important;
}
.alert-danger i.material-icons {
  color: #b3261e !important;
}

.alert-success {
  background-color: #e6f4ea !important;
  border-color: #ceead6 !important;
  color: #0d3c1d !important;
}
.alert-success i.material-icons {
  color: #146c2e !important;
}

/* Dark Theme Alert Box Adaptation */
body.dark-theme .modal-content .alert,
body.dark-theme .confirm-alert-modal .alert,
body.dark-theme .alert {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .alert-info {
  background-color: #002244 !important;
  border-color: #004a77 !important;
  color: #c2e7ff !important;
}
body.dark-theme .alert-info i.material-icons {
  color: #a8c7fa !important;
}

body.dark-theme .alert-warning {
  background-color: #3c2d00 !important;
  border-color: #5c4500 !important;
  color: #ffeebc !important;
}
body.dark-theme .alert-warning i.material-icons {
  color: #fdd663 !important;
}

body.dark-theme .alert-danger {
  background-color: #3c1919 !important;
  border-color: #5c2626 !important;
  color: #f9dedc !important;
}
body.dark-theme .alert-danger i.material-icons {
  color: #f28b82 !important;
}

body.dark-theme .alert-success {
  background-color: #0e3019 !important;
  border-color: #1a522a !important;
  color: #ceead6 !important;
}
body.dark-theme .alert-success i.material-icons {
  color: #81c995 !important;
}

/* Modal Content & Confirmation Box Adjustments for Dark Mode */
body.dark-theme .modal-content {
  background-color: var(--surface-color) !important;
  color: var(--text-color) !important;
  border: 1px solid var(--border-color) !important;
}

body.dark-theme .confirm-icon-wrapper {
  background-color: var(--hover-bg) !important;
}

/* Digital Application Form Responsive Table Styles */
.digital-form-preview {
  color: var(--text-color);
}

.application-section-title {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: none;
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}

body.dark-theme .application-section-title {
  background-color: rgba(255, 255, 255, 0.05);
}

.app-info-table {
  font-size: 13px;
  border-color: var(--border-color) !important;
  background-color: var(--surface-color);
  margin-bottom: 1rem;
}

.app-info-table th.app-table-key {
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--text-secondary);
  font-weight: 600;
  vertical-align: middle;
  border-color: var(--border-color) !important;
}

body.dark-theme .app-info-table th.app-table-key {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.app-info-table td.app-table-val {
  color: var(--text-color);
  vertical-align: middle;
  border-color: var(--border-color) !important;
  background-color: var(--surface-color);
}

body.dark-theme .app-info-table {
  background-color: var(--surface-color);
  border-color: var(--border-color) !important;
}

.app-budget-table th,
.app-budget-table td {
  border-color: var(--border-color) !important;
}

.app-budget-table .table-subtotal {
  background-color: rgba(0, 0, 0, 0.02);
}

body.dark-theme .app-budget-table .table-subtotal {
  background-color: rgba(255, 255, 255, 0.04);
}

@media (max-width: 768px) {
  .app-info-table,
  .app-info-table tbody,
  .app-info-table tr,
  .app-info-table th,
  .app-info-table td {
    display: block;
    width: 100% !important;
  }

  .app-info-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
  }

  .app-info-table th.app-table-key {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 6px 12px;
    font-size: 12px;
  }

  .app-info-table td.app-table-val {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 6px 12px;
    margin-bottom: 4px;
  }

  .app-info-table td.app-table-val:last-child {
    border-bottom: none !important;
  }
}

/* Official Microfinance Repayment Sheet Print & Responsive Styles */
.repayment-sheet-header {
  color: var(--text-color);
}

.repayment-meta-bar {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 6px;
  padding: 8px 12px !important;
}

body.dark-theme .repayment-meta-bar {
  background-color: rgba(255, 255, 255, 0.05);
}

.repayment-table {
  width: 100% !important;
  border-collapse: collapse !important;
}

.repayment-table th,
.repayment-table td {
  border-color: #cfd8dc !important;
}

body.dark-theme .repayment-table th,
body.dark-theme .repayment-table td {
  border-color: var(--border-color) !important;
}

@media print {
  @page {
    size: auto;
    margin: 5mm !important;
  }

  body,
  body.dark-theme {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt !important;
  }

  body.dark-theme *,
  body.dark-theme *::before,
  body.dark-theme *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body.dark-theme .table,
  body.dark-theme .material-table,
  body.dark-theme .official-table,
  body.dark-theme .print-table,
  body.dark-theme .repayment-table,
  body.dark-theme .table > :not(caption) > * > * {
    background-color: #ffffff !important;
    color: #000000 !important;
  }

  body.dark-theme .table th,
  body.dark-theme .material-table th,
  body.dark-theme .print-table th,
  body.dark-theme .responsive-card-table th {
    background-color: #f0f4f8 !important;
    color: #000000 !important;
    border-color: #000000 !important;
  }

  body.dark-theme .table td,
  body.dark-theme .material-table td,
  body.dark-theme .print-table td,
  body.dark-theme .responsive-card-table td {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
  }

  body.dark-theme .table-danger,
  body.dark-theme tr.table-danger,
  body.dark-theme tr.table-danger > th,
  body.dark-theme tr.table-danger > td {
    background-color: #f8d7da !important;
    color: #842029 !important;
  }

  /* Force display of print container and hide chrome */
  .top-nav,
  .sidebar,
  .sidebar-backdrop,
  .fab-btn,
  .breadcrumb,
  .d-print-none,
  .mobile-bottom-nav,
  .modal-backdrop,
  .modal {
    display: none !important;
  }

  .main-canvas,
  #app-content,
  .print-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  /* Repayment Sheet Official Header */
  .repayment-sheet-header {
    border-bottom: 2pt solid #1a237e !important;
    padding-bottom: 8pt !important;
    margin-bottom: 12pt !important;
  }

  .repayment-header-tag {
    background-color: #e8eaf6 !important;
    color: #1a237e !important;
    border: 1pt solid #1a237e !important;
    font-weight: 700 !important;
    display: inline-block !important;
  }

  .repayment-meta-bar {
    background-color: #f5f5f5 !important;
    border: 0.75pt solid #cccccc !important;
    margin-top: 6pt !important;
    padding: 4pt 8pt !important;
    font-size: 9pt !important;
    color: #000000 !important;
  }

  /* Table styling for official printout */
  .table-responsive {
    overflow: visible !important;
  }

  .repayment-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9pt !important;
  }

  .repayment-table th,
  .repayment-table td {
    border: 0.75pt solid #111111 !important;
    padding: 4pt 6pt !important;
    color: #000000 !important;
    background-color: #ffffff !important;
  }

  .repayment-table thead th {
    background-color: #1a237e !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 8.5pt !important;
    text-transform: uppercase !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .repayment-table tbody tr {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .repayment-table tr.table-secondary {
    background-color: #f0f4f8 !important;
    font-weight: 700 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .repayment-table tfoot td {
    background-color: #1a237e !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 9.5pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-collection-box {
    border: 1pt solid #000000 !important;
    background-color: #ffffff !important;
    min-height: 20px !important;
    line-height: 20px !important;
  }

  /* Signature Block */
  .repayment-signature-block {
    margin-top: 24pt !important;
    padding-top: 12pt !important;
    border-top: 1.5pt solid #000000 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}

/* Official Microfinance Industry Standard Document Styles */
.official-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 12px;
}

.official-table th {
  background-color: #1a237e !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 8px 6px !important;
  border: 1px solid #101652 !important;
}

.official-table td {
  padding: 7px 6px !important;
  border: 1px solid var(--border-color) !important;
  vertical-align: middle;
}

.official-table tr.group-subtotal-row {
  background-color: #f0f4f9 !important;
  font-weight: 700;
  border-top: 1.5px solid #1a237e !important;
  border-bottom: 2px double #1a237e !important;
}

body.dark-theme .official-table tr.group-subtotal-row {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-color);
}

.official-table tfoot td {
  background-color: #1a237e !important;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 12.5px;
  border: 1px solid #101652 !important;
}

.denomination-box {
  background-color: #f8f9fa;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  padding: 12px 16px;
}

body.dark-theme .denomination-box {
  background-color: var(--surface-color);
  border-color: var(--border-color);
}

.denomination-table {
  font-size: 11px;
  width: 100%;
}

.denomination-table th,
.denomination-table td {
  padding: 3px 6px;
  border: 1px solid #ddd;
}

.declaration-text {
  font-size: 10.5px;
  color: #555;
  font-style: italic;
}

body.dark-theme .declaration-text {
  color: #aaa;
}

@media print {
  .official-table th {
    background-color: #1a237e !important;
    color: #ffffff !important;
    border: 1pt solid #000000 !important;
  }

  .official-table td {
    border: 0.75pt solid #000000 !important;
    color: #000000 !important;
  }

  .official-table tr.group-subtotal-row {
    background-color: #f0f4f8 !important;
    color: #000000 !important;
    border-top: 1.5pt solid #000000 !important;
    border-bottom: 2.5pt double #000000 !important;
  }

  .official-table tfoot td {
    background-color: #1a237e !important;
    color: #ffffff !important;
    border: 1pt solid #000000 !important;
  }

  .denomination-box {
    border: 1pt solid #000000 !important;
    background-color: #ffffff !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .denomination-table th,
  .denomination-table td {
    border: 0.5pt solid #000000 !important;
    color: #000000 !important;
  }
}

/* ============================================================================
   REPORT TABS — Material Design Scrollable Tab Bar
   ============================================================================ */

.report-tabs-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 2px solid var(--border-color);
  background: var(--surface-color);
  border-radius: 16px 16px 0 0;
  padding: 0 4px;
  margin-bottom: 0;
}

.report-tabs-bar::-webkit-scrollbar {
  display: none;
}

.report-tab-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Outfit', 'Roboto', sans-serif;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  border-radius: 12px 12px 0 0;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.report-tab-btn:hover {
  color: var(--primary-color);
  background-color: rgba(26, 115, 232, 0.06);
}

.report-tab-btn.active {
  color: var(--primary-color);
  font-weight: 600;
}

.report-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 8px;
  right: 8px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 3px 3px 0 0;
}

.report-tab-btn i.material-icons {
  font-size: 18px;
}

/* Report Content Area */
.report-content-area {
  background: var(--surface-color);
  border-radius: 0 0 16px 16px;
  padding: 20px 24px 24px;
  border: 1px solid var(--border-color);
  border-top: none;
}

/* Report Summary Widgets — compact strip */
.report-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.report-summary-widget {
  background: linear-gradient(135deg, var(--bg-color) 0%, var(--surface-color) 100%);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-summary-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.report-summary-widget .widget-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
}

.report-summary-widget .widget-value {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  line-height: 1.2;
}

.report-summary-widget .widget-value.text-primary { color: var(--primary-color); }
.report-summary-widget .widget-value.text-success { color: #1e8e3e; }
.report-summary-widget .widget-value.text-danger { color: #d93025; }
.report-summary-widget .widget-value.text-warning { color: #e37400; }
.report-summary-widget .widget-value.text-info { color: #1a73e8; }

/* Report Filter Bar */
.report-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--bg-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.report-filter-bar .form-floating {
  flex: 1;
  min-width: 140px;
}

.report-filter-bar .form-floating .form-control {
  border-radius: 10px;
  height: 48px;
  font-size: 14px;
}

.report-filter-bar .btn-apply-filter {
  height: 48px;
  padding: 0 24px;
  font-weight: 600;
  border-radius: 24px;
  white-space: nowrap;
}

/* Report Table Enhancement */
.report-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.report-table-wrapper .material-table {
  margin-bottom: 0;
}

/* Report Empty State */
.report-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.report-empty-state i {
  font-size: 56px;
  opacity: 0.25;
  display: block;
  margin-bottom: 12px;
}

.report-empty-state h6 {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
}

.report-empty-state p {
  font-size: 13px;
  max-width: 380px;
  margin: 0 auto;
}

/* Print overrides for report tabs */
@media print {
  @page {
    size: auto;
    margin: 5mm !important;
  }

  body.is-printing-voucher #reportContentArea {
    display: none !important;
  }

  .report-tabs-bar,
  .report-filter-bar,
  .report-print-footer {
    display: none !important;
  }

  /* Force ALL responsive hidden table cells to be visible in print */
  th.d-none, td.d-none,
  th[class*="d-none"], td[class*="d-none"],
  th.d-sm-table-cell, td.d-sm-table-cell,
  th.d-md-table-cell, td.d-md-table-cell,
  th.d-lg-table-cell, td.d-lg-table-cell,
  th.d-xl-table-cell, td.d-xl-table-cell {
    display: table-cell !important;
  }

  .report-content-area {
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: 8.5pt !important;
    color: #000 !important;
  }
  .report-summary-strip {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6pt !important;
    margin-bottom: 10pt !important;
  }
  .report-summary-strip.print-hide,
  .print-hide {
    display: none !important;
  }
  .report-summary-widget {
    border: 0.75pt solid #333 !important;
    border-left: 2.5pt solid #000 !important;
    border-radius: 0 !important;
    padding: 4pt 6pt !important;
    background: #fff !important;
  }
  .report-summary-widget .widget-label {
    font-size: 7pt !important;
    color: #333 !important;
    font-weight: 700 !important;
  }
  .report-summary-widget .widget-value {
    font-size: 10pt !important;
    color: #000 !important;
    font-weight: 800 !important;
  }
  .report-table-wrapper {
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }
  .report-table-wrapper .material-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 8.5pt !important;
  }
  .report-table-wrapper .material-table th {
    font-size: 7.5pt !important;
    font-weight: 700 !important;
    padding: 4pt 5pt !important;
    color: #000 !important;
    background-color: #f0f0f0 !important;
    border: 0.75pt solid #333 !important;
    text-transform: uppercase;
  }
  .report-table-wrapper .material-table td {
    font-size: 8pt !important;
    padding: 4pt 5pt !important;
    color: #000 !important;
    border: 0.5pt solid #444 !important;
  }
  .report-table-wrapper .badge {
    font-size: 7.5pt !important;
    font-weight: 600 !important;
    padding: 1.5pt 4pt !important;
    border: 0.5pt solid #222 !important;
    color: #000 !important;
    background: transparent !important;
    display: inline-block !important;
  }
  .col-mark-cell {
    border-left: 0.75pt solid #444 !important;
    border-right: 0.75pt solid #444 !important;
    background: #ffffff !important;
    min-width: 45px !important;
  }
}

.col-mark-cell {
  border-left: 1px solid var(--border-color);
  background: var(--bg-color);
  min-width: 55px;
}

/* Responsive for small screens */
@media (max-width: 768px) {
  .report-tab-btn {
    padding: 10px 12px;
    font-size: 12px;
  }
  .report-tab-btn i.material-icons {
    font-size: 16px;
  }
  .report-content-area {
    padding: 14px 12px 16px;
  }
  .report-summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .report-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .report-filter-bar .btn-apply-filter {
    width: 100%;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   MANAGE PROFILE STYLES
   ════════════════════════════════════════════════════════════════════════════ */
.profile-avatar-container {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: var(--bg-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.profile-avatar-preview {
  width: 90px;
  height: 90px;
  min-width: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), #1557b0);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
  border: 3px solid var(--surface-color);
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================================
 * AGREEMENT DOCUMENT STYLES & PRINT MEDIA
 * ============================================================================ */
.agreement-paper-wrapper {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.agreement-paper {
  width: 100%;
  max-width: 820px;
  background: #ffffff;
  color: #111111;
  font-family: 'Inter', 'Segoe UI', 'Mukta Malar', 'Latha', sans-serif;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 40px 45px;
  box-sizing: border-box;
}

.agreement-page {
  position: relative;
}

.agreement-header-text {
  font-size: 12px;
  line-height: 1.55;
  text-align: justify;
  font-weight: 500;
  color: #0c0c0c;
  padding-bottom: 8px;
  border-bottom: 1.5px dashed #cbd5e1;
}

.agreement-intro,
.agreement-declaration,
.agreement-signoff,
.agreement-receipt-acknowledgment {
  font-size: 11.5px;
  line-height: 1.6;
  color: #1a1a1a;
  text-align: justify;
}

.fill-box {
  border-bottom: 1.5px solid #000;
  padding: 0 4px;
  display: inline-block;
}

.fill-line {
  border-bottom: 1px solid #000;
  min-height: 20px;
  padding-left: 6px;
  font-weight: 600;
}

.fill-line-inline {
  border-bottom: 1px solid #000;
  padding: 0 10px;
}

.agreement-clauses {
  padding-left: 20px;
  margin-bottom: 15px;
}

.agreement-clauses li {
  font-size: 11px;
  line-height: 1.55;
  margin-bottom: 8px;
  text-align: justify;
  color: #1e1e1e;
}

.agreement-header-sub {
  font-size: 12.5px;
  font-weight: 700;
  color: #000;
}

.agreement-summary-box {
  background-color: #fafafa;
  font-size: 11.5px;
  line-height: 1.65;
}

.agreement-page-break {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 1px;
  margin: 35px 0;
  padding: 10px 0;
  border-top: 1px dashed #cbd5e1;
  border-bottom: 1px dashed #cbd5e1;
  text-transform: uppercase;
}

.signature-block {
  text-align: center;
  padding-top: 25px;
}

.signature-line {
  border-bottom: 1.5px solid #000;
  width: 80%;
  margin: 0 auto 6px auto;
}

.witnesses-block {
  font-size: 11px;
  line-height: 1.7;
}

@media print {
  @page {
    size: auto;
    margin: 5mm !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* Hide UI chrome */
  header,
  .sidebar,
  .sidebar-backdrop,
  .fab-btn,
  .toast-container,
  .d-print-none,
  #agreementControlsCard,
  .agreement-page-break {
    display: none !important;
  }

  .main-canvas {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .agreement-paper-wrapper {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .agreement-paper {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: 9.5pt !important;
  }

  .agreement-header-text {
    font-size: 9pt !important;
    line-height: 1.45 !important;
  }

  .agreement-intro,
  .agreement-declaration,
  .agreement-signoff,
  .agreement-receipt-acknowledgment {
    font-size: 8.5pt !important;
    line-height: 1.45 !important;
  }

  .agreement-clauses li {
    font-size: 8.5pt !important;
    line-height: 1.45 !important;
    margin-bottom: 6pt !important;
  }

  .agreement-page.page-2 {
    page-break-before: always !important;
    break-before: page !important;
    padding-top: 10pt !important;
  }

  .agreement-summary-box {
    background-color: #ffffff !important;
    font-size: 8.5pt !important;
    border: 1.5pt solid #000000 !important;
  }

  .signature-block {
    padding-top: 20pt !important;
  }
}

/* ── Global 100% Full-Width Print Overrides for All Document Reports ── */
@media print {
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .main-canvas,
  #app-content,
  .page-view,
  .print-form-container,
  .print-schedule-container,
  .print-container,
  .report-content-area,
  .report-table-wrapper,
  .report-print-header,
  .repayment-sheet-container,
  .doc-container,
  .material-card,
  .material-table,
  .official-table,
  .repayment-table,
  .table-responsive,
  .table,
  .agreement-paper-wrapper,
  .agreement-paper {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }

  .material-table,
  .official-table,
  .repayment-table,
  .table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
  }
}

/* Interactive Profile Picture Lightbox Styles */
.bor-detail-avatar,
.bor-table-avatar,
.bor-photo-preview,
.img-previewable {
  cursor: pointer !important;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bor-detail-avatar:hover,
.bor-table-avatar:hover,
.bor-photo-preview:hover,
.img-previewable:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}