/* ==========================================================================
   Header Profile Bar & Pending Users Notification Badge (Fixed Alignment)
   ========================================================================== */
.topbar-user-area {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.75rem !important;
  margin-left: auto !important;
}

.user-chip {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.55rem !important;
  padding: 0.28rem 0.85rem 0.28rem 0.35rem !important;
  background: var(--surface-subtle) !important;
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
  box-shadow: var(--shadow-xs) !important;
}

.chip-avatar {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #e8f7ee, #d1fae5) !important;
  color: #065f46 !important;
  border: 1px solid #a7f3d0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  flex-shrink: 0 !important;
}

.chip-name {
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.chip-role {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 0.12rem 0.45rem !important;
  border-radius: 999px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

.chip-role.admin {
  background: #ede9fe !important;
  color: #6d28d9 !important;
  border: 1px solid #ddd6fe !important;
}

.chip-role.volunteer {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}

.btn-logout {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  padding: 0.42rem 0.85rem !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background: #ffffff !important;
  color: var(--text-secondary) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: var(--shadow-xs) !important;
  white-space: nowrap !important;
}

.btn-logout:hover {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
}

.logout-icon {
  font-size: 0.88rem !important;
  line-height: 1 !important;
}

/* Eye-Catching Pending Registrations Notification Badge Pill */
.nav-badge-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 22px !important;
  height: 22px !important;
  padding: 0 6px !important;
  border-radius: 999px !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  background: #ea580c !important; /* Vibrant high-contrast alert orange */
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.4) !important;
  line-height: 1 !important;
  margin-left: 0.45rem !important;
  vertical-align: middle !important;
}

/* ==========================================================================
   BIS Expense Management - Modern, High-Precision Stylesheet
   Designed for Clarity, High Contrast, and Zero Unnecessary Horizontal Scrolling
   ========================================================================== */

:root {
  /* Brand Palette (Boroughs Islamic Society Emerald Theme) */
  --primary: #0f853c;
  --primary-hover: #0c6f32;
  --primary-light: #e8f7ee;
  --primary-border: #bbf0cd;

  /* Surfaces & Canvas */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-subtle: #f1f5f9;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;

  /* High-Contrast Typography */
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Semantic Feedback Colors */
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  /* Geometry & Elevation */
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Header & Top Navigation
   ========================================================================== */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: var(--shadow-xs);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background-color: var(--border);
}

.auth-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  margin: 0 auto 0.85rem;
  display: block;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-btn:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.nav-btn.active {
  background: var(--primary-light);
  color: var(--primary-hover);
  border: 1px solid var(--primary-border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.88rem;
}

.role-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-tag.admin {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.role-tag.volunteer {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* ==========================================================================
   Header Profile Bar & Pending Users Notification Badge
   ========================================================================== */
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.75rem 0.28rem 0.35rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
}

.user-profile-badge .user-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8f7ee, #d1fae5);
  color: #065f46;
  border: 1px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.user-profile-details {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.user-display-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.user-role-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  line-height: 1.2;
}

.user-role-pill.admin {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.user-role-pill.volunteer {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Modern Clean Sign Out Button */
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.btn-logout:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.12);
}

.logout-icon {
  font-size: 0.88rem;
  line-height: 1;
}

/* Registration Pending Badge Pill on Nav Tab */
.nav-badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #ea580c; /* High-visibility vibrant orange */
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.35);
  line-height: 1;
  margin-left: 0.45rem;
  animation: pulse-badge 2.5s infinite ease-in-out;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.container {
  max-width: 1440px;
  margin: 1.5rem auto;
  padding: 0 1.75rem;
}

/* ==========================================================================
   Auth Layout (Modern Centered Experience)
   ========================================================================== */
.auth-wrapper {
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.05);
  padding: 2.5rem 2.25rem;
  margin: 0 auto;
  transition: all 0.2s ease;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.65rem;
}

