/* ============================================
   BlueGreenPlanet — Corporate Blue Theme
   ============================================ */

:root {
  --primary:       #003087;
  --primary-light: #0055b3;
  --primary-dark:  #001f5c;
  --accent:        #0099cc;
  --white:         #ffffff;
  --gray-50:       #f8f9fa;
  --gray-100:      #f1f3f5;
  --gray-200:      #e9ecef;
  --gray-300:      #dee2e6;
  --gray-500:      var(--text-muted);
  --gray-600:      var(--text-muted);
  --gray-400:      var(--text-muted);
  --gray-700:      var(--text-muted);
  /* patch548: one standard dark-grey for ALL muted text (page + tab descriptions,
     pagination, table headings, labels). Change --text-muted to restyle globally. */
  --text-muted:    #212529;
  --gray-800:      #343a40;
  --success:       #15803d;
  --success-bg:    #dcfce7;
  --success-border:#86efac;
  --error:         #b91c1c;
  --error-bg:      #fee2e2;
  --error-border:  #fca5a5;
  --warn:          #92400e;
  --warn-bg:       #fef3c7;
  --warn-border:   #fcd34d;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.10);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.12);
  --radius:     8px;
  --radius-lg:  12px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Nav ──────────────────────────────────── */
.navbar {
  background: var(--primary);
  color: var(--white);
  padding: 0 2rem;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
}

.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 0 0.75rem;
  height: 32px;
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: var(--transition);
  white-space: nowrap;
  background: rgba(255,255,255,0.1);
}

.nav-link:hover, .nav-link.active {
  color: var(--white);
  background: rgba(255,255,255,0.15);
}

.nav-btn {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border: none;
  padding: 0 0.75rem;
  height: 32px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.nav-btn:hover { background: rgba(255,255,255,0.15); color: var(--white); }

/* Nav user pill */
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.9);
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem 0.4rem 0.4rem;
  border-radius: 2rem;
  background: rgba(255,255,255,0.1);
}

.nav-user .avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

/* ── Page layouts ─────────────────────────── */
.page-centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
  padding: 2rem 1rem;
}

.page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

/* ── Cards ───────────────────────────────── */
.card {
  background-color: var(--white);
  background-image: linear-gradient(var(--card-c3, transparent), var(--card-c3, transparent));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
body.has-sidenav .card { border: 1px solid var(--card-border, transparent); }
/* patch548: standard tab-box background on every portal page - User Support
   blue rgb(40,115,195); diagonal top-left -> bottom-right, fading only halfway
   to white at the far corner (0.12 tint -> 0.06). Overrides per-page JS tint. */
body.has-sidenav .card {
  background-image: linear-gradient(to bottom right, rgba(40,115,195,0.12) 0%, rgba(40,115,195,0.06) 100%);
  border-color: rgba(40,115,195,0.40);
}

.card-header {
  background: var(--primary);
  color: var(--white);
  padding: 1.25rem 2rem;
}

.card-header h1 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.15rem; }
.card-header p  { font-size: 0.85rem; opacity: 0.8; }
.card-body      { padding: 2rem; }

/* Login card */
.login-card { width: 100%; max-width: 660px; overflow: hidden; }
.login-card .card-body { padding: 2.5rem; }

.login-logo { display: flex; align-items: center; gap: 1rem; text-align: left; margin: -2.5rem -2.5rem 1.75rem; padding: 1.5rem 2rem; background: linear-gradient(135deg, #1565a8 0%, #1e8ac6 100%); }
.login-logo svg { width: 44px; height: 44px; flex-shrink: 0; }
.login-logo-text { display: flex; flex-direction: column; }
.login-logo h2  { font-size: 1.2rem; font-weight: 700; color: #fff; margin: 0; }
.login-logo p   { color: rgba(255,255,255,0.82); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 0.18rem; }

/* ── Tabs ─────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 1.5rem; gap: 0; }

.tab {
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: none;
  font-family: inherit;
  transition: var(--transition);
}

.tab:hover  { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel  { display: none; }
.tab-panel.active { display: block; }

/* ── Forms ───────────────────────────────── */
.form-group  { margin-bottom: 1.1rem; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

@media (max-width: 580px) { .form-row { grid-template-columns: 1fr; } }

.form-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.35rem;
}

.required-star { color: var(--error); font-size: 0.75rem; }

.form-control {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(0,85,179,0.12);
}

/* Text areas expand vertically only; their container grows to fit (patch541). */
textarea, textarea.form-control { resize: vertical; min-height: 2.6rem; overflow: auto; }

.form-control:disabled,
.form-control[readonly] {
  background: var(--gray-100);
  color: var(--gray-600);
  cursor: default;
}

/* Validation states */
.form-control.is-valid   { border-color: var(--success); }
.form-control.is-invalid { border-color: var(--error); }

.form-control.is-valid:focus  { box-shadow: 0 0 0 3px rgba(21,128,61,0.12); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(185,28,28,0.12); }

/* Inline field feedback */
.field-feedback {
  font-size: 0.77rem;
  margin-top: 0.3rem;
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.field-feedback.show    { display: flex; }
.field-feedback.error   { color: var(--error); }
.field-feedback.success { color: var(--success); }

/* Password field with toggle */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .form-control { padding-right: 2.6rem; }

.btn-toggle-pwd {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  padding: 0.2rem;
  display: flex;
  align-items: center;
  transition: color var(--transition);
  line-height: 1;
}

.btn-toggle-pwd:hover { color: var(--primary); }

/* ── Password checklist ──────────────────── */
.password-checklist {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 1rem;
}

.req-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: var(--gray-500);
  transition: color var(--transition);
}

.req-item.met   { color: var(--success); }

.req-icon {
  font-size: 0.68rem;
  width: 13px;
  text-align: center;
  flex-shrink: 0;
}

/* Confirm match indicator */
.match-indicator {
  font-size: 0.77rem;
  margin-top: 0.3rem;
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.match-indicator.show     { display: flex; }
.match-indicator.match    { color: var(--success); }
.match-indicator.no-match { color: var(--error); }

/* ── Strength bar ─────────────────────────── */
.strength-bar {
  height: 4px;
  border-radius: 2px;
  margin-top: 0.5rem;
  background: var(--gray-200);
}

.strength-bar .fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
  width: 0%;
}

.strength-label { font-size: 0.75rem; margin-top: 0.25rem; color: var(--gray-600); }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }

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

.btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--error); color: var(--white); }

