/* ═══════════════════════════════════════════════════════════════
   Station 2501 — HOHRS Dark Theme
   Hennepin Overland Railway Historical Society
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --night:          #07101a;
  --night-2:        #0d1c2b;
  --night-3:        #132436;
  --panel:          rgba(255,255,255,0.04);
  --panel-solid:    #111e2c;
  --border:         rgba(255,255,255,0.08);
  --border-bright:  rgba(255,255,255,0.15);
  --green:          #0b4f2a;
  --green-light:    #1a7a42;
  --green-glow:     rgba(11,79,42,0.45);
  --green-mid:      #15623a;
  --gold:           #f3b200;
  --gold-dark:      #c78f00;
  --gold-glow:      rgba(243,178,0,0.35);
  --text:           #e8eef4;
  --text-muted:     #7a99b0;
  --text-dim:       #4a6070;
  --red:            #c0392b;
  --red-light:      #e74c3c;
  --amber:          #e67e22;
  --info:           #2e86c1;
  --info-light:     #3fa0d5;
  --radius:         14px;
  --radius-sm:      9px;
}

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--night);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Gradient background + starfield */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 40% at 20% -10%, rgba(11,79,42,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 85% 5%, rgba(243,178,0,0.10) 0%, transparent 55%),
    linear-gradient(180deg, #07101a 0%, #0a1622 40%, #0d1c2b 100%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 10%, rgba(255,255,255,0.55) 0%, transparent 100%),
    radial-gradient(1px 1px at 72% 7%,  rgba(255,255,255,0.45) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 4%, rgba(255,255,255,0.65) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 16%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 14%, rgba(255,255,255,0.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 28% 19%, rgba(255,255,255,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 21%, rgba(255,255,255,0.38) 0%, transparent 100%),
    radial-gradient(1px 1px at 4%  28%, rgba(255,255,255,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 94% 23%, rgba(255,255,255,0.32) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 2%,  rgba(255,255,255,0.5)  0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* All content above the background */
main, footer { position: relative; z-index: 1; }

/* Navbar sits above main so its dropdowns aren't obscured */
.navbar { position: relative; z-index: 100; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 700; }
a { color: var(--gold); }
a:hover { color: #f7cc4d; }

/* ── NAVBAR / MASTHEAD ── */
.navbar {
  background: linear-gradient(135deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.02) 100%) !important;
  border-bottom: 1px solid var(--border-bright);
  backdrop-filter: blur(12px);
  padding-top: 0;
  padding-bottom: 0;
  position: relative;
  overflow: visible;
}

/* Green-to-gold accent line across top of nav */
.navbar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green) 0%, var(--gold) 55%, transparent 100%);
  z-index: 2;
}

.navbar-inner {
  display: flex;
  flex-direction: column;
  padding: 14px 0 0;
}

.navbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.brand-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
  line-height: 1;
}

.brand-title {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.brand-title i { margin-right: 6px; }

.app-version {
  font-size: 0.45em;
  font-weight: 400;
  opacity: 0.3;
  letter-spacing: 0.06em;
  margin-left: 1.2em;
  vertical-align: middle;
}

.navbar-brand {
  text-decoration: none;
  padding: 0;
  margin-right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.navbar-brand:hover .brand-title { color: #fff; }
.navbar-brand:hover { text-decoration: none; }

/* Logo badge — white pill to frame the full-color logo on the dark background */
.nav-logo {
  height: 52px;
  width: auto;
  background: rgba(255,255,255,0.96);
  border-radius: 10px;
  padding: 5px 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1);
  transition: box-shadow 160ms ease;
}

.navbar-brand:hover .nav-logo {
  box-shadow: 0 4px 20px rgba(243,178,0,0.35), 0 0 0 1px rgba(255,255,255,0.15);
}

.brand-text { display: flex; flex-direction: column; }

/* Status badge in header */
.nav-status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(11,79,42,0.25);
  border: 1px solid rgba(26,122,66,0.5);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: #5ddc8a;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #5ddc8a;
  box-shadow: 0 0 8px #5ddc8a;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #5ddc8a; }
  50%       { opacity: 0.6; box-shadow: 0 0 16px #5ddc8a; }
}

/* Nav links row */
.navbar-nav-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 2px 0 4px;
}

.navbar-nav-row > .navbar-nav:first-child {
  flex: 1;
}

.navbar-nav .nav-link {
  color: var(--text-muted) !important;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px !important;
  border-radius: var(--radius-sm);
  transition: all 140ms ease;
  white-space: nowrap;
}

.navbar-nav .nav-link:hover {
  color: var(--text) !important;
  background: rgba(255,255,255,0.06);
}

.navbar-nav .nav-link.active {
  color: #8eeab0 !important;
  background: rgba(11,79,42,0.25);
}

/* Dropdown menus */
.dropdown-menu {
  background: var(--night-3) !important;
  border: 1px solid var(--border-bright) !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px !important;
  backdrop-filter: blur(12px);
  z-index: 1050 !important;
  pointer-events: auto !important;
}

.dropdown-item {
  color: var(--text-muted) !important;
  border-radius: 6px;
  font-size: 13px;
  padding: 7px 12px;
  transition: background 120ms ease, color 120ms ease;
  cursor: pointer;
  display: block;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(255,255,255,0.08) !important;
  color: var(--text) !important;
  outline: none;
}

.dropdown-item:active {
  background: rgba(11,79,42,0.3) !important;
  color: #8eeab0 !important;
}

.dropdown-item.text-danger { color: #f08070 !important; }
.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus { background: rgba(192,57,43,0.2) !important; color: #f08070 !important; }

.dropdown-divider { border-color: var(--border) !important; }

.navbar-toggler {
  border-color: var(--border-bright) !important;
  color: var(--text-muted) !important;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28232, 238, 244, 0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* ── MAIN CONTENT AREA ── */
main.container-fluid {
  padding-top: 28px !important;
  padding-bottom: 48px !important;
}

/* ── CARDS ── */
.card {
  background: linear-gradient(160deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.02) 100%) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  backdrop-filter: blur(8px);
  color: var(--text);
}

.card-header {
  background: rgba(255,255,255,0.035) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
  padding: 10px 16px !important;
}

.card-footer {
  background: rgba(255,255,255,0.02) !important;
  border-top: 1px solid var(--border) !important;
}

.card-footer a {
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
  transition: color 120ms;
}

.card-footer a:hover { color: var(--gold); }

/* ── TABLES ── */
.table {
  color: var(--text) !important;
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(255,255,255,0.04);
  --bs-table-striped-bg: rgba(255,255,255,0.02);
}

.table thead th {
  background: rgba(255,255,255,0.04) !important;
  color: var(--text-dim) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid var(--border-bright) !important;
  border-top: none !important;
  padding: 10px 12px !important;
}

.table td {
  border-color: var(--border) !important;
  vertical-align: middle;
  padding: 10px 12px;
  color: var(--text);
}

.table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.018);
}

.table tbody tr:hover td {
  background: rgba(255,255,255,0.04) !important;
}

.table-light { --bs-table-bg: transparent !important; }

/* Clickable table rows */
.cursor-pointer { cursor: pointer; }

/* ── BUTTONS ── */

/* Primary (was btn-dark → now green) */
.btn-dark {
  background: linear-gradient(180deg, var(--green-light) 0%, var(--green) 100%) !important;
  border-color: var(--green-mid) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--radius-sm) !important;
  transition: all 160ms ease !important;
  box-shadow: 0 4px 14px var(--green-glow);
}

.btn-dark:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px var(--green-glow) !important;
  color: #fff !important;
}