.auth-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  margin: 0 auto 0.85rem;
  display: block;
}

.auth-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-top: 0.35rem;
  line-height: 1.4;
}

/* Modern Segmented Control for Sign In vs Volunteer Sign Up */
.auth-segmented-control {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.segmented-btn {
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.segmented-btn.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-auth-submit {
  box-shadow: 0 2px 4px rgba(15, 133, 60, 0.2);
}

.auth-switch-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px dashed var(--border);
}

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-text-link:hover {
  color: var(--primary-hover);
}

.auth-info-callout {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #ecfdf5;
  border: 1px solid #bbf0cd;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  color: #065f46;
  line-height: 1.45;
}

.callout-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Stat Cards (Modern SaaS Metric Cards)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-icon-wrapper.icon-primary {
  background: #ecfdf5;
  border: 1px solid #bbf0cd;
}

.stat-icon-wrapper.icon-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.stat-icon-wrapper.icon-success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}

.stat-icon-wrapper.icon-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.stat-icon-wrapper.icon-neutral {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  margin-top: 0.2rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================================
   Buttons & Form Controls
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 133, 60, 0.2);
}

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

.btn-secondary {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-subtle);
  border-color: #cbd5e1;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

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

.btn-danger:hover {
  background: #fee2e2;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-row {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.15rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.required {
  color: var(--danger);
  font-weight: 700;
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 133, 60, 0.15);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

/* ==========================================================================
   Panels & Modern Table Toolbar
   ========================================================================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.panel-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Two-Tier Filter Toolbar */
.filters-toolbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0.95rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filters-primary-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-search-wrapper {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.filter-search-wrapper .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.85rem;
  opacity: 0.6;
}

#filter-search {
  padding-left: 2.25rem;
  height: 38px;
}

.filter-field-status {
  width: 210px;
}

.filter-field-submitter {
  width: 190px;
}

.filter-field-status select,
.filter-field-submitter select {
  height: 38px;
  font-weight: 500;
}

.filters-secondary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.filter-group-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.2rem;
}

.filter-group input[type="date"] {
  height: 34px;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  width: 140px;
}

.filter-sep {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.input-prefix-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 0.55rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-prefix-wrapper input[type="number"] {
  height: 34px;
  width: 100px;
  padding-left: 1.25rem;
  padding-right: 0.5rem;
  font-size: 0.82rem;
}

.filter-actions-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-left: auto;
}

.filter-count-badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ==========================================================================
   Table & Responsive Wrapper (Zero Unwanted Horizontal Scroll)
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.expenses-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

th {
  background: #f8fafc;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.8rem 1.15rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  vertical-align: middle;
  background: var(--surface);
}

tr:last-child td {
  border-bottom: none;
}

tr.clickable-row {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

tr.clickable-row:hover td {
  background-color: #f8fafc;
}

/* ==========================================================================
   Modern Table Cell Components
   ========================================================================== */
.req-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.req-id-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.req-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
  display: inline-block;
}

.req-meta-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.category-pill {
  font-size: 0.72rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}

.badge-icon-item {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: #ecfdf5;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--primary-border);
}

.req-desc-snippet {
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.submitter-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8f7ee, #d1fae5);
  color: #065f46;
  font-weight: 700;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #a7f3d0;
}

