/* ==================================================================
   Grant Manager — Design System
   Reusable, theme-aware component layer (Nord dark default + light).
   Consumes the --gm-* design tokens defined by modern-theme.css /
   nord-dark.css, so it adapts automatically to html[data-theme].
   Injected into every inner-page iframe by dist/js/shell.js and
   linked directly by the Tailwind shell (main-index.php) & login.

   Contents:
     1.  Tokens / base
     2.  Focus visibility & accessibility
     3.  Buttons
     4.  Forms & validation feedback
     5.  Status indicators / badges / pills
     6.  Empty / loading / error states
     7.  Filters & table tools
     8.  Pagination
     9.  Cards & statistic tiles
    10.  Alerts / callouts
    11.  Avatars
    12.  Progress
    13.  Confirm dialog & toasts (design-system.js)
    14.  Print helpers
    15.  Shell — light mode overrides (Tailwind shell hardcoded colors)
   ================================================================== */

/* 1. Tokens / base --------------------------------------------------- */
:root,
html[data-theme="dark"],
html:not([data-theme]) {
  --gm-radius: 14px;
  --gm-radius-sm: 10px;
  --gm-radius-xs: 7px;
  --gm-focus: 0 0 0 3px var(--gm-focus-ring, rgba(136, 192, 208, 0.28));
  --gm-border-strong: #4C566A;

  --gm-bg: #242933;
  --gm-surface: #2E3440;
  --gm-surface-2: #3B4252;
  --gm-border: #434C5E;
  --gm-text: #F9FAFB;
  --gm-text-secondary: #E5E7EB;
  --gm-text-tertiary: #D1D5DB;
  --gm-text-muted: #9CA3AF;
  --text-primary: var(--gm-text);
  --text-secondary: var(--gm-text-secondary);
  --text-tertiary: var(--gm-text-tertiary);
  --text-muted: var(--gm-text-muted);
  --gm-primary: #88C0D0;
  --gm-primary-dark: #81A1C1;
  --gm-primary-light: #8FBCBB;
  --gm-danger: #F87171;
  --gm-warning: #EBCB8B;
  --gm-info: #93C5FD;
  --gm-success: #A3BE8C;
  --gm-input-bg: #3B4252;
  --gm-input-border: #4C566A;
  --gm-input-muted: #9CA3AF;
  --gm-input-placeholder: #9CA3AF;
  --gm-overlay: rgba(36, 41, 51, 0.72);
  --gm-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.22);
  --gm-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35);
  --gm-accent-soft: rgba(136, 192, 208, 0.14);
  --gm-alert-info-bg: rgba(147,197,253,0.16);
  --gm-alert-info-fg: #E5E7EB;
  --gm-alert-success-bg: rgba(163, 190, 140, 0.16);
  --gm-alert-success-fg: #E5E7EB;
  --gm-alert-warning-bg: rgba(235, 203, 139, 0.16);
  --gm-alert-warning-fg: #F9FAFB;
  --gm-alert-danger-bg: rgba(248,113,113,0.16);
  --gm-alert-danger-fg: #FEE2E2;
  --gm-row-flag-bg: rgba(248,113,113,0.16);
  --gm-btn-primary: linear-gradient(135deg, #5E81AC, #81A1C1);
  --gm-btn-primary-hover: linear-gradient(135deg, #4C6F99, #5E81AC);
  --gm-btn-primary-shadow: 0 6px 16px rgba(94, 129, 172, 0.35);
  --color-success: #A3BE8C; --color-success-bg: rgba(163,190,140,0.16);
  --color-warning: #EBCB8B; --color-warning-bg: rgba(235,203,139,0.16);
  --color-danger: #F87171; --color-danger-bg: rgba(248,113,113,0.16);
  --color-info: #93C5FD; --color-info-bg: rgba(147,197,253,0.16);
  --color-neutral: #D1D5DB; --color-neutral-bg: rgba(209,213,219,0.14);

  --gm-status-open: #88C0D0;
  --gm-status-received: #81A1C1;
  --gm-status-approved: #A3BE8C;
  --gm-status-processed: #8FBCBB;
  --gm-status-authorised: #B48EAD;
  --gm-status-reversed: #BF616A;
  --gm-status-draft: #D8DEE9;
  --gm-status-pending: #EBCB8B;
  --gm-status-cleared: #A3BE8C;
}

html[data-theme="light"] {
  --gm-radius: 14px;
  --gm-radius-sm: 10px;
  --gm-radius-xs: 7px;
  --gm-focus: 0 0 0 3px var(--gm-focus-ring, rgba(20, 184, 166, 0.18));
  --gm-border-strong: #9CA3AF;

  --gm-bg: #f1f5f9;
  --gm-surface: #ffffff;
  --gm-surface-2: #f8fafc;
  --gm-border: #D1D5DB;
  --gm-text: #111827;
  --gm-text-secondary: #374151;
  --gm-text-tertiary: #4B5563;
  --gm-text-muted: #6B7280;
  --text-primary: var(--gm-text);
  --text-secondary: var(--gm-text-secondary);
  --text-tertiary: var(--gm-text-tertiary);
  --text-muted: var(--gm-text-muted);
  --gm-primary: #0f766e;
  --gm-primary-dark: #0d5c56;
  --gm-primary-light: #14b8a6;
  --gm-danger: #991B1B;
  --gm-warning: #92400E;
  --gm-info: #1E40AF;
  --gm-success: #166534;
  --gm-input-bg: #FFFFFF;
  --gm-input-border: #D1D5DB;
  --gm-input-muted: #6B7280;
  --gm-input-placeholder: #6B7280;
  --gm-overlay: rgba(15, 23, 42, 0.45);
  --gm-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 14px rgba(15, 23, 42, 0.05);
  --gm-shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
  --gm-accent-soft: rgba(20, 184, 166, 0.12);
  --gm-alert-info-bg: #DBEAFE;
  --gm-alert-info-fg: #1E40AF;
  --gm-alert-success-bg: #DCFCE7;
  --gm-alert-success-fg: #166534;
  --gm-alert-warning-bg: #FEF3C7;
  --gm-alert-warning-fg: #92400E;
  --gm-alert-danger-bg: #FEE2E2;
  --gm-alert-danger-fg: #991B1B;
  --gm-row-flag-bg: #FEE2E2;
  --gm-btn-primary: linear-gradient(135deg, #0f766e, #0d9488);
  --gm-btn-primary-hover: linear-gradient(135deg, #0d5c56, #0f766e);
  --gm-btn-primary-shadow: 0 6px 16px rgba(15, 118, 110, 0.28);
  --color-success: #166534; --color-success-bg: #DCFCE7;
  --color-warning: #92400E; --color-warning-bg: #FEF3C7;
  --color-danger: #991B1B;  --color-danger-bg: #FEE2E2;
  --color-info: #1E40AF;    --color-info-bg: #DBEAFE;
  --color-neutral: #374151; --color-neutral-bg: #F3F4F6;
  --gm-table-head-text: #1F2937;
  --gm-table-body-text: #111827;
  --gm-table-secondary-text: #4B5563;
  --gm-table-totals-text: #111827;

  --gm-status-open: #0e7490;
  --gm-status-received: #2563eb;
  --gm-status-approved: #059669;
  --gm-status-processed: #0d9488;
  --gm-status-authorised: #7c3aed;
  --gm-status-reversed: #dc2626;
  --gm-status-draft: #475569;
  --gm-status-pending: #d97706;
  --gm-status-cleared: #059669;
}

html,
body {
  font-family: var(--gm-font, "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Row flag (e.g. non-acquitted) — theme-aware, survives zebra + injected theme */
tr.gm-row-flag td {
  background-color: var(--gm-row-flag-bg, rgba(191, 97, 106, 0.18)) !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--gm-display, var(--gm-font, "DM Sans", sans-serif));
  letter-spacing: -0.02em;
}

/* 2. Focus visibility & accessibility -------------------------------- */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--gm-primary, #88C0D0);
  outline-offset: 2px;
  border-radius: 4px;
}
.form-control:focus,
.gm-input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--gm-primary, #88C0D0);
  outline-offset: 1px;
}

.gm-skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 10000;
  padding: 0.6rem 1rem;
  background: var(--gm-surface, #2E3440);
  color: var(--gm-text, #ECEFF4);
  border-radius: 0 0 var(--gm-radius-xs) 0;
  font-size: 0.85rem;
  font-weight: 600;
}
.gm-skip-link:focus {
  left: 0;
  color: var(--gm-primary, #88C0D0);
}

.custom-control.custom-switch {
  --gm-switch-width: 44px;
  --gm-switch-height: 24px;
  --gm-switch-thumb: 18px;
  --gm-switch-gap: 12px;
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--gm-switch-height);
  padding-left: calc(var(--gm-switch-width) + var(--gm-switch-gap));
  margin-bottom: 0.75rem;
}

.custom-switch .custom-control-input {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 2;
  width: var(--gm-switch-width);
  height: var(--gm-switch-height);
  margin: 0;
  transform: translateY(-50%);
  opacity: 0;
  cursor: pointer;
}

.custom-switch .custom-control-label {
  display: flex;
  align-items: center;
  min-height: var(--gm-switch-height);
  padding-left: 0;
  color: var(--gm-text-secondary);
  line-height: 1.35;
  cursor: pointer;
}

.custom-switch .custom-control-label::before,
.custom-switch .custom-control-label::after {
  position: absolute;
  content: "";
  pointer-events: none;
  box-sizing: border-box;
}

.custom-switch .custom-control-label::before {
  left: calc(-1 * (var(--gm-switch-width) + var(--gm-switch-gap)));
  top: 50%;
  width: var(--gm-switch-width);
  height: var(--gm-switch-height);
  margin-top: calc(var(--gm-switch-height) / -2);
  border: 1px solid var(--gm-input-border);
  border-radius: calc(var(--gm-switch-height) / 2);
  background: var(--gm-input-bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.custom-switch .custom-control-label::after {
  left: calc(-1 * (var(--gm-switch-width) + var(--gm-switch-gap)) + 3px);
  top: 50%;
  width: var(--gm-switch-thumb);
  height: var(--gm-switch-thumb);
  margin-top: calc(var(--gm-switch-thumb) / -2);
  border-radius: 50%;
  background: var(--gm-text-muted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
  border-color: var(--gm-primary);
  background: var(--gm-primary);
  box-shadow: 0 0 0 3px var(--gm-accent-soft);
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
  background: var(--gm-surface);
  transform: translateX(calc(var(--gm-switch-width) - var(--gm-switch-thumb) - 6px));
}

.custom-switch .custom-control-input:not(:disabled):active ~ .custom-control-label::before {
  border-color: var(--gm-primary);
  background: var(--gm-primary);
}

.custom-switch .custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 3px var(--gm-accent-soft);
}

.custom-switch .custom-control-input:focus-visible ~ .custom-control-label::before {
  outline: 2px solid var(--gm-primary);
  outline-offset: 2px;
}

.custom-switch .custom-control-input:disabled,
.custom-switch .custom-control-input:disabled ~ .custom-control-label {
  cursor: not-allowed;
}

.custom-switch .custom-control-input:disabled ~ .custom-control-label {
  color: var(--gm-text-muted);
  opacity: 0.65;
}

.custom-switch .custom-control-input:disabled ~ .custom-control-label::before {
  background: var(--gm-surface-2);
  border-color: var(--gm-border);
  box-shadow: none;
}

.custom-switch .custom-control-input:disabled ~ .custom-control-label::after {
  background: var(--gm-border-strong);
  box-shadow: none;
}

.bootstrap-switch {
  box-sizing: border-box;
  display: inline-block;
  position: relative;
  direction: ltr;
  text-align: left;
  line-height: 8px;
  user-select: none;
  width: 44px !important;
  height: 24px !important;
  min-width: 44px;
  border: 1px solid var(--gm-input-border) !important;
  border-radius: 999px !important;
  background: var(--gm-input-bg) !important;
  box-shadow: none !important;
  overflow: hidden;
  vertical-align: middle;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.bootstrap-switch .bootstrap-switch-container {
  display: inline-block;
  position: relative;
  top: 0;
  width: 66px !important;
  height: 22px !important;
  border-radius: 999px;
  transform: translate3d(0, 0, 0);
  transition: margin-left 0.18s ease;
}

.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off,
.bootstrap-switch .bootstrap-switch-label {
  box-sizing: border-box;
  width: 22px !important;
  height: 22px !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 0 !important;
  line-height: 22px !important;
  text-align: center;
  vertical-align: middle;
}

.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off,
.bootstrap-switch .bootstrap-switch-label {
  display: table-cell;
}

.bootstrap-switch input[type="checkbox"],
.bootstrap-switch input[type="radio"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  opacity: 0 !important;
  pointer-events: none;
}

.bootstrap-switch .bootstrap-switch-handle-on {
  background: var(--gm-primary) !important;
}

.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success { background: var(--gm-success) !important; }
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger { background: var(--gm-danger) !important; }
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info { background: var(--gm-info) !important; }
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning { background: var(--gm-warning) !important; }
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary { background: var(--gm-primary) !important; }

.bootstrap-switch .bootstrap-switch-handle-off {
  background: var(--gm-input-border) !important;
}

.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success { background: var(--gm-success) !important; }
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger { background: var(--gm-danger) !important; }
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info { background: var(--gm-info) !important; }
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning { background: var(--gm-warning) !important; }
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary { background: var(--gm-primary) !important; }

.bootstrap-switch .bootstrap-switch-label {
  border-radius: 50% !important;
  background: var(--gm-surface) !important;
  box-shadow: inset 0 0 0 3px var(--gm-surface);
}

.bootstrap-switch.bootstrap-switch-focused {
  border-color: var(--gm-primary) !important;
  box-shadow: 0 0 0 3px var(--gm-accent-soft) !important;
}

.bootstrap-switch.bootstrap-switch-disabled,
.bootstrap-switch.bootstrap-switch-readonly {
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  .custom-switch .custom-control-label::before,
  .custom-switch .custom-control-label::after,
  .bootstrap-switch {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 3. Buttons --------------------------------------------------------- */
.gm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--gm-radius-sm, 10px);
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}
.gm-btn:active {
  transform: translateY(1px);
}
.gm-btn:disabled,
.gm-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.gm-btn-primary {
  background: var(--gm-btn-primary, linear-gradient(135deg, #5E81AC, #81A1C1));
  color: #fff !important;
  box-shadow: var(--gm-btn-primary-shadow, 0 6px 16px rgba(94, 129, 172, 0.35));
}
.gm-btn-primary:hover,
.gm-btn-primary:focus-visible {
  background: var(--gm-btn-primary-hover, linear-gradient(135deg, #4C6F99, #5E81AC));
  color: #fff !important;
}

.gm-btn-secondary,
.gm-btn-default {
  background: var(--gm-surface-2, #3B4252);
  border: 1px solid var(--gm-border, #434C5E);
  color: var(--gm-text, #ECEFF4) !important;
}
.gm-btn-secondary:hover,
.gm-btn-default:hover {
  border-color: var(--gm-primary, #88C0D0);
  color: var(--gm-primary, #88C0D0) !important;
}

.gm-btn-danger {
  background: linear-gradient(135deg, #A54E56, var(--gm-danger, #BF616A));
  color: #fff !important;
}
.gm-btn-success {
  background: linear-gradient(135deg, #8FAF78, var(--gm-success, #A3BE8C));
  color: #fff !important;
}
.gm-btn-warning {
  background: linear-gradient(135deg, #D08770, var(--gm-warning, #EBCB8B));
  color: #242933 !important;
}

.gm-btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--gm-text-muted, #9AA4B5) !important;
}
.gm-btn-ghost:hover {
  background: var(--gm-surface-2, #3B4252);
  color: var(--gm-text, #ECEFF4) !important;
}

.gm-btn-outline {
  background: transparent;
  border: 1.5px solid var(--gm-primary, #88C0D0);
  color: var(--gm-primary, #88C0D0) !important;
}
.gm-btn-outline:hover {
  background: var(--gm-primary, #88C0D0);
  color: #242933 !important;
}
html[data-theme="light"] .gm-btn-outline:hover {
  color: #fff !important;
}

.gm-btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  border-radius: var(--gm-radius-xs, 7px);
}
.gm-btn-lg {
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
}
.gm-btn-block {
  display: flex;
  width: 100%;
}

/* 4. Forms & validation feedback ------------------------------------- */
.gm-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.gm-field > label {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--gm-text, #ECEFF4);
  margin: 0;
}
.gm-field .gm-hint {
  font-size: 0.78rem;
  color: var(--gm-text-muted, #9AA4B5);
}
.gm-required {
  color: var(--gm-danger, #BF616A);
  margin-left: 0.15rem;
}

.gm-feedback {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.5rem;
  border-radius: var(--gm-radius-xs, 7px);
  color: var(--gm-danger, #BF616A);
  background: var(--gm-alert-danger-bg, rgba(191, 97, 106, 0.14));
}
.gm-feedback.is-valid {
  color: var(--gm-success, #A3BE8C);
  background: var(--gm-alert-success-bg, rgba(163, 190, 140, 0.14));
}

.gm-field .is-invalid {
  border-color: var(--gm-danger, #BF616A) !important;
  box-shadow: 0 0 0 3px rgba(191, 97, 106, 0.2) !important;
}
.gm-field .is-valid {
  border-color: var(--gm-success, #A3BE8C) !important;
}

.gm-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--gm-text, #ECEFF4);
  cursor: pointer;
}
.gm-check input[type="checkbox"],
.gm-check input[type="radio"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--gm-primary, #88C0D0);
  margin: 0;
}

/* 5. Status indicators / badges / pills ------------------------------ */
.gm-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--gm-surface-2, #3B4252);
  color: var(--gm-text-muted, #9AA4B5);
  border: 1px solid var(--gm-border, #434C5E);
}
.gm-status .gm-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: currentColor;
  flex-shrink: 0;
}
.gm-status.is-open          { color: var(--gm-status-open, #88C0D0); border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.gm-status.is-received      { color: var(--gm-status-received, #81A1C1); border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.gm-status.is-approved      { color: var(--gm-status-approved, #A3BE8C); border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.gm-status.is-processed     { color: var(--gm-status-processed, #8FBCBB); border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.gm-status.is-authorised    { color: var(--gm-status-authorised, #B48EAD); border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.gm-status.is-reversed,
.gm-status.is-cancelled,
.gm-status.is-void          { color: var(--gm-status-reversed, #BF616A); border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.gm-status.is-draft         { color: var(--gm-status-draft, #D8DEE9); border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.gm-status.is-pending       { color: var(--gm-status-pending, #EBCB8B); border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.gm-status.is-cleared       { color: var(--gm-status-cleared, #A3BE8C); border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }

.gm-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}
.gm-pill.is-success { background: var(--gm-alert-success-bg, rgba(163, 190, 140, 0.18)); color: var(--gm-success, #A3BE8C); }
.gm-pill.is-danger  { background: var(--gm-alert-danger-bg, rgba(191, 97, 106, 0.18)); color: var(--gm-danger, #BF616A); }
.gm-pill.is-warning { background: var(--gm-alert-warning-bg, rgba(235, 203, 139, 0.16)); color: var(--gm-warning, #EBCB8B); }
.gm-pill.is-info    { background: var(--gm-alert-info-bg, rgba(94, 129, 172, 0.18)); color: var(--gm-info, #81A1C1); }
.gm-pill.is-muted   { background: var(--gm-surface-2, #3B4252); color: var(--gm-text-muted, #9AA4B5); }

/* 6. Empty / loading / error states ----------------------------------- */
.gm-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.6rem;
  padding: 3rem 1.5rem;
  color: var(--gm-text-muted, #9AA4B5);
}
.gm-state .gm-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--gm-radius, 14px);
  font-size: 1.4rem;
  color: var(--gm-primary, #88C0D0);
  background: var(--gm-accent-soft, rgba(136, 192, 208, 0.14));
}
.gm-state .gm-state-title {
  font-family: var(--gm-display, "DM Sans", sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gm-text, #ECEFF4);
}
.gm-state .gm-state-hint {
  font-size: 0.85rem;
  max-width: 28rem;
}
.gm-state .gm-state-action {
  margin-top: 0.4rem;
}

.gm-spinner {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  border: 2.5px solid var(--gm-border, #434C5E);
  border-top-color: var(--gm-primary, #88C0D0);
  border-radius: 999px;
  animation: gm-spin 0.7s linear infinite;
}
@keyframes gm-spin {
  to { transform: rotate(360deg); }
}
.gm-spinner-sm { width: 0.9rem; height: 0.9rem; border-width: 2px; }
.gm-spinner-lg { width: 2.2rem; height: 2.2rem; border-width: 3.5px; }

.gm-loading-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem;
  color: var(--gm-text-muted, #9AA4B5);
  font-size: 0.85rem;
  font-weight: 500;
}

.gm-error-state {
  border: 1px solid var(--gm-danger, #BF616A);
  background: var(--gm-alert-danger-bg, rgba(191, 97, 106, 0.12));
  color: var(--gm-text, #ECEFF4);
  border-radius: var(--gm-radius-sm, 10px);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.gm-error-state > .fa,
.gm-error-state > i {
  color: var(--gm-danger, #BF616A);
  margin-top: 0.15rem;
}
.gm-error-state .gm-error-title {
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.gm-error-state .gm-error-detail {
  font-size: 0.85rem;
  color: var(--gm-text-muted, #9AA4B5);
}

/* 7. Filters & table tools -------------------------------------------- */
.gm-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--gm-radius-sm, 10px);
  background: var(--gm-surface, #2E3440);
  border: 1px solid var(--gm-border, #434C5E);
  margin-bottom: 1rem;
}
.gm-filter-bar .gm-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gm-text-muted, #9AA4B5);
  margin-right: 0.15rem;
}
.gm-filter-bar input,
.gm-filter-bar select,
.gm-filter-bar .form-control {
  min-height: 36px;
  width: auto;
}
.gm-filter-spacer {
  flex: 1;
}

.gm-table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.gm-table-tools .dataTables_filter,
.gm-table-tools .dataTables_length {
  display: inline-block;
}

/* 7a. Overflow and accessible truncation ------------------------------- */
/*
 * Descriptive cells are safely clipped inside fixed table boundaries. Add
 * gm-critical or gm-wrap to financial identifiers/values that must remain
 * complete and wrap instead of truncating.
 */
table,
.table,
.gm-table {
  max-width: 100%;
}

.table,
.gm-table,
.gm-overflow-table {
  table-layout: fixed;
  width: 100%;
}

table:not(.gm-free-table) {
  table-layout: fixed;
  width: 100%;
}

table td,
table th,
.table td,
.table th,
.gm-table td,
.gm-table th,
.gm-overflow-table td,
.gm-overflow-table th {
  min-width: 0;
  max-width: 32rem;
}

table td:not(.gm-critical):not(.gm-wrap),
.table td:not(.gm-critical):not(.gm-wrap),
.gm-table td:not(.gm-critical):not(.gm-wrap),
.gm-overflow-table td:not(.gm-critical):not(.gm-wrap) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table th,
.table th,
.gm-table th,
.gm-overflow-table th,
table td.gm-wrap,
.table td.gm-wrap,
.gm-table td.gm-wrap,
.gm-overflow-table td.gm-wrap,
table td.gm-critical,
.table td.gm-critical,
.gm-table td.gm-critical,
.gm-overflow-table td.gm-critical {
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

/* Existing semantic classes identify values that must remain complete. */
td[class*="amount"], td[class*="date"], td[class*="ref"],
td[class*="code"], td[class*="total"], td[class*="balance"],
td[class*="currency"], td[class*="number"] {
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.card,
.card-body,
.card-header,
.gm-card,
.gm-card-header,
.gm-card-body,
.gm-stat-card,
.gm-dropdown-item,
.gm-filter-bar,
.form-group,
.input-group,
.row > [class*="col-"] {
  min-width: 0;
}

.card-title,
.gm-card-title,
.gm-stat-label,
.gm-dropdown-item,
.gm-filter-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title,
.gm-card-title,
.gm-stat-label,
.gm-dropdown-item,
.gm-filter-label {
  max-width: 100%;
}

.form-control,
select,
input,
textarea,
.select2-container,
.select2-selection {
  max-width: 100%;
  min-width: 0;
}

input[type="number"],
input[type="date"],
input[data-gm-critical],
.gm-critical {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.gm-overflow-tooltip {
  position: fixed;
  z-index: 2000;
  max-width: min(32rem, calc(100vw - 2rem));
  padding: .45rem .6rem;
  border: 1px solid var(--gm-border-strong, #4C566A);
  border-radius: var(--gm-radius-xs, 7px);
  background: var(--gm-surface-2, #3B4252);
  color: var(--gm-text, #ECEFF4);
  box-shadow: var(--gm-shadow-lg, 0 12px 40px rgba(0,0,0,.35));
  font-size: .78rem;
  line-height: 1.35;
  pointer-events: none;
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
  table td:not(.gm-critical):not(.gm-wrap),
  .table td:not(.gm-critical):not(.gm-wrap),
  .gm-table td:not(.gm-critical):not(.gm-wrap) {
    max-width: 14rem;
  }
}

/* 8. Pagination ------------------------------------------------------- */
.gm-pagination,
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
}
.gm-pagination li,
.pagination li {
  list-style: none;
}
.gm-pagination .page-link,
.pagination .page-link,
.gm-pagination a,
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: var(--gm-radius-xs, 7px);
  border: 1px solid var(--gm-border, #434C5E);
  background: var(--gm-surface, #2E3440);
  color: var(--gm-text, #ECEFF4);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.gm-pagination a:hover,
.pagination a:hover,
.gm-pagination .page-link:hover,
.pagination .page-link:hover {
  background: var(--gm-surface-2, #3B4252);
  color: var(--gm-primary, #88C0D0);
}
.gm-pagination .active a,
.gm-pagination .page-item.active .page-link,
.pagination .active a,
.pagination .page-item.active .page-link {
  background: var(--gm-primary, #88C0D0);
  border-color: var(--gm-primary, #88C0D0);
  color: #242933;
  font-weight: 700;
}
html[data-theme="light"] .gm-pagination .active a,
html[data-theme="light"] .pagination .active a,
html[data-theme="light"] .gm-pagination .page-item.active .page-link,
html[data-theme="light"] .pagination .page-item.active .page-link {
  color: #fff;
}
.gm-pagination .disabled a,
.pagination .disabled a {
  opacity: 0.5;
  pointer-events: none;
}

/* 9. Cards & statistic tiles ------------------------------------------ */
.gm-card {
  background: var(--gm-surface, #2E3440);
  border: 1px solid var(--gm-border, #434C5E);
  border-radius: var(--gm-radius, 14px);
  box-shadow: var(--gm-shadow, 0 1px 2px rgba(0,0,0,0.2), 0 8px 24px rgba(0,0,0,0.22));
  overflow: hidden;
}
.gm-card .gm-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gm-border, #434C5E);
  font-weight: 650;
  font-size: 1.02rem;
}
.gm-card .gm-card-body {
  padding: 1.15rem 1.25rem;
}
.gm-card .gm-card-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--gm-border, #434C5E);
  background: var(--gm-surface-2, #3B4252);
}

.gm-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.gm-stat-card {
  position: relative;
  background: var(--gm-surface, #2E3440);
  border: 1px solid var(--gm-border, #434C5E);
  border-radius: var(--gm-radius, 14px);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--gm-shadow, 0 1px 2px rgba(0,0,0,0.2));
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gm-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--gm-shadow-lg, 0 12px 40px rgba(0,0,0,0.35));
}
.gm-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.gm-stat-card.is-success::before { background: linear-gradient(90deg, #A3BE8C, #8FBCBB); }
.gm-stat-card.is-danger::before  { background: linear-gradient(90deg, #BF616A, #D08770); }
.gm-stat-card.is-info::before    { background: linear-gradient(90deg, #5E81AC, #88C0D0); }
.gm-stat-card.is-warning::before { background: linear-gradient(90deg, #D08770, #EBCB8B); }
.gm-stat-card .gm-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  font-size: 1.05rem;
  color: var(--gm-primary, #88C0D0);
  background: var(--gm-accent-soft, rgba(136, 192, 208, 0.14));
  margin-bottom: 0.6rem;
}
.gm-stat-card .gm-stat-value {
  font-family: var(--gm-display, "DM Sans", sans-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gm-text, #ECEFF4);
  font-variant-numeric: tabular-nums;
}
.gm-stat-card .gm-stat-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gm-text-muted, #9AA4B5);
}

/* 10. Alerts / callouts ----------------------------------------------- */
.gm-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-radius: var(--gm-radius-sm, 10px);
  border: 1px solid transparent;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.gm-alert.is-info    { background: var(--gm-alert-info-bg, rgba(94,129,172,0.18)); color: var(--gm-alert-info-fg, #D8DEE9); border-color: rgba(129,161,193,0.4); }
.gm-alert.is-success { background: var(--gm-alert-success-bg, rgba(163,190,140,0.18)); color: var(--gm-alert-success-fg, #E5E9F0); border-color: rgba(163,190,140,0.4); }
.gm-alert.is-warning { background: var(--gm-alert-warning-bg, rgba(235,203,139,0.16)); color: var(--gm-alert-warning-fg, #ECEFF4); border-color: rgba(235,203,139,0.4); }
.gm-alert.is-danger  { background: var(--gm-alert-danger-bg, rgba(191,97,106,0.18)); color: var(--gm-alert-danger-fg, #ECEFF4); border-color: rgba(191,97,106,0.4); }
.gm-alert .gm-alert-icon {
  margin-top: 0.1rem;
}
.gm-alert .gm-alert-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.15rem;
}
.gm-alert .gm-alert-close:hover { opacity: 1; }

/* 11. Avatars ---------------------------------------------------------- */
.gm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gm-text, #ECEFF4);
  background: var(--gm-accent-soft, rgba(136, 192, 208, 0.14));
  border: 1px solid var(--gm-border, #434C5E);
  overflow: hidden;
  flex-shrink: 0;
}
.gm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gm-avatar-sm { width: 1.75rem; height: 1.75rem; font-size: 0.65rem; }
.gm-avatar-lg { width: 3rem; height: 3rem; font-size: 1rem; }

/* 12. Progress --------------------------------------------------------- */
.gm-progress {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--gm-surface-2, #3B4252);
  overflow: hidden;
}
.gm-progress .gm-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gm-primary-dark, #5E81AC), var(--gm-primary, #88C0D0));
  transition: width 0.3s ease;
}
.gm-progress .gm-progress-bar.is-danger  { background: var(--gm-danger, #BF616A); }
.gm-progress .gm-progress-bar.is-warning { background: var(--gm-warning, #EBCB8B); }
.gm-progress .gm-progress-bar.is-success { background: var(--gm-success, #A3BE8C); }

/* 13. Confirm dialog & toasts (design-system.js) ----------------------- */
.gm-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--gm-overlay, rgba(36, 41, 51, 0.72));
  animation: gm-fade-in 0.15s ease;
}
.gm-confirm {
  width: 100%;
  max-width: 26rem;
  border-radius: var(--gm-radius, 14px);
  border: 1px solid var(--gm-border, #434C5E);
  background: var(--gm-surface, #2E3440);
  color: var(--gm-text, #ECEFF4);
  box-shadow: var(--gm-shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.35));
  overflow: hidden;
  animation: gm-rise 0.16s ease;
}
.gm-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gm-border, #434C5E);
  background: var(--gm-surface-2, #3B4252);
  font-weight: 700;
}
.gm-confirm-header .gm-confirm-icon {
  color: var(--gm-danger, #BF616A);
}
.gm-confirm-body {
  padding: 1.1rem 1.25rem;
  font-size: 0.92rem;
  line-height: 1.5;
}
.gm-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--gm-border, #434C5E);
  background: var(--gm-surface-2, #3B4252);
}

.gm-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1070;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}
.gm-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  border-radius: var(--gm-radius-sm, 10px);
  border: 1px solid var(--gm-border, #434C5E);
  background: var(--gm-surface, #2E3440);
  color: var(--gm-text, #ECEFF4);
  box-shadow: var(--gm-shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.35));
  animation: gm-rise 0.18s ease;
  font-size: 0.88rem;
  line-height: 1.4;
}
.gm-toast .gm-toast-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--gm-text-muted, #9AA4B5);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem;
}
.gm-toast .gm-toast-close:hover { color: var(--gm-text, #ECEFF4); }
.gm-toast.is-success { border-color: var(--gm-success, #A3BE8C); }
.gm-toast.is-success .gm-toast-icon { color: var(--gm-success, #A3BE8C); }
.gm-toast.is-danger { border-color: var(--gm-danger, #BF616A); }
.gm-toast.is-danger .gm-toast-icon { color: var(--gm-danger, #BF616A); }
.gm-toast.is-warning { border-color: var(--gm-warning, #EBCB8B); }
.gm-toast.is-warning .gm-toast-icon { color: var(--gm-warning, #EBCB8B); }
.gm-toast.is-info { border-color: var(--gm-info, #81A1C1); }
.gm-toast.is-info .gm-toast-icon { color: var(--gm-info, #81A1C1); }

@keyframes gm-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes gm-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 14. Print helpers ----------------------------------------------------- */
.gm-print-hidden {
  display: none !important;
}
@media print {
  .gm-print-visible { display: block !important; }
}

/* 15. Shell — light mode overrides ---------------------------------------
   The Tailwind shell (tailwind.css) hardcodes dark colors. These rules
   re-theme the shell chrome when html[data-theme="light"].            */
html[data-theme="light"] body {
  background-color: #f1f5f9;
}
html[data-theme="light"] .gm-topbar,
html[data-theme="light"] .gm-iframe-bar {
  background-color: #ffffff;
  border-color: #e2e8f0;
}
html[data-theme="light"] .gm-topbar-btn {
  color: #475569;
}
html[data-theme="light"] .gm-topbar-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

html[data-theme="light"] .gm-dropdown-menu,
html[data-theme="light"] .gm-modal-dialog {
  background-color: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .gm-dropdown-header {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}
html[data-theme="light"] .gm-dropdown-item {
  color: #0f172a;
  border-color: rgba(226, 232, 240, 0.8);
}
html[data-theme="light"] .gm-dropdown-item:hover {
  background-color: #f1f5f9;
}
html[data-theme="light"] .gm-dropdown-footer {
  color: #0d9488;
}
html[data-theme="light"] .gm-modal-header,
html[data-theme="light"] .gm-modal-body {
  color: #0f172a;
  border-color: #e2e8f0;
}

html[data-theme="light"] .gm-input,
html[data-theme="light"] .gm-input-addon {
  background-color: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}
html[data-theme="light"] .gm-input::placeholder {
  color: #94a3b8;
}
html[data-theme="light"] .gm-input:focus {
  border-color: #14b8a6;
}

html[data-theme="light"] .gm-tab-link {
  color: #64748b;
}
html[data-theme="light"] .gm-tab-link:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}
html[data-theme="light"] .gm-tab-item.gm-active .gm-tab-link {
  color: #0d9488;
  background-color: rgba(20, 184, 166, 0.1);
}
html[data-theme="light"] .gm-iframe-empty,
html[data-theme="light"] .gm-iframe-loading {
  color: #64748b;
}
html[data-theme="light"] .gm-iframe-empty h2,
html[data-theme="light"] .gm-iframe-loading h2 {
  color: #475569;
}

html[data-theme="light"] .gm-table thead th {
  background-color: #f8fafc;
  color: #64748b;
}
html[data-theme="light"] .gm-table tbody td {
  border-color: rgba(226, 232, 240, 0.8);
  color: #0f172a;
}

html[data-theme="light"] .gm-btn-primary {
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: #ffffff;
}
html[data-theme="light"] .gm-btn-primary:hover {
  background: linear-gradient(135deg, #0d5c56, #0f766e);
}
html[data-theme="light"] .gm-btn-danger {
  color: #ffffff;
}
html[data-theme="light"] .gm-theme-toggle {
  background-color: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}
html[data-theme="light"] .gm-theme-toggle:hover {
  border-color: #14b8a6;
  color: #0d9488;
  background-color: rgba(20, 184, 166, 0.08);
}

/* Keep the sidebar deep in both themes for a premium, focused nav. */
html[data-theme="light"] .gm-sidebar,
html[data-theme="light"] .gm-brand {
  background-color: #0b1220;
}
html[data-theme="light"] .gm-brand {
  border-color: rgba(255, 255, 255, 0.08);
}

/* Login card anchors the absolute theme toggle (both themes). */
.gm-login-card {
  position: relative;
}
html[data-theme="light"] .gm-user-panel {
  border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="light"] .gm-user-name {
  color: #e2e8f0;
}
html[data-theme="light"] .gm-treeview-menu {
  border-color: rgba(255, 255, 255, 0.08);
}

/* =====================================================================
   MOBILE SAFETY NET
   Applied below the tablet breakpoint to every page that loads the
   design system (shell, login, iframe pages). It prevents the most
   common small-screen failures without altering desktop layouts.
   ===================================================================== */
@media (max-width: 767.98px) {
  /* 14px text on inputs triggers iOS Safari zoom-on-focus; keep inputs at 16px. */
  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* Media never overflows its containing layout. */
  img,
  video,
  canvas,
  svg {
    max-width: 100%;
    height: auto;
  }

  /* Wide tables keep scrolling inside their wrapper instead of the page. */
  .table-responsive,
  .table-wrap,
  .gm-table-scroll,
  .overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Comfortable hit areas for icon-only shell controls. */
  .gm-topbar-btn,
  .gm-home-btn {
    min-width: 2.5rem;
    min-height: 2.5rem;
  }

  /* Drop avatar-driven page headers stack cleanly. */
  .gm-page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