.btn-dark:active { transform: translateY(0) !important; }

/* Outline secondary */
.btn-outline-secondary {
  border-color: var(--border-bright) !important;
  color: var(--text-muted) !important;
  background: transparent !important;
  border-radius: var(--radius-sm) !important;
  transition: all 140ms ease !important;
  font-weight: 500;
}

.btn-outline-secondary:hover {
  background: rgba(255,255,255,0.08) !important;
  color: var(--text) !important;
  border-color: rgba(255,255,255,0.25) !important;
}

.btn-outline-secondary.active {
  background: rgba(11,79,42,0.25) !important;
  border-color: var(--green-light) !important;
  color: #8eeab0 !important;
}

/* Outline dark (secondary action) */
.btn-outline-dark {
  border-color: var(--border-bright) !important;
  color: var(--text-muted) !important;
  background: transparent !important;
  border-radius: var(--radius-sm) !important;
  transition: all 140ms ease !important;
}

.btn-outline-dark:hover {
  background: rgba(255,255,255,0.07) !important;
  color: var(--text) !important;
  border-color: rgba(255,255,255,0.22) !important;
}

/* Small buttons */
.btn-sm { font-size: 12px !important; padding: 4px 10px !important; }

/* Success button (delivered toggle on) */
.btn-success {
  background: linear-gradient(180deg, var(--green-light), var(--green)) !important;
  border-color: var(--green-mid) !important;
  color: #fff !important;
  border-radius: var(--radius-sm) !important;
}

/* Button group */
.btn-group .btn-outline-secondary {
  border-color: var(--border) !important;
}

.btn-group .btn-outline-secondary:not(:first-child) {
  border-left-color: var(--border) !important;
}

/* ── BADGES ── */
.badge {
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.5px;
  border-radius: 6px;
  padding: 3px 7px;
}

.bg-success {
  background: rgba(11,79,42,0.6) !important;
  color: #6ee89a !important;
  border: 1px solid rgba(26,122,66,0.5);
}

.bg-warning {
  background: rgba(243,178,0,0.2) !important;
  color: var(--gold) !important;
  border: 1px solid rgba(243,178,0,0.4);
}

.bg-primary {
  background: rgba(46,134,193,0.25) !important;
  color: #7ec8e3 !important;
  border: 1px solid rgba(46,134,193,0.4);
}

.bg-secondary {
  background: rgba(255,255,255,0.08) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border);
}

.bg-danger {
  background: rgba(192,57,43,0.3) !important;
  color: #f08070 !important;
  border: 1px solid rgba(192,57,43,0.5);
}

.bg-info {
  background: rgba(46,134,193,0.2) !important;
  color: #7ec8e3 !important;
  border: 1px solid rgba(46,134,193,0.4);
}

/* ── MODAL ── */
.modal-content {
  background: var(--night-2) !important;
  border: 1px solid var(--border-bright) !important;
  border-radius: var(--radius) !important;
  color: var(--text) !important;
}
.modal-header {
  background: rgba(255,255,255,0.04) !important;
  border-bottom: 1px solid var(--border) !important;
}
.modal-footer {
  background: rgba(255,255,255,0.02) !important;
  border-top: 1px solid var(--border) !important;
}
.modal-title { color: var(--text) !important; }
.modal-backdrop { background-color: rgba(0,0,0,0.82) !important; }
.btn-close { filter: invert(1) grayscale(1) brightness(1.5) !important; }
/* Auto-link modal: force flex centering (Bootstrap sets display:block inline, !important overrides it) */
#boAutoLinkModal.show { display: flex !important; align-items: center; }
#boAutoLinkModal .modal-content { box-shadow: 0 12px 60px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,255,255,0.07) !important; }

/* ── FORM CONTROLS ── */
.form-control,
.form-select {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid var(--border-bright) !important;
  color: var(--text) !important;
  border-radius: var(--radius-sm) !important;
  transition: border-color 140ms, box-shadow 140ms;
}

.form-control:focus,
.form-select:focus {
  background: rgba(255,255,255,0.08) !important;
  border-color: var(--green-light) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 3px rgba(26,122,66,0.25) !important;
  outline: none;
}

.form-control::placeholder { color: var(--text-dim) !important; }

.form-control:disabled,
.form-select:disabled {
  background: rgba(255,255,255,0.02) !important;
  color: var(--text-dim) !important;
  border-color: var(--border) !important;
  opacity: 1;
}

.input-group-text {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid var(--border-bright) !important;
  color: var(--text-muted) !important;
}