.submitter-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.submitter-name {
  font-weight: 600;
  font-size: 0.86rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.submitter-email {
  font-size: 0.74rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date-display {
  font-size: 0.84rem;
  font-weight: 500;
  color: #334155;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.amount-main {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.sub-approved-tag {
  font-size: 0.74rem;
  font-weight: 600;
  margin-top: 0.15rem;
  white-space: nowrap;
}

.sub-approved-tag.success {
  color: #059669;
}

.sub-approved-tag.danger {
  color: #dc2626;
}

.sub-approved-tag.info {
  color: #2563eb;
}

.sub-approved-tag.warning {
  color: #d97706;
}

.sub-approved-tag.muted {
  color: #64748b;
}

.payout-method-pill {
  font-size: 0.76rem;
  font-weight: 600;
  color: #1e293b;
  background: #f8fafc;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  display: inline-block;
  white-space: nowrap;
}

.payout-details-text {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.status-action-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.row-arrow {
  color: #94a3b8;
  font-size: 1.15rem;
  font-weight: 600;
  transition: transform 0.12s ease, color 0.12s ease;
  user-select: none;
}

tr.clickable-row:hover .row-arrow {
  transform: translateX(3px);
  color: var(--primary);
}

/* ==========================================================================
   Modern Status Badges with Colored Indicators
   ========================================================================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-Submitted,
.status-pending {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid var(--warning-border);
}

.status-Submitted .status-dot,
.status-pending .status-dot {
  background: var(--warning);
}

.status-In-Process {
  background: var(--info-bg);
  color: #1e40af;
  border: 1px solid var(--info-border);
}

.status-In-Process .status-dot {
  background: var(--accent);
}

.status-Approved,
.status-approved {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid var(--success-border);
}

.status-Approved .status-dot,
.status-approved .status-dot {
  background: var(--success);
}

.status-Denied,
.status-rejected {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid var(--danger-border);
}

.status-Denied .status-dot,
.status-rejected .status-dot {
  background: var(--danger);
}

.status-Archived {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.status-Archived .status-dot {
  background: #94a3b8;
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */
.alert {
  padding: 0.85rem 1.15rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.alert-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}

/* ==========================================================================
   Universal Modal Header Structure
   ========================================================================== */
.modal-header {
  padding: 1.25rem 1.75rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-shrink: 0;
}

.modal-header-content {
  flex: 1;
  min-width: 0;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.modal-close-btn,
.close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
  margin-top: -2px;
}

.modal-close-btn:hover,
.close-btn:hover {
  background: var(--surface-subtle);
  border-color: var(--border);
  color: var(--text);
}

/* ==========================================================================
   Submit New Expense Modal (Modern Card & Dropzone)
   ========================================================================== */
.modal-card-new-expense {
  width: 92vw;
  max-width: 820px;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.08);
  background: var(--surface);
}

.new-expense-body {
  padding: 1.35rem 1.75rem;
  background: #f8fafc;
  overflow-y: auto;
}

.form-section-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-xs);
}

.form-section-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Modern File Upload Dropzone */
.upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background: #ecfdf5;
}

.dropzone-icon {
  font-size: 2.25rem;
  margin-bottom: 0.35rem;
  opacity: 0.85;
}

.dropzone-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.dropzone-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Live Selected File Chips */
.new-files-preview-list {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.file-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.file-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.82rem;
  box-shadow: var(--shadow-xs);
}

.chip-icon {
  font-size: 1rem;
}

.chip-name {
  font-weight: 600;
  color: var(--text);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-size {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Modal Dialogs & Deep Review View (Roomy, Modern, Executive Experience)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Base Modal (Used for New Expense Creation & Admin Dialogs) */
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Large Executive Modal for Deep Review & Collaborative Q&A */
.modal-card-detail {
  width: 95vw;
  max-width: 1240px;
  height: 90vh;
  max-height: 880px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.08);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Modern Detail Modal Header */
.detail-header {
  padding: 1.15rem 1.75rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.detail-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.detail-header-badge-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.detail-submitter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface-subtle);
  padding: 0.2rem 0.65rem 0.2rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.detail-modal-title-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 780px;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Modal Body & Roomy 2-Column Split Architecture */
.detail-modal-body {
  padding: 1.35rem 1.75rem;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

.detail-roomy-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 1.75rem;
  height: 100%;
  min-height: 0;
  flex: 1;
}

/* Left Pane: Review Decision, Form Inputs, Receipts */
.detail-left-pane {
  overflow-y: auto;
  padding-right: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

/* Custom Sleek Scrollbar for Left Pane & Message Feed */
.detail-left-pane::-webkit-scrollbar,
.qa-messages-feed::-webkit-scrollbar {
  width: 6px;
}

.detail-left-pane::-webkit-scrollbar-track,
.qa-messages-feed::-webkit-scrollbar-track {
  background: transparent;
}

.detail-left-pane::-webkit-scrollbar-thumb,
.qa-messages-feed::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.detail-left-pane::-webkit-scrollbar-thumb:hover,
.qa-messages-feed::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Admin Review & Decision Card */
.admin-decision-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-xs);
}

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

.decision-header-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.decision-header-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #dcfce7;
  color: #166534;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #a7f3d0;
}