.btn-sm   { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

/* Spinner */
.btn .spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn.loading .spinner  { display: block; }
.btn.loading .btn-text { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alerts ──────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
}

.alert.show   { display: flex; }
.alert-error  { background: var(--error-bg);   color: var(--error);   border: 1px solid var(--error-border); }
.alert-success{ background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.alert-warn   { background: var(--warn-bg);    color: var(--warn);    border: 1px solid var(--warn-border); }

/* ── Session timeout warning ─────────────── */
#session-warning {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #5b21b6;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  align-items: center;
  gap: 0.75rem;
  z-index: 9999;
  font-size: 0.85rem;
  white-space: nowrap;
  max-width: 90vw;
}

#session-warning.show { display: flex; }

#session-warning button {
  background: white;
  color: #5b21b6;
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

/* ── Splash / Dashboard ──────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.welcome-banner h1 { font-size: 1.7rem; font-weight: 700; margin-bottom: 0.3rem; }
.welcome-banner p  { opacity: 0.85; font-size: 0.9rem; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.info-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.info-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.info-card h3    { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-600); margin-bottom: 0.4rem; }
.info-card .value{ font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.info-card .sub  { font-size: 0.78rem; color: var(--gray-600); margin-top: 0.2rem; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.action-tile {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  text-decoration: none;
  color: var(--gray-800);
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
}

.action-tile:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.action-tile svg   { width: 38px; height: 38px; margin-bottom: 0.6rem; color: var(--primary); }
.action-tile h4    { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.2rem; }
.action-tile p     { font-size: 0.78rem; color: var(--gray-600); }

/* ── Profile page ────────────────────────── */
.profile-page { max-width: 760px; }

.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.profile-header h2 { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
/* text column flexes & wraps; action button stays top-right (patch448) */
.profile-header > div:first-child { flex: 1 1 0; min-width: 0; }
.profile-header .btn-group { flex-shrink: 0; }
.profile-header #edit-btn { margin-top: 10px; } /* drop button to title x-height (patch464) */

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.section-title:first-child { margin-top: 0; }

/* Section tabs (shared) */
.section-tabs {
  display:flex; gap:0; border-bottom:2px solid var(--gray-200);
  margin-bottom:0.75rem; flex-wrap:wrap;
}
.section-tab {
  padding:0.3rem 1.25rem; font-size:0.875rem; font-weight:600;
  border:none; background:none; cursor:pointer; color:var(--gray-500);
  border-bottom:2px solid transparent; margin-bottom:-2px;
  transition:var(--transition); font-family:inherit;
}
.section-tab.active { color:var(--primary); border-bottom-color:var(--primary); }
.section-tab:hover:not(.active) { color:var(--gray-700); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }

/* Avatar */
.avatar {
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.user-info-row .details { line-height: 1.4; }
.user-info-row .name    { font-size: 1.05rem; font-weight: 700; }
.user-info-row .role    { font-size: 0.82rem; color: var(--gray-600); }

/* Unsaved changes bar */
#unsaved-bar {
  position: sticky;
  top: 46px;
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  color: var(--warn);
  padding: 0.6rem 2rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 50;
  font-size: 0.85rem;
  font-weight: 600;
}

#unsaved-bar.show { display: flex; }

#unsaved-bar .bar-actions { display: flex; gap: 0.5rem; }

#unsaved-bar button {
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: 1.5px solid;
}

#unsaved-bar .save-bar-btn   { background: var(--warn); color: white; border-color: var(--warn); }
#unsaved-bar .cancel-bar-btn { background: transparent; color: var(--warn); border-color: var(--warn); }

/* ── Misc ────────────────────────────────── */
.text-center { text-align: center; }
.text-small  { font-size: 0.82rem; color: var(--gray-600); }
.txt-muted   { color: var(--text-muted); } /* patch548: standard dark-grey text class */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.btn-group  { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.divider    { border: none; border-top: 1px solid var(--gray-200); margin: 1.5rem 0; }

a.link { color: var(--primary-light); text-decoration: none; font-weight: 600; }
a.link:hover { text-decoration: underline; }

/* ── Address Autocomplete ─────────────────── */
.autocomplete-wrapper { position: relative; }

.ac-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.ac-item {
  padding: 0.6rem 0.875rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

.ac-item:last-child { border-bottom: none; }

.ac-item:hover,
.ac-item.focused { background: var(--gray-50); }

.ac-item.focused { outline: 2px solid var(--primary-light); outline-offset: -2px; }

.ac-main {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.15rem;
}

.ac-sub {
  font-size: 0.76rem;
  color: var(--gray-600);
}

.ac-loading {
  padding: 0.75rem 0.875rem;
  font-size: 0.82rem;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ac-empty {
  padding: 0.75rem 0.875rem;
  font-size: 0.82rem;
  color: var(--gray-600);
  font-style: italic;
}

.ac-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Address hint text */
.addr-hint {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Postal same-as toggle */
.postal-toggle {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

/* ── Readonly badge ─────────────────────── */
/* Readonly badge */
.badge-readonly {
  font-size: 0.68rem;
  background: var(--gray-200);
  color: var(--gray-600);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Terms checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 0.15rem;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-group label {
  font-size: 0.8rem;
  color: var(--gray-600);
  cursor: pointer;
  line-height: 1.4;
}

/* ── Select (state dropdown) ──────────────────────────────── */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236c757d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}
select.form-control:disabled { cursor: default; }

/* ── Phone Selector ───────────────────────────────────────── */
.phone-selector-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.phone-flag-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.75rem;
  background: var(--gray-100);
  border: 1.5px solid var(--gray-300);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--gray-800);
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
  /* no fixed height: align-items:stretch on the wrapper matches the input exactly */
}

.phone-flag-btn:hover { background: var(--gray-200); }
.phone-flag-btn:disabled { cursor: default; opacity: 0.6; }

.phone-selector-wrapper .form-control {
  border-radius: 0 var(--radius) var(--radius) 0;
  flex: 1;
  min-width: 0;
}

.phone-flag   { font-size: 1.1rem; line-height: 1; display: inline-block; }
.phone-cc     { display: inline-flex; align-items: baseline; gap: 0.3rem; }
.phone-dial   { font-size: 0.82rem; font-weight: 600; color: var(--gray-700); line-height: 1; }
.phone-caret  { font-size: 0.85rem; color: var(--gray-500); margin-left: 0.15rem; line-height: 1; }

/* Phone country dropdown */
.phone-country-dd {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 280px;
  background: var(--white);
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 600;
  overflow: hidden;
}
.phone-country-dd.open { display: flex; flex-direction: column; }

.phone-dd-top {
  padding: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.phone-dd-search {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
}
.phone-dd-search:focus { border-color: var(--primary-light); }

.phone-dd-list {
  max-height: 240px;
  overflow-y: auto;
}

.phone-dd-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
  font-size: 0.82rem;
}
.phone-dd-item:last-child { border-bottom: none; }
.phone-dd-item:hover, .phone-dd-item.active { background: var(--gray-50); }
.phone-dd-item.active { color: var(--primary); font-weight: 600; }

.phone-dd-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-dd-dial { color: var(--gray-500); font-size: 0.78rem; flex-shrink: 0; }
.phone-dd-empty { padding: 0.75rem; font-size: 0.82rem; color: var(--gray-600); text-align: center; font-style: italic; }

/* ── Forgot-password UI ───────────────────────────────────── */
.link-subtle {
  color: var(--primary-light);
  font-size: 0.82rem;
  text-decoration: none;
}
.link-subtle:hover { text-decoration: underline; }

/* Muted admin contact link — less visually dominant than primary blue */
.link-admin { color: #4a5a70; font-size: inherit; text-decoration: none; }
.link-admin:hover { text-decoration: underline; }

.reset-sent-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  padding: 1.5rem 1rem 1rem;
}
.reset-sent-box svg { margin-bottom: 0.25rem; }
.reset-sent-box h3  { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); margin: 0; }
.reset-sent-box p   { font-size: 0.875rem; color: var(--gray-600); margin: 0; }

/* .reset-dev-box removed — demo mode link no longer shown */

/* ── Nav Dropdown ─────────────────────────────────────────── */
.nav-dropdown-wrap {
  position: relative;
}
/* User pill left margin to balance right-side spacing */
.nav-dropdown-wrap:not(#nav-admin-link) {
  margin-left: 0.5rem;
}

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
  padding: 0 0.75rem;
  height: 32px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.nav-dropdown-btn:hover,
.nav-dropdown-btn.open { background: rgba(255,255,255,0.15); color: var(--white); }

.nav-dd-caret {
  opacity: 0.7;
  transition: transform var(--transition);
  flex-shrink: 0;
}
.nav-dropdown-btn.open .nav-dd-caret { transform: rotate(180deg); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  z-index: 200;
  padding: 0.35rem 0;
}

.nav-dropdown.open { display: block; }

.nav-dd-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: var(--gray-800);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
  transition: background var(--transition);
  white-space: nowrap;
}

.nav-dd-item svg { flex-shrink: 0; color: var(--gray-500); transition: color var(--transition); }

.nav-dd-item:hover                { background: #e8eef6; color: var(--primary); }
.nav-dd-item:hover svg            { color: var(--primary); }
.nav-dd-item.active               { color: var(--primary); font-weight: 600; }
.nav-dd-item.active svg           { color: var(--primary); }

.nav-dd-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 0.35rem 0;
}

.nav-dd-signout            { color: var(--error); }
.nav-dd-signout svg        { color: var(--error) !important; }
.nav-dd-signout:hover      { background: var(--error-bg); color: var(--error); }

/* ── Login two-column split layout ───────────────────────── */
.login-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
  padding: 2rem 1rem;
}

.login-split-card {
  display: grid;
  grid-template-columns: 270px 1fr;
  width: 100%;
  max-width: 900px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  align-items: stretch;
}

.login-brand-panel {
  background: linear-gradient(170deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
  color: white;
}

.login-brand-panel .brand-logo { display: flex; flex-direction: column; gap: 0.75rem; }
.login-brand-panel .brand-logo svg { width: 56px; height: 56px; }
.login-brand-panel .brand-logo h1 { font-size: 1.4rem; font-weight: 800; margin: 0; }
.login-brand-panel .brand-logo p  { font-size: 0.8rem; opacity: 0.65; margin: 0; }

.login-brand-features { display: flex; flex-direction: column; gap: 0.9rem; }

.login-brand-feature {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  opacity: 0.82;
  line-height: 1.4;
}
.login-brand-feature svg { flex-shrink: 0; }

.login-form-panel {
  background: white;
  padding: 2.5rem 2.5rem;
}

@media (max-width: 640px) {
  .login-split-card { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { padding: 2rem 1.5rem; }
}

/* ── Compact user card ───────────────────────────────────── */
.user-card-compact .card-body { padding: 0.5rem 1.5rem; }
.user-card-compact .user-info-row { margin-bottom: 0; }
.user-meta { display: flex; flex-direction: column; gap: 0.25rem; text-align: right; flex-shrink: 0; margin-left: 1.25rem; }
.user-meta-item { display: flex; flex-direction: row; gap: 0.35rem; align-items: baseline; justify-content: flex-end; line-height: 1.4; }
.user-meta-label { font-size: 0.72rem; color: var(--gray-500); }
.user-meta-item strong { font-size: 0.8rem; color: var(--gray-800); }

/* ── Collapsible field group ─────────────────────────────── */
.collapse-section { border: 1.5px solid var(--gray-200); border-radius: var(--radius); margin-bottom: 1.1rem; overflow: hidden; }
.collapse-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0.6rem 0.875rem; background: var(--gray-50); border: none; cursor: pointer; font-family: inherit; font-size: 0.825rem; font-weight: 600; color: var(--gray-800); text-align: left; transition: background var(--transition); gap: 0.5rem; }
.collapse-toggle:hover { background: var(--gray-100); }
.collapse-toggle.open { background: var(--gray-100); border-bottom: 1.5px solid var(--gray-200); }
.collapse-caret { flex-shrink: 0; color: var(--gray-500); transition: transform var(--transition); }
.collapse-toggle.open .collapse-caret { transform: rotate(180deg); }
.collapse-content { display: none; padding: 1rem 0.875rem 0.25rem; }
.collapse-content.open { display: block; }

/* ── Payment form ─────────────────────────────────────────── */
.payment-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.payment-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  background: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  transition: var(--transition);
}
.payment-tab:hover { border-color: var(--primary-light); color: var(--primary-light); }
.payment-tab.active { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
.payment-tab svg { flex-shrink: 0; }

.card-number-wrap {
  position: relative;
}
.card-number-wrap .form-control {
  padding-right: 7rem;
  letter-spacing: 0.08em;
  font-family: 'Courier New', monospace;
}
.card-type-slot {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}
.card-type-badge {
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bin-info {
  font-size: 0.78rem;
  color: var(--gray-600);
  display: block;
  margin-top: 0.3rem;
}
.bin-loading {
  font-size: 0.78rem;
  color: var(--gray-500);
  font-style: italic;
}

.payment-saved-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.payment-saved-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.payment-saved-details { flex: 1; min-width: 0; }
.payment-saved-details .label { font-size: 0.72rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; }
.payment-saved-details .value { font-weight: 600; color: var(--gray-800); font-size: 0.875rem; }

.payment-disclaimer {
  font-size: 0.75rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-100);
  padding-top: 0.75rem;
  margin-top: 1.25rem;
  display: flex;
  gap: 0.4rem;
}

/* ── Multi-payment method list ───────────────────────────── */
.pay-methods-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 1.25rem; border: 1.5px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.pay-method-row { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; background: var(--white); border-bottom: 1px solid var(--gray-100); transition: background var(--transition); }
.pay-method-row:last-child { border-bottom: none; }
.pay-method-row:hover { background: var(--gray-50); }
.pay-method-icon { width: 40px; height: 28px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; color: #fff; flex-shrink: 0; letter-spacing: 0.02em; }
.pay-method-info { flex: 1; min-width: 0; }
.pay-method-label { font-size: 0.875rem; color: var(--gray-800); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pay-method-sub { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.1rem; }
.pay-primary-badge { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; background: var(--success-bg); color: var(--success); padding: 0.1rem 0.45rem; border-radius: 999px; }
.pay-method-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.pay-empty { text-align: center; padding: 2rem 1rem; color: var(--gray-500); font-size: 0.875rem; }
.pay-add-bar { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.pay-form-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; border-bottom: 1.5px solid var(--gray-200); padding-bottom: 0.75rem; }
.pay-form-header h4 { font-size: 0.9rem; font-weight: 600; color: var(--gray-800); margin: 0; }
.btn-xs { font-size: 0.73rem !important; padding: 0.2rem 0.6rem !important; }
.btn-ghost { background: none; border: none; color: var(--gray-500); cursor: pointer; padding: 0.25rem; border-radius: var(--radius-sm); transition: color var(--transition), background var(--transition); display: flex; align-items: center; }
.btn-ghost:hover { color: var(--error); background: var(--error-bg); }

/* ── Toggle switch ───────────────────────────── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid var(--gray-200); margin-bottom: 1rem; }
.toggle-row-label { font-size: 0.88rem; font-weight: 600; color: var(--gray-800); }
.toggle-row-desc  { font-size: 0.78rem; color: var(--gray-600); margin-top: 0.1rem; }
.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; gap: 0.5rem; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { position: relative; width: 40px; height: 22px; background: var(--gray-300); border-radius: 11px; transition: background var(--transition); flex-shrink: 0; }
.toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle-switch input:checked ~ .toggle-track { background: var(--success); }
.toggle-switch input:checked ~ .toggle-track::after { transform: translateX(18px); }
.toggle-label { font-size: 0.82rem; font-weight: 500; color: var(--gray-600); min-width: 2rem; }

/* ── 2FA methods list ────────────────────────── */
.twofa-methods-list { display: flex; flex-direction: column; gap: 0; border: 1.5px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.twofa-method-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.875rem; background: var(--white); border-bottom: 1px solid var(--gray-100); }
.twofa-method-row:last-child { border-bottom: none; }
.twofa-method-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--gray-100); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; }
.twofa-method-info { flex: 1; }
.twofa-method-label { font-size: 0.83rem; font-weight: 600; color: var(--gray-800); }
.twofa-method-sub   { font-size: 0.75rem; color: var(--gray-500); }
.twofa-method-actions { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.twofa-empty { text-align: center; padding: 1.25rem; color: var(--gray-500); font-size: 0.83rem; }
.twofa-add-bar { display: flex; justify-content: flex-end; margin-top: 0.25rem; margin-bottom: 0.5rem; }

/* ── 2FA login panel ─────────────────────────── */
.twofa-panel { text-align: center; padding: 0.5rem 0 0.25rem; }
.twofa-icon-ring { width: 56px; height: 56px; border-radius: 50%; background: #eff6ff; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.twofa-code-demo { margin: 1rem 0 0.5rem; padding: 0.75rem 1rem; background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius); font-size: 0.82rem; color: var(--warn); }
.twofa-code-demo strong { font-size: 1.4rem; letter-spacing: 0.25em; display: block; margin-top: 0.25rem; color: var(--gray-800); }
.twofa-code-input { letter-spacing: 0.25em; font-size: 1.25rem; text-align: center; font-weight: 700; }

/* ── Admin inactive badge ────────────────────── */
.badge-inactive { background: #f1f5f9; color: #64748b; }

/* Compact card avatar — smaller circle */
.user-card-compact .user-info-row .avatar {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
}
/* Task #62 — save button blocked state */
.btn-blocked {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: auto !important;
}

/* Task #58 — email verified badge */
.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 9999px;
  padding: 1px 8px;
  margin-top: 3px;
}



/* perceived nav spacing (final): the pill backgrounds are nearly invisible on the dark
   header, so the eye judges spacing between TEXT/ICONS, which includes each item's
   internal padding. Equal padding (0.5rem) on every item + 0.5rem gap = a constant
   1.5rem of visual whitespace between every pair, with or without the Admin menu. */
.navbar-nav { gap: 0.5rem; }
.navbar-nav .nav-link { padding: 0 0.5rem; margin-right: 0; }
.nav-dropdown-btn { padding: 0 0.5rem; }
.nav-dropdown-wrap:not(#nav-admin-link) { margin-left: 0; }


/* ── left sidebar menu (mirrors the top menu; injected by initSideNav in app.js) ── */
.side-nav {
  position: fixed; top: 46px; left: 0; bottom: 0; width: 220px;
  background: var(--white); border-right: 1px solid var(--gray-200);
  padding: 1rem 0.75rem; overflow-y: auto; z-index: 90;
}
body.has-sidenav { padding-left: 220px; }
.snav-heading {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gray-500); padding: 0 0.75rem; margin: 1.1rem 0 0.35rem;
}
.snav-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  padding: 0.5rem 0.75rem; border-radius: var(--radius);
  color: var(--gray-800); font-size: 0.875rem; text-decoration: none;
  border: none; background: none; font-family: inherit; cursor: pointer; text-align: left;
  transition: var(--transition);
}
.snav-item svg { flex-shrink: 0; color: var(--gray-500); transition: color var(--transition); }
.snav-item:hover        { background: #e8eef6; color: var(--primary); }
.snav-item:hover svg    { color: var(--primary); }
.snav-item.active       { color: var(--primary); font-weight: 600; background: #eef4fb; }
.snav-item.active svg   { color: var(--primary); }
.snav-divider { border-top: 1px solid var(--gray-200); margin: 1rem 0.5rem 0; }
.snav-signout           { color: var(--error); margin-top: 0.5rem; }
.snav-signout svg       { color: var(--error) !important; }
.snav-signout:hover     { background: var(--error-bg); color: var(--error); }
@media (max-width: 900px) {
  .side-nav { display: none; }
  body.has-sidenav { padding-left: 0; }
}
/* full-width header above sidebar: cancel the body's sidebar offset for the navbar only */
body.has-sidenav .navbar { margin-left: -220px; }
@media (max-width: 900px) { body.has-sidenav .navbar { margin-left: 0; } }
/* same full-bleed for the admin 2FA nudge bar so its red background spans the full width */
body.has-sidenav #bgp-2fa-nudge { margin-left: -220px; }
@media (max-width: 900px) { body.has-sidenav #bgp-2fa-nudge { margin-left: 0; } }

/* left-align content beside sidebar: same 4rem gap as the admin pages
   (admin pages carry their own identical padding override, so they are unchanged) */
body.has-sidenav .page-content { margin: 0; padding: 1.5rem 4rem; }
@media (max-width: 900px) { body.has-sidenav .page-content { margin: 0 auto; padding: 2rem; } }

/* sidebar alignment (decisive): identical gap on every page incl. splash;
   !important so page-level style blocks cannot re-centre the content */
body.has-sidenav .page-content { margin: 0 !important; padding: 1.5rem 4rem !important; }
@media (max-width: 900px) { body.has-sidenav .page-content { margin: 0 auto !important; padding: 2rem !important; } }

/* full-width content beside sidebar (matches admin pages) */
body.has-sidenav .page-content { max-width: none !important; }

/* uniform title gap: same space between header banner and first content element on every page */
body.has-sidenav .page-content { padding-top: 1.5rem !important; }
body.has-sidenav .page-content > :first-child { margin-top: 0 !important; }
body.has-sidenav .page-content .profile-page > :first-child { margin-top: 0 !important; }

/* splash top offset: banner starts 20px lower to match other pages' title gap */
body.has-sidenav .page-content > .welcome-banner { margin-top: 10px !important; }

/* ── standard page footer bar ── */
.page-footer {
  border-top: 1px solid var(--gray-300);
  background: var(--gray-100);
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--gray-700);
}
.page-footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; padding: 0.3rem 1.5rem;
}
.pf-links a { color: var(--gray-700); text-decoration: none; margin-left: 1.2rem; }
.pf-links a:hover { color: var(--primary); }
/* full-width footer spanning under the fixed sidebar */
body.has-sidenav .page-footer {
  margin-left: -220px;
  width: calc(100% + 220px);
}
body.has-sidenav .page-footer-inner {
  padding-left: calc(220px + 1.5rem);
}
@media (max-width: 900px) {
  body.has-sidenav .page-footer { margin-left: 0; width: 100%; }
  body.has-sidenav .page-footer-inner { padding-left: 1.5rem; }
}
/* brand suffix on logged-in pages */
.brand-portal { margin-left: 0; font-weight: inherit; font-size: inherit; opacity: 1; }   /* flex gap (0.5rem) provides the space *//* ── generic dialog ── */
.bgp-dlg-overlay { position: fixed; inset: 0; z-index: 1500; background: rgba(0,15,45,0.55);
                   display: flex; align-items: center; justify-content: center; padding: 1rem; }
.bgp-dlg { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
           max-width: 440px; width: 100%; padding: 1.5rem; text-align: center; }
.bgp-dlg-icon { width: 44px; height: 44px; border-radius: 50%; color: #fff; font-weight: 800;
                font-size: 1.3rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.9rem; }
.bgp-dlg-msg  { font-size: 0.92rem; color: var(--gray-800); margin-bottom: 1.25rem; white-space: pre-line; }
.bgp-dlg-btns { display: flex; gap: 0.75rem; justify-content: center; }
.bgp-dlg-input { width: 100%; box-sizing: border-box; padding: 0.55rem 0.7rem; margin-bottom: 1.15rem;
                 border: 1px solid var(--gray-300); border-radius: 6px; font-size: 0.92rem; font-family: inherit; color: var(--gray-800); }
.bgp-dlg-input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(0,85,179,0.15); }

/* ── table pager ── */
.bgp-pager { display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem;
             margin-top: 0.75rem; font-size: 0.8rem; color: var(--gray-500); }
.bgp-pg-btn { background: none; border: 1px solid var(--gray-300); border-radius: var(--radius);
              padding: 0.25rem 0.7rem; cursor: pointer; font: inherit; font-size: 0.78rem; color: var(--gray-600); }
.bgp-pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.bgp-pg-btn:disabled { opacity: 0.4; cursor: default; }

/* ── admin edit badge: slow pulsing border ── */
#admin-edit-badge { border: 3px solid rgba(248,113,113,0.3); animation: bgpEditPulse 2.6s ease-in-out infinite; }
@keyframes bgpEditPulse {
  0%, 100% { border-color: rgba(248,113,113,0.2); box-shadow: 0 0 2px rgba(248,113,113,0.1); }
  50%      { border-color: #fecaca; box-shadow: 0 0 12px rgba(248,113,113,0.85); }
}

/* ── segmented verification code boxes ── */
.code-boxes { display: flex; gap: 0.5rem; justify-content: center; margin: 0.25rem 0; }
.code-box { width: 44px; height: 54px; text-align: center; font-size: 1.45rem; font-family: monospace;
            border: 1.5px solid var(--gray-300); border-radius: 8px; outline: none; transition: var(--transition); }
.code-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,48,135,0.12); }
/* ── sticky page footer + policy popup ── */
body { display: flex; flex-direction: column; min-height: 100vh; }
.page-footer { margin-top: auto; }
.bgp-policy-overlay { position: fixed; inset: 0; z-index: 1400; background: rgba(0,15,45,0.62);
                      display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.bgp-policy-card { position: relative; width: min(880px, 96vw); height: 90vh; background: #fff;
                   border-radius: var(--radius-lg); box-shadow: 0 24px 70px rgba(0,0,0,0.4);
                   overflow: hidden; display: flex; flex-direction: column; }
.bgp-policy-card iframe { border: 0; width: 100%; flex: 1; }
.bgp-policy-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px;
                    border-radius: 50%; border: none; cursor: pointer; background: rgba(255,255,255,0.9);
                    color: var(--gray-600); font-size: 1.25rem; line-height: 1;
                    display: flex; align-items: center; justify-content: center; }
.bgp-policy-close:hover { background: #fff; color: var(--gray-800); }
.bgp-policy-foot { border-top: 1px solid var(--gray-200); background: #fff;
                   padding: 0.5rem 1.25rem; font-size: 0.75rem; color: var(--gray-500); flex-shrink: 0; }
/* ── footer full-bleed + reliable bottom anchoring ── */
html { height: 100%; }
.page-content { flex: 1 0 auto; }
body.has-sidenav .page-footer { margin-left: -220px; position: relative; z-index: 95; }
body.has-sidenav .page-footer .page-footer-inner { padding-left: 1.5rem; }
@media (max-width: 900px) { body.has-sidenav .page-footer { margin-left: 0; } }
/* ── concertina sidebar ── */
.snav-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between;
               background: none; border: none; cursor: pointer; font-family: inherit; }
.snav-toggle:hover { color: var(--primary); }
.snav-caret { transition: transform var(--transition); transform: rotate(-90deg); opacity: 0.6; }
.snav-toggle.open .snav-caret { transform: rotate(0deg); }
.snav-sec.closed { display: none; }
/* active top-level nav item */
.nav-link.active-section, .nav-dropdown-btn.active-section { background: rgba(255,255,255,0.24); color: var(--white); }
/* ── contextual form help icon + popup ── */
.bgp-help-btn { position: absolute; top: 0.7rem; right: 0.7rem; z-index: 5;
                background: none; border: none; padding: 3px; cursor: pointer; line-height: 0;
                color: var(--gray-400); opacity: 0.35; transition: opacity var(--transition), color var(--transition), transform var(--transition); }
.bgp-help-btn:hover { opacity: 1; color: var(--primary);
                      filter: drop-shadow(0 0 6px rgba(0,48,135,0.5)); transform: scale(1.08); }
.bgp-help-body ol { margin: 0; padding-left: 1.25rem; }
.bgp-help-body li { font-size: 0.9rem; color: var(--gray-800); margin-bottom: 0.6rem; line-height: 1.5; }
.bgp-help-body p  { font-size: 0.9rem; color: var(--gray-800); }/* ── ghostly themed page background ── */
body.has-pagebg { background-color: #f3f6f7; }
body.has-pagebg.has-sidenav .side-nav {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(1px);
}
body.has-pagebg.has-sidenav .page-footer { background: rgba(241,243,245,0.75); }
/* user-meta clears help icon and aligns with the form content edge below */
.user-card-compact .user-meta { margin-right: 0.75rem; }

/* ── portal assistant widget ── */
#bgp-asst-launch {
  /* 0.5cm down as requested; horizontally pulled back to 8px - the full 0.5cm
     right put the button ~1px from the viewport edge. */
  position: fixed; right: 8px; bottom: calc(58px - 0.5cm); z-index: 1300;
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; box-shadow: 0 6px 20px rgba(0,48,135,0.35);
  display: flex; align-items: center; justify-content: center; opacity: 0.82;
  transition: opacity var(--transition), transform var(--transition);
}
#bgp-asst-launch:hover { opacity: 1; transform: translateY(-2px); }
#bgp-asst-launch.hidden { display: none; }
#bgp-asst-launch .bgp-asst-ico { display: block; }
#bgp-asst-launch .bgp-asst-dot { opacity: 0; transition: opacity 0.15s ease; }
#bgp-asst-launch:hover .bgp-asst-dot { opacity: 1; animation: bgpAsstDot 0.7s ease-in-out 1; }
#bgp-asst-launch:hover .bgp-asst-dot2 { animation-delay: 0.15s; }
#bgp-asst-launch:hover .bgp-asst-dot3 { animation-delay: 0.30s; }
@keyframes bgpAsstDot { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-3px); } 75% { transform: translateY(0); } }
#bgp-asst-panel {
  position: fixed; right: 20px; bottom: 58px; z-index: 1301;
  width: 360px; max-width: calc(100vw - 32px); height: 460px; max-height: calc(100vh - 96px);
  background: #fff; border: 1px solid var(--gray-200); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15,23,42,0.28); display: none; flex-direction: column; overflow: hidden;
}
#bgp-asst-panel.open { display: flex; }
.bgp-asst-head {
  background: var(--primary); color: #fff; padding: 0.7rem 1rem; font-weight: 600; font-size: 0.92rem;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.bgp-asst-close { background: none; border: none; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; opacity: 0.85; }
.bgp-asst-close:hover { opacity: 1; }
.bgp-asst-head-left { display: flex; align-items: center; gap: 0.5rem; }
.bgp-asst-home { background: none; border: none; color: #fff; cursor: pointer; padding: 0; display: flex; align-items: center; opacity: 0.9; }
.bgp-asst-home:hover { opacity: 1; }
.bgp-asst-head-right { display: flex; align-items: center; gap: 0.6rem; }
.bgp-asst-dl { background: none; border: none; color: #fff; cursor: pointer; padding: 0; display: flex; align-items: center; opacity: 0.9; }
.bgp-asst-dl:hover { opacity: 1; }
.bgp-asst-dl:disabled { opacity: 0.4; cursor: default; }
.bgp-asst-msgs { flex: 1; overflow-y: auto; padding: 0.9rem; display: flex; flex-direction: column; gap: 0.55rem; background: var(--gray-50); }
.bgp-asst-msg { max-width: 85%; padding: 0.55rem 0.8rem; border-radius: 12px; font-size: 0.88rem; line-height: 1.45; white-space: pre-wrap; }
.bgp-asst-user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bgp-asst-bot  { align-self: flex-start; background: #fff; color: var(--gray-800); border: 1px solid var(--gray-200); border-bottom-left-radius: 4px; }
.bgp-asst-typing { opacity: 0.6; font-style: italic; }
.bgp-asst-quick { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.1rem; }
.bgp-asst-chip { background: #fff; border: 1px solid var(--gray-300); border-radius: 999px; padding: 0.3rem 0.7rem;
                 font: inherit; font-size: 0.8rem; color: var(--primary); cursor: pointer; line-height: 1.2; }
.bgp-asst-chip:hover { background: var(--gray-100); border-color: var(--primary-light); }
.bgp-asst-link { color: var(--primary); font-weight: 600; text-decoration: underline; }
.bgp-asst-bot strong { font-weight: 700; }
.bgp-asst-form { display: flex; gap: 0.5rem; padding: 0.6rem; border-top: 1px solid var(--gray-200); flex-shrink: 0; }
.bgp-asst-form input { flex: 1; border: 1px solid var(--gray-300); border-radius: 20px; padding: 0.5rem 0.9rem; font: inherit; font-size: 0.88rem; outline: none; }
.bgp-asst-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,48,135,0.12); }
.bgp-asst-form button { background: var(--primary); color: #fff; border: none; border-radius: 50%; width: 38px; height: 38px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bgp-asst-form button:hover { background: var(--primary-dark); }
@media (max-width: 480px) { #bgp-asst-panel { right: 8px; bottom: 8px; height: calc(100vh - 80px); } }
/* Document System: two-across wrapping button blocks */
.doc-grid { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.doc-block { flex: 1 1 230px; min-width: 210px; }
.doc-block div[style*="display:flex"] { flex-wrap: wrap; }
.doc-block .text-small, #req-meta, #tp-meta, #sa-meta { white-space: normal; overflow-wrap: anywhere; }

/* ── BGP pill-buttons: status pills styled as small buttons ─────────── */
.badge, .badge-active, .badge-admin, .badge-inactive, .badge-locked,
.badge-paid, .badge-partial, .badge-pending, .badge-readonly,
.badge-verified, .badge-void,
.sub-status, .env-badge, .dep-flag, .pay-primary-badge, .card-type-badge {
  display: inline-block;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
  padding: 0.18rem 0.55rem !important;
  line-height: 1.4;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