.form-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.form-text { color: var(--text-dim) !important; font-size: 11px; }
.form-text.text-success { color: #6ee89a !important; }
.form-text.text-warning { color: var(--gold) !important; }
.form-text.text-danger  { color: #f08070 !important; }

/* Checkboxes */
.form-check-input {
  background-color: rgba(255,255,255,0.06) !important;
  border-color: var(--border-bright) !important;
}

.form-check-input:checked {
  background-color: var(--green-light) !important;
  border-color: var(--green-light) !important;
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(26,122,66,0.25) !important;
  border-color: var(--green-light) !important;
}

.form-check-label {
  color: var(--text-muted);
  font-size: 14px;
}

.form-check-label.text-danger  { color: #f08070 !important; }
.form-check-label.text-success { color: #6ee89a !important; }

/* Select dropdown options (browser-rendered) */
.form-select option {
  background: var(--night-3);
  color: var(--text);
}

/* Date inputs */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
}

/* ── ALERTS (flash messages) ── */
.alert {
  border-radius: var(--radius-sm) !important;
  border-width: 1px !important;
  font-size: 14px;
}

.alert-success {
  background: rgba(11,79,42,0.25) !important;
  border-color: rgba(26,122,66,0.5) !important;
  color: #8eeab0 !important;
}

.alert-danger, .alert-error {
  background: rgba(192,57,43,0.2) !important;
  border-color: rgba(192,57,43,0.5) !important;
  color: #f08070 !important;
}

.alert-warning {
  background: rgba(243,178,0,0.15) !important;
  border-color: rgba(243,178,0,0.4) !important;
  color: var(--gold) !important;
}

.alert-info {
  background: rgba(46,134,193,0.15) !important;
  border-color: rgba(46,134,193,0.4) !important;
  color: #7ec8e3 !important;
}

.btn-close {
  filter: invert(1) brightness(0.7);
}

/* ── TEXT UTILITIES ── */
.text-muted   { color: var(--text-muted) !important; }
.text-dark    { color: var(--text) !important; }
.text-success { color: #6ee89a !important; }
.text-warning { color: var(--gold) !important; }
.text-danger  { color: #f08070 !important; }

/* Required star */
.text-danger:not(.form-check-label):not(span) { color: #f08070 !important; }

/* Display numbers on dashboard */
.display-4 { color: var(--text) !important; }

/* ── CODE ── */
code {
  color: var(--gold) !important;
  background: rgba(243,178,0,0.1) !important;
  border: 1px solid rgba(243,178,0,0.2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ── LOGIN PAGE ── */
.login-wrap {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.login-logo {
  height: 64px;
  width: auto;
  background: rgba(255,255,255,0.96);
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1);
}

.login-title {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  text-align: center;
  margin-bottom: 24px;
}

.login-title i { margin-right: 8px; }

/* ── DASHBOARD STAT CARDS ── */
.stat-number {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.stat-label {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* Pending delivery card highlight */
.card.border-warning {
  border-color: rgba(243,178,0,0.4) !important;
  background: linear-gradient(160deg, rgba(243,178,0,0.08) 0%, rgba(255,255,255,0.02) 100%) !important;
}

.card.border-warning .stat-number { color: var(--gold) !important; }
.card.border-success .stat-number { color: #22c55e !important; }

.stat-dollar {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
  margin-top: 0.3rem;
  letter-spacing: 0.01em;
}
.stat-dollar.met {
  color: #22c55e;
}
.stat-dollar-of {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-dim);
}

.stat-secondary {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 0.25rem;
  letter-spacing: 0.02em;
}

/* ── PAGE HEADERS ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

/* ── PANEL INLINE EDIT ── */
.edit-section-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12px;
  transition: color 120ms, background 120ms;
  line-height: 1;
}

.edit-section-btn:hover {
  color: var(--gold);
  background: rgba(243,178,0,0.1);
}

.panel-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-flags-active {
  border-color: rgba(243,178,0,0.4) !important;
  background: linear-gradient(160deg, rgba(243,178,0,0.06) 0%, rgba(255,255,255,0.02) 100%) !important;
}

.card-header-flags-active {
  color: var(--gold) !important;
}

/* Auto-save indicator — brief ✓ that fades out */
.autosave-indicator {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #6ee89a;
  opacity: 1;
  transition: opacity 1s ease 0.6s;
}
.autosave-indicator.autosave-warn {
  color: var(--gold);
  transition: opacity 1.2s ease 1s;
}
.autosave-indicator.fade { opacity: 0; }

/* ── SORTABLE TABLE HEADERS ── */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover { color: var(--text-main); }
th.sort-active    { color: var(--accent); }
/* Higher specificity overrides for wa-table which has 0,1,2 */
.wa-table th.sortable       { cursor: pointer; user-select: none; }
.wa-table th.sortable:hover { color: var(--text-main); }
.wa-table th.sort-active    { color: var(--accent); }
.sort-icon {
  margin-left: 3px;
  font-size: 0.7em;
  vertical-align: middle;
  opacity: 0.8;
}

/* ── EVENT LOG NOTES INPUT ── */
.event-notes-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  padding: 0 2px;
  font-size: 0.8rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s;
}
.event-notes-input::placeholder { color: var(--text-dim); }
.event-notes-input:hover  { border-bottom-color: var(--border); }
.event-notes-input:focus  { border-bottom-color: var(--accent); }

/* ── MEMBERS SPLIT PANE ── */
.members-layout {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 20px;
  height: calc(100vh - 140px);
  min-height: 500px;
}

.members-list-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 1.5rem;
}

.members-list-pane .card {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.members-list-pane .table-responsive {
  flex: 1;
  overflow-y: auto;
}

.members-detail-pane {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  padding-left: 20px;
}

/* Panel root fills the detail pane as a flex column */
.panel-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-bottom: 1.5rem;  /* matches left pane — lets card bottom border breathe */
}

/* Top sections (name, contact/membership/flags row) hold their natural height */
.panel-root > .section-wrapper,
.panel-root > .row,
.panel-root > .small {
  flex-shrink: 0;
}

/* Line items card grows to fill all remaining space */
.card-line-items {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Card header must not steal space from tab content */
.card-line-items > .card-header {
  flex-shrink: 0;
}

/* Tab content + active pane must propagate flex growth */
.card-line-items .tab-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.card-line-items .tab-pane.show.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Filter bar holds its height; table gets all remaining space */
.card-line-items .li-filter-bar {
  flex-shrink: 0;
}
.card-line-items .table-responsive {
  flex: 1;
  overflow-y: auto;
  min-height: 80px;
}

/* ── MEMBER PANEL TABS ── */
.member-tabs {
  display: flex;
  align-items: stretch;
  border-bottom: none;
  gap: 1rem;
}
.member-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.6rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  text-transform: uppercase;
}
.member-tab-btn:hover { color: var(--text); }
.member-tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.member-tab-controls { flex-shrink: 0; }
.tab-pane { display: none; }
.tab-pane.show.active { display: block; }

/* Selected row highlight */
.member-row-active td {
  background: rgba(11,79,42,0.2) !important;
}

.member-row-active td:first-child {
  border-left: 2px solid var(--green-light);
}

.member-row-active .member-row-name {
  color: var(--gold);
}

/* Member list avatars */
.member-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.member-avatar-person {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.28);
  border: 1px solid rgba(255,255,255,0.09);
}
.member-avatar-committee {
  background: rgba(11,79,42,0.45);
  color: #8eeab0;
  border: 1px solid var(--green-light);
}

/* User management avatars */
.user-avatar-regular {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.28);
  border: 1px solid rgba(255,255,255,0.09);
}
.user-avatar-admin {
  background: rgba(180,140,0,0.2);
  color: var(--gold);
  border: 1px solid rgba(180,140,0,0.4);
}

/* User list row highlight */
.user-row-active td {
  background: rgba(11,79,42,0.2) !important;
}
.user-row-active td:first-child {
  border-left: 2px solid var(--green-light);
}
.user-row-active .user-row-name {
  color: var(--gold);
}

.settings-cat-row-active td {
  background: rgba(11,79,42,0.2) !important;
}
.settings-cat-row-active td:first-child {
  border-left: 2px solid var(--green-light);
}
.settings-cat-row-active .fw-semibold {
  color: var(--gold);
}

/* Force bullet-style masking on password fields (prevents rectangle artifacts) */
input[type="password"] {
  -webkit-text-security: disc;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Committee record — panel tint */
.committee-panel {
  background: rgba(11,79,42,0.05);
  border-radius: 6px;
}
.committee-panel .section-wrapper:first-child {
  background: rgba(11,79,42,0.12);
  border-left: 3px solid var(--green-light);
  border-radius: 4px;
  padding-left: 10px;
}

/* Test record rows — salmon name + badge */
.member-row[data-test-record="1"] .member-row-name { color: #ff6b75; }
.bg-test-record {
  background: rgba(255, 107, 117, 0.2) !important;
  color: #ff6b75 !important;
  border: 1px solid rgba(255, 107, 117, 0.4);
}

/* Inactive member rows — faded/muted appearance */
.member-row-inactive td {
  opacity: 0.42;
}

.member-row-inactive .member-row-name {
  font-style: italic;
}

/* Inactive badge */
.bg-inactive {
  background-color: #3a4050 !important;
  color: #7a8aa5 !important;
}

/* ── LINE ITEM STATUS FILTER BAR ── */
.li-filter-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.li-filter-btn {
  padding: .35em .65em;
  font-size: .75em;
  font-weight: 700;
  line-height: 1;
  border-radius: .375rem;
  border: none;
  outline: none;
  cursor: pointer;
  color: #fff;
  opacity: 0.45;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.li-filter-btn[data-filter="all"]         { background-color: #4e5d6c; }
.li-filter-btn[data-filter="queued"]      { background-color: #fd7e14; }
.li-filter-btn[data-filter="on_order"]    { background-color: #9b59b6; }
.li-filter-btn[data-filter="backordered"] { background-color: #ffc107; color: #000; }
.li-filter-btn[data-filter="cancelled"]   { background-color: #6c757d; }
.li-filter-btn[data-filter="received"]    { background-color: #0d6efd; }
.li-filter-btn[data-filter="delivered"]   { background-color: #198754; }

/* ── ZERO/NULL AND NEGATIVE VALUE COLORS ── */
.li-val-dim { color: var(--text-dim); }
.li-val-neg { color: #ff6b75; }  /* warm coral-red, readable on dark bg */

/* ── MEMBER MUGSHOT ── */
.member-mugshot {
  aspect-ratio: 3 / 4;
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 2.2rem;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: border-color 140ms, background 140ms, color 140ms;
  overflow: hidden;
}

.member-mugshot:hover {
  border-color: var(--border-bright);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
}

.member-mugshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-sm) - 1px);
}

/* ── MEMBER LIST TYPE FILTER + ACTIVE TOGGLE ── */
#memberTable.hide-committee-badges .badge.bg-info { display: none; }

.member-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
}

.member-toggle-track {
  position: relative;
  width: 28px;
  height: 15px;
  border-radius: 8px;
  background: var(--green-light);   /* green = Active */
  transition: background 0.2s;
  flex-shrink: 0;
}
.member-toggle-all .member-toggle-track { background: #4e5d6c; }  /* grey = All */

.member-toggle-thumb {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.member-toggle-all .member-toggle-thumb { transform: translateX(13px); }

.member-toggle-lbl {
  font-size: .65em;
  font-weight: 700;
  line-height: 1;
  color: var(--text-dim);
  transition: color 0.2s;
}
.member-active-toggle:not(.member-toggle-all) .member-toggle-lbl-active { color: var(--green-light); }
.member-toggle-all .member-toggle-lbl-all { color: #7a99b0; }

/* ── PRICE MODE COLUMN GREYING ── */
/* When Price Type = MSRP, grey the Cost value; when Cost, grey the MSRP value */
tr[data-price-mode="msrp"] .li-cost-cell .li-editable-display { color: var(--text-dim); }
tr[data-price-mode="cost"] .li-msrp-cell .li-editable-display { color: var(--text-dim); }

/* ── INERT CELLS — display-only, no click action ── */
.li-row .li-inert-cell { cursor: default; }

/* ── YEAR GROUP ROWS (items + slips tabs) ── */
.li-year-group-hidden { display: none !important; }
.li-year-header-row > td {
  padding: 0 !important;
  background: rgba(255,255,255,0.045);
  border-top: 1px solid var(--border) !important;
}
.li-year-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  background: none;
  border: none;
  padding: 0.3rem 0.75rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: left;
}
.li-year-toggle:hover { color: var(--text); }
.li-year-chevron { font-size: 0.6rem; transition: transform 0.15s ease; }
.li-year-chevron-open { transform: rotate(90deg); }

/* ── WALTHERS VERIFIED BADGE ── */
.walthers-badge {
  font-size: 0.6rem;
  font-weight: 600;
  color: #4a9eda;
  letter-spacing: 0.02em;
  vertical-align: middle;
  opacity: 0.85;
  flex-shrink: 0;
}

/* ── WALTHERS NAV BADGE — online/offline states ── */
.walthers-nav-badge {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
  color: var(--text-muted);
}
.walthers-nav-badge .walthers-nav-dot {
  background: var(--text-dim);
  box-shadow: none;
  animation: none;
}
.walthers-nav-badge.walthers-online {
  background: rgba(11,79,42,0.25);
  border-color: rgba(26,122,66,0.5);
  color: #5ddc8a;
}
.walthers-nav-badge.walthers-online .walthers-nav-dot {
  background: #5ddc8a;
  box-shadow: 0 0 8px #5ddc8a;
  animation: pulse 2s ease-in-out infinite;
}
.walthers-nav-badge.walthers-offline {
  background: rgba(192,57,43,0.2);
  border-color: rgba(192,57,43,0.5);
  color: var(--red-light);
}
.walthers-nav-badge.walthers-offline .walthers-nav-dot {
  background: var(--red-light);
  box-shadow: 0 0 8px var(--red-light);
  animation: none;
}

/* ── QUICKBOOKS NAV BADGE ── */
.qb-nav-badge.qb-online-prod {
  background: rgba(11,79,42,0.25);
  border-color: rgba(26,122,66,0.5);
  color: #5ddc8a;
}
.qb-nav-badge.qb-online-prod .qb-nav-dot {
  background: #5ddc8a;
  box-shadow: 0 0 8px #5ddc8a;
  animation: pulse 2s ease-in-out infinite;
}
.qb-nav-badge.qb-online-sandbox {
  background: rgba(180,100,0,0.2);
  border-color: rgba(200,130,0,0.5);
  color: #f0a040;
}
.qb-nav-badge.qb-online-sandbox .qb-nav-dot {
  background: #f0a040;
  box-shadow: 0 0 8px #f0a040;
  animation: pulse-amber 2s ease-in-out infinite;
}
.qb-nav-badge.qb-offline {
  background: rgba(80,80,80,0.15);
  border-color: rgba(120,120,120,0.3);
  color: var(--text-dim, #666);
}
.qb-nav-badge.qb-offline .qb-nav-dot {
  background: var(--text-dim, #666);
  box-shadow: none;
  animation: none;
}
@keyframes pulse-amber {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #f0a040; }
  50%       { opacity: 0.6; box-shadow: 0 0 16px #f0a040; }
}
.qb-nav-badge.qb-expiring {
  background: rgba(180,30,30,0.2);
  border-color: rgba(220,60,60,0.5);
  color: #eb5757;
}
.qb-nav-badge.qb-expiring .qb-nav-dot {
  background: #eb5757;
  box-shadow: 0 0 8px #eb5757;
  animation: pulse-red 2s ease-in-out infinite;
}
@keyframes pulse-red {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #eb5757; }
  50%       { opacity: 0.6; box-shadow: 0 0 16px #eb5757; }
}

/* ── WALTHERS STATUS BADGE ── */
.walthers-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.18rem 0.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  white-space: nowrap;
  transition: border-color 0.3s, color 0.3s;
}
.walthers-status-logo {
  height: 11px;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.7;
}
.walthers-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: background 0.3s;
}
.walthers-status-badge.walthers-online {
  border-color: rgba(26,122,66,0.5);
  color: #4cbb7f;
}
.walthers-status-badge.walthers-online .walthers-status-dot {
  background: #1a7a42;
  box-shadow: 0 0 5px rgba(26,122,66,0.7);
}
.walthers-status-badge.walthers-offline {
  border-color: rgba(192,57,43,0.5);
  color: var(--red-light);
}
.walthers-status-badge.walthers-offline .walthers-status-dot {
  background: var(--red);
  box-shadow: 0 0 5px rgba(192,57,43,0.6);
}

/* ── DESCRIPTION CLAMP ── */
.li-desc-display {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

/* ── INLINE EDITABLE CELLS (line item rows) ── */
.li-editable { cursor: text; }
.li-editable:hover .li-editable-display { text-decoration: underline dotted rgba(255,255,255,0.3); }

.li-inline-input {
  padding: 1px 4px;
  font-size: inherit;
  font-family: inherit;
  background: var(--surface-2, #2a2a2a);
  border: 1px solid #f3b200;
  border-radius: .25rem;
  color: inherit;
  min-width: 30px;
}
.li-editable-number .li-inline-input {
  width: 68px;
  text-align: right;
}
.li-editable:not(.li-editable-number) .li-inline-input {
  width: 100%;
  min-width: 80px;
}

/* ── PRICE OVERRIDE EDITOR (inline in line item rows) ── */
.li-price-trigger {
  cursor: pointer;
}
.li-price-trigger:hover {
  text-decoration: underline dotted;
}
.li-price-overridden {
  color: #f3b200;
  font-weight: 600;
}
.li-price-editor {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
}
.li-price-input {
  width: 62px;
  padding: 1px 4px;
  font-size: .78em;
  background: var(--surface-2, #2a2a2a);
  border: 1px solid var(--border, #444);
  border-radius: .25rem;
  color: inherit;
  text-align: right;
}
.li-price-input:focus {
  outline: none;
  border-color: #f3b200;
}
.li-override-clear {
  background: none;
  border: none;
  padding: 0 0 0 3px;
  font-size: .78em;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
  color: var(--text-dim);
  transition: color 0.15s;
}
.li-override-clear:hover { color: #ff6b75; }

.li-price-save,
.li-price-cancel {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: .8em;
  line-height: 1;
  cursor: pointer;
  color: var(--text-dim);
  transition: color 0.15s;
}
.li-price-save:hover  { color: #198754; }
.li-price-cancel:hover { color: var(--red, #dc3545); }

/* Manual override badge — shown instead of toggle when member price is set */
.price-manual-badge {
  display: inline-block;
  margin-left: 5px;
  font-size: .68em;
  font-weight: 700;
  color: #f3b200;
  opacity: 0.8;
  vertical-align: middle;
  letter-spacing: .02em;
}

/* ── PRICE TOGGLE (iOS-style switch, inline in line item rows) ── */
.price-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 5px;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  opacity: 0.45;
  transition: opacity 0.15s;
}
.price-toggle:hover { opacity: 0.75; }
.price-toggle-forced { opacity: 1; }
.price-toggle-forced:hover { opacity: 0.85; }

.price-toggle-track {
  position: relative;
  width: 28px;
  height: 15px;
  border-radius: 8px;
  background: #0d6efd;   /* MSRP = blue */
  transition: background 0.2s;
  flex-shrink: 0;
}
.price-toggle-on .price-toggle-track { background: #fd7e14; } /* Cost = orange */

.price-toggle-thumb {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.price-toggle-on .price-toggle-thumb { transform: translateX(13px); }

/* MSRP / Cost labels flanking the track */
.price-toggle-lbl {
  font-size: .62em;
  font-weight: 700;
  line-height: 1;
  color: var(--text-dim);
  transition: color 0.2s;
}
/* Highlight the active side */
.price-toggle:not(.price-toggle-on) .price-toggle-lbl-msrp { color: #0d6efd; }
.price-toggle-on .price-toggle-lbl-cost  { color: #fd7e14; }

/* Manual price — static indicator, no toggle */

/* Line total flags (line items list) */
.li-total-flag {
  display: inline-block;
  margin-left: 4px;
  font-size: .65em;
  font-weight: 700;
  vertical-align: middle;
  opacity: 0.75;
}
.li-total-override { color: #f3b200; }   /* gold = dollar override active */
.li-total-forced   { color: #0d6efd; }   /* blue = MSRP/Cost forced */

/* Status badge classes — single source of truth for all status colors */
.bg-status-queued      { background-color: #fd7e14 !important; color: #fff !important; }
.bg-status-on_order    { background-color: #9b59b6 !important; color: #fff !important; }
.bg-status-backordered { background-color: #ffc107 !important; color: #000 !important; }
.bg-status-cancelled   { background-color: #6c757d !important; color: #fff !important; }
.bg-status-received    { background-color: #0d6efd !important; color: #fff !important; }
.bg-status-delivered   { background-color: #198754 !important; color: #fff !important; }

.li-filter-btn:focus-visible { outline: none; }

.li-filter-btn:hover {
  opacity: 0.8;
}

.li-filter-btn.li-filter-active {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

/* Placeholder */
.members-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  pointer-events: none;
}

.members-placeholder-icon {
  font-size: 3.5rem;
  color: var(--text-dim);
  opacity: 0.5;
}

.members-placeholder-text {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

@media (max-width: 992px) {
  .members-layout { grid-template-columns: 1fr; height: auto; }
  .members-detail-pane { overflow-y: auto; overflow-x: hidden; border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 20px; min-height: 300px; }
  .members-list-pane { height: auto; }
  .members-list-pane .card { max-height: 60vh; }
  .panel-root { flex: none; }
  .card-line-items { flex: none; }
  .card-line-items .table-responsive { max-height: 50vh; }
}

/* ── PACKING SLIP PRINT ── */
@media print {
  body, body::before, body::after {
    background: #fff !important;
    color: #000 !important;
  }
  .navbar, .no-print { display: none !important; }
  .card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    backdrop-filter: none !important;
    color: #000 !important;
  }
  .table { color: #000 !important; }
  .table thead th { color: #444 !important; background: #f5f5f5 !important; }
  .table td { color: #000 !important; border-color: #ddd !important; }
  code { color: #333 !important; background: #f0f0f0 !important; border: none !important; }
  .badge { border: 1px solid #ccc !important; color: #333 !important; background: #eee !important; }
}

/* ── COMPACT MEMBER LIST: narrow left pane on iPad landscape ── */
/* Applied via JS (applyCompactLayout) based on window.innerWidth — iPad Pro 13" reports 1600px */
.members-layout.compact-list { grid-template-columns: 200px 1fr; }
.members-layout.compact-list .col-hide-compact { display: none; }
.members-layout.compact-list .member-avatar { width: 22px; height: 22px; font-size: 0.6rem; flex-shrink: 0; }

/* ── TABLET: hide email/phone columns on iPad and similar ── */
@media (max-width: 1024px) {
  .col-hide-tablet { display: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .navbar-top { flex-wrap: wrap; gap: 10px; }
  .nav-status-badge { font-size: 10px; padding: 5px 10px; }
  .brand-title { font-size: 18px; }
  .navbar-nav-row { flex-direction: column; align-items: flex-start; padding-bottom: 8px; }
  .collapse:not(.show) { display: none; }
}

/* ── RECEIVING ── */
.rcv-group { border-bottom: 1px solid var(--border); }
.rcv-group:last-child { border-bottom: none; }
.rcv-group-header { background: rgba(255,255,255,0.04); font-size: 0.9rem; cursor: pointer; user-select: none; }
.rcv-group-toggle { font-size: 0.7rem; color: var(--text-dim); transition: transform 0.15s ease; flex-shrink: 0; }
.rcv-group.rcv-group-collapsed .rcv-group-toggle { transform: rotate(-90deg); }
.rcv-group.rcv-group-collapsed .rcv-pending-row { display: none !important; }
.rcv-member-link { color: inherit; }
.rcv-member-link:hover { color: var(--gold); }
.rcv-item-row { font-size: 0.85rem; border-top: 1px solid rgba(255,255,255,0.05); }
.rcv-item-row:hover { background: rgba(255,255,255,0.03); }
.rcv-staged-out { opacity: 0.32; pointer-events: none; transition: opacity 0.2s; }
.rcv-move-all-bar {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.rcv-sku      { font-size: 0.8rem; min-width: 70px; flex-shrink: 0; color: var(--text-dim); }
.rcv-sku--bo  { color: var(--text-dim) !important; background: rgba(255,255,255,0.04) !important; border-color: rgba(255,255,255,0.1) !important; }
.rcv-qty      { flex-shrink: 0; min-width: 2rem; text-align: right; font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }
.rcv-price    { flex-shrink: 0; min-width: 4.5rem; text-align: right; font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.rcv-line-total { flex-shrink: 0; min-width: 4.5rem; text-align: right; font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.rcv-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Typeahead dropdown */
.rcv-typeahead-dropdown {
  position: absolute;
  z-index: 1050;
  left: 0; right: 0;
  background: #1e2a22;
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.rcv-dd-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.rcv-dd-item:last-child { border-bottom: none; }
.rcv-dd-item:hover, .rcv-dd-focus { background: rgba(26,122,66,0.25); }
.rcv-dd-email { font-size: 0.78rem; color: var(--text-dim); flex-shrink: 0; }

/* Member chip (selected state) */
.rcv-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(26,122,66,0.2);
  border: 1px solid var(--green-light);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.85rem;
  color: #8eeab0;
}

/* Recently added list */
.rcv-recent-row {
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.82rem;
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.rcv-recent-member { font-weight: 600; color: var(--text-dim); }
.rcv-recent-qty { color: var(--text-dim); margin-left: auto; }

/* Three-column receiving layout */
.rcv-layout {
  display: grid;
  grid-template-columns: 35fr 35fr 30fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 992px) {
  .rcv-layout { grid-template-columns: 1fr; }
}
/* Receiving Day mode — Items On Order left, Currently Receiving right, both tall */
/* Heights set via inline style in JS — Safari requires definite heights on flex containers */
.rcv-layout--receiving-day {
  grid-template-columns: 55fr 45fr;
}
.rcv-layout--receiving-day #quickAddCol {
  display: none;
}
.rcv-layout--receiving-day ~ #rcvBottomRow {
  display: none;
}
.rcv-day-toggle { color: var(--text-dim); transition: color 0.15s; }
.rcv-day-toggle:hover { color: var(--gold); }
.rcv-layout--receiving-day #pendingCol .rcv-day-toggle { color: var(--gold); }
/* Receiving Day Mode — pending row column alignment and name wrapping */
.rcv-layout--receiving-day .rcv-pending-row .rcv-name {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rcv-layout--receiving-day .rcv-pending-row .rcv-qty        { width: 45px;  min-width: 45px; }
.rcv-layout--receiving-day .rcv-pending-row .rcv-price      { width: 65px;  min-width: 65px; }
.rcv-layout--receiving-day .rcv-pending-row [class*="bg-status-"] { width: 95px; flex-shrink: 0; text-align: center; }
.rcv-layout--receiving-day .rcv-pending-row .rcv-bo-btn     { width: 38px;  flex-shrink: 0; font-size: 0.55rem; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.rcv-layout--receiving-day .rcv-pending-row .rcv-bo-btn.d-none { display: inline-block !important; visibility: hidden; }
.rcv-layout--receiving-day .rcv-sku-sort-member             { width: 130px; min-width: 130px; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.rcv-col { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

/* Bottom row: two-column grid matching the top layout's proportions (70fr : 30fr = left+mid : QA) */
.rcv-bottom-row {
  display: grid;
  grid-template-columns: 70fr 30fr;
  gap: 1rem;
}
.rcv-bottom-col { min-height: 0; display: flex; flex-direction: column; }
.rcv-bottom-row .card { min-height: 0; overflow: hidden; }
@media (max-width: 992px) {
  .rcv-bottom-row { grid-template-columns: 1fr; }
}

/* Ready to Deliver — grouped list */
.rcv-deliver-group { border-bottom: 1px solid var(--border); }
.rcv-deliver-group:last-child { border-bottom: none; }
.rcv-deliver-alt { background: rgba(255,255,255,0.025); }
.rcv-deliver-header {
  display: flex;
  align-items: center;
  font-size: 0.88rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.rcv-deliver-header::-webkit-details-marker { display: none; }
.rcv-deliver-header::marker { display: none; }
.rcv-deliver-chevron { font-size: 0.7rem; color: var(--text-dim); transition: transform 0.15s ease; }
.rcv-deliver-group[open] > .rcv-deliver-header .rcv-deliver-chevron { transform: rotate(90deg); }
.rcv-deliver-group[open] > .rcv-deliver-header { border-bottom-color: rgba(255,255,255,0.06); }
.rcv-deliver-item { border-top: 1px solid rgba(255,255,255,0.04); }
.rcv-deliver-indent { width: 14px; flex-shrink: 0; }

/* Slip row highlight — triggered by ?slip= deep link from Receiving screen */
@keyframes slip-flash {
  0%   { background: rgba(212, 175, 55, 0.35); }
  60%  { background: rgba(212, 175, 55, 0.25); }
  100% { background: transparent; }
}
.slip-highlight { animation: slip-flash 2s ease-out forwards; }

/* Pending row action buttons */
.rcv-stage-btn {
  flex-shrink: 0;
  padding: 0.1rem 0.35rem;
  font-size: 1rem;
  line-height: 1;
  color: var(--green-light);
  background: transparent;
  border: none;
}
.rcv-stage-btn:hover { color: #fff; background: rgba(26,122,66,0.35); border-radius: 4px; }

.rcv-bo-btn {
  flex-shrink: 0;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--amber);
  background: transparent;
  border: 1px solid var(--amber);
  border-radius: 4px;
}
.rcv-bo-btn:hover { background: rgba(230,126,34,0.2); color: var(--amber); }
.rcv-bo-btn:disabled, .rcv-stage-btn:disabled { opacity: 0.4; }

/* Backordered badge — clickable undo */
.rcv-undo-badge {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.rcv-undo-badge:hover { filter: brightness(1.25); }

/* On Order badge — clickable revert to Queued */
.rcv-unorder-badge {
  cursor: pointer;
}
.rcv-unorder-badge:hover { filter: brightness(1.25); }

/* ── Items Ordered expand card window ── */
/* Layout is handled via inline styles on the overlay/dialog (set by JS).
   Only visual styling lives here. */
#itemsExpandOverlay { cursor: default; }
#itemsExpandDialog  { cursor: default; }

/* Cards inside the card window: dark theme, square edges */
#itemsExpandBody .card-line-items,
#itemsExpandBody .card-packing-slips {
  background: var(--night-2) !important;
  color: inherit;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
}
#itemsExpandBody .card-line-items .card-header,
#itemsExpandBody .card-packing-slips .card-header {
  background: var(--night-3);
  border-color: var(--border);
}
#itemsExpandBody .card-line-items .li-filter-bar {
  border-radius: 0;
}
#itemsExpandBody .card-packing-slips .table-responsive {
  height: auto !important;
  overflow-y: visible !important;
}

/* PO column — hidden unless member has uses_po */
.panel-root[data-uses-po="0"] .po-col { display: none; }

/* ── Walthers page tabs ─────────────────────────────────────────────────────── */
#walthersTab {
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: -1px; /* overlap the border with the card top edge */
}
#walthersTab .nav-link {
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color 0.15s, background 0.15s;
}
#walthersTab .nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  border-bottom-color: transparent;
}
#walthersTab .nav-link.active {
  color: var(--gold);
  background: var(--panel-solid);
  border-color: var(--border);
  border-bottom-color: var(--panel-solid);
}

/* ── Send to Walthers page ─────────────────────────────────────────────────── */
.stw-layout {
  display: grid;
  grid-template-columns: 35fr 35fr 30fr;
  gap: 1rem;
  align-items: stretch;
  /* height set by JS in send.html to exactly fill remaining viewport */
}
@media (max-width: 992px) {
  .stw-layout { grid-template-columns: 1fr; height: auto !important; }
}
/* Left and middle cards fill full height */
.stw-col {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Scrollable bodies grow to fill remaining card height */
#stw-queued-col .card-body,
#stw-staged-col .card-body,
#stw-recent-col .card-body { flex: 1 1 0; overflow-y: auto; min-height: 0; }
/* Right column: stacks QuickAdd (natural height) + Recent Sends (fills rest) */
.stw-right-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  min-width: 0;   /* prevent flex child from expanding beyond its allocation */
  overflow: hidden;
}
#stw-qa-col   { flex-shrink: 0; }
#stw-recent-col { flex: 1 1 0; min-height: 0; }
/* Ensure cards in the right col don't expand past the column width */
#stw-qa-col, #stw-recent-col { overflow: hidden; }

/* Queued and staged item rows */
.stw-item-row {
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 0.4rem 0.75rem;
}
.stw-item-row:hover { background: rgba(255,255,255,0.03); }
.stw-staged-out { opacity: 0.32; pointer-events: none; transition: opacity 0.2s; }
.stw-sku      { font-size: 0.78rem; min-width: 72px; flex-shrink: 0; color: var(--text-dim); }
.stw-sku-badge { flex-shrink: 0; }
.stw-name     { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stw-qty      { font-size: 0.78rem; flex-shrink: 0; min-width: 2rem; text-align: right; color: var(--text-dim); }
.stw-price    { font-size: 0.78rem; flex-shrink: 0; min-width: 4.5rem; text-align: right; color: var(--text-dim); }
.stw-member-header {
  background: rgba(255,255,255,0.04);
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.stw-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-dim);
}
.stw-empty i { font-size: 1.8rem; display: block; margin-bottom: 0.4rem; }

/* Move-all button strip above queued list */
.stw-cart-status-bar {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
}
.stw-cart-known {
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
}
.stw-cart-unknown {
  background: rgba(220, 160, 0, 0.12);
  color: #f0b429;
  border-color: rgba(220, 160, 0, 0.3);
}
.stw-move-all-bar {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

/* Recent Sends submission group headers */
.stw-sub-group .stw-item-row { overflow: hidden; }
.stw-sub-group .stw-name { flex: 1 1 0; }
.stw-sub-header {
  background: rgba(255,255,255,0.04);
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.stw-sub-header:hover { background: rgba(255,255,255,0.07); }

/* SKU-checking spinner on move button */
.stw-stage-btn .spinner-border { width: 0.85rem; height: 0.85rem; border-width: 2px; }

/* Validation badge */
.stw-invalid-badge { font-size: 0.65rem; background: var(--danger, #dc3545) !important; }

/* Disclosure chevron on queued-items group headers */
.stw-chevron {
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0.6;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.stw-chevron:hover { opacity: 1; }

/* Clickable member name inside group headers */
.stw-member-link {
  color: inherit;
  text-decoration: none;
}
.stw-member-link:hover { color: var(--gold); }

/* Per-member subtotal inside group headers */
.stw-member-subtotal {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 400;
}

/* ── Minimum-order progress indicator ───────────────────────────────────────── */
.stw-cost-track {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.07);
}
.stw-cost-bar {
  height: 100%;
  background: var(--gold);
  transition: width 0.5s ease, background 0.4s ease;
  border-radius: 0 2px 2px 0;
}
.stw-cost-bar.met {
  background: #22c55e;
}
.stw-cost-value {
  color: var(--gold);
  transition: color 0.4s ease;
}
.stw-cost-value.met {
  color: #22c55e;
}
.stw-cost-of {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.45;
  margin-left: 2px;
}
@keyframes stwCostPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); filter: drop-shadow(0 0 6px #22c55e99); }
  65%  { transform: scale(0.96); }
  100% { transform: scale(1); filter: none; }
}
.stw-cost-value.pop {
  display: inline-block;
  animation: stwCostPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Stage / unstage arrow buttons — match receiving page style */
.stw-stage-btn {
  flex-shrink: 0;
  padding: 0.1rem 0.35rem;
  font-size: 1rem;
  line-height: 1;
  color: var(--green-light);
  background: transparent;
  border: none;
}
.stw-stage-btn:hover { color: #fff; background: rgba(26,122,66,0.35); border-radius: 4px; }
.stw-stage-btn:disabled { opacity: 0.4; }

.stw-unstage-btn {
  flex-shrink: 0;
  padding: 0.1rem 0.35rem;
  font-size: 1rem;
  line-height: 1;
  color: #e05c5c;
  background: transparent;
  border: none;
}
.stw-unstage-btn:hover { color: #fff; background: rgba(180,40,40,0.3); border-radius: 4px; }

/* ── Dark-theme modals ──────────────────────────────────────────────────────── */
/* Modals must live outside <main> (in {% block modals %}) so Bootstrap's       */
/* backdrop doesn't win the z-index fight against main's stacking context.      */
/* ── Walthers Account Dashboard ─────────────────────────────────────────────── */
.wa-loading, .wa-state-msg {
  padding: 1.25rem 1rem;
  font-size: 0.875rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
}
.wa-table {
  font-size: 0.82rem;
  color: var(--text);
}
.wa-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}
.wa-table td {
  padding: 0.45rem 0.75rem !important;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.wa-table tbody tr:last-child td { border-bottom: none; }
.wa-table tbody tr:hover { background: rgba(255,255,255,0.03); }
/* Grouped items: hover the whole group together, not row-by-row */
.wa-table .item-group tr:hover { background: transparent; }
.wa-table .item-group:hover tr { background: rgba(255,255,255,0.03); }
/* Two-row-per-item pattern: suppress border between data row and desc row,
   restore it on desc row (acts as the between-item separator) */
.wa-table .item-group tr:first-child td { border-bottom: none; }
.wa-table .item-group tr.item-desc-row td {
  border-top: none;
  padding-top: 0 !important;
  padding-bottom: 0.35rem;
  font-size: 0.77em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.wa-table .item-group:last-child tr.item-desc-row td { border-bottom: none; }
.wa-description {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wa-po-link { cursor: pointer; }
.wa-po-link code { color: var(--bs-link-color); }
.wa-po-link:hover code { text-decoration: underline; }
.wa-track-link {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-decoration: none;
}
.wa-track-link:hover { color: var(--text); text-decoration: underline; }
.wa-ts {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
}

.stw-modal .modal-content {
  background: var(--panel-solid);
  color: var(--text);
  border: 1px solid var(--border-bright);
}
.stw-modal .modal-header,
.stw-modal .modal-footer {
  border-color: var(--border);
}
.stw-modal .modal-header .btn-close { filter: invert(1) grayscale(1); }

/* ── Quick Add shared component (quickadd.js / quick_add macro) ─────────────── */
.qa-panel { }   /* wrapper — no additional styles needed; layout comes from card-body */

.qa-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

/* SKU validity indicator (badge / spinner next to label) */
.qa-sku-indicator { display: inline-flex; align-items: center; }
.qa-sku-badge     { font-size: 0.65rem; }
.qa-sku-spinner   { vertical-align: middle; }

/* Error message */
.qa-error {
  font-size: 0.82rem;
  color: #e05c5c;
  padding: 0.35rem 0.5rem;
  background: rgba(220,53,69,0.12);
  border-radius: 4px;
}

/* Reset button — small muted link below submit */
.qa-reset-btn {
  font-size: 0.8rem;
  text-decoration: none;
  color: inherit !important;
}
.qa-reset-btn:hover {
  color: var(--gold) !important;
}

/* Line total — inline display in the 4-column price row */
.qa-total-display {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
  padding: 0.25rem 0;
  line-height: 1.8;  /* vertically aligns with input-group height */
}

/* Price mode toggle — Cost / MSRP labels in the 4-column row */
.qa-mode-label {
  /* base state: static dim label text, no interactivity */
}
.qa-mode-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.qa-mode-btn:hover { color: var(--gold); }
.qa-mode-active {
  color: var(--text);
  font-weight: 700;
}
.qa-mode-active::after {
  content: ' ✓';
  color: var(--green-light);
  font-weight: 700;
}

/* ── Sale icon urgency — blink when expiry is within warning window ── */
@keyframes sale-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.15; }
}
.sale-icon-urgent {
  animation: sale-blink 1s ease-in-out infinite;
}

/* QB Developer Tools table */
.dev-res-cell { width: 50%; min-height: 2.6em; word-break: break-word; color: var(--text-dim); padding: 4px 10px 4px 0; vertical-align: middle; }
.dev-btn-cell { white-space: nowrap; padding: 4px 10px 4px 0; vertical-align: middle; }
#qbDevTools td { padding-top: 4px; padding-bottom: 4px; vertical-align: middle; }