/* Detail Section Cards */
.detail-section-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-xs);
}

.section-card-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.95rem;
}

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

/* Roomy Receipt Attachments Gallery */
.roomy-attachments-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.roomy-attachment-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.15s ease;
}

.roomy-attachment-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-xs);
}

.roomy-attachment-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.roomy-attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.roomy-attachment-thumb:hover img {
  transform: scale(1.08);
}

.pdf-icon-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #fef2f2;
  color: #dc2626;
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  line-height: 1.1;
}

.pdf-icon-large small {
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.8;
}

.roomy-attachment-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.roomy-attachment-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roomy-attachment-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.roomy-attachment-actions-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.drive-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  text-decoration: none;
  transition: all 0.12s ease;
}

.drive-link-badge:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

.empty-attachments-box {
  text-align: center;
  padding: 1.75rem 1rem;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

/* Detail Sticky Action Bar */
.detail-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.5rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
  background: transparent;
  flex-wrap: wrap;
}

.detail-action-bar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Right Pane: Roomy & Collaborative Q&A Discussion Center
   ========================================================================== */
.detail-right-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.qa-chat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.qa-chat-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.qa-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.qa-header-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.qa-header-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.qa-count-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* Messages Feed */
.qa-messages-feed {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  background: #f8fafc;
}

.qa-empty-state {
  text-align: center;
  margin: auto;
  padding: 2.5rem 1.5rem;
  max-width: 360px;
  color: var(--text-muted);
}

.qa-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.65rem;
  opacity: 0.8;
}

.qa-empty-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.qa-empty-sub {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Feed Message Items */
.qa-feed-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  width: 100%;
}

.qa-feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.avatar-admin {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

.avatar-volunteer {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #166534;
  border: 1px solid #86efac;
}

.qa-feed-body {
  flex: 1;
  min-width: 0;
}

.qa-feed-bubble {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.12s ease;
}

.bubble-admin {
  border-left: 4px solid #6d28d9;
}

.bubble-volunteer {
  border-left: 4px solid var(--primary);
}

.qa-feed-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.qa-feed-author-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.qa-feed-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
}

.qa-feed-time {
  font-size: 0.74rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.qa-feed-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Chat Composer */
.qa-composer {
  padding: 1.1rem 1.35rem;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex-shrink: 0;
}

.qa-composer-input-wrapper {
  position: relative;
  width: 100%;
}

.qa-composer textarea {
  width: 100%;
  min-height: 72px;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  background: #f8fafc;
  transition: all 0.15s ease;
}

.qa-composer textarea:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 133, 60, 0.15);
}

.qa-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.qa-composer-tip {
  font-size: 0.76rem;
  color: #94a3b8;
}

.qa-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ==========================================================================
   Mobile & Tablet Responsive Enhancements (Native App Feel on iOS & Android)
   ========================================================================== */
@media (max-width: 960px) {
  .modal-card-detail {
    width: 96vw;
    height: 94vh;
    max-height: none;
  }

  .detail-roomy-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
    gap: 1.5rem;
  }

  .detail-left-pane {
    overflow-y: visible;
    padding-right: 0;
  }

  .detail-right-pane {
    min-height: 520px;
    height: 540px;
  }
}

@media (max-width: 860px) {
  .topbar-inner {
    padding: 0.65rem 1.25rem;
  }

  .filters-primary-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-field-status,
  .filter-field-submitter {
    width: 100%;
  }

  .filters-secondary-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .filter-actions-right {
    margin-left: 0;
    justify-content: space-between;
  }
}

/* Mobile-First Deep Polish (< 768px: iPhones & Android Phones) */
@media (max-width: 768px) {
  /* 1. Compact Header */
  .topbar-inner {
    padding: 0.6rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .brand {
    justify-content: space-between;
    width: 100%;
  }

  .brand-logo {
    height: 32px;
  }

  .brand-divider {
    display: none;
  }

  .nav-tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2rem;
    display: flex;
    gap: 0.35rem;
  }

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

  .nav-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    flex-shrink: 0;
  }

  /* 2. Container & Padding */
  .container {
    padding: 0.85rem 0.75rem 3rem;
    margin: 0.5rem auto;
  }

  /* 3. Compact 2x2 Metric Grid */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .stat-card {
    padding: 0.85rem 0.75rem;
    gap: 0.65rem;
    border-radius: 10px;
    align-items: center;
  }

  .stat-icon-wrapper {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
    border-radius: 8px;
  }

  .stat-label {
    font-size: 0.68rem;
    letter-spacing: 0.02em;
  }

  .stat-value {
    font-size: 1.22rem;
    margin-top: 0.1rem;
  }

  .stat-sub {
    font-size: 0.68rem;
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 4. Compact Filter Toolbar */
  .panel {
    border-radius: 12px;
    margin-bottom: 1.25rem;
  }

  .panel-header {
    padding: 0.85rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .panel-header-actions {
    width: 100%;
  }

  .panel-header-actions .btn {
    width: 100%;
  }

  .filters-toolbar {
    padding: 0.85rem 1rem;
    gap: 0.65rem;
  }

  .filter-search-wrapper #filter-search {
    height: 38px;
    font-size: 16px; /* Prevents iOS auto-zoom */
  }

  .filter-group {
    flex-wrap: wrap;
    width: 100%;
  }

  .filter-group input[type="date"],
  .input-prefix-wrapper input[type="number"] {
    font-size: 16px;
    height: 36px;
  }

  /* 5. Transform Table to Native Mobile Cards */
  .table-responsive {
    overflow-x: visible;
    background: transparent;
    padding: 0.5rem;
  }

  #tab-expenses-view .expenses-table {
    display: block;
    width: 100%;
  }

  #tab-expenses-view .expenses-table thead {
    display: none; /* Hide desktop table headers only for expenses cards */
  }

  #tab-expenses-view .expenses-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  #tab-expenses-view .expenses-table tr.clickable-row {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-xs);
    position: relative;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  }

  #tab-expenses-view .expenses-table tr.clickable-row:active {
    transform: scale(0.985);
    background: #f8fafc;
    border-color: #cbd5e1;
  }

  #tab-expenses-view .expenses-table td {
    display: block;
    padding: 0;
    border: none;
    background: transparent;
    width: 100% !important;
  }

  /* Mobile Card Elements */
  #tab-expenses-view .req-title {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    font-size: 0.98rem;
    line-height: 1.35;
  }

  #tab-expenses-view .req-desc-snippet {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
    white-space: normal;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
  }

  /* Submitter & Date row on card */
  #tab-expenses-view .expenses-table td:nth-child(2) {
    padding-top: 0.45rem;
    border-top: 1px dashed var(--border);
  }

  #tab-expenses-view .submitter-cell {
    gap: 0.55rem;
  }

  #tab-expenses-view .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  /* Date row */
  #tab-expenses-view .expenses-table td:nth-child(3) {
    display: none;
  }

  /* Amount & Payout card footer row */
  #tab-expenses-view .expenses-table td:nth-child(4) {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
  }

  #tab-expenses-view .amount-main {
    font-size: 1.25rem;
  }

  #tab-expenses-view .expenses-table td:nth-child(5) {
    display: none;
  }

  /* Status badge on card */
  #tab-expenses-view .expenses-table td:nth-child(6) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.35rem;
  }

  .status-action-cell {
    width: 100%;
    justify-content: space-between;
  }

  .row-arrow {
    display: inline-block;
    font-size: 1.25rem;
  }

  /* 6. Mobile Modals (Full-Height Sheet Style) */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card,
  .modal-card-detail,
  .modal-card-new-expense {
    width: 100vw;
    height: 96vh;
    max-height: 96vh;
    max-width: 100vw;
    border-radius: 18px 18px 0 0;
    border: none;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
  }

  .modal-header {
    padding: 1rem 1.15rem;
  }

  .detail-modal-title-text {
    font-size: 1.15rem;
    max-width: 280px;
  }

  .modal-body {
    padding: 1.15rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .form-row {
    flex-direction: column;
    gap: 0.85rem;
  }

  .form-group {
    margin-bottom: 0.85rem;
  }

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

  .detail-roomy-layout {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: auto;
    min-height: auto;
  }

  .detail-left-pane,
  .detail-right-pane {
    width: 100%;
    overflow: visible;
    height: auto;
    min-height: auto;
    padding-right: 0;
  }

  .qa-chat-card {
    min-height: 480px;
    height: 520px;
  }

  .upload-dropzone {
    padding: 1.5rem 1rem;
  }

  .roomy-attachment-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .roomy-attachment-actions-row {
    width: 100%;
    justify-content: flex-start;
  }
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Users & Registrations Table Styling
   ========================================================================== */
.user-actions-cell {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.45rem !important;
  white-space: nowrap !important;
}

.user-self-pill {
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  background: var(--surface-subtle) !important;
  padding: 0.25rem 0.65rem !important;
  border-radius: 6px !important;
  border: 1px solid var(--border) !important;
  display: inline-block !important;
  white-space: nowrap !important;
}


/* ==========================================================================
   Users & Registrations Table Styling (Strict Alignment)
   ========================================================================== */
.users-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  table-layout: auto !important;
}

.users-table th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 0.85rem 1.15rem !important;
  border-bottom: 1px solid var(--border) !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

.users-table td {
  padding: 0.95rem 1.15rem !important;
  border-bottom: 1px solid var(--border) !important;
  font-size: 0.88rem !important;
  vertical-align: middle !important;
  background: #ffffff !important;
}

.users-table tr:hover td {
  background-color: #f8fafc !important;
}

.user-actions-cell {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.45rem !important;
  white-space: nowrap !important;
}

.user-self-pill {
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  background: var(--surface-subtle) !important;
  padding: 0.25rem 0.65rem !important;
  border-radius: 6px !important;
  border: 1px solid var(--border) !important;
  display: inline-block !important;
  white-space: nowrap !important;
}


/* ==========================================================================
   Account & Profile Management Page
   ========================================================================== */
.account-grid-container {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.5rem;
  background: #f8fafc;
}

.account-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.account-card-stats {
  grid-column: 1 / -1;
}

.account-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.account-card-icon {
  font-size: 1.65rem;
  line-height: 1;
}

.account-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.account-card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.account-avatar-banner {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1.35rem;
}

.account-avatar-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dcfce7, #a7f3d0);
  color: #065f46;
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #86efac;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.account-avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.account-display-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.account-display-email {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.account-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.account-joined-tag {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

.account-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.acc-stat-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}

.acc-stat-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.acc-stat-lbl {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.user-chip {
  transition: all 0.15s ease;
}

.user-chip:hover {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}

@media (max-width: 860px) {
  .account-grid-container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
}
