/* ============================================================
   Guest Path — Proposal Engine — Styles
============================================================ */

/* ── Version update banner ──────────────────────────────── */
.version-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--navy);
  color: var(--white);
  font-size: 0.85rem;
  position: sticky;
  top: 0;
  z-index: 9999;
}
.version-banner.hidden { display: none; }
.version-banner-refresh {
  padding: 0.25rem 0.75rem;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.82rem;
}
.version-banner-refresh:hover { opacity: 0.85; }
.version-banner-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.7;
  line-height: 1;
}
.version-banner-dismiss:hover { opacity: 1; }

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

input, select, textarea, button {
  font-family: 'Sora', sans-serif;
}

html { font-size: 90%; }

:root {
  --navy:       #00235A;
  --navy-light: #003580;
  --gold:       #C8A96E;
  --white:      #ffffff;
  --gray-50:    #f8f9fb;
  --gray-100:   #f0f2f5;
  --gray-200:   #e2e6ea;
  --gray-400:   #9aa3af;
  --gray-600:   #5a6472;
  --gray-800:   #2c3340;
  --danger:     #d63031;
  --success:    #00b894;
  --shell-max-width: 1900px;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg:  0 4px 20px rgba(0,0,0,0.12);
}

body {
  font-family: 'Sora', sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  font-size: 8.1pt;
  line-height: 1.5;
  padding-bottom: 80px;
}

/* ---- Header ---- */
.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.header-inner {
  max-width: var(--shell-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: stretch;
   justify-content: flex-start;
  min-height: 64px;
  gap: 0.5rem;
}

.header-logo {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  justify-content: center;
  padding: 0.75rem 0;
  flex-shrink: 0;
}

/* ---- Hamburger Menu ---- */
.hamburger-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.hamburger-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 43px;
  height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius, 6px);
}

.hamburger-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.hamburger-icon {
  width: 35px;
  height: 35px;
  object-fit: contain;
  display: block;
}

.hamburger-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius, 6px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.28);
  z-index: 500;
  min-width: 160px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}

.hamburger-dropdown.hidden { display: none; }

.hamburger-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  white-space: nowrap;
}

.hamburger-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
}

.hamburger-item-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 0.5rem;
  opacity: 0.65;
}
.hamburger-item:hover .hamburger-item-icon {
  opacity: 1;
}

.hamburger-item--empty {
  pointer-events: none;
  min-height: 2rem;
  cursor: default;
}

.hamburger-item--empty:hover {
  background: transparent;
}

.hamburger-item--has-submenu {
  display: flex;
  align-items: center;
}

.hamburger-item-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.55;
  transition: transform 0.15s;
  padding-left: 0.5rem;
}

.hamburger-item--has-submenu.is-open .hamburger-item-arrow {
  transform: rotate(-180deg);
  opacity: 0.9;
}

.hamburger-submenu {
  background: rgba(0,0,0,0.22);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.hamburger-submenu.hidden { display: none; }

/* Group trigger rows (Quote, Property, Template Setup) */
.hamburger-submenu-group {
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.45rem 1rem 0.45rem 1.25rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  width: 100%;
}

.hamburger-submenu-group:hover,
.hamburger-submenu-group.is-open {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

/* Direct (non-group) items in the admin submenu */
.hamburger-submenu-item {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.4rem 1rem 0.4rem 1.25rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  white-space: nowrap;
}

.hamburger-submenu-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
}

/* Flyout wrapper on each group row */
.hmb-group-wrap {
  position: relative;
}

/* Flyout panel — appears to the right of its trigger row */
.hmb-flyout {
  position: absolute;
  left: 100%;
  top: 0;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius, 6px);
  box-shadow: 6px 6px 24px rgba(0,0,0,0.4);
  z-index: 600;
  min-width: 175px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}

.hmb-flyout.hidden { display: none; }

/* Items inside a flyout panel */
.hamburger-flyout-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.45rem 1.1rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  white-space: nowrap;
  width: 100%;
}

.hamburger-flyout-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
}

/* Group trigger inside a flyout (e.g. "Option" inside Quote flyout) */
.hamburger-flyout-group {
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.45rem 1.1rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  width: 100%;
}

.hamburger-flyout-group:hover,
.hamburger-flyout-group.is-open {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

/* Right-pointing arrow on group triggers */
.hmb-flyout-arrow {
  margin-left: auto;
  font-size: 0.6rem;
  opacity: 0.45;
  padding-left: 0.6rem;
}

.hmb-group-trigger.is-open .hmb-flyout-arrow {
  opacity: 0.9;
}

.brand-hotel {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold);
}

.brand-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* ---- Main Layout ---- */
.main-layout {
  max-width: 1900px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

:is(
  #view-quote-setup,
  #view-manage-users,
  #view-rate-option-setup,
  #view-extras-option-setup,
  #view-release-schedule-option-setup,
  #view-cancellation-policy-option-setup,
  #view-deposit-schedule-option-setup,
  #view-rooming-list-option-setup,
  #view-property-details-setup,
  #view-room-classes-setup,
  #view-guest-path-segment-setup,
  #view-documents-management,
  #view-rate-plan-setup,
  #view-project-deployment,
  #view-database,
  #view-admin-blocks
) .main-layout {
  max-width: var(--shell-max-width);
}

#view-tq-quotationMultigroup .main-layout,
#view-quote-defaults-setup .main-layout {
  max-width: 1900px;
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  position: relative; /* needed for absolutely-positioned dismiss button */
}

.card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--gold);
}

.card-title-row .card-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.status-change-label {
  font-size: 0.72rem;
  color: var(--color-muted, #999);
  white-space: nowrap;
  align-self: center;
}

.card-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* tq-card-row now uses tq-half-row — kept for backward compat */
.tq-card-row {
  display: flex;
  align-items: stretch;
}

/* Half-row flex container for side-by-side cards with right-side insert button */
.tq-half-row {
  display: flex;
  align-items: stretch;
}

.tq-card-half {
  flex: 0 0 50%;
  width: 50%;
  min-width: 0;
}

#tq-card-rooming .data-table,
#tmg-card-rooming .data-table {
  table-layout: fixed;
}

#tq-card-rooming .data-table th:nth-child(1),
#tq-card-rooming .data-table td:nth-child(1),
#tmg-card-rooming .data-table th:nth-child(1),
#tmg-card-rooming .data-table td:nth-child(1) {
  width: 46%;
}

#tq-card-rooming .data-table th:nth-child(2),
#tq-card-rooming .data-table td:nth-child(2),
#tmg-card-rooming .data-table th:nth-child(2),
#tmg-card-rooming .data-table td:nth-child(2) {
  width: 46%;
}

#tq-card-rooming .data-table th:nth-child(3),
#tq-card-rooming .data-table td:nth-child(3),
#tmg-card-rooming .data-table th:nth-child(3),
#tmg-card-rooming .data-table td:nth-child(3) {
  width: 8%;
}

#tq-card-rooming .data-table td:nth-child(1) select,
#tq-card-rooming .data-table td:nth-child(2) input,
#tmg-card-rooming .data-table td:nth-child(1) select,
#tmg-card-rooming .data-table td:nth-child(2) input {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

#tq-card-deposit .data-table,
#tmg-card-deposit .data-table {
  table-layout: fixed;
  width: 100%;
}

#tq-card-deposit .data-table th:nth-child(1),
#tq-card-deposit .data-table td:nth-child(1),
#tmg-card-deposit .data-table th:nth-child(1),
#tmg-card-deposit .data-table td:nth-child(1) { width: 34%; }

#tq-card-deposit .data-table th:nth-child(2),
#tq-card-deposit .data-table td:nth-child(2),
#tmg-card-deposit .data-table th:nth-child(2),
#tmg-card-deposit .data-table td:nth-child(2) { width: 11%; }

#tq-card-deposit .data-table th:nth-child(3),
#tq-card-deposit .data-table td:nth-child(3),
#tmg-card-deposit .data-table th:nth-child(3),
#tmg-card-deposit .data-table td:nth-child(3) { width: 36%; }

#tq-card-deposit .data-table th:nth-child(4),
#tq-card-deposit .data-table td:nth-child(4),
#tmg-card-deposit .data-table th:nth-child(4),
#tmg-card-deposit .data-table td:nth-child(4) { width: 13%; }

#tq-card-deposit .data-table th:nth-child(5),
#tq-card-deposit .data-table td:nth-child(5),
#tmg-card-deposit .data-table th:nth-child(5),
#tmg-card-deposit .data-table td:nth-child(5) { width: 6%; }

#tq-card-deposit .data-table td select,
#tq-card-deposit .data-table td input,
#tmg-card-deposit .data-table td select,
#tmg-card-deposit .data-table td input {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

#tmg-card-release .data-table {
  table-layout: fixed;
  width: 100%;
}

#tmg-card-release .data-table th:nth-child(1),
#tmg-card-release .data-table td:nth-child(1) { width: 32%; }

#tmg-card-release .data-table th:nth-child(2),
#tmg-card-release .data-table td:nth-child(2) { width: 20%; }

#tmg-card-release .data-table th:nth-child(3),
#tmg-card-release .data-table td:nth-child(3) { width: 40%; }

#tmg-card-release .data-table th:nth-child(4),
#tmg-card-release .data-table td:nth-child(4) { width: 8%; }

#tmg-card-release .data-table td input {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

#byDay-date-range,
#tq-byDay-date-range,
[id^="tmg-byDay-date-range-"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#byDay-date-range input[type="date"],
#tq-byDay-date-range input[type="date"] {
  padding: 3px 6px;
  font-size: 0.8rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
}

[id^="tmg-byDay-date-range-"] input[type="date"] {
  padding: 3px 6px;
  font-size: 0.8rem;
  width: 7.5rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
}

.th-byDay {
  white-space: nowrap;
  font-size: 0.8rem;
}

.col-byday input {
  width: 55px;
  min-width: 55px;
  text-align: center;
}

/* No. of Rooms column — always visible in both normal and byDay mode */

/* Start Date / End Date columns in Room Classes table */
.col-startdate input, .col-enddate input {
  width: 110px;
  font-size: 0.8rem;
  padding: 3px 4px;
}

/* Room Classes by Day table */
#byDay-table-section { margin-top: 0; overflow-x: auto; }

.byday-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.byday-table th {
  background: var(--navy);
  color: var(--gold);
  padding: 5px 7px;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  font-size: 0.75rem;
  min-width: 52px;
}
/* Room type group header spanning 4 sub-columns */
.byday-table .th-roomtype-group {
  background: var(--navy-light, #1a4a8a);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  border-left: 2px solid rgba(255,255,255,0.3);
  white-space: normal;
  word-break: break-word;
  min-width: 200px;
}
/* Sub-column headers: Room Nights, Rate 1, Rate 2, Extra Adult */
.byday-table .th-byDay-sub {
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  border-left: 1px solid rgba(255,255,255,0.15);
}
.byday-table .th-byDay-sub:first-child { border-left: 2px solid rgba(255,255,255,0.3); }
/* Date label column */
.byday-table th.th-date-col { color: var(--gold); min-width: 60px; white-space: nowrap; }
.byday-table td { padding: 4px 5px; border: 1px solid var(--gray-200); vertical-align: middle; }
.byday-table .td-date-label { font-weight: 600; font-size: 0.8rem; white-space: nowrap; text-align: center; background: var(--gray-50); }
.byday-table .td-rate { text-align: center; color: var(--gray-600); font-size: 0.8rem; min-width: 52px; }
.byday-table .td-rate.disabled { background: var(--gray-100); color: var(--gray-400); }
.byday-table .td-qty { text-align: center; min-width: 52px; }
.byday-table .td-qty input { width: 48px; text-align: center; }
.byday-table .td-qty.disabled { background: var(--gray-100); }
/* Merged/combined qty cell (multiple rows of same type) — read-only display */
.byday-table .td-qty-combined { font-weight: 600; color: var(--navy); }
/* Left border to visually group each room type's 4 columns */
.byday-table .col-group-start { border-left: 2px solid var(--gray-300) !important; }

/* ---- Field Grid ---- */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.5rem;
}

.field-grid .field {
  min-width: 0;
}

.field-grid.col-3 { grid-template-columns: repeat(3, 1fr); }
.field-grid.col-1 { grid-template-columns: 1fr; }
.field-grid.col-2 { grid-template-columns: repeat(2, 1fr); }
.field-grid.col-4 { grid-template-columns: repeat(4, 1fr); }
.field-grid.col-5 { grid-template-columns: repeat(5, 1fr); }
.field-grid.col-6 { grid-template-columns: repeat(6, 1fr); }
.field-grid.tq-proposal-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.field-grid.tmg-proposal-grid {
  /* Date | Date | Days (narrow) | Status | Type | ID */
  grid-template-columns: minmax(9rem, 1fr) minmax(9rem, 1fr) minmax(4.5rem, 0.5fr) minmax(10rem, 1.5fr) minmax(10rem, 1.5fr) minmax(8rem, 1fr);
}
.field-grid.tmg-comp-upgrade-grid {
  /* Upg/Night (narrow) | Max Upg/Night (narrow) | Room Class (wider) */
  grid-template-columns: minmax(5rem, 0.7fr) minmax(6rem, 0.7fr) minmax(10rem, 1.6fr);
}

.tq-proposal-field {
  min-width: 0;
}

.tq-proposal-field--compact {
  grid-column: span 2;
}

.tq-proposal-field--proposal-date {
  grid-column: 1 / span 2;
}

.tq-proposal-field--valid-date {
  grid-column: 3 / span 2;
}

.tq-proposal-field--quote-id {
  grid-column: 5 / span 2;
}

.tq-proposal-field--status {
  grid-column: 1 / span 3;
}

.tq-proposal-field--type {
  grid-column: 4 / span 3;
}


.field-grid.rate-details-grid {
  grid-template-columns: 1.55fr 0.95fr 0.95fr repeat(5, minmax(76px, 0.72fr));
  gap: 0.75rem;
}

.rate-details-modal-box {
  width: min(1180px, 96vw);
}

.rate-details-grid .field {
  min-width: 0;
}

.rate-details-grid input,
.rate-details-grid select {
  width: 32.2rem;
  min-width: 0;
  padding: 0.52rem 0.55rem;
  font-size: 0.9rem;
}

.rate-details-grid label {
  font-size: 0.66rem;
}

.rate-details-form-row {
  column-gap: 0.75rem;
}

.rate-plan-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  column-gap: 4mm;
  align-items: stretch;
}

.rate-plan-form-fields {
  min-width: 0;
}

.rate-plan-profile-select {
  width: 32.2rem;
  min-height: 9rem;
  padding: 0.45rem 0.55rem;
}

.rate-plan-profile-picker {
  width: 100%;
}

.rate-plan-profile-stack {
  width: 100%;
}

.rate-plan-profile-label {
  display: flex;
  align-items: center;
  min-height: 2rem;
  padding-top: 2.65rem;
}

.rate-plan-profile-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
  min-height: 2rem;
}

.rate-plan-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 0.82rem;
  line-height: 1;
}

.rate-plan-profile-chip-remove {
  border: none;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
}

.rate-plan-profile-chip-remove:hover {
  color: var(--danger);
}

.rate-plan-profile-empty {
  font-size: 0.82rem;
  color: var(--gray-400);
  font-style: italic;
  padding-top: 0.2rem;
}

.rate-plan-profile-summary {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--gray-600);
  line-height: 1.3;
}

.rate-details-row-content {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.rate-details-modal-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.rate-details-table-wrap {
  width: 100%;
}

.rate-details-table {
  width: max-content;
  min-width: 100%;
}

.rate-details-table input,
.rate-details-table select {
  width: 100%;
}

.rate-details-room-class-select {
  min-width: 9rem;
}

.rate-details-remove-row-btn {
  width: 1.9rem;
  height: 1.9rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--gray-500);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rate-details-remove-row-btn:hover {
  background: rgba(214, 48, 49, 0.1);
  color: var(--danger);
}

.rate-details-remove-row-btn:focus-visible {
  outline: 2px solid rgba(0, 53, 128, 0.25);
  outline-offset: 2px;
}

.rate-details-empty {
  padding: 0.75rem 0;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.rate-details-summary {
  min-width: 0;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 10pt;
  line-height: 1.3;
  text-align: left;
}

.rate-details-summary-panel {
  align-self: stretch;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.rate-details-summary-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rate-details-summary-line + .rate-details-summary-line {
  margin-top: 0.15rem;
}

.rate-details-summary-entry + .rate-details-summary-entry {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--gray-200);
}

/* ---- Fields ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Inline select + icon-button row inside a .field */
.field-input-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.field-input-row .form-select,
.field-input-row input {
  flex: 1;
  min-width: 0;
}
.btn-field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--white, #fff);
  color: var(--gray-500);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-field-icon:hover {
  background: var(--primary-50, #eff6ff);
  border-color: var(--primary, #3b82f6);
  color: var(--primary, #3b82f6);
}
.btn-field-icon img,
.btn-field-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}

label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.label-center {
  text-align: center;
}

.label-vcenter {
  display: flex;
  align-items: center;
  align-self: center;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
.field-grid select {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(0, 53, 128, 0.1);
}

input[readonly] {
  background: var(--gray-50);
  color: var(--gray-600);
  cursor: default;
}

/* ---- Select ---- */
.form-select,
.admin-option-select {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--gray-800);
  background: var(--white);
  width: 32.2rem;
  max-width: 100%;
  min-height: 2.2rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: auto;
}

.form-select:focus,
.admin-option-select:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(0, 53, 128, 0.1);
}

/* ---- Dynamic Room Type columns (BB mode) ---- */
.col-bb { display: none; }
#roomClass-table.mode-bb .col-bb { display: table-cell; }
#sgl-roomClass-table.mode-bb .col-bb,
[id^="sgl-group-"].mode-bb .col-bb { display: table-cell; }
#tq-roomClass-table.mode-bb .col-bb { display: table-cell; }
[id^="tq-group-"].mode-bb .col-bb  { display: table-cell; }
[id^="tmg-roomClass-table-"].mode-bb .col-bb { display: table-cell; }

/* ---- PAX columns — visible always (for per-room-type pax counts) ---- */
.col-byday-pax { display: table-cell; }
#roomClass-table.mode-byday .col-byday-pax { display: table-cell; }

/* ---- Calculated / readonly inputs ---- */
.input-calc {
  background: var(--gray-50) !important;
  color: var(--gray-600) !important;
  cursor: default !important;
}

.data-table input.input-calc {
  background: var(--gray-50) !important;
  color: var(--gray-600) !important;
}

/* ---- Percentage input wrapper ---- */
.input-pct {
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  transition: border-color 0.15s, background 0.15s;
  min-width: 80px;
}
.input-pct:hover {
  border-color: var(--gray-200);
  background: var(--white);
}
.input-pct:focus-within {
  border-color: var(--navy-light);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(0, 53, 128, 0.1);
}
.input-pct input {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  min-width: 0;
  flex: 1;
  padding: 0.35rem 0.25rem 0.35rem 0.5rem;
}
.input-pct input:hover,
.input-pct input:focus {
  border-color: transparent !important;
  box-shadow: none !important;
  background: transparent !important;
}
.input-pct-symbol {
  padding: 0.35rem 0.5rem 0.35rem 0;
  font-size: 0.875rem;
  color: var(--gray-600);
  user-select: none;
}

/* ---- In-table select ---- */
.table-select {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-800);
  background: transparent;
  width: 32.2rem;
  min-width: 200px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.table-select:hover {
  border-color: var(--gray-200);
  background: var(--white);
}

.table-select:focus {
  outline: none;
  border-color: var(--navy-light);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(0, 53, 128, 0.1);
}

#tq-proposal-form #tq-roomClass-table .table-select[data-field="roomClass"] {
  width: 9.66rem;
}

#tmg-proposal-form [id^="tmg-roomClass-table-"] .table-select[data-field="roomClass"] {
  width: 16.1rem;
}

#tq-proposal-form #tq-optionalExtras-table .table-select[data-field="optionalExtrasType"] {
  width: 6.44rem;
  min-width: 6.44rem;
}

#tq-proposal-form #tq-optionalExtras-table .table-select[data-field="optionalExtrasFrequency"] {
  width: 8.05rem;
  min-width: 8.05rem;
}

#tmg-proposal-form #tmg-optionalExtras-table .table-select[data-field="optionalExtrasType"] {
  width: 6.44rem;
  min-width: 6.44rem;
}

#tmg-proposal-form #tmg-optionalExtras-table .table-select[data-field="optionalExtrasFrequency"] {
  width: 8.05rem;
  min-width: 8.05rem;
}

#tq-proposal-form #tq-card-cancellation .table-select[data-field="cancellationPenalty"],
#tmg-proposal-form #tmg-card-cancellation .table-select[data-field="cancellationPenalty"] {
  width: 16.1rem;
  min-width: 16.1rem;
}

#tq-proposal-form #tq-card-deposit .table-select[data-field="depositType"] {
  width: 7.41rem !important;
  min-width: 7.41rem !important;
}

#tmg-proposal-form #tmg-card-deposit .table-select[data-field="depositType"] {
  width: 100% !important;
  min-width: 0 !important;
}

#tq-proposal-form #tq-card-deposit .table-select[data-field="depositPeriod"] {
  width: 8.5rem !important;
  min-width: 8.5rem !important;
}

#tmg-proposal-form #tmg-card-deposit .table-select[data-field="depositPeriod"] {
  width: 100% !important;
  min-width: 0 !important;
}

/* ---- Checkboxes ---- */
.checkbox-field::before {
  content: '';
  display: block;
  height: calc(0.72rem * 1.2 + 0.25rem);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
  text-transform: none;
  letter-spacing: 0;
  padding: 0.5rem 0;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--navy);
  flex-shrink: 0;
}

/* ---- Rate-basis segmented toggle (Room Only / BB) ---- */
.rate-basis-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
}

.rate-basis-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.rate-basis-btn {
  flex: 1;
  text-align: center;
  padding: 0.35rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-600);
  background: transparent;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.rate-basis-radio:checked + .rate-basis-btn {
  background: var(--navy);
  color: var(--gold);
}

/* ---- Tables ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead tr {
  background: var(--gray-50);
}

.data-table th {
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: normal;
  word-break: break-word;
  border-bottom: 1px solid var(--gray-200);
}

.data-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background: var(--gray-50);
}

.data-table tbody tr.dash-table-filler-row:hover {
  background: transparent;
}

.data-table tbody tr.dash-table-filler-row td {
  color: transparent;
  user-select: none;
}

.data-table input {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  width: 100%;
  background: transparent;
  transition: border-color 0.15s, background 0.15s;
}
.data-table input[type="number"] { text-align: right; }

.data-table input:hover {
  border-color: var(--gray-200);
  background: var(--white);
}

.data-table input:focus {
  border-color: var(--navy-light);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(0, 53, 128, 0.1);
  outline: none;
}


/* ---- Buttons ---- */
.btn-add {
  background: transparent;
  border: 1.5px solid var(--navy);
  color: var(--navy);
  padding: 0.38rem 0.9rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-add:hover {
  background: var(--navy);
  color: var(--white);
}

/* ---- Report Export dropdown (reusable across view-reports-* pages) ---- */
.report-export-wrap {
  position: relative;
  display: inline-block;
}

.report-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.report-export-btn svg {
  flex-shrink: 0;
}

.report-export-caret {
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0.75;
}

.report-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1.5px solid var(--navy);
  border-radius: 6px;
  min-width: 148px;
  z-index: 200;
  box-shadow: 0 4px 14px rgba(0,0,0,0.13);
  overflow: hidden;
}

.report-export-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.55rem 1rem;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--navy);
  cursor: pointer;
  white-space: nowrap;
}

.report-export-item:hover {
  background: var(--navy);
  color: #fff;
}

.report-export-item + .report-export-item {
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* ---- Saved-options picker button ---- */
.btn-picker {
  background: transparent;
  border: 1.5px solid rgba(0,35,90,0.35);
  color: var(--sub);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-picker:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* Inline variant — sits next to a field label or table header */
.btn-picker-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: 1px solid rgba(0,35,90,0.28);
  color: var(--sub);
  padding: 1px 7px 2px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  vertical-align: middle;
  margin-right: 0.6rem;
  line-height: 1.5;
}
.btn-picker-inline:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ---- Shared options-picker dropdown ---- */
.options-picker-menu {
  position: fixed;
  min-width: 260px;
  max-width: 380px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.14);
  z-index: 500;
  overflow: hidden;
}
.options-picker-header {
  padding: 8px 13px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: #f6f8fb;
}
.options-picker-item {
  display: block;
  width: 100%;
  padding: 9px 13px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #f0f2f5;
  text-align: left;
  font-size: 0.83rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.options-picker-item:last-child { border-bottom: none; }
.options-picker-item:hover {
  background: #eef2ff;
  color: var(--navy);
}
.options-picker-empty {
  padding: 13px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.btn-remove {
  background: transparent;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.btn-remove:hover {
  color: var(--danger);
  background: rgba(214, 48, 49, 0.08);
}

/* ---- Summary Card ---- */
.summary-card {
  background: var(--navy);
  color: var(--white);
}

.summary-card .card-title {
  color: var(--gold);
  border-bottom-color: rgba(200, 169, 110, 0.4);
}

.summary-grid {
  display: flex;
  flex-direction: column;
}

.summary-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0 0 0.4rem;
  border-bottom: 1px solid rgba(200,169,110,0.3);
  margin-bottom: 0.1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.summary-row:last-child {
  border-bottom: none;
  padding-top: 0.9rem;
  margin-top: 0.25rem;
}

.summary-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
}

.summary-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
}

.summary-total .summary-label,
.summary-total .summary-value {
  font-size: 1.1rem;
  color: var(--gold);
}

.summary-group-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(200, 169, 110, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 0 0.2rem;
  border-top: 1px solid rgba(200, 169, 110, 0.2);
}

.summary-group-header--first {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.25rem;
}

.summary-group-dates {
  font-weight: 400;
  opacity: 0.7;
  font-size: 0.7rem;
  margin-left: 0.4rem;
  text-transform: none;
  letter-spacing: 0;
}

.summary-grand-separator {
  border-top: 2px solid rgba(200, 169, 110, 0.35);
  margin: 0.25rem 0 0;
}

/* ── Summary card two-panel layout ──────────────────────────────────────── */
.summary-card-body {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.summary-card-body .summary-grid {
  flex: 0 0 50%;
  max-width: 50%;
}

.summary-dates-panel {
  flex: 1;
  min-width: 0;
  border-left: 1px solid rgba(255,255,255,0.15);
  padding-left: 2.5rem;
}

.summary-dates-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(200,169,110,0.3);
  margin-bottom: 0.2rem;
}

.summary-dates-group-header {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(200,169,110,0.7);
  padding: 0.55rem 0 0.15rem;
}

.summary-dates-sub-header {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(200,169,110,0.45);
  padding: 0.35rem 0 0.1rem 0.75rem;
}

.summary-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.38rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 1rem;
}

.summary-date-row:last-child {
  border-bottom: none;
}

.summary-date-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  flex: 1;
}

.summary-date-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
}

.summary-date-empty {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
  font-style: italic;
  padding: 0.5rem 0;
}

.summary-inv-btn {
  flex-shrink: 0;
  margin-left: 0.25rem;
  margin-right: auto;
  color: rgba(255, 255, 255, 0.35);
  border-color: transparent;
}
.summary-inv-btn:hover {
  color: var(--gold);
  background: rgba(200, 169, 110, 0.12);
  border-color: rgba(200, 169, 110, 0.3);
}

/* ---- Sticky Footer ---- */
.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 100;
}

.footer-inner {
  max-width: 1900px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-status {
  font-size: 0.85rem;
  color: var(--gray-600);
}

.footer-status.error   { color: var(--danger); font-weight: 600; }
.footer-status.success { color: var(--success); font-weight: 600; }

.btn-generate {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 0.72rem 2.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn-generate:hover    { background: var(--navy-light); }
.btn-generate:active   { transform: scale(0.98); }
.btn-generate:disabled { background: var(--gray-400); cursor: not-allowed; transform: none; }

.btn-page {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 5px;
  background: var(--surface, #fff);
  color: var(--navy);
  font-size: 0.82rem;
  cursor: pointer;
  line-height: 1.4;
}
.btn-page:hover:not(:disabled) { background: var(--gray-100, #f3f4f6); }
.btn-page:disabled { color: var(--gray-300, #d1d5db); cursor: default; }

/* ---- Navigation Tabs ---- */
.site-nav {
  display: flex;
  gap: 0;
  align-items: stretch;
}

/* ---- Module-aware nav groups ---- */
.module-nav {
  display: none;
  align-items: stretch;
  gap: 0;
}
#site-nav[data-active-module="quotes"]           .module-nav[data-module="quotes"],
#site-nav[data-active-module="invoice"]          .module-nav[data-module="invoice"],
#site-nav[data-active-module="document-builder"] .module-nav[data-module="document-builder"] {
  display: flex;
}

/* ---- GuestPath logo (header right) ---- */
.gp-logo {
  height: 44px;
  width: auto;
  display: block;
  align-self: center;
  mix-blend-mode: screen;
  opacity: 0.95;
}

.company-logo {
  height: 44px;
  width: auto;
  max-width: 160px;
  display: block;
  align-self: center;
  margin-left: 0.75rem;
  object-fit: contain;
  border-radius: 3px;
}

/* ---- User avatar circle ---- */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  user-select: none;
  align-self: center;
  cursor: pointer;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* ---- Avatar profile popup ---- */
.avatar-popup {
  position: fixed;
  top: 68px;
  right: 1.25rem;
  z-index: 500;
}

.avatar-popup.hidden {
  display: none;
}

.avatar-popup-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
  width: 300px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.15s ease;
}

/* Navy header bar — matches .modal-header */
.avatar-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: var(--navy);
  flex-shrink: 0;
}

.avatar-popup-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.03em;
  margin: 0;
}

.avatar-popup-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
  line-height: 1;
}

.avatar-popup-close:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

.avatar-popup-header-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.avatar-popup-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}

.avatar-popup-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.avatar-popup-icon-btn img {
  width: 18px;
  height: 18px;
  display: block;
}

/* ---- More Profile Details: signature uploader ---- */
.mpd-signature-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.mpd-signature-preview-wrap {
  position: relative;
  width: 200px;
  height: 60px;
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mpd-signature-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mpd-signature-preview img {
  max-width: 200px;
  max-height: 60px;
  display: block;
}

.mpd-signature-empty {
  font-size: 0.78rem;
  color: var(--gray-400);
}

.mpd-signature-preview-wrap:has(.mpd-signature-preview:not(.hidden)) .mpd-signature-empty {
  display: none;
}

.mpd-signature-context-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 110px;
  overflow: hidden;
}

.mpd-signature-context-menu button {
  background: none;
  border: none;
  text-align: left;
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--gray-800);
}

.mpd-signature-context-menu button:hover {
  background: var(--gray-100);
}

.mpd-signature-context-menu #mpd-signature-delete {
  color: var(--danger);
}

/* Body area below the header */
.avatar-popup-body {
  padding: 1.4rem 1.4rem 1.2rem;
}

.avatar-popup-fields {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.avatar-popup-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.avatar-popup-label {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
}

.avatar-popup-value {
  font-size: 0.875rem;
  color: var(--gray-800);
}

.avatar-popup-upload {
  margin-bottom: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
}

.avatar-popup-upload .btn-secondary {
  min-width: 112px;
  min-height: 42px;
}

.avatar-popup-upload .sign-out-btn {
  margin-left: 0;
}

.ap-avatar-large-row {
  display: flex;
  justify-content: center;
  padding-top: 0.75rem;
}

.ap-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  user-select: none;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.ap-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* ---- Edit view ---- */
#ap-edit-view.hidden {
  display: none;
}

.ap-edit-canvas-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 0.75rem;
}

.ap-edit-canvas {
  border-radius: 50%;
  cursor: grab;
  display: block;
  touch-action: none;
  box-shadow: 0 0 0 3px var(--gray-200), 0 4px 18px rgba(0,0,0,0.18);
}

.ap-edit-canvas:active {
  cursor: grabbing;
}

.ap-edit-hint {
  font-size: 0.72rem;
  color: var(--gray-500);
  margin: 0 0 0.85rem;
  text-align: center;
}

.ap-edit-zoom-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gray-100);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.85rem;
}

.ap-edit-zoom-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-right: 0.15rem;
  white-space: nowrap;
}

.ap-zoom-step-btn {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  display: flex;
  align-items: center;
}

.ap-zoom-step-btn:hover {
  color: var(--navy);
}

.ap-zoom-slider {
  flex: 1;
  accent-color: var(--navy);
  cursor: pointer;
}

.ap-edit-actions {
  display: flex;
  gap: 0;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.ap-edit-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: none;
  border: none;
  border-right: 1px solid var(--gray-200);
  padding: 0.5rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}

.ap-edit-action-btn:last-child {
  border-right: none;
}

.ap-edit-action-btn:hover {
  background: var(--gray-100);
}

.ap-edit-action-remove {
  color: #c0392b;
}

.ap-edit-action-remove:hover {
  background: #fef2f2;
}

.ap-edit-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.nav-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(255,255,255,0.65);
  padding: 0 0.85rem;
  border-radius: 0;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.nav-tab:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
  border-bottom-color: rgba(200,169,110,0.5);
}

.nav-tab.active {
  background: transparent;
  color: var(--white);
  border-bottom-color: var(--gold);
  font-weight: 700;
}

/* ---- Admin nav dropdown ---- */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
}

.nav-tab--arrow {
  gap: 5px;
}

.nav-arrow {
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0.8;
  transition: transform 0.15s;
  display: inline-block;
}

.nav-tab--arrow.open .nav-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,0.12);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  z-index: 200;
  overflow: hidden;
}

#admin-dropdown-menu {
  overflow: visible;
}

.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  background: rgba(255,255,255,0.09);
  color: var(--white);
}

.nav-dropdown-item.active {
  color: var(--gold);
  font-weight: 600;
}

.nav-dropdown-item--icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Quotes dropdown — submenu group headers */
.nav-dropdown-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 14px 7px;
  background: rgba(255,255,255,0.04);
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}
.nav-dropdown-group:first-child { border-top: none; }
.nav-dropdown-group:hover { background: rgba(255,255,255,0.09); }
.nav-dropdown-group .nav-arrow { font-size: 0.65rem; }

.nav-dropdown-group-wrap {
  position: relative;
}

.nav-dropdown-subgroup {
  position: absolute;
  top: 0;
  left: calc(100% + 6px);
  min-width: 220px;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.26);
  z-index: 230;
  overflow: visible;
}

.nav-dropdown-group-wrap .nav-dropdown-group:hover,
.nav-dropdown-group-wrap .nav-dropdown-group.is-open {
  background: rgba(255,255,255,0.12);
}

.nav-dropdown-group-wrap .nav-dropdown-group.is-open .nav-arrow {
  transform: rotate(90deg);
}

/* VarPicker collapsible groups */
.var-picker-arrow { display: inline-block; transition: transform 0.15s; font-style: normal; }
.var-group-header.collapsed .var-picker-arrow { transform: rotate(-90deg); }
.var-group-body.collapsed { display: none; }

/* Indented sub-items */
.nav-dropdown-subitem { padding-left: 16px !important; }

/* Save Quote tab — gold outline, distinct from nav tabs */
.nav-tab-save {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
}
.nav-tab-save:hover {
  background: var(--gold) !important;
  color: var(--navy) !important;
}

/* Vertical divider between nav groups */
.nav-divider {
  width: 1px;
  height: 1.4rem;
  background: rgba(255,255,255,0.2);
  margin: 0 0.25rem;
}

/* ---- Views ---- */
/* General hidden utility — applies to any element */
.hidden { display: none !important; }

.view.hidden { display: none; }

/* ---- Footer Actions ---- */
.footer-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.footer-actions .footer-generate-group {
  margin-left: auto;
}

.footer-generate-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.footer-generate-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.footer-generate-divider {
  width: 100%;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  margin-bottom: 0.4rem;
}

.footer-generate-buttons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.footer-actions .btn-secondary {
  padding: 0.72rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.btn-save {
  background: transparent;
  border: 1.5px solid var(--navy);
  color: var(--navy);
  padding: 0.72rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-save:hover { background: var(--navy); color: var(--white); }

.btn-save-as {
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  padding: 0.72rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-save-as:hover { background: var(--gold); color: var(--white); }

.btn-new-quote {
  background: transparent;
  border: 1.5px solid var(--gray-400);
  color: var(--gray-600);
  padding: 0.72rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  margin-right: auto;
}
.btn-new-quote:hover { background: var(--gray-100); border-color: var(--gray-600); color: var(--gray-800); }


/* ---- Load Layout dropdown ---- */
.tq-load-layout-wrap {
  position: relative;
}

.btn-load-layout {
  background: transparent;
  border: 1.5px solid var(--gray-400);
  border-radius: 4px;
  color: var(--gray-700);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-load-layout:hover { border-color: var(--navy); color: var(--navy); }
.tq-dropdown-arrow { font-size: 0.75rem; margin-left: 0.2rem; }

.tq-load-layout-menu {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  bottom: calc(100% + 6px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  left: 0;
  max-height: 260px;
  min-width: 240px;
  overflow-y: auto;
  padding: 0.3rem 0;
  position: absolute;
  z-index: 200;
}
.tq-load-layout-menu.hidden { display: none; }

.tq-load-item {
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.5rem 0.9rem;
  text-align: left;
  width: 100%;
}
.tq-load-item:hover { background: var(--gray-50, #f8f9fa); }
.tq-load-item.active { background: var(--navy-5, #eef1f6); font-weight: 600; }

.tq-load-item-name {
  color: var(--gray-800);
  flex: 1;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tq-load-item-date {
  color: var(--gray-400);
  font-size: 0.75rem;
  white-space: nowrap;
}

.tq-load-empty {
  color: var(--gray-400);
  font-size: 0.82rem;
  padding: 0.6rem 0.9rem;
}

/* ---- Saved Quotes Table extras ---- */
.cell-mono        { font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.82rem; color: var(--navy); font-weight: 600; }
.cell-currency    { font-weight: 700; text-align: right; }
.quote-id-link    { color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.quote-id-link:hover { opacity: 0.75; }

/* PMS-linked badge next to Quote ID */
.pms-id-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.4rem;
  padding: 0 0.35em;
  font-size: 0.82rem;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: var(--navy, #00235A);
  color: #9fc8ff;
  cursor: default;
  user-select: none;
  vertical-align: middle;
}


.cell-actions     { text-align: center; width: 44px; }
.cell-status-icon { text-align: center; width: 36px; }
.cell-creator     { text-align: center; width: 42px; }
.cell-sort-handle { text-align: center; width: 44px; color: #9aa3af; font-size: 0.8rem; cursor: grab; user-select: none; }
.cell-sort-handle:active { cursor: grabbing; }
tr.dt-drag-over td { background: var(--accent-light, #e8f0fe); }
.cell-expired-inq { color: #c0392b; }

/* Creator initials badge */
.creator-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy, #1a2236);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: default;
  user-select: none;
}
.creator-badge--closed {
  color: #c0392b;
}
.creator-badge--tree {
  width: 1.6em;
  height: 1.6em;
  font-size: inherit;
  border-radius: 3px;
  flex-shrink: 0;
}
.creator-badge--pms {
  background: #0e6b6b;
  color: #fff;
  margin-left: 0.5rem;
}
.folio-pms-tab {
  font-size: 7.5px;
  font-weight: 600;
  color: #0e6b6b;
  background: #e0f4f4;
  border: 1px solid #9ed8d8;
  border-radius: 3px;
  padding: 0.1em 0.4em;
  letter-spacing: 0.03em;
  user-select: none;
  white-space: nowrap;
}

.saved-quotes-search-row { margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.saved-quotes-search {
  width: 100%;
  max-width: 360px;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--gray-700);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
}
.saved-quotes-search:focus { border-color: var(--navy-light); }

.saved-quotes-date-range {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
}
.saved-quotes-date-range-label {
  font-size: 0.8rem;
  color: var(--gray-600);
  white-space: nowrap;
}
.saved-quotes-date-range-sep {
  font-size: 0.8rem;
  color: var(--gray-500);
}
.saved-quotes-date-input {
  width: 8.4rem;
  min-width: 8.4rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--gray-700);
  background: var(--white);
}
.saved-quotes-date-input:focus {
  outline: none;
  border-color: var(--navy);
}
.saved-quotes-date-clear {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--gray-700);
  background: var(--white);
  cursor: pointer;
}
.saved-quotes-date-clear:hover {
  border-color: var(--navy);
  color: var(--navy);
}

#saved-quotes-table { font-size: 0.75rem; }
#saved-quotes-table th { white-space: nowrap; }
#saved-quotes-table th[data-col] { cursor: pointer; user-select: none; }
#saved-quotes-table th[data-col]::after { content: " \2195"; opacity: 0.25; font-size: 0.75em; }
#saved-quotes-table th[data-sort="asc"]::after  { content: " \2191"; opacity: 0.9; }
#saved-quotes-table th[data-sort="desc"]::after { content: " \2193"; opacity: 0.9; }
/* col 1=Quote ID, col 2=Group Name, col 3=Quote Type, col 4=Arrival, col 5=Nights,
   col 6=Rate, col 7=Total Revenue, col 8=Saved, col 9=Proposal Date, col 10=Status */
#saved-quotes-table th:nth-child(2),
#saved-quotes-table td:nth-child(2) { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#saved-quotes-table th:nth-child(3),
#saved-quotes-table td:nth-child(3) { width: 100px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#saved-quotes-table th:nth-child(4),
#saved-quotes-table td:nth-child(4) { white-space: nowrap; }
#saved-quotes-table th:nth-child(5),
#saved-quotes-table td:nth-child(5) { width: 56px; white-space: nowrap; }
#saved-quotes-table th:nth-child(6),
#saved-quotes-table td:nth-child(6) { width: 80px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#saved-quotes-table th:nth-child(7),
#saved-quotes-table td:nth-child(7) { width: 110px; white-space: nowrap; }
#saved-quotes-table th:nth-child(8),
#saved-quotes-table td:nth-child(8) { white-space: nowrap; }
#saved-quotes-table th:nth-child(9),
#saved-quotes-table td:nth-child(9) { white-space: nowrap; }
#saved-quotes-table th:nth-child(10),
#saved-quotes-table td:nth-child(10) { text-align: center; }
#saved-quotes-table th:nth-child(11),
#saved-quotes-table td:nth-child(11) { text-align: center; }
#saved-quotes-table th:nth-child(12),
#saved-quotes-table td:nth-child(12) {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  position: sticky;
  right: 0;
  background: var(--white);
  z-index: 1;
}
#saved-quotes-table thead th:nth-child(12) { background: var(--gray-50); }

/* Expand toggle button in Quote ID cell */
.sq-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 3px 0 0;
  font-size: 0.7rem;
  color: var(--gray-500);
  vertical-align: middle;
  line-height: 1;
  width: 1rem;
  display: inline-block;
  text-align: center;
}
.sq-expand-btn:hover { color: var(--navy); }
/* Spacer for single-block rows — keeps Quote ID text aligned with multi-block rows */
.sq-expand-spacer {
  display: inline-block;
  width: 1rem;
}

/* Expanded sub-rows */
.sq-block-row td {
  background: var(--gray-50);
  font-size: 0.72rem;
  color: var(--gray-600);
  border-top: none;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}
.sq-block-row .sq-block-indent { padding-left: 1.6rem; }
.sq-block-row .sq-block-name { font-style: italic; }
.sq-block-row .sq-block-pms { font-size: 0.7rem; color: var(--gray-500); }
tr.sq-row-expanded td { border-bottom: none; }

/* Export CSV dropdown */
.sq-export-wrap {
  position: relative;
  display: inline-block;
}
.sq-export-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 200;
  overflow: hidden;
}
.sq-export-option {
  display: block;
  width: 100%;
  padding: 0.5rem 0.9rem;
  text-align: left;
  font-size: 0.8rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-700);
  white-space: nowrap;
}
.sq-export-option:hover { background: var(--gray-50); color: var(--navy); }
.saved-quotes-filter-divider {
  color: var(--gray-300);
  font-size: 1rem;
  padding: 0 0.15rem;
}

/* Saved Quotes Pagination */
.sq-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0 0.15rem;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-height: 2rem;
}
.sq-page-info {
  font-size: 0.8rem;
  color: var(--text-muted, #666);
}
.sq-page-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.sq-page-btn {
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--border, #ddd);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--navy, #1a2d4e);
  transition: background 0.12s, border-color 0.12s;
  min-width: 1.9rem;
}
.sq-page-btn:hover:not(:disabled) { background: var(--navy-light, #e8edf5); border-color: var(--navy, #1a2d4e); }
.sq-page-btn:disabled { opacity: 0.38; cursor: default; }
.sq-page-btn--active { background: var(--navy, #1a2d4e); color: #fff; border-color: var(--navy, #1a2d4e); pointer-events: none; opacity: 1; }
.sq-page-ellipsis { font-size: 0.8rem; padding: 0 0.15rem; color: #999; line-height: 1; }

.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.9rem;
  line-height: 1.6;
}
.empty-state.hidden { display: none; }

/* ---- Context Menu ---- */
.context-menu {
  position: absolute;
  z-index: 500;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 185px;
  padding: 0.35rem 0;
  animation: fadeInDown 0.1s ease;
}

.context-menu.hidden { display: none; }

.context-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.context-item:hover         { background: var(--gray-50); }
.context-item-danger        { color: var(--danger); }
.context-item-danger:hover  { background: rgba(214,48,49,0.06); }

.context-submenu {
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 4px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 0.35rem 0;
  z-index: 501;
  animation: fadeInDown 0.1s ease;
}

#context-status-submenu {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: 4px;
}

.context-submenu.hidden {
  display: none;
}

.context-arrow {
  margin-left: auto;
  font-size: 0.7em;
  opacity: 0.5;
}

.context-menu-header {
  padding: 0.4rem 1rem 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 0.2rem;
  user-select: none;
}

.context-icon { font-size: 0.85rem; width: 1.1rem; flex-shrink: 0; }

.context-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 0.3rem 0;
}

.btn-context-menu {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 1.15rem;
  color: var(--gray-400);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
  padding: 0;
  line-height: 1;
}

.btn-context-menu:hover {
  color: var(--navy);
  background: var(--gray-100);
  border-color: var(--gray-200);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.15s ease;
}
.modal-box-wide { max-width: 680px; }

/* ── Modal Tabs ── */
.modal-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  background: var(--gray-50, #f8f9fa);
  flex-shrink: 0;
}
.modal-tab {
  padding: 0.65rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.modal-tab:hover { color: var(--navy); }
.modal-tab.active { color: var(--navy); border-bottom-color: var(--gold); }

/* ── Scheduled Dates Tab ── */
.modal-sched-section { padding: 0.85rem 1.2rem 0.5rem; }
.modal-sched-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-600); margin-bottom: 0.55rem; }
.modal-sched-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.modal-sched-table th { text-align: left; padding: 0.3rem 0.6rem; color: var(--gray-500); font-weight: 600; border-bottom: 1px solid var(--gray-200); }
.modal-sched-table td { padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--gray-100); color: var(--gray-800); }
.modal-sched-table tr:last-child td { border-bottom: none; }
.modal-sched-empty { color: var(--gray-400); font-style: italic; padding: 0.5rem 0.6rem; }
.sched-cal-cell { width: 2rem; padding: 0.2rem 0.3rem !important; text-align: center; }
.sched-cal-btn { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0.1rem 0.2rem; border-radius: 3px; opacity: 0.55; line-height: 1; }
.sched-cal-btn:hover { opacity: 1; background: var(--gray-100); }

/* ── Correspondence Tab ── */
.corr-header {
  padding: 0.9rem 1.2rem 0.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.corr-email-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}
.corr-email-label { font-size: 0.8rem; color: var(--gray-600); font-weight: 600; }
.corr-email-addr  { font-size: 0.82rem; color: var(--navy); background: var(--gray-100,#f0f0f0); padding: 0.2rem 0.5rem; border-radius: 4px; user-select: all; }
.corr-hint-main   { font-size: 0.78rem; color: var(--gray-500); margin: 0; }
.summary-email-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.tq-copy-email-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.15rem;
  cursor: pointer;
  color: rgba(255,255,255,0.55);
  border-radius: 3px;
  transition: color 0.15s ease;
  flex-shrink: 0;
}
.tq-copy-email-btn svg { width: 0.9rem; height: 0.9rem; }
.tq-copy-email-btn:hover { color: rgba(255,255,255,0.9); }
.tq-copy-email-btn.is-copied { color: var(--success, #00b894); }
.btn-small {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  color: var(--gray-600);
}
.btn-small:hover { background: var(--gray-100,#f0f0f0); }
#corr-container   { overflow-y: auto; max-height: 340px; padding: 0.5rem 0; }
.corr-loading, .corr-error { padding: 1rem 1.2rem; font-size: 0.85rem; color: var(--gray-500); }
.corr-error       { color: var(--danger); }
.corr-empty       { padding: 1.2rem; text-align: center; color: var(--gray-400); font-size: 0.85rem; }
.corr-empty .corr-hint { font-size: 0.8rem; margin-top: 0.4rem; color: var(--gray-500); }
.corr-card        { border-bottom: 1px solid var(--gray-200); }
.corr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  gap: 0.5rem;
  transition: background 0.1s;
}
.corr-card-header:hover { background: var(--gray-50,#f8f9fa); }
.corr-meta        { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
.corr-subject     { font-size: 0.85rem; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corr-from        { font-size: 0.75rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corr-right       { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.corr-date        { font-size: 0.75rem; color: var(--gray-400); white-space: nowrap; }
.corr-att-badge   { font-size: 0.8rem; }
.corr-chevron     { font-size: 0.75rem; color: var(--gray-400); transition: transform 0.15s; }
.corr-card-body   { padding: 0.5rem 1.2rem 0.9rem; border-top: 1px solid var(--gray-100,#f0f0f0); }
.corr-body-html   { font-size: 0.82rem; line-height: 1.5; max-height: 240px; overflow-y: auto; }
.corr-body-text pre { font-size: 0.8rem; white-space: pre-wrap; word-break: break-word; color: var(--gray-700); margin: 0; max-height: 240px; overflow-y: auto; }
.corr-body-empty  { font-size: 0.8rem; color: var(--gray-400); }
.corr-attachments { margin-top: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.corr-att-label   { font-size: 0.75rem; color: var(--gray-500); font-weight: 600; }
.corr-att-link    { font-size: 0.78rem; color: var(--navy); text-decoration: none; background: var(--gray-100,#f0f0f0); padding: 0.2rem 0.5rem; border-radius: 4px; }
.corr-att-link:hover { background: var(--gray-200); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  background: var(--navy);
  flex-shrink: 0;
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-header-status {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 0.22rem 0.7rem;
  border-radius: 20px;
  white-space: nowrap;
}

.modal-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.modal-close:hover { color: var(--white); background: rgba(255,255,255,0.12); }

#tmg-block-extras-modal .tmg-extras-modal-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

#tmg-block-extras-modal .tmg-extras-modal-title-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.blocks-editor-mode-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: var(--gray-50);
  overflow: hidden;
}

.blocks-editor-mode-btn {
  border: none;
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.85rem;
  text-transform: uppercase;
}

.blocks-editor-mode-btn.active {
  background: var(--navy);
  color: var(--gold);
}

.blocks-editor-rte-wrap {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.blocks-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.55rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.blocks-editor-toolbar-btn {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--white);
  color: var(--gray-800);
  cursor: pointer;
  font-size: 0.78rem;
  min-width: 2.3rem;
  padding: 0.35rem 0.6rem;
}

.blocks-editor-toolbar-btn:hover {
  background: var(--gray-100);
}

.blocks-editor-rte {
  min-height: 220px;
  max-height: 420px;
  padding: 0.8rem 0.9rem;
  line-height: 1.55;
  outline: none;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

.blocks-editor-rte:empty::before {
  content: attr(data-placeholder);
  color: var(--gray-400);
}

.blocks-editor-rte ul,
.blocks-editor-rte ol {
  margin: 0.5rem 0 0.5rem 1.2rem;
}

.blocks-editor-rte p {
  margin: 0 0 0.6rem;
}

.modal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1.4rem;
  border-bottom: 1px solid var(--gray-100);
}
.modal-row:last-child { border-bottom: none; }

.modal-row-highlight {
  background: var(--gray-50);
}
.modal-row-highlight .modal-label,
.modal-row-highlight .modal-value {
  font-weight: 700;
  color: var(--navy);
}

.modal-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-800);
  text-align: right;
}

.modal-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 0.35rem 1.4rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.4rem;
  border-top: 1px solid var(--gray-200);
  gap: 0.75rem;
  flex-shrink: 0;
}

.modal-footer-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.modal-footer-actions .btn-secondary,
.modal-footer-actions .btn-generate {
  height: 57.03px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#tmg-block-extras-modal .modal-footer-actions .btn-secondary,
#tmg-block-extras-modal .modal-footer-actions .btn-generate {
  height: auto;
  padding: 0.4rem 1.4rem;
}

.modal-status {
  font-size: 0.82rem;
  color: var(--gray-600);
  flex: 1;
}
.modal-status.success { color: var(--success); font-weight: 600; }
.modal-status.error   { color: var(--danger);  font-weight: 600; }

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600);
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--gray-400); color: var(--gray-800); }

/* ---- Header Right (welcome + sign out + logo) ---- */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
   margin-left: auto;
  flex-shrink: 0;
}

.user-welcome {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
  padding-right: 0.6rem;
  border-right: 1px solid rgba(255,255,255,0.2);
  letter-spacing: 0.02em;
}

.sign-out-btn {
  white-space: nowrap;
}

/* ---- Admin Panel ---- */
.admin-add-form .field-grid { margin-bottom: 1rem; }

.admin-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 2mm;
  margin-top: 0.5rem;
}

.admin-error {
  background: #fff5f5;
  border: 1px solid #f5c6c6;
  border-radius: 6px;
  padding: 8px 14px;
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 14px;
}

/* ── Branding sub-section ── */
.card-section-divider {
  border-top: 1px solid var(--border, #e5e7eb);
  margin: 1.25rem 0 1rem;
}
.card-subsection-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.875rem;
}
.branding-file-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.branding-filename {
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.branding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.875rem;
}
.branding-upload-dropdown {
  position: relative;
}
.branding-upload-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 200;
  min-width: 220px;
  overflow: hidden;
}
.branding-upload-menu button {
  display: block;
  width: 100%;
  padding: 0.5rem 0.875rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text, #111827);
}
.branding-upload-menu button:hover {
  background: var(--surface-hover, #f3f4f6);
}
.branding-preview {
  margin-top: 0.5rem;
}
.branding-preview-label {
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
  margin: 0 0 0.375rem;
}
.branding-preview-img {
  max-height: 80px;
  width: auto;
  max-width: 300px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 4px;
  padding: 4px;
  background: #0a1f5c;
  object-fit: contain;
}
.branding-preview-img--dark {
  background: #fff;
}

.admin-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--gray-400);
  font-style: italic;
}

.admin-users-table .btn-delete-user {
  background: transparent;
  border: 1px solid var(--gray-400);
  color: var(--gray-600);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.admin-users-table .btn-delete-user:hover {
  background: var(--gray-200);
  color: var(--gray-800);
  border-color: var(--gray-600);
}
/* Hard-delete button — pending users only */
.admin-users-table .btn-delete-user--hard {
  border-color: var(--danger);
  color: var(--danger);
}
.admin-users-table .btn-delete-user--hard:hover {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}
.admin-users-table .btn-delete-user:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* User status badges */
.user-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.user-status--active               { background: #d4f5e9; color: #00704a; }
.user-status--pending_verification { background: #fff3cd; color: #856404; }
.user-status--disabled             { background: #f8d7da; color: #842029; }

/* ============================================================
   Client Profile Field
============================================================ */

/* Input + context-menu button side-by-side */
.client-field-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.client-field-wrap input {
  flex: 1;
  border-radius: 6px 0 0 6px;
  border-right: none;
}

.client-field-wrap input:focus {
  position: relative;
  z-index: 1;
  border-right: none;
}

.btn-client-menu {
  flex-shrink: 0;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-left: none;
  border-radius: 0 6px 6px 0;
  color: var(--gray-600);
  font-size: 1.1rem;
  padding: 0 0.7rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  letter-spacing: 0.05em;
}

.btn-client-menu:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* Profile search dropdown */
.profile-search-wrap {
  position: relative;
}

.profile-search-dropdown {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 0 0 6px 6px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
}

.profile-search-dropdown.hidden { display: none; }

.profile-search-item {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.profile-search-item:hover {
  background: var(--gray-50);
  color: var(--navy);
}

.profile-search-item.profile-search-new {
  border-top: 1px solid var(--gray-200);
  color: var(--navy-light);
  font-weight: 600;
  font-size: 0.82rem;
}

.profile-search-empty {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  color: var(--gray-400);
  font-style: italic;
}

/* Duplicate profile warning modal list rows */
.dup-profile-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.875rem;
  background: var(--white);
  transition: background 0.1s, border-color 0.1s;
}

.dup-profile-row:hover {
  background: var(--gray-50);
  border-color: var(--navy-light);
}

.dup-profile-row.selected {
  background: var(--navy-xlight, #eaf0fb);
  border-color: var(--navy);
}

.dup-profile-name {
  flex: 1;
  font-weight: 500;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dup-profile-type {
  font-size: 0.78rem;
  color: var(--gray-500);
  white-space: nowrap;
}

/* ============================================================
   Dashboard
============================================================ */

/* Page header row */
.dash-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.dash-page-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-title-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.dash-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.dash-page-sub {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.3rem;
}
.tq-status-icon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-top: 0.25rem;
}
.status-icon-sm {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 2px;
}

/* ============================================================
   Quick Proposal Page
============================================================ */

.quick-proposal-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.quick-proposal-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.quick-proposal-intro-text {
  color: var(--gray-600);
  max-width: 720px;
}

.quick-proposal-status-wrap {
  min-width: 180px;
  text-align: right;
}

.quick-proposal-filters {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(260px, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.quick-proposal-filters .form-select {
  height: 2.2rem;
}

.quick-proposal-count {
  color: var(--gray-600);
  font-weight: 600;
  text-align: right;
}

.quick-proposal-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quick-proposal-group-card {
  padding: 1.25rem;
}

.quick-proposal-group-header {
  margin-bottom: 1rem;
}

.quick-proposal-group-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.quick-proposal-group-sub {
  margin-top: 0.2rem;
  color: var(--gray-400);
  font-size: 0.8rem;
}

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

.quick-proposal-grid--pair {
  grid-template-columns: auto 1fr;
}

.quick-proposal-block {
  position: relative;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
  padding: 1rem;
  min-height: 220px;
  box-shadow: var(--shadow);
}

.quick-proposal-block-meta {
  padding-right: 3rem;
}

.quick-proposal-block-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.55rem;
}

.quick-proposal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.quick-proposal-default-badge {
  background: rgba(200, 169, 110, 0.18);
  color: var(--navy);
}

.quick-proposal-block-content {
  color: var(--gray-800);
  line-height: 1.6;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.quick-proposal-block-content > :first-child {
  margin-top: 0;
}

.quick-proposal-block-content > :last-child {
  margin-bottom: 0;
}

.quick-proposal-block-content p,
.quick-proposal-block-content ul,
.quick-proposal-block-content ol,
.quick-proposal-block-content blockquote {
  margin: 0 0 0.75rem;
}

.quick-proposal-block-content ul,
.quick-proposal-block-content ol {
  padding-left: 1.2rem;
}

.quick-proposal-array-table {
  width: 100%;
  margin: 0.75rem 0;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--gray-200);
}

.quick-proposal-array-table th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.quick-proposal-array-table th + th {
  border-left: 1px solid var(--gray-200);
}

.quick-proposal-array-table td {
  padding: 0.6rem 0.75rem;
  vertical-align: top;
  border-top: 1px solid var(--gray-200);
}

.quick-proposal-array-table tbody tr:first-child td {
  border-top: none;
}

.quick-proposal-array-table td + td {
  border-left: 1px solid var(--gray-200);
}

.quick-proposal-array-table .col-date {
  width: 90px;
}

.quick-proposal-array-table .col-rate {
  width: 65px;
}

.quick-proposal-array-table th.col-rate {
  white-space: normal;
  word-break: break-word;
}

.quick-proposal-array-table td.col-rate {
  white-space: nowrap;
}

.quick-proposal-block-content li + li {
  margin-top: 0.25rem;
}

.quick-proposal-block-content strong {
  font-weight: 700;
}

.quick-proposal-block-content em {
  font-style: italic;
}

.quick-proposal-block-content u {
  text-decoration: underline;
}

.quick-proposal-copy-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.quick-proposal-copy-btn:hover {
  transform: translateY(-1px);
  border-color: var(--navy-light);
  background: var(--gray-50);
}

.quick-proposal-copy-btn.is-copied {
  border-color: var(--success);
  background: rgba(0, 184, 148, 0.12);
}

.quick-proposal-copy-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

@media (max-width: 860px) {
  .quick-proposal-intro {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-proposal-status-wrap {
    min-width: 0;
    text-align: left;
  }

  .quick-proposal-filters {
    grid-template-columns: 1fr;
  }

  .quick-proposal-count {
    text-align: left;
  }
}

.profiles-page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* KPI cards grid */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.dash-kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-kpi-icon {
  font-size: 1.45rem;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-kpi-icon--blue  { background: rgba(0,53,128,0.09); }
.dash-kpi-icon--gold  { background: rgba(200,169,110,0.15); }
.dash-kpi-icon--green { background: rgba(0,184,148,0.11); }
.dash-kpi-icon--navy  { background: rgba(0,35,90,0.07); }

.dash-kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.dash-kpi-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
}

/* Two-column body layout */
.dash-two-col {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.25rem;
  align-items: stretch;
}

/* Truncated name cell */
.dash-name-cell {
  font-weight: 500;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sub-label (used next to card titles) */
.dash-sub-label {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 500;
}

/* Status badges */
.dash-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.dash-badge--today { background: #d4f5e9; color: #00704a; }
.dash-badge--soon  { background: #fff3cd; color: #856404; }
.dash-badge--ok    { background: #cce5ff; color: #004085; }
.dash-badge--out   { background: var(--gray-100); color: var(--gray-600); }
.dash-badge--past  { background: #f8d7da; color: #842029; }

/* Revenue pipeline horizontal bar chart */
.dash-pipeline-bars {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dash-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 160px;
  align-items: center;
  gap: 0.75rem;
}

.dash-bar-label {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--gray-600);
  text-align: right;
  white-space: nowrap;
}
.dash-bar-label--current { color: var(--navy); font-weight: 700; }
.dash-bar-label--past    { color: var(--gray-400); }

.dash-bar-track {
  background: var(--gray-100);
  border-radius: 4px;
  height: 22px;
  overflow: hidden;
}

.dash-bar-stack {
  display: flex;
  height: 100%;
  min-width: 0;
  border-radius: 4px;
  overflow: hidden;
}

.dash-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-light), var(--navy));
  border-radius: 4px;
  transition: width 0.45s ease;
}
.dash-bar-fill--past    { background: linear-gradient(90deg, var(--gray-200), var(--gray-400)); }
.dash-bar-fill--current { background: linear-gradient(90deg, #00897b, var(--success)); }

.dash-bar-segment {
  display: block;
  height: 100%;
  min-width: 0;
  background: var(--dash-segment-color, var(--navy));
  cursor: pointer;
}

.dash-bar-segment:hover {
  filter: brightness(1.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.dash-bar-segment--past {
  filter: saturate(0.45) brightness(1.02);
}

.dash-bar-segment--current {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

.dash-bar-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}
.dash-bar-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
}
.dash-bar-count {
  font-size: 0.7rem;
  color: var(--gray-400);
}

.dash-bar-breakdown-label {
  font-size: 0.68rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.dash-bar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  font-size: 0.68rem;
  color: var(--gray-600);
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 0.14rem 0.4rem;
}

.dash-bar-legend-swatch {
  width: 0.6rem;
  height: 0.6rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--dash-segment-color, var(--navy));
}

.dash-bar-legend-text,
.dash-bar-legend-value {
  white-space: nowrap;
}

.dash-bar-legend-value {
  color: var(--gray-500);
}

/* ── Complimentary cards (side-by-side, 50% width each) ──── */
/* tq-comp-row is now a tq-half-row; these styles are kept for reference */
.tq-comp-row .card {
  display: flex;
  flex-direction: column;
}

/* Responsive */
@media (max-width: 1100px) {
  .dash-kpi-grid  { grid-template-columns: repeat(2, 1fr); }
  .dash-two-col   { grid-template-columns: 1fr; }
  .dash-bar-row   { grid-template-columns: 70px 1fr 130px; }
  .dash-bar-legend { gap: 0.25rem 0.35rem; }
  .tq-half-row,
  .tq-comp-row    { flex-direction: column; }
}
@media (max-width: 600px) {
  .dash-kpi-grid  { grid-template-columns: 1fr 1fr; }
  .dash-kpi-card  { padding: 1rem; gap: 0.75rem; }
  .dash-kpi-value { font-size: 1.2rem; }
  .dash-bar-row   { grid-template-columns: 1fr; gap: 0.45rem; }
  .dash-bar-label { text-align: left; }
}

/* ---- Animations ---- */
@keyframes fadeIn      { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown  { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes slideUp     { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .field-grid.col-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .tq-card-row,
  .tq-half-row        { flex-direction: column; }
  .field-grid,
  .field-grid.col-3,
  .field-grid.col-2,
  .field-grid.rate-details-grid,
  .field-grid.tq-proposal-grid { grid-template-columns: 1fr; }
  .tq-proposal-field,
  .tq-proposal-field--compact,
  .tq-proposal-field--proposal-date,
  .tq-proposal-field--valid-date,
  .tq-proposal-field--quote-id,
  .tq-proposal-field--status,
  .tq-proposal-field--type {
    grid-column: auto;
  }
  .rate-plan-form-layout {
    grid-template-columns: 1fr;
    row-gap: 0.75rem;
  }
  .rate-details-row-content {
    align-items: flex-start;
  }
  .rate-details-summary {
    text-align: left;
  }
  .rate-details-summary-panel {
    height: auto;
  }
  .header-inner      { padding: 0.75rem 1rem; }
  .main-layout       { padding: 0 0.75rem; margin: 1rem auto; }
  .card              { padding: 1.1rem; }
}

/* ============================================================
   Project Deployment Admin — Status Badges
============================================================ */

/* Developer status badges */
.dep-status { display:inline-block; padding:2px 8px; border-radius:10px; font-size:0.75rem; font-weight:600; white-space:nowrap; }
.dep-status--NST { background:#e9ecef; color:#495057; }
.dep-status--STA { background:#cce5ff; color:#004085; }
.dep-status--PAU { background:#fff3cd; color:#856404; }
.dep-status--REV { background:#e2d9f3; color:#5a1a8a; }
.dep-status--ERR { background:#f8d7da; color:#842029; }
.dep-status--COM { background:#d4f5e9; color:#00704a; }

/* Claude read/unread badges */
.dep-claude { display:inline-block; padding:2px 8px; border-radius:10px; font-size:0.75rem; font-weight:600; white-space:nowrap; }
.dep-claude--REA { background:#d4f5e9; color:#00704a; }
.dep-claude--UNR { background:#fff3cd; color:#856404; }

/* Task group badges */
.dep-group { display:inline-block; padding:2px 8px; border-radius:10px; font-size:0.75rem; font-weight:600; white-space:nowrap; }
.dep-group--DEP { background:#cce5ff; color:#004085; }
.dep-group--CON { background:#e2d9f3; color:#5a1a8a; }
.dep-group--FEA { background:#d4f5e9; color:#00704a; }
.dep-group--BUG { background:#f8d7da; color:#842029; }

/* Action badges */
.dep-action { display:inline-block; padding:2px 6px; border-radius:4px; font-size:0.7rem; font-weight:700; letter-spacing:0.04em; white-space:nowrap; }
.dep-action--ADD    { background:#d4f5e9; color:#00704a; }
.dep-action--MODIFY { background:#fff3cd; color:#856404; }
.dep-action--DELETE { background:#f8d7da; color:#842029; }

/* Notes cell — truncate in table, full text in tooltip */
.dep-notes-cell { max-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--gray-600); font-size:0.8rem; }

/* Event ID — monospace for readability */
.dep-event-id { font-family:"Courier New",Courier,monospace; font-size:0.8rem; color:var(--gray-800); white-space:nowrap; }

/* Deployment entries table — grow to natural content width so headers never wrap */
#view-project-deployment .main-layout {
  max-width: var(--shell-max-width);
}

#view-project-deployment .card {
  width: 100%;
}

#view-project-deployment .table-wrapper {
  width: 100%;
  max-width: 100%;
}

#view-project-deployment .data-table {
  width: max-content;
  min-width: 100%;
}

/* Docs badge in table */
.dep-docs-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e2d9f3;
  color: #5a1a8a;
  cursor: pointer;
  white-space: nowrap;
}
.dep-docs-badge:hover { background: #d0c1ec; }

/* Attachment list items */
.dep-attachment-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin-bottom: 0.4rem;
  background: var(--gray-50);
  font-size: 0.85rem;
}
.dep-attachment-icon { font-size: 1rem; flex-shrink: 0; }
.dep-attachment-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray-800);
  font-weight: 500;
}
.dep-attachment-size {
  color: var(--gray-400);
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.dep-attachment-download {
  text-decoration: none;
  color: var(--navy);
  font-size: 1rem;
  flex-shrink: 0;
  padding: 2px 4px;
  border-radius: 4px;
}
.dep-attachment-download:hover { background: var(--gray-200); }
.dep-attachment-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
}
.dep-attachment-delete:hover { background: rgba(214,48,49,0.08); }

/* File upload row */
.dep-upload-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dep-file-label {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border: 1px dashed var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--gray-600);
  background: var(--white);
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: border-color 0.15s, background 0.15s;
}
.dep-file-label:hover { border-color: var(--navy); background: var(--gray-50); }

/* ── Deployment filter bar ────────────────────────────────────── */
.dep-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 0 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.dep-filter-input {
  flex: 1;
  min-width: 180px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.85rem;
}
.dep-filter-select {
  width: 32.2rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
}
#profiles-filter-type {
  width: 11.3rem;
}
#saved-quotes-user-filter {
  width: 9.66rem;
}
.dep-filter-input:focus, .dep-filter-select:focus {
  outline: none;
  border-color: var(--navy);
}

/* ── Sortable column headers ──────────────────────────────────── */
.dep-sort-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.dep-sort-th:hover {
  background: var(--gray-100);
  color: var(--navy);
}
.dep-sort-indicator {
  font-size: 0.7rem;
  margin-left: 3px;
  color: var(--navy);
  opacity: 0.8;
}

/* ── Expand / collapse button ─────────────────────────────────── */
.dep-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--navy);
  padding: 2px 4px;
  border-radius: 3px;
  line-height: 1;
}
.dep-expand-btn:hover { background: var(--gray-100); }
.dep-expand-cell { white-space: nowrap; }
.dep-expand-placeholder { display: inline-block; width: 20px; }

/* ── Profiles table — expandable contact rows ─────────────────── */
.expand-cell { width: 28px; padding: 0 4px !important; text-align: center; }
.expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--gray-400);
  padding: 2px 3px;
  border-radius: 3px;
  line-height: 1;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.expand-btn:hover { background: var(--gray-100); color: var(--navy); }
.expand-btn.expanded { transform: rotate(90deg); color: var(--navy); }
.profile-contacts-row td { padding: 0 !important; border-bottom: 2px solid var(--gray-200); }
.profile-contacts-row:hover { background: transparent !important; }
.contacts-subrow-inner {
  padding: 10px 12px 10px 36px;
  background: var(--gray-50);
}
.contacts-subtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.contacts-subtable th {
  padding: 4px 10px 4px 6px;
  text-align: left;
  color: var(--gray-400);
  font-weight: 600;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.contacts-subtable td {
  padding: 4px 10px 4px 6px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  white-space: nowrap;
}
.contacts-subtable tbody tr:last-child td { border-bottom: none; }
.contacts-subtable tbody tr:hover { background: var(--gray-100); }

/* Task count badge on event row */
.dep-task-count {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 1px 5px;
  margin-left: 3px;
  vertical-align: middle;
}

/* ── Nested task rows ─────────────────────────────────────────── */
.dep-event-row { background: #fff; }
.dep-event-row--expanded > td { background: #f8f9ff; }
.dep-task-row { background: #f4f6fb; }
.dep-task-row:hover { background: #eef1f9; }
.dep-task-indent-cell { padding-left: 0 !important; width: 36px; text-align: center; }
.dep-task-connector {
  display: inline-block;
  width: 14px;
  height: 18px;
  border-left: 2px solid var(--gray-300);
  border-bottom: 2px solid var(--gray-300);
  border-radius: 0 0 0 4px;
  vertical-align: middle;
  margin-left: 10px;
}
.dep-task-num-cell { padding-left: 4px !important; }
.dep-task-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dep-desc-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Linked event badge ───────────────────────────────────────── */
.dep-linked-badge {
  display: inline-block;
  background: #e8f4fd;
  color: #0c5a8a;
  border: 1px solid #b3d9f2;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  white-space: nowrap;
  cursor: default;
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Tasks list inside entry modal ───────────────────────────── */
.dep-task-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin-bottom: 0.4rem;
  background: var(--gray-50);
}
.dep-task-item-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 46px;
}
.dep-task-item-desc {
  flex: 1;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dep-task-item-status { flex-shrink: 0; }

/* ============================================================
   Feedback Facility
   ============================================================ */


/* Type badges */
.fb-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.fb-type--bug        { background: #fee2e2; color: #b91c1c; }
.fb-type--suggestion { background: #fef9c3; color: #92400e; }
.fb-type--general    { background: #e0f2fe; color: #0369a1; }

/* Status badges */
.fb-status {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.fb-status--open     { background: #fee2e2; color: #b91c1c; }
.fb-status--resolved { background: #dcfce7; color: #15803d; }

/* Individual feedback card */
.fb-entry {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.7rem;
  background: #fff;
  transition: opacity 0.2s;
}
.fb-entry--resolved {
  opacity: 0.65;
  background: var(--gray-50, #f9fafb);
}
.fb-entry-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}
.fb-entry-meta {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--gray-500);
  white-space: nowrap;
}
.fb-entry-message {
  font-size: 0.88rem;
  color: var(--gray-800, #1f2937);
  margin: 0 0 0.45rem;
  line-height: 1.45;
}
.fb-entry-resolved-by {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin: 0 0 0.45rem;
  font-style: italic;
}
.fb-entry-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Small action buttons inside the inbox cards */
.fb-btn-sm {
  padding: 0.28rem 0.75rem;
  font-size: 0.8rem;
}
.btn-danger {
  background: var(--danger, #dc2626);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.15s;
}
.btn-danger:hover { opacity: 0.85; }


/* ============================================================
   Series Group Leisure — Group Rows
============================================================ */
.group-row {
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  margin-bottom: 1rem;
  overflow: hidden;
}
.group-row--saved {
  border-color: var(--navy, #1e3a5f);
}
.group-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--gray-50, #f9fafb);
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}
.group-row--saved .group-row-header {
  background: var(--navy, #1e3a5f);
  border-bottom-color: var(--navy, #1e3a5f);
}
.group-row-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy, #1e3a5f);
}
.group-row--saved .group-row-title {
  color: #fff;
}
.group-row-body {
  padding: 1rem 1.25rem;
}
.group-row-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--gray-50, #f9fafb);
  border-top: 1px solid var(--gray-200, #e5e7eb);
}
.group-sub-title-row {
  margin: 1rem 0 0.5rem;
}
.card-sub-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy, #1e3a5f);
}
.btn-save-group {
  padding: 0.45rem 1.2rem;
  background: var(--navy, #1e3a5f);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-save-group:hover { opacity: 0.85; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.82rem; }
.group-save-status {
  font-size: 0.82rem;
  font-weight: 600;
}
.group-save-status.saved { color: var(--success, #16a34a); }
.group-save-status.error { color: var(--danger, #dc2626); }

/* ============================================================
   Template Quotation — Insert Point Styles
============================================================ */
.tq-insert-point {
  position: relative;
}
.tq-insert-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.25rem 0;
  margin: 0.1rem 0;
}
.tq-insert-row::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 2px dashed var(--gray-200, #e5e7eb);
  z-index: 0;
}
.tq-insert-btn {
  position: relative;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--navy, #1e3a5f);
  color: #fff;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow, 0 1px 4px rgba(0,0,0,0.12));
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.tq-insert-btn:hover  { background: var(--gold, #b8960c); transform: scale(1.1); }
.tq-insert-btn.hidden { display: none; }
.tq-insert-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  min-width: 260px;
  padding: 0.4rem 0;
  overflow: hidden;
}
.tq-insert-menu-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400, #9ca3af);
  padding: 0.4rem 0.9rem 0.25rem;
}
.tq-insert-option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--navy, #1e3a5f);
  cursor: pointer;
  transition: background 0.1s;
}
.tq-insert-option:hover  { background: var(--gray-50, #f9fafb); }
.tq-insert-option.hidden { display: none; }

/* Inserted section: card with a subtle left accent */
.tq-inserted-section {
  border-left: 3px solid var(--navy, #1e3a5f);
  animation: tqSlideIn 0.18s ease-out;
}
@keyframes tqSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* TQ inserted sections: keep card-header-controls + remove btn grouped on the right */
.tq-inserted-section .card-title-row {
  justify-content: flex-start;
}
.tq-inserted-section .card-title-row .card-header-controls {
  margin-left: auto;
}
.tq-inserted-section .card-title-row .tq-section-remove {
  margin-left: 8px;
}

/* ── Sequential insert zones (progressive card reveal) ──── */
.tq-seq-ins-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0;
  margin: 0.1rem 0;
}
.tq-seq-ins-zone::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 2px dashed var(--gray-200, #e5e7eb);
  z-index: 0;
}
.tq-seq-ins-zone.hidden { display: none; }

/* Labeled sequential insert button (pill shape with text) */
.tq-insert-btn-seq {
  width: auto;
  height: auto;
  padding: 0.3rem 1.1rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ── Half-row: side-by-side card + right-side insert button ── */
.tq-half-insert-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.75rem;
  flex: 0 0 auto;
}
.tq-half-insert-wrap.hidden { display: none; }

/* ── Card dismiss (×) button — top-right of insertable cards ── */
.tq-card-dismiss {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--gray-300, #d1d5db);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  z-index: 2;
  transition: color 0.12s, background 0.12s;
}
.tq-card-dismiss:hover {
  color: var(--danger, #dc2626);
  background: var(--gray-50, #f9fafb);
}
/* Shift card title right when dismiss button is present */
.card > .tq-card-dismiss ~ .card-title,
.card > .tq-card-dismiss ~ h2.card-title {
  padding-right: 2rem;
}

/* ── Card collapse toggle ── */
.card-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400, #9ca3af);
  font-size: 1rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.12s, background 0.12s;
}
.card-collapse-btn:hover { color: var(--gray-600, #4b5563); background: var(--gray-50, #f9fafb); }
.card-collapse-btn .collapse-chevron { display: inline-block; transition: transform 0.15s; }
.card.collapsed .card-collapse-btn .collapse-chevron { transform: rotate(-90deg); }
.card.collapsed .card-body { display: none; }

/* Remove button on inserted sections */
.card-title-row .tq-section-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--gray-400, #9ca3af);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.card-title-row .tq-section-remove:hover {
  color: var(--danger, #dc2626);
  background: var(--gray-50, #f9fafb);
}

/* ── Profiles view — pagination bar ── */
.profiles-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.84rem;
  color: var(--gray-600);
}
.profiles-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.profiles-page-btn {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--navy);
  transition: background 0.12s, border-color 0.12s;
}
.profiles-page-btn:hover:not(:disabled) {
  background: var(--gray-100);
  border-color: var(--gray-400);
}
.profiles-page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.profiles-page-links {
  display: flex;
  gap: 0.2rem;
}
.profiles-page-link {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--gray-600);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.profiles-page-link:hover {
  background: var(--gray-100);
  border-color: var(--gray-200);
}
.profiles-page-link.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.profiles-per-page-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.profiles-per-page-wrap select {
  width: 32.2rem;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.84rem;
  background: var(--white);
  color: var(--gray-800);
}

/* ── DB Loading Spinner ─────────────────────────────────────────────────────── */
.db-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 35, 90, 0.06);
  pointer-events: all;
}
.db-loader-overlay.hidden {
  display: none !important;
}
.db-loader-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(200, 169, 110, 0.22);
  border-top-color: var(--gold);
  border-right-color: rgba(200, 169, 110, 0.6);
  animation: db-spin 0.75s linear infinite;
  box-shadow: 0 4px 18px rgba(0, 35, 90, 0.14);
  background: var(--white);
}
@keyframes db-spin {
  to { transform: rotate(360deg); }
}

/* ── PDF Preview Overlay ─────────────────────────────────────────────────── */
#pdf-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #d0d0d0;
  display: flex;
  flex-direction: column;
}

.pdf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--navy, #001f5b);
  color: #fff;
  flex-shrink: 0;
  gap: 12px;
}

.pdf-bar-title {
  font-size: 0.9rem;
  opacity: 0.85;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-pdf-save {
  background: var(--gold, #c8a96e);
  color: #1a1a2e;
  border: none;
  padding: 7px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
}

.btn-pdf-save:hover {
  filter: brightness(1.1);
}

.btn-pdf-close {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 7px 14px;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: 4px;
}

.btn-pdf-close:hover {
  background: rgba(255,255,255,0.1);
}

.pdf-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  justify-content: center;
}

/* docx-preview renders pages inside .docx-wrapper > .docx */
#pdf-docx-container .docx-wrapper {
  background: transparent;
  padding: 20px 0;
}

#pdf-docx-container .docx-wrapper > section.docx {
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  margin: 0 auto 16px;
}

/* Print: hide the app shell, show only DOCX preview */
@media print {
  /* Default print mode: show only PDF overlay (DOCX preview) */
  body:not(.printing-report) > *:not(#pdf-preview-overlay) {
    display: none !important;
  }
  /* Reports print mode: show only the reports view */
  body.printing-report > *:not(#view-reports-quotes-made) {
    display: none !important;
  }
  body.printing-report #view-reports-quotes-made {
    display: block !important;
  }
  #pdf-preview-overlay {
    position: static;
    background: #fff;
  }
  .pdf-bar {
    display: none !important;
  }
  .pdf-body {
    padding: 0;
    display: block;
    overflow: visible;
  }
  #pdf-docx-container .docx-wrapper {
    padding: 0;
  }
  #pdf-docx-container .docx-wrapper > section.docx {
    box-shadow: none;
    margin: 0;
  }

  /* Reports print overrides */
  .qmr-controls,
  .qmr-print-btn,
  #qmr-controls-card,
  #qmr-print-btn { display: none !important; }
  .qmr-header { margin-bottom: 0.5rem; }
  .qmr-table-wrapper { overflow: visible; }
  .qmr-table { font-size: 8pt; }
  .qmr-status-section { page-break-inside: avoid; }
  .qmr-quote-row, .qmr-total-row { page-break-inside: avoid; }
  #view-reports-quotes-made { display: block !important; }
  #view-reports-quotes-made .main-layout { margin: 0; padding: 0 0.5rem; max-width: 100% !important; }
  .qmr-section-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============================================================
   Room Capacity Fields — Property Setup
============================================================ */
.field-grid.col-4 { grid-template-columns: repeat(4, 1fr); }

.capacity-section .field-grid {
  align-items: end;
}

.capacity-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.capacity-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-top: 0.6rem;
}

.capacity-summary-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: #f8fafc;
}

.capacity-summary-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.capacity-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 1rem;
}

.capacity-summary-list--single {
  grid-template-columns: minmax(0, 1fr);
}

.capacity-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.capacity-summary-label {
  font-size: 0.75rem;
  color: var(--gray-600);
}

.capacity-summary-value {
  font-size: 0.96rem;
  color: var(--navy);
}

.capacity-group-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy);
  margin: 0.75rem 0 0.25rem;
}

.capacity-group-desc {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--gray-600);
  font-size: 0.8rem;
}

.rc-calc-label {
  font-weight: 400;
  color: var(--gray-500);
  font-size: 0.75rem;
}

.rc-field-error {
  display: block;
  color: var(--danger, #d63031);
  font-size: 0.78rem;
  margin-top: 2px;
}

.rc-field-warning {
  display: block;
  color: #e17055;
  font-size: 0.78rem;
  margin-top: 2px;
}

.rc-field-hint {
  display: block;
  color: var(--gray-500);
  font-size: 0.78rem;
  margin-top: 2px;
}

.rc-field-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.rc-input-error {
  border-color: var(--danger, #d63031) !important;
}

/* Validation tooltip — shown on hover when a field has a rc-input-error */
.field[data-rc-tooltip] {
  position: relative;
}
.field[data-rc-tooltip]::after {
  content: attr(data-rc-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: #2d3748;
  color: #fff;
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
  max-width: 220px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 500;
}
.field[data-rc-tooltip]:hover::after {
  opacity: 1;
}

/* PMS block lock indicator — red asterisk with hover tooltip in TMG status label */
.pms-lock-indicator {
  color: #c00;
  cursor: help;
  margin-left: 0.25rem;
  position: relative;
  font-weight: 700;
}
.pms-lock-indicator::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #2d3748;
  color: #fff;
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
  white-space: normal;
  max-width: 200px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 500;
}
.pms-lock-indicator:hover::after {
  opacity: 1;
}

@media (max-width: 900px) {
  .field-grid.col-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .field-grid.col-4 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   INVOICE MODULE
   ══════════════════════════════════════════════════════════ */

/* Two-panel outer layout */
.inv-main {
  padding-top: 1.5rem;
}

.inv-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* ── Left panel ─────────────────────────────────────────── */

.inv-left-panel {
  position: sticky;
  top: 1.25rem;
}

/* Quote search input */
.inv-quote-search {
  width: 100%;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.inv-quote-search:focus { border-color: var(--navy-light, #4a6fa5); }

/* Dropdown */
.inv-quote-search-wrap {
  position: relative;
  margin-bottom: 0.6rem;
}

.inv-quote-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
}

.inv-dropdown-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--navy);
  border-bottom: 1px solid var(--gray-100);
}
.inv-dropdown-item:last-child { border-bottom: none; }
.inv-dropdown-item:hover { background: var(--gray-50); }

.inv-dropdown-noquote {
  color: var(--gray-500);
  font-style: italic;
  font-size: 0.82rem;
}

/* No-quote button */
.inv-no-quote-wrap {
  margin-bottom: 0.5rem;
}

/* Quote badge */
.inv-quote-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--navy);
  color: var(--white);
  border-radius: 20px;
  padding: 0.25rem 0.65rem 0.25rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  width: fit-content;
  max-width: 100%;
}

.inv-badge-clear {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}
.inv-badge-clear:hover { color: var(--white); }

/* Item list */
.inv-item-list {
  max-height: 58vh;
  overflow-y: auto;
  border-top: 1px solid var(--gray-100);
  padding-top: 0.5rem;
}

.inv-item-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin: 0.75rem 0 0.25rem;
  padding-left: 2px;
}
.inv-item-category:first-child { margin-top: 0; }

.inv-item-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.8rem;
}
.inv-item-row:last-child { border-bottom: none; }

.inv-item-btn {
  flex-shrink: 0;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.inv-item-btn-charge {
  background: #fff7ed;
  border-color: #f59e0b;
  color: #92400e;
}
.inv-item-btn-charge:hover {
  background: #f59e0b;
  color: #fff;
}

.inv-item-btn-credit {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #166534;
}
.inv-item-btn-credit:hover {
  background: #22c55e;
  color: #fff;
}

.inv-item-name {
  flex: 1;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-item-value {
  flex-shrink: 0;
  color: var(--gray-600);
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  text-align: right;
  min-width: 60px;
}

/* ── Right panel ────────────────────────────────────────── */

/* Mockup header: two-column */
.inv-mockup-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.inv-address-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.inv-address-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.inv-address-contact {
  font-size: 0.85rem;
  color: var(--gray-600);
}

.inv-address-lines {
  font-size: 0.82rem;
  color: var(--gray-600);
  line-height: 1.55;
  margin-top: 0.2rem;
}

/* Meta grid (right column) */
.inv-meta-block {
  display: flex;
  flex-direction: column;
}

.inv-meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.75rem;
  align-items: center;
}

.inv-meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-align: right;
  white-space: nowrap;
}

.inv-meta-value {
  font-size: 0.82rem;
  color: var(--navy);
}

input.inv-meta-input {
  font-size: 0.82rem;
  color: var(--navy);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gray-200);
  border-radius: 0;
  outline: none;
  padding: 1px 2px;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.15s;
}
input.inv-meta-input:focus { border-bottom-color: var(--navy-light, #4a6fa5); }

/* Line items table */
.inv-table-wrap {
  margin-bottom: 0;
}

.inv-line-table .inv-cell-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--navy);
  outline: none;
  padding: 0;
}
.inv-line-table .inv-cell-input:focus {
  background: var(--gray-50);
  border-radius: 3px;
  padding: 0 2px;
}

.inv-line-table .inv-cell-charge,
.inv-line-table .inv-cell-credit {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  color: var(--navy);
}

/* tfoot rows */
.inv-totals-row td,
.inv-balance-row td,
.inv-gst-row td,
.inv-net-row td {
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
}

.inv-totals-row {
  border-top: 2px solid var(--navy);
}
.inv-totals-row td { font-weight: 700; }

.inv-balance-row { border-top: 1px solid var(--gray-200); }

.inv-net-row {
  border-top: 1px solid var(--gray-200);
}
.inv-net-row td { font-weight: 700; }

.inv-tfoot-label {
  text-align: right;
  color: var(--gray-600);
  font-size: 0.8rem;
}

.inv-tfoot-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
  white-space: nowrap;
}

.inv-balance-val { font-weight: 700; }
.inv-net-val     { font-weight: 700; color: var(--navy); }

/* Footer block */
.inv-footer-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.inv-footer-legal {
  font-size: 0.75rem;
  color: var(--gray-500);
  line-height: 1.5;
  margin: 0;
}

.inv-signature-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.inv-footer-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
}

.inv-signature-line {
  font-size: 0.875rem;
  color: var(--gray-400);
  letter-spacing: 0.05em;
}

.inv-footer-note {
  font-size: 0.72rem;
  color: var(--gray-400);
  font-style: italic;
  margin: 0;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .inv-layout {
    grid-template-columns: 1fr;
  }
  .inv-left-panel {
    position: static;
  }
  .inv-item-list {
    max-height: 40vh;
  }
}

@media (max-width: 700px) {
  .inv-mockup-header {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Quote Calendar — Gantt view
============================================================ */

.qcal-main { max-width: 100%; }

/* Controls row */
.qcal-controls-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}
.qcal-ctrl-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 12px;
  color: var(--gray-600);
  white-space: nowrap;
}
.qcal-date-input {
  font-family: inherit;
  font-size: 12px !important;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  color: var(--gray-800);
  background: #fff;
  height: 2.2rem;
  box-sizing: border-box;
}
.qcal-select {
  font-family: inherit;
  font-size: 12px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  color: var(--gray-800);
  background: #fff;
  cursor: pointer;
  height: 2.2rem;
  box-sizing: border-box;
}
.qcal-stay-toggle { cursor: pointer; }
.btn-sm { font-size: 12px; padding: 0.25rem 0.6rem; }
.qcal-ctrl-divider { width: 1px; height: 18px; background: var(--gray-200); flex-shrink: 0; }
.qcal-sort-dir-btn { min-width: 28px; font-weight: 600; }
.qcal-search-input {
  font-family: inherit;
  font-size: 12px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  height: 28px;
  width: 160px;
  box-sizing: border-box;
  outline: none;
}
.qcal-search-input:focus {
  border-color: var(--blue-400, #5b9bd5);
  box-shadow: 0 0 0 2px rgba(91,155,213,0.2);
}

/* Toolbar (filter row) */
.qcal-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.qcal-filter-label { font-size: 11px; color: var(--gray-600); white-space: nowrap; }
.qcal-status-pills { display: flex; gap: 0.3rem; flex-wrap: wrap; }

/* Status filter pills */
.qcal-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1.5px solid transparent;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.12s, border-color 0.12s;
  background: var(--gray-200);
  color: var(--gray-600);
}
.qcal-pill.active { opacity: 1; }
.qcal-pill.qcal-status--inq          { background: #fff3cd; color: #856404; border-color: #856404; }
.qcal-pill.qcal-status--ten          { background: #d1ecf1; color: #0c5460; border-color: #0c5460; }
.qcal-pill.qcal-status--def          { background: #d4edda; color: #155724; border-color: #155724; }
.qcal-pill.qcal-status--pen          { background: #cce5ff; color: #004085; border-color: #004085; }
.qcal-pill.qcal-status--act          { background: #e2d9f3; color: #4a235a; border-color: #4a235a; }
.qcal-pill.qcal-status--los          { background: var(--gray-200); color: var(--gray-600); border-color: var(--gray-400); }
.qcal-pill.qcal-status--clx          { background: #f8d7da; color: #721c24; border-color: #721c24; }
.qcal-pill:not(.active):hover { opacity: 0.6; }

/* Legend */
.qcal-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
  font-size: 11px;
  color: var(--gray-600);
}
.qcal-legend-item { display: flex; align-items: center; gap: 0.35rem; }
.qcal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.qcal-legend-stay-swatch {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  margin-right: 1px;
}
.qcal-legend-stay--inq { background: rgba(255,243,205,0.9); border: 1.5px solid #856404; }
.qcal-legend-stay--ten { background: rgba(209,236,241,0.9); border: 1.5px solid #0c5460; }
.qcal-legend-stay--def { background: rgba(212,237,218,0.9); border: 1.5px solid #155724; }
.qcal-legend-stay--pen { background: rgba(204,229,255,0.9); border: 1.5px solid #004085; }

/* Scroll container */
.qcal-scroll-wrap {
  overflow: auto;
  max-height: calc(100vh - 260px);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
}

/* Gantt table */
.qcal-table {
  border-collapse: collapse;
  min-width: max-content;
  width: 100%;
  font-size: 11px;
}

/* Sticky left column */
.qcal-fixed {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  min-width: 270px;
  max-width: 320px;
}
.qcal-corner { z-index: 4; }

/* Month header row */
.qcal-month-row th { background: var(--navy); color: #fff; }
.qcal-month-th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.3rem 0.5rem;
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  border-right: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap;
}

/* Day header row */
.qcal-day-row th { background: var(--gray-50); }
.qcal-day-th {
  position: sticky;
  top: 24px;
  z-index: 1;
  padding: 0.2rem 0;
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  text-align: center;
  border-right: 1px solid var(--gray-200);
  border-bottom: 2px solid var(--gray-200);
  vertical-align: middle;
}
.qcal-day-num {
  display: block;
  font-weight: 600;
  line-height: 1.2;
  font-size: 11px;
}
.qcal-day-wk {
  display: block;
  font-size: 9px;
  color: var(--gray-400);
  line-height: 1;
}
.qcal-day-th.qcal-today-col { background: rgba(200,169,110,0.15); }
.qcal-day-th.qcal-today-col .qcal-day-num { color: #8a6520; }
.qcal-day-th.qcal-weekend { background: var(--gray-100); }

/* Quote label column */
.qcal-label-col {
  border-right: 2px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-100);
  padding: 0.3rem 0.5rem;
}
.qcal-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
}
.qcal-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 9px;
  color: var(--gray-400);
  padding: 0;
  width: 14px;
  flex-shrink: 0;
  line-height: 1;
}
.qcal-expand-btn:hover { color: var(--navy); }
.qcal-expand-spacer { width: 14px; flex-shrink: 0; }

/* ⋮ context trigger inside label */
.qcal-ctx-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-400);
   margin-left: auto;
  padding: 0 2px;
  line-height: 1;
  border-radius: 3px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.1s;
}
.qcal-quote-row:hover .qcal-ctx-btn,
.qcal-ctx-btn:focus { opacity: 1; color: var(--gray-600); }
.qcal-ctx-btn:hover { background: var(--gray-100); color: var(--navy); }

/* Context menu popup */
.qcal-ctx-menu {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.3rem 0;
  min-width: 150px;
}
.qcal-ctx-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.45rem 1rem;
  font-size: 12px;
  font-family: inherit;
  color: var(--gray-800);
  cursor: pointer;
}
.qcal-ctx-item:hover { background: var(--gray-100); color: var(--navy); }
.qcal-qid {
  font-family: monospace;
  font-size: 10px;
  color: var(--gray-600);
  flex-shrink: 0;
}
.qcal-gname {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-800);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.qcal-status-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--gray-200);
  color: var(--gray-600);
}
.qcal-pmid-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  flex-shrink: 0;
  background: #002266;
  color: #93c5fd;
  letter-spacing: 0.02em;
}
.qcal-status--inq { background: #fff3cd; color: #856404; }
.qcal-status--ten { background: #d1ecf1; color: #0c5460; }
.qcal-status--def { background: #d4edda; color: #155724; }
.qcal-status--pen { background: #cce5ff; color: #004085; }
.qcal-status--los,
.qcal-status--clx { background: var(--gray-200); color: var(--gray-600); }

/* Day cells */
.qcal-cell {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  padding: 0.15rem 0.1rem;
  vertical-align: middle;
  text-align: center;
}
.qcal-quote-row:hover .qcal-cell { background: rgba(0,35,90,0.02); }
.qcal-quote-row:hover .qcal-fixed { background: var(--gray-50); }
/* Row hover: in-stay cells darken toward status colour (not grey) */
.qcal-quote-row:hover .qcal-cell.qcal-in-stay--inq { background: rgba(245,210,100,0.9); }
.qcal-quote-row:hover .qcal-cell.qcal-in-stay--ten { background: rgba(170,215,225,0.9); }
.qcal-quote-row:hover .qcal-cell.qcal-in-stay--def { background: rgba(165,215,180,0.9); }
.qcal-quote-row:hover .qcal-cell.qcal-in-stay--pen { background: rgba(155,200,250,0.9); }
.qcal-quote-row:hover .qcal-cell.qcal-in-stay--los,
.qcal-quote-row:hover .qcal-cell.qcal-in-stay--clx { background: rgba(200,205,212,0.85); }
.qcal-cell.qcal-today-col { background: rgba(200,169,110,0.1); }
.qcal-cell.qcal-weekend { background: var(--gray-50); }
/* Stay period — shaded by quote status */
.qcal-cell.qcal-in-stay                { background: rgba(0,35,90,0.08); }
.qcal-cell.qcal-in-stay--inq           { background: rgba(255,243,205,0.7); }
.qcal-cell.qcal-in-stay--ten           { background: rgba(209,236,241,0.7); }
.qcal-cell.qcal-in-stay--def           { background: rgba(212,237,218,0.7); }
.qcal-cell.qcal-in-stay--pen           { background: rgba(204,229,255,0.7); }
.qcal-cell.qcal-in-stay--los,
.qcal-cell.qcal-in-stay--clx           { background: rgba(226,230,234,0.6); }

/* Stay boundary borders match status color */
.qcal-cell.qcal-stay-start             { border-left: 3px solid #00235A; }
.qcal-cell.qcal-stay-end               { border-right: 3px solid #00235A; }
.qcal-in-stay--inq.qcal-stay-start     { border-left-color:  #856404; }
.qcal-in-stay--inq.qcal-stay-end       { border-right-color: #856404; }
.qcal-in-stay--ten.qcal-stay-start     { border-left-color:  #0c5460; }
.qcal-in-stay--ten.qcal-stay-end       { border-right-color: #0c5460; }
.qcal-in-stay--def.qcal-stay-start     { border-left-color:  #155724; }
.qcal-in-stay--def.qcal-stay-end       { border-right-color: #155724; }
.qcal-in-stay--pen.qcal-stay-start     { border-left-color:  #004085; }
.qcal-in-stay--pen.qcal-stay-end       { border-right-color: #004085; }
.qcal-in-stay--los.qcal-stay-start,
.qcal-in-stay--clx.qcal-stay-start     { border-left-color:  #9aa3af; }
.qcal-in-stay--los.qcal-stay-end,
.qcal-in-stay--clx.qcal-stay-end       { border-right-color: #9aa3af; }

/* Milestone dots */
.qcal-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 1px;
  cursor: default;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

/* Room class sub-rows */
.qcal-rc-row { background: var(--gray-50); }
.qcal-rc-label-col { background: var(--gray-50); padding-left: 2rem; }
.qcal-rc-label { display: flex; align-items: center; gap: 0.5rem; }
.qcal-rc-rate  { font-size: 10px; color: var(--gray-500); margin-left: auto; white-space: nowrap; }
.qcal-rc-name { font-size: 11px; color: var(--gray-600); font-style: italic; }
.qcal-rc-meta { font-size: 10px; color: var(--gray-400); }
.qcal-rc-cell { height: 18px; }
.qcal-rc-cell.qcal-in-stay--rc { background: rgba(0,35,90,0.05); }
/* Multi-block group header rows */
.qcal-rc-block-row { background: var(--gray-100); }
.qcal-rc-block-label-col { background: var(--gray-100); padding-left: 1rem; }
.qcal-rc-block-label { font-size: 10px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; }
.qcal-rc-block-cell { height: 14px; }
.qcal-rc-block-cell.qcal-in-stay--block { background: rgba(0,35,90,0.08); }
/* Rooms sold label in stay cells */
.qcal-rooms-sold {
  display: block;
  font-size: 8px;
  line-height: 1;
  color: rgba(0,0,0,0.35);
  margin-top: 1px;
}

/* ── Calendar mode toggle ──────────────────────────────────── */
.qcal-mode-toggle {
  display: flex;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.qcal-mode-btn {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
  border: none;
  background: #fff;
  color: var(--gray-600);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.qcal-mode-btn + .qcal-mode-btn { border-left: 1px solid var(--gray-300); }
.qcal-mode-btn--active { background: var(--navy); color: #fff; }
.qcal-mode-btn:not(.qcal-mode-btn--active):hover { background: var(--gray-100); }

/* Controls group wrapper (for inline toggling inside flex row) */
.qcal-ctrl-group { display: flex; align-items: center; gap: 0.75rem; }
.qcal-ctrl-group.hidden { display: none; }

/* ── PMS block cells ───────────────────────────────────────── */
.qcal-pms-in-block { background: rgba(45,106,79,0.12) !important; }
.qcal-quote-row:hover .qcal-cell.qcal-pms-in-block { background: rgba(45,106,79,0.22) !important; }
.qcal-pms-in-block.qcal-stay-start { border-left-color:  #2d6a4f; }
.qcal-pms-in-block.qcal-stay-end   { border-right-color: #2d6a4f; }

/* PMS badge */
.qcal-pms-badge { background: #2d6a4f !important; color: #fff !important; }

/* PMS label right-side cluster (Group Info btn + PMS badge) */
.qcal-pms-label-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.qcal-pms-info-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--gray-400);
  padding: 1px 3px;
  line-height: 1;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.1s;
}
.qcal-quote-row:hover .qcal-pms-info-btn,
.qcal-pms-info-btn:focus { opacity: 1; color: var(--gray-600); }
.qcal-pms-info-btn:hover { background: var(--gray-100); color: var(--navy); }

/* Group Info modal */
.qcal-gi-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qcal-gi-overlay.hidden { display: none; }
.qcal-gi-modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: min(860px, 95vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.qcal-gi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  gap: 1rem;
}
.qcal-gi-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
}
.qcal-gi-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}
.qcal-gi-tag {
  background: #2d6a4f;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.qcal-gi-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--gray-400);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  flex-shrink: 0;
}
.qcal-gi-close:hover { background: var(--gray-100); color: var(--gray-800); }
.qcal-gi-body {
  overflow-y: auto;
  padding: 1rem 1.25rem;
}
.qcal-gi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.qcal-gi-table th {
  text-align: right;
  padding: 0.4rem 0.6rem;
  background: var(--gray-100);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--gray-200);
}
.qcal-gi-table th:first-child { text-align: left; }
.qcal-gi-table td {
  text-align: right;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
}
.qcal-gi-table td:first-child { text-align: left; font-weight: 500; }
.qcal-gi-table tbody tr:hover td { background: var(--gray-50, #f9fafb); }
.qcal-gi-table tfoot td {
  font-weight: 600;
  border-top: 2px solid var(--gray-200);
  border-bottom: none;
  background: var(--gray-100);
}

/* PMS metric rows (Contract / Allotment / Pickup / Available) */
.qcal-pms-metric-row { background: #f7f9f8; }
.qcal-pms-metric-label-col {
  background: #f7f9f8;
  padding-left: 3.5rem;
}
.qcal-pms-metric-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 10px;
  color: var(--gray-600);
}
.qcal-pms-metric-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.qcal-pms-metric-cell { height: 16px; }
.qcal-pms-metric-row:hover .qcal-fixed { background: #eef3f0; }

/* PMS daily totals row */
.qcal-pms-total-row { background: #f0f4f8; border-top: 2px solid #cbd5e0; }
.qcal-pms-total-label-col { background: #f0f4f8 !important; }
.qcal-pms-total-row:hover .qcal-fixed { background: #e2e8f0; }
.qcal-pms-total-label { font-weight: 600; font-size: 0.75rem; color: #4a5568; text-transform: uppercase; letter-spacing: 0.04em; }
.qcal-pms-total-cell { background: #f0f4f8 !important; }
.qcal-pms-total-cell.qcal-today-col { background: rgba(26,115,232,0.08) !important; }
.qcal-pms-total-val { font-weight: 700 !important; font-size: 0.8rem; }

/* PMS legend swatch */
.qcal-pms-legend-swatch {
  display: inline-block;
  width: 24px;
  height: 10px;
  background: rgba(45,106,79,0.15);
  border: 1.5px solid #2d6a4f;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Group & Rates Tabbed Card ─────────────────────────────── */
.tq-group-tab-card {
  padding: 0;
  overflow: visible;
  border-left: 3px solid var(--navy, #1e3a5f);
  animation: tqSlideIn 0.18s ease-out;
}
.tq-group-tab-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  background: var(--gray-50, #f9fafb);
  border-radius: var(--radius, 8px) var(--radius, 8px) 0 0;
}
.tq-group-tab-btns {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.tq-group-tab-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 50%;
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.1s;
}
.tq-group-tab-btn:hover { opacity: 0.75; transform: scale(1.08); }
.tq-group-tab-btn.active { opacity: 1; }
.tq-group-tab-btn.active .creator-badge {
  background: var(--navy, #1e3a5f);
  box-shadow: 0 0 0 2.5px var(--gold, #b8960c);
}
.tq-group-tab-remove {
  display: none;
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  font-size: 0.55rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 2;
}
.tq-group-tab-btn:hover .tq-group-tab-remove,
.tq-group-tab-btn.active .tq-group-tab-remove { display: flex; }
.tq-group-tab-add {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy, #1e3a5f);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.tq-group-tab-add:hover { background: var(--gold, #b8960c); transform: scale(1.1); }
.tq-group-tab-dismiss { margin-left: auto; }
.tq-group-pane { padding: 1.25rem 1.5rem; }
.tq-group-pane.hidden { display: none; }
.tq-group-pane-section + .tq-group-pane-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100, #f3f4f6);
}
.tq-group-pane-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.tq-group-pane-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400, #9ca3af);
  margin: 0;
}
.tq-group-pane-title-row .card-header-controls { margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════════
   Admin Shared
   ═══════════════════════════════════════════════════════════════════ */
.admin-success {
  background: #f0faf4;
  border: 1px solid #b2dfce;
  border-radius: 6px;
  padding: 8px 14px;
  color: #1a7f4b;
  font-size: 13px;
  margin-bottom: 14px;
}

.btn-icon-danger {
  background: none;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 4px;
  color: var(--danger, #e53e3e);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 3px 7px;
}
.btn-icon-danger:hover {
  background: #fff5f5;
  border-color: var(--danger, #e53e3e);
}
.btn-icon {
  background: none;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 4px;
  color: var(--gray-600, #4b5563);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 3px 7px;
}
.btn-icon:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
}

.btn-refresh-icon {
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
}
.btn-refresh-icon img.spin {
  animation: btn-refresh-spin 0.8s linear infinite;
}
.btn-refresh-icon img.pinch-forward {
  animation: btn-refresh-pinch 0.6s ease-in-out infinite alternate;
}
.btn-refresh-icon img.pinch-backward {
  animation: btn-refresh-pinch 0.3s ease reverse forwards;
}
@keyframes btn-refresh-pinch {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-18deg); }
}
@keyframes btn-refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════
   Rate Grid
   ═══════════════════════════════════════════════════════════════════ */
#view-rate-grid .main-layout {
  max-width: 1900px;
}
.rg-matrix-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
}

.rg-matrix {
  border-collapse: collapse;
  min-width: 560px;
  width: 100%;
}

.rg-matrix th,
.rg-matrix td {
  border: 1px solid var(--gray-200, #e5e7eb);
  padding: 5px 8px;
  text-align: center;
  font-size: 0.83rem;
  white-space: nowrap;
}

.rg-matrix th:first-child,
.rg-matrix td:first-child {
  text-align: left;
  min-width: 88px;
  padding-left: 10px;
}

.rg-matrix thead th {
  background: var(--bg-subtle, #f8f9fa);
  font-weight: 600;
  color: var(--gray-700, #374151);
}

.rg-copy-row th {
  background: var(--bg-subtle, #f8f9fa);
  padding: 3px 4px;
  border-bottom: none;
}

.rg-row-header {
  font-weight: 600;
}

.rg-row-label {
  font-size: 0.83rem;
  color: var(--gray-700, #374151);
}

.rg-cell-input {
  width: 68px;
  border: none;
  background: transparent;
  text-align: right;
  padding: 2px 4px;
  font-size: 0.83rem;
  font-family: inherit;
}

.rg-cell-input:focus {
  outline: 2px solid var(--primary, #0070f3);
  border-radius: 3px;
  background: #fff;
}

.rg-copy-down-btn {
  background: none;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rg-copy-down-btn:hover {
  border-color: var(--primary, #0070f3);
}

.rg-copy-down-icon {
  width: 14px;
  height: 14px;
  display: block;
}

/* Rate Grid PP blocks */
.rg-pp-block {
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  background: #fff;
}

.rg-pp-block + .rg-pp-block {
  margin-top: 0.75rem;
}

.rg-pp-header {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.rg-pp-header .field {
  margin-bottom: 0;
}

.rg-pp-number-field {
  flex: 0 0 220px;
}

.rg-pp-actions-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 2px;
}

.rg-pp-add-row {
  display: flex;
  justify-content: flex-start;
  margin: 0.5rem 0 1rem;
}

/* Room Class sub-blocks inside a PP block */
.rg-rc-container {
  margin-top: 0.75rem;
}

.rg-rc-block {
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
  background: #f9fafb;
}

.rg-rc-header {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.rg-rc-header .field {
  margin-bottom: 0;
}

.rg-rc-add-row {
  margin-top: 0.5rem;
  padding-top: 0.25rem;
}

/* PP expand button in Saved Seasons table */
.rg-pp-expand-btn {
  background: var(--primary, #0070f3);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.5;
}

.rg-pp-expand-btn::after {
  content: " ▼";
  font-size: 0.65rem;
}

.rg-pp-expand-btn[aria-expanded="true"]::after {
  content: " ▲";
  font-size: 0.65rem;
}

.rg-pp-subrow > td {
  background: var(--bg-subtle, #f8f9fa);
  border-top: none;
}

.rg-pp-subrow-expand-td {
  padding: 0 !important;
}

/* ── Expanded season rate view ─────────────────────────────────────────── */
.rg-season-expand {
  padding: 12px 16px 16px;
}

.rg-expand-empty {
  color: #9aa3af;
  font-size: 0.85rem;
  padding: 8px 0;
}

.rg-expand-pp-section {
  margin-bottom: 1.25rem;
}

.rg-expand-pp-section:last-of-type {
  margin-bottom: 0;
}

.rg-expand-pp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.rg-expand-pp-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--gray-700, #374151);
}

.rg-expand-pms-tag {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.78rem;
  font-family: monospace;
}

.rg-expand-table th {
  font-size: 0.78rem;
  white-space: nowrap;
}

.rg-expand-rc-col {
  width: 140px;
  min-width: 120px;
}

.rg-expand-rate-col {
  width: 90px;
  min-width: 80px;
}

.rg-expand-rc-cell {
  vertical-align: middle;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gray-700, #374151);
  white-space: nowrap;
}

.rg-expand-rate-label {
  font-size: 0.78rem;
  color: var(--gray-500, #6b7280);
  white-space: nowrap;
}

.rg-expand-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-200, #e5e7eb);
}

.rg-expand-msg {
  font-size: 0.82rem;
}

.rg-expand-msg--ok  { color: #16a34a; }
.rg-expand-msg--err { color: var(--danger, #e53e3e); }

.rg-pp-subrow-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rg-pp-subrow-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-600, #4b5563);
}

.rg-pp-tag {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.82rem;
  font-family: monospace;
  color: var(--gray-700, #374151);
}

/* Custom multi-select */
.rg-multiselect {
  position: relative;
  width: 100%;
}

.rg-multiselect-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  min-height: 36px;
  font-size: 0.88rem;
  color: var(--gray-600, #4b5563);
  user-select: none;
}

.rg-multiselect-trigger:focus {
  outline: 2px solid var(--primary, #0070f3);
  outline-offset: 2px;
}

.rg-multiselect-arrow {
  font-size: 0.75rem;
  color: var(--gray-400, #9ca3af);
  flex-shrink: 0;
  margin-left: 6px;
}

.rg-multiselect-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
}

.rg-multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--gray-700, #374151);
}

.rg-multiselect-option:hover {
  background: var(--bg-subtle, #f8f9fa);
}

.pbb-catstatus-multiselect {
  width: auto;
  min-width: 160px;
}

.pbb-catstatus-multiselect .rg-multiselect-trigger {
  min-height: unset;
  white-space: nowrap;
}

.pbb-catstatus-multiselect .rg-multiselect-option {
  padding: 6px 12px;
}

.pbb-catstatus-multiselect .rg-multiselect-option input[type="checkbox"] {
  cursor: pointer;
}

/* ── Invoice Dashboard ──────────────────────────────────────────────────── */

.inv-dash-tree { padding: 0.25rem 0; }

.inv-dash-folio-wrap  { margin-bottom: 0.5rem; }
.inv-dash-quote-wrap  { margin-bottom: 0.15rem; }
.inv-dash-block-wrap  { margin-bottom: 0.1rem; }

.inv-dash-group-row {
  display:     flex;
  align-items: center;
  gap:         0.45rem;
  padding:     0.4rem 0.75rem;
  border-radius: 6px;
  cursor:      default;
  user-select: none;
}
.inv-dash-group-row:hover { background: var(--gray-50, #f9fafb); }

.inv-dash-level-folio {
  background:  var(--gray-100, #f3f4f6);
  font-weight: 700;
  font-size:   0.9rem;
  border:      1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  margin-bottom: 2px;
}
.inv-dash-level-quote {
  padding-left: 2rem;
  font-weight:  600;
  font-size:    0.8rem;
}
.inv-dash-level-block {
  padding-left: 3.75rem;
  font-size:    0.85rem;
  color:        var(--gray-700, #374151);
}

.inv-dash-toggle {
  background: none;
  border:     none;
  cursor:     pointer;
  font-size:  0.65rem;
  color:      var(--gray-500, #6b7280);
  padding:    0 2px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.12s;
}
.inv-dash-toggle:hover { color: var(--navy, #1a3b5d); }

.inv-dash-icon  { font-size: 1rem; flex-shrink: 0; }
.inv-dash-label { flex: 1; font-size: 0.8rem; }

.inv-dash-count {
  font-size:    0.72rem;
  color:        var(--gray-400, #9ca3af);
  background:   var(--gray-100, #f3f4f6);
  border:       1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  padding:      1px 8px;
  flex-shrink:  0;
}

.inv-dash-children          { }
.inv-dash-children.hidden   { display: none; }

.inv-dash-table {
  margin:    0.3rem 0 0.75rem 3.75rem;
  width:     calc(100% - 3.75rem);
}

/* ── Invoice Dashboard two-panel layout ─────────────────────────────────── */

.inv-dash-layout {
  display: grid;
  grid-template-columns: 950px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.inv-dash-left-panel {
  position: sticky;
  top: 1.25rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  overflow-x: auto;
}

.inv-dash-right-panel { min-height: 300px; }

.inv-dash-detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: var(--gray-50, #f9fafb);
  border: 1px dashed var(--gray-200, #e5e7eb);
  border-radius: 10px;
  color: var(--gray-400, #9ca3af);
  font-size: 0.9rem;
}

.inv-dash-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.inv-dash-detail-inv-no {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy, #1a3b5d);
}

.inv-dash-detail-meta {
  font-size: 0.82rem;
  color: var(--gray-500, #6b7280);
  margin-top: 0.2rem;
}

.inv-dash-detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.inv-dash-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  border-top: 1px solid var(--gray-100, #f3f4f6);
  padding-top: 1rem;
}

.inv-dash-stat {
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-100, #f3f4f6);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}

.inv-dash-stat-label {
  font-size: 0.72rem;
  color: var(--gray-400, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.inv-dash-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy, #1a3b5d);
  font-variant-numeric: tabular-nums;
}

.inv-dash-stat--balance .inv-dash-stat-value { color: var(--green-600, #16a34a); }

@media (max-width: 860px) {
  .inv-dash-layout              { grid-template-columns: 1fr; }
  .inv-dash-left-panel          { position: static; max-height: 360px; }
  .inv-dash-stat-row            { grid-template-columns: repeat(2, 1fr); }
}

/* ── Folio View ─────────────────────────────────────────────────────────── */

.folio-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.folio-left-panel {
  position: sticky;
  top: 1.25rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
}
.folio-right-panel { min-height: 300px; }

.folio-tree { padding: 0.25rem 0; }

.folio-tree-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 8px;
  font-weight: 600;
}
.folio-tree-item:hover  { background: var(--gray-50, #f9fafb); }
.folio-tree-item.active { background: var(--blue-50, #eff6ff); }
.folio-folder-icon { width: 18px; height: 18px; flex-shrink: 0; }

.folio-tree-quote {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem 0.3rem 2.5rem;
  font-size: 8px;
  color: var(--gray-600, #4b5563);
  border-radius: 6px;
}
.folio-tree-quote:hover { background: var(--gray-50, #f9fafb); }
.folio-quote-icon { width: 14px; height: 14px; flex-shrink: 0; }

.folio-tree-block {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem 0.28rem 3.5rem;
  font-size: 8px;
  color: var(--gray-600, #4b5563);
  font-variant-numeric: tabular-nums;
}

.folio-tree-inv {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.75rem 0.25rem 5rem;
  font-size: 8px;
  color: var(--gray-500, #6b7280);
  font-variant-numeric: tabular-nums;
}

.folio-sub-items.hidden { display: none; }

.folio-detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: var(--gray-50, #f9fafb);
  border: 1px dashed var(--gray-200, #e5e7eb);
  border-radius: 10px;
  color: var(--gray-400, #9ca3af);
  font-size: 0.9rem;
}

.folio-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.folio-detail-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy, #1a3b5d);
}
.folio-detail-meta {
  font-size: 0.82rem;
  color: var(--gray-500, #6b7280);
  margin-top: 0.2rem;
}
.folio-detail-actions { display: flex; gap: 0.5rem; }

.folio-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--gray-100, #f3f4f6);
  margin-bottom: 1rem;
}
.folio-tab {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 4px 4px 0 0;
  transition: color 0.12s;
}
.folio-tab:hover { color: var(--navy, #1a3b5d); }
.folio-tab.active {
  color: var(--navy, #1a3b5d);
  border-bottom-color: var(--blue-500, #0085FC);
}
.folio-tab-panel.hidden { display: none; }

@media (max-width: 860px) {
  .folio-layout     { grid-template-columns: 1fr; }
  .folio-left-panel { position: static; max-height: 360px; }
}

/* ── Folio detail — Profile tab ──────────────────────────────────────────── */
.folio-prof-section { padding: 0.6rem 0.9rem 0.4rem; }
.folio-prof-section + .folio-prof-section { border-top: 1px solid var(--gray-100, #f3f4f6); }
.folio-prof-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500, #6b7280);
  margin-bottom: 0.4rem;
}
.folio-prof-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.folio-prof-table td, .folio-prof-table th {
  padding: 0.28rem 0.5rem;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  color: var(--gray-800, #1f2937);
}
.folio-prof-table tr:last-child td { border-bottom: none; }
.folio-prof-table th { color: var(--gray-500); font-weight: 600; text-align: left; }
.folio-prof-label {
  width: 5rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  white-space: nowrap;
}
.folio-prof-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--navy, #003580);
  color: #fff;
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}
/* ── Folio detail — Schedule tab ─────────────────────────────────────────── */
.folio-sched-quote-header {
  padding: 0.5rem 1.2rem 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy, #003580);
  border-bottom: 2px solid var(--navy, #003580);
  margin-top: 0.4rem;
}
.folio-sched-quote-header:first-child { margin-top: 0; }

/* ── Folio Groups tab ────────────────────────────────────────────────────── */
.folio-grp-block {
  padding: 0.6rem 1.2rem 0.9rem;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
}
.folio-grp-block:last-child { border-bottom: none; }
.folio-grp-block-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-600, #475569);
  margin-bottom: 0.3rem;
}
.folio-grp-block-meta {
  font-size: 0.8rem;
  color: var(--gray-500, #64748b);
  margin-bottom: 0.55rem;
}
.folio-grp-rc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.folio-grp-rc-table th {
  text-align: center;
  padding: 0.28rem 0.55rem;
  color: var(--gray-500, #64748b);
  font-weight: 600;
  border-bottom: 1px solid var(--gray-200, #e2e8f0);
  white-space: nowrap;
}
.folio-grp-rc-table th:first-child { text-align: left; }
.folio-grp-rc-table td {
  text-align: center;
  padding: 0.32rem 0.55rem;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  color: var(--gray-800, #1e293b);
}
.folio-grp-rc-table tr:last-child td { border-bottom: none; }
.folio-grp-rc-name { font-weight: 500; text-align: left; }
.folio-grp-num     { font-variant-numeric: tabular-nums; }
.folio-grp-rate    { font-variant-numeric: tabular-nums; font-family: var(--font-mono, monospace); font-size: 0.8rem; }
.folio-grp-dates   { color: var(--gray-500, #64748b); font-size: 0.78rem; }
.folio-grp-empty   { color: var(--gray-400, #94a3b8); font-style: italic; padding: 0.5rem 0.55rem; }

/* ── Folio quote link ─────────────────────────────────────────────────────── */
.folio-quote-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--navy, #003580);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.12s;
}
.folio-quote-link:hover { text-decoration-color: currentColor; }

/* ── Folio Filter Card ────────────────────────────────────────────────────── */
.folio-filter-card { margin-bottom: 0.6rem; padding: 0.6rem 0.75rem; }
.folio-filter-grid {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.2rem;
}
.folio-filter-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  align-items: center;
  gap: 0.4rem;
}
.folio-filter-row--pills { align-items: start; }
.folio-pill-wrap { display: flex; flex-wrap: wrap; gap: 0.2rem; padding-top: 0.1rem; }
.folio-pill {
  font-size: 8pt;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  border: 1.5px solid var(--gray-300, #d1d5db);
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-500, #6b7280);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.1s, border-color 0.1s, background 0.1s;
  line-height: 1.4;
}
.folio-pill.active {
  opacity: 1;
  background: var(--navy, #003580);
  color: #fff;
  border-color: var(--navy, #003580);
}
.folio-pill:not(.active):hover { opacity: 0.75; }
.folio-filter-label {
  font-size: 8pt;
  font-weight: 600;
  color: var(--gray-600, #4b5563);
  white-space: nowrap;
}
.folio-filter-select {
  font-size: 8pt;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  color: var(--gray-800, #1f2937);
  background: var(--white, #fff);
  width: 100%;
  cursor: pointer;
  appearance: auto;
}
.folio-filter-select:focus {
  outline: none;
  border-color: var(--navy-light, #2563eb);
  box-shadow: 0 0 0 2px rgba(0, 53, 128, 0.08);
}
.folio-filter-select--multi {
  appearance: none;
  min-height: 2.4rem;
  max-height: 5rem;
  overflow-y: auto;
  padding: 0.1rem 0.2rem;
}
.folio-filter-select--multi option {
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
}
.folio-filter-select--multi option:checked {
  background: var(--navy, #003580);
  color: #fff;
}

/* ── Match GuestPath → PMS view ─────────────────────────────────────────── */

#view-match-pms .main-layout { max-width: 1900px; }

.match-pms-subtitle {
  color: var(--gray-500, #6b7280);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.match-pms-status {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.match-pms-status--ok    { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.match-pms-status--error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.match-pms-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1rem;
  align-items: start;
}

.match-pms-panel-left,
.match-pms-panel-right {
  min-height: 400px;
}

.match-pms-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  background: var(--gray-100, #f3f4f6);
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
}

/* Unmatched blocks table */
.match-pms-blocks-table { font-size: 0.8rem; }

.match-pms-block-row { cursor: pointer; transition: background 0.1s; }
.match-pms-block-row:hover   { background: #f0f4ff; }
.match-pms-block-row.is-selected { background: #e0eaff; }

.match-pms-score {
  font-size: 0.72rem;
  color: var(--gray-500, #6b7280);
  margin-left: 0.25rem;
}

/* Confidence badges */
.match-pms-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-high   { background: #dcfce7; color: #166534; }
.badge-review { background: #fef9c3; color: #854d0e; }
.badge-weak   { background: #fee2e2; color: #991b1b; }

/* Selected block detail strip */
.match-pms-selected-detail {
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-100, #f3f4f6);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
}

.match-pms-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.match-pms-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  margin-right: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.match-pms-value { font-size: 0.8rem; }

/* Candidates list */
.match-pms-candidates-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mpms-candidate-card {
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.8rem;
  transition: box-shadow 0.15s;
}
.mpms-candidate-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.mpms-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--gray-50, #f9fafb);
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  flex-wrap: wrap;
}

.mpms-rank {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-400, #9ca3af);
  min-width: 1.5rem;
}
.mpms-allot-code  { font-weight: 600; font-size: 0.8rem; }
.mpms-description { flex: 1; font-size: 0.8rem; color: var(--gray-700, #374151); }
.mpms-total-score { font-weight: 700; font-size: 0.85rem; color: var(--navy, #003580); margin-left: auto; }

.mpms-confirm-btn { font-size: 0.75rem; padding: 0.25rem 0.65rem; margin-left: 0.5rem; }

.mpms-card-body {
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mpms-pms-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.78rem;
  color: var(--gray-700, #374151);
}

/* Score breakdown row */
.mpms-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--gray-100, #f3f4f6);
}
.mpms-bditem {
  font-size: 0.72rem;
  color: var(--gray-500, #6b7280);
}
.mpms-bditem strong { color: var(--gray-800, #1f2937); }

/* No-match row */
.match-pms-nomatch-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100, #f3f4f6);
}

/* Responsive */
@media (max-width: 1100px) {
  .match-pms-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   Reports > Quotes Made
   ============================================================ */

#view-reports-quotes-made .main-layout {
  max-width: 1900px;
}

/* ── Page header ── */
.qmr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.qmr-header-title-group {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.qmr-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy, #1e2d4e);
  margin: 0;
}

.qmr-subtitle {
  font-size: 0.875rem;
  color: var(--gray-400, #9ca3af);
}

/* ── Controls card ── */
.qmr-controls {
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.25rem;
}

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

.qmr-controls-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  white-space: nowrap;
}

.qmr-preset-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.qmr-preset-btn {
  background: var(--white, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  color: var(--gray-600, #4b5563);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.qmr-preset-btn:hover {
  background: var(--gray-50, #f9fafb);
  border-color: var(--navy-light, #3b5faa);
  color: var(--navy, #1e2d4e);
}

.qmr-preset-btn.active {
  background: var(--navy, #1e2d4e);
  border-color: var(--navy, #1e2d4e);
  color: #fff;
}

.qmr-search {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  font-size: 0.85rem;
}

.qmr-sort-select {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
}

.qmr-custom-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.qmr-custom-row.hidden { display: none; }

.qmr-date-input {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  font-size: 0.85rem;
}

.qmr-apply-btn {
  padding: 0.3rem 0.85rem;
}

/* ── Status section ── */
.qmr-status-section {
  margin-bottom: 2rem;
}

.qmr-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 6px 6px 0 0;
  margin-bottom: 0;
}

.qmr-section-header--enquiry    { background: #dbeafe; border-left: 4px solid #3b82f6; }
.qmr-section-header--tentative  { background: #fef3c7; border-left: 4px solid #f59e0b; }
.qmr-section-header--definite   { background: #dcfce7; border-left: 4px solid #16a34a; }
.qmr-section-header--lost       { background: #fee2e2; border-left: 4px solid #ef4444; }

.qmr-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--navy, #1e2d4e);
}

.qmr-section-count {
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 0.1rem 0.55rem;
  color: var(--gray-700, #374151);
}

.qmr-table-wrapper {
  border-radius: 0 0 6px 6px;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-top: none;
  overflow-x: auto;
}

/* ── Table ── */
.qmr-table {
  width: max-content;
  min-width: 100%;
  font-size: 0.8rem;
}

.qmr-table th {
  padding: 0.5rem 0.6rem;
  font-size: 0.75rem;
  white-space: nowrap;
  background: var(--gray-50, #f9fafb);
}

.qmr-table td {
  padding: 0.4rem 0.55rem;
  vertical-align: top;
}

/* Quote header row */
.qmr-quote-row td {
  background: var(--gray-50, #f9fafb);
  font-weight: 500;
}

/* Block rows */
.qmr-block-row td {
  background: #fff;
}

/* Total row */
.qmr-total-row td {
  background: #f0f4ff;
  font-weight: 600;
  border-top: 1px solid var(--gray-200, #e5e7eb);
  border-bottom: 2px solid var(--gray-200, #e5e7eb);
}

.qmr-total-label {
  text-align: right;
  color: var(--gray-500, #6b7280);
  font-size: 0.75rem;
  font-style: italic;
}

.qmr-total-num {
  font-variant-numeric: tabular-nums;
}

/* Numeric cells */
.cell-num, .qmr-table .cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Status code badge */
.qmr-status-code {
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gray-600, #4b5563);
}

/* Initials badge */
.qmr-initials {
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--navy-light, #3b5faa);
}

/* Rate cells with room class per line */
.qmr-rate-cell {
  white-space: pre;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}

.qmr-extras-cell {
  text-align: center;
}

.qmr-table .cell-num {
  text-align: center;
}

/* Room class chips */
.qmr-rc {
  display: inline-block;
  background: var(--gray-100, #f3f4f6);
  border-radius: 4px;
  padding: 0 0.3rem;
  font-size: 0.73rem;
  margin: 0 1px;
}

/* Empty section */
.qmr-section--empty .qmr-table-wrapper {
  display: none;
}

.qmr-section--empty .empty-state {
  display: block;
  padding: 1rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-top: none;
  border-radius: 0 0 6px 6px;
}

/* ── Print overrides for report ── */
@media print {
  #view-reports-quotes-made.view {
    display: block !important;
  }

  .qmr-controls,
  #qmr-print-btn,
  #qmr-controls-card {
    display: none !important;
  }

  .qmr-table-wrapper {
    overflow: visible;
  }

  .qmr-table {
    font-size: 7.5pt;
    width: 100%;
  }

  .qmr-status-section {
    page-break-inside: avoid;
    margin-bottom: 1rem;
  }

  .qmr-quote-row,
  .qmr-total-row {
    page-break-inside: avoid;
  }

  .qmr-section-header {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ─── Reports: PMS by Block ──────────────────────────────────────────────── */

/* Page header */
.pbb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.pbb-header-title-group {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.pbb-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy, #1e2d4e);
  margin: 0;
}

.pbb-subtitle {
  font-size: 0.875rem;
  color: var(--gray-400, #9ca3af);
}

/* Controls card */
.pbb-controls {
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.25rem;
}

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

.pbb-filter-row {
  margin-top: 0.6rem;
}

.pbb-controls-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  white-space: nowrap;
}

.pbb-preset-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pbb-preset-btn {
  background: var(--white, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  color: var(--gray-600, #4b5563);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.pbb-preset-btn:hover {
  background: var(--gray-50, #f9fafb);
  border-color: var(--navy-light, #3b5faa);
  color: var(--navy, #1e2d4e);
}

.pbb-preset-btn.active {
  background: var(--navy, #1e2d4e);
  border-color: var(--navy, #1e2d4e);
  color: #fff;
}

.pbb-search {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  font-size: 0.85rem;
}

.pbb-group-filter {
  min-width: 220px;
  max-width: 380px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  font-size: 0.85rem;
}

.pbb-select,
.pbb-sort-select {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
}

.pbb-custom-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.pbb-custom-row.hidden { display: none; }

.pbb-date-input {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  font-size: 0.85rem;
}

.pbb-apply-btn {
  padding: 0.3rem 0.85rem;
}

/* Grand total chips bar */
.pbb-grand-total {
  margin-bottom: 1rem;
}

.pbb-grand-total.hidden { display: none; }

.pbb-grand-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pbb-grand-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600, #4b5563);
  margin-right: 0.5rem;
}

.pbb-grand-chip {
  background: var(--navy, #1e2d4e);
  color: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.pbb-grand-chip span {
  font-weight: 400;
  opacity: 0.8;
  margin-right: 0.35rem;
}

/* Block table */
.pbb-table-wrapper {
  overflow-x: auto;
}

.pbb-table {
  width: max-content;
  min-width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
}

.pbb-table th {
  padding: 0.5rem 0.6rem;
  font-size: 0.75rem;
  white-space: nowrap;
  background: var(--gray-50, #f9fafb);
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  text-align: left;
}

.pbb-table td {
  padding: 0.4rem 0.55rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

.pbb-block-row:hover td {
  background: var(--gray-50, #f9fafb);
}

.pbb-total-row td {
  background: #f0f4ff;
  font-weight: 600;
  border-top: 1px solid var(--gray-200, #e5e7eb);
  border-bottom: 2px solid var(--gray-200, #e5e7eb);
}

.pbb-total-label {
  text-align: right;
  color: var(--gray-500, #6b7280);
  font-size: 0.75rem;
  font-style: italic;
}

.pbb-group-header-row td {
  background: var(--gray-100, #f3f4f6);
  font-weight: 600;
  border-top: 1px solid var(--gray-200, #e5e7eb);
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.pbb-group-header-label {
  color: var(--navy, #1e2d4e);
  font-size: 0.8rem;
}

.pbb-agent-cell {
  font-weight: 600;
  color: var(--navy, #1e2d4e);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pbb-id-cell {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--gray-500, #6b7280);
}

.pbb-code-cell {
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-700, #374151);
}

.pbb-desc-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Cancelled CAT status (PMS pmsStatusType → GP quoteStatusType clx = 1) */
.pbb-row-cancelled td {
  background: #fde8e8;
  color: #9b1c1c;
}

.pbb-row-cancelled .pbb-code-cell,
.pbb-row-cancelled .pbb-id-cell {
  color: #9b1c1c;
}

.pbb-status-badge {
  display: inline-block;
  border-radius: 10px;
  padding: 0.1rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.pbb-status-badge--confirmed { background: #dcfce7; color: #15803d; }
.pbb-status-badge--tentative { background: #fef3c7; color: #92400e; }
.pbb-status-badge--cancelled { background: #fee2e2; color: #b91c1c; }
.pbb-status-badge--other     { background: #e2e8f0; color: #374151; }

.pbb-quote-link {
  color: var(--navy-light, #3b5faa);
  text-decoration: none;
  font-family: monospace;
  font-size: 0.8rem;
}

.pbb-quote-link:hover {
  text-decoration: underline;
}

/* Pickup % color coding */
.pbb-pct--high { color: #15803d; font-weight: 700; }
.pbb-pct--mid  { color: #b45309; font-weight: 700; }
.pbb-pct--low  { color: #b91c1c; font-weight: 700; }

/* Column visibility toggles */
.pbb-col-toggle-row { align-items: flex-start; flex-wrap: wrap; margin-top: 1.1rem; }
.pbb-col-toggles    { display: flex; flex-wrap: wrap; gap: 6px; }
.pbb-col-toggle {
  padding: 3px 10px;
  border-radius: 12px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #6b7280;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.4;
  white-space: nowrap;
}
.pbb-col-toggle.active {
  border-color: #1e3a5f;
  background: #1e3a5f;
  color: #fff;
}
.pbb-col-toggle:hover:not(.active) {
  border-color: #6b7280;
  background: #f3f4f6;
  color: #374151;
}

/* Numeric alignment */
.pbb-table .cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ─── Document Builder ───────────────────────────────────────────────────── */
.db-layout {
  display: grid;
  grid-template-columns: 308px 1fr 308px;
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.db-sidebar {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.db-sidebar-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #5a6270;
  margin: 0 0 .75rem;
  letter-spacing: .04em;
}

.db-var-search {
  width: 100%;
  margin-bottom: .5rem;
  padding: .35rem .5rem;
  font-size: .8rem;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  box-sizing: border-box;
}

.db-var-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.db-var-item {
  padding: .35rem .5rem;
  font-size: .8rem;
  cursor: grab;
  border-radius: 4px;
  color: #1B2430;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.db-var-item:hover {
  background: #f0f2f5;
}

.db-var-item .db-var-type {
  font-size: .65rem;
  color: #9aa0aa;
  font-family: monospace;
}

.db-var-array-badge {
  display: inline-flex;
  align-items: center;
  font-size: .62rem;
  font-weight: 700;
  font-family: monospace;
  background: #1B2430;
  color: #D4AF37;
  border-radius: 3px;
  padding: 1px 4px;
  flex-shrink: 0;
}

.db-var-array-toggle {
  cursor: pointer;
  user-select: none;
}
.db-var-array-toggle:hover { background: #2e3d52; }

.db-var-item--array {
  border-left: 2px solid #D4AF37;
  padding-left: calc(.5rem - 2px);
}
.db-var-item--expanded {
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

.db-var-sub-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 2px .5rem 2px 1.4rem;
  font-size: .72rem;
  border-left: 2px solid #D4AF37;
  border-bottom: 1px solid #f1f3f5;
  background: #f8f9fa;
  cursor: grab;
  min-height: 22px;
}
.db-var-sub-item:last-of-type { border-radius: 0 0 4px 4px; }
.db-var-sub-item:hover { background: #eef2ff; }
.db-var-sub-item:active { cursor: grabbing; }

.db-var-sub-key {
  font-family: monospace;
  font-size: .7rem;
  color: #3451b2;
  white-space: nowrap;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-var-sub-label {
  font-size: .67rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.db-var-sample-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid #d0d4da;
  flex-shrink: 0;
  margin-left: auto;
  transition: background .2s, border-color .2s, box-shadow .2s;
}

#db-variable-list.db-preview-active .db-var-sample-dot {
  background: #22c55e;
  border-color: #16a34a;
  box-shadow: 0 0 4px rgba(34, 197, 94, .55);
}

/* Variable group headers */
.db-var-group-hdr {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .5rem .25rem;
  margin-top: .4rem;
  cursor: pointer;
  user-select: none;
  border-top: 1px solid #e8eaed;
}

.db-var-group-hdr:first-child {
  margin-top: 0;
  border-top: none;
}

.db-var-group-chevron {
  font-size: .6rem;
  color: #9aa0aa;
  transition: transform .15s;
  display: inline-block;
}

.db-var-group-hdr--collapsed .db-var-group-chevron {
  transform: rotate(-90deg);
}

.db-var-group-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #5a6270;
  flex: 1;
}

.db-var-group-count {
  font-size: .6rem;
  color: #b0b8c1;
  font-family: monospace;
}

/* Variable name — now lives inside .db-var-name-wrap (column flex), so flex:1 applies to the wrap */
.db-var-item .db-var-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Preview value shown inline */
.db-var-preview-val {
  font-size: .68rem;
  color: #3a7d44;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
  flex-shrink: 0;
}

.db-checkbox-sym {
  font-size: 1.15em;
  line-height: 1;
  flex-shrink: 0;
}

.db-checkbox-var-pill {
  font-size: .65rem;
  color: #3451b2;
  background: #ebf0ff;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: monospace;
  flex-shrink: 0;
}

.db-varlist-display {
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.db-varlist-placeholder {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .4rem;
  background: #f5f7fa;
  border: 1px dashed #adb5bd;
  border-radius: 4px;
  font-size: .8rem;
  color: #5a6270;
}

.db-varlist-name {
  font-weight: 600;
  color: #1B2430;
}

.db-varlist-orient {
  font-size: .72em;
  color: #8892a0;
}

.db-varlist-row {
  padding: 1px 0;
  line-height: 1.5;
}

.db-varlist-empty {
  font-style: italic;
  color: #9aa0aa;
  font-size: .85em;
}

/* ── Loop block ───────────────────────────────────────────────────────────── */
.db-loop-block {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 36px;
  border: 1.5px dashed #7b9fd4;
  border-radius: 4px;
  overflow: hidden;
}
.db-loop-header {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 2px .5rem;
  background: #dbeafe;
  border-bottom: 1px solid #bfdbfe;
  font-size: .72rem;
  font-weight: 600;
  color: #1e40af;
  flex-shrink: 0;
  user-select: none;
}
.db-loop-icon {
  font-size: .85rem;
  line-height: 1;
}
.db-loop-var-badge {
  font-family: monospace;
  font-size: .72rem;
}
.db-loop-template {
  flex: 1;
  padding: .25rem .5rem;
  outline: none;
  font-size: inherit;
  color: inherit;
  font-weight: inherit;
  min-height: 1.4em;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f0f7ff;
}
.db-loop-template:empty::before {
  content: "{{field}} — type template or drag column tokens here";
  color: #93c5fd;
  font-style: italic;
  pointer-events: none;
}
.db-loop-preview-row {
  padding: .15rem .5rem;
  font-size: inherit;
  color: inherit;
  font-weight: inherit;
  line-height: 1.5;
  border-bottom: 1px solid #e0edf8;
}
.db-loop-preview-row:last-child { border-bottom: none; }
.db-loop-preview-empty {
  font-style: italic;
  color: #93c5fd;
  font-size: .85em;
}
.db-loop-cols-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .15rem 0;
}
.db-loop-col-chip {
  display: inline-block;
  padding: 1px .45rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-family: monospace;
  font-size: .7rem;
  color: #1d4ed8;
  cursor: default;
  user-select: all;
}
.db-loop-tpl-input { font-family: monospace; font-size: .8rem; }

.db-vl-align-group { display: flex; gap: .25rem; }
.db-align-btn {
  flex: 1;
  padding: .2rem .4rem;
  font-size: .75rem;
  border: 1px solid #c5cdd6;
  border-radius: 4px;
  background: #f8fafc;
  color: #374151;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.db-align-btn:hover { background: #e8f0fe; border-color: #93b4f5; }
.db-align-btn.active { background: #3451b2; color: #fff; border-color: #2c44a0; }

.db-canvas-wrap {
  background: #e8eaed;
  border-radius: 8px;
  padding: 1.5rem;
  min-height: 600px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.db-canvas {
  position: relative;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  width: 794px;
  min-height: 1123px;
  outline: none;
}

.db-canvas-block {
  position: absolute;
  box-sizing: border-box;
  padding: 3px 5px;
  cursor: grab;
  border: 2px solid transparent;
  user-select: none;
}

.db-canvas-block > * {
  cursor: default;
  user-select: text;
}

.db-canvas-block [contenteditable] {
  cursor: text;
}

.db-canvas-block:hover {
  border-color: #b0b8c1;
}

.db-canvas-block--selected {
  border-color: #1B2430;
  box-shadow: 0 0 0 2px #D4AF37;
  overflow: visible;
}

.db-canvas-block--multi-selected {
  border-color: #1B2430;
  outline: 1.5px dashed #1B2430;
  outline-offset: 1px;
}

.db-rect-select {
  position: absolute;
  border: 1.5px solid #9aa0aa;
  background: rgba(154, 160, 170, 0.08);
  pointer-events: none;
  z-index: 150;
  box-sizing: border-box;
}

.db-resize-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border: 1.5px solid #1B2430;
  box-sizing: border-box;
  border-radius: 1px;
  z-index: 100;
}
.db-resize-handle[data-dir="nw"] { top: -4px; left: -4px; cursor: nw-resize; }
.db-resize-handle[data-dir="n"]  { top: -4px; left: calc(50% - 4px); cursor: n-resize; }
.db-resize-handle[data-dir="ne"] { top: -4px; right: -4px; cursor: ne-resize; }
.db-resize-handle[data-dir="e"]  { top: calc(50% - 4px); right: -4px; cursor: e-resize; }
.db-resize-handle[data-dir="se"] { bottom: -4px; right: -4px; cursor: se-resize; }
.db-resize-handle[data-dir="s"]  { bottom: -4px; left: calc(50% - 4px); cursor: s-resize; }
.db-resize-handle[data-dir="sw"] { bottom: -4px; left: -4px; cursor: sw-resize; }
.db-resize-handle[data-dir="w"]  { top: calc(50% - 4px); left: -4px; cursor: w-resize; }

.db-canvas-block[data-type="heading"] {
  font-weight: 700;
}

.db-canvas-block[data-type="divider"] {
  border-top: 1px solid #333333;
  min-height: 4px;
  padding: 0;
  cursor: default;
}

.db-canvas-block [contenteditable] {
  outline: none;
  min-width: 1px;
  user-select: text;
  margin-top: 12px;
}

.db-toolbar-sep {
  width: 1px;
  height: 28px;
  background: #d0d5dd;
  margin: 0 .25rem;
  align-self: center;
  flex-shrink: 0;
}

.db-insert-group {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.db-insert-btn {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .6rem;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #1B2430;
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}

.db-insert-btn:hover {
  background: #f0f2f5;
  border-color: #b0b8c1;
}

.db-insert-btn svg {
  flex-shrink: 0;
}

.db-insert-sep {
  width: 1px;
  height: 22px;
  background: #d0d5dd;
  margin: 0 .15rem;
  align-self: center;
  flex-shrink: 0;
}

.db-insert-btn--toggle {
  padding-left: 1rem;
  padding-right: 1rem;
  min-width: 7rem;
  justify-content: center;
}

.db-insert-btn--toggle.active {
  background: #1B2430;
  color: #fff;
  border-color: #1B2430;
}

.db-insert-btn--toggle.active:hover {
  background: #2c3e50;
  border-color: #2c3e50;
}

/* Preview split-button + dropdown */
.db-preview-wrap {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.db-preview-wrap .db-insert-btn--toggle {
  border-radius: 6px 0 0 6px;
  border-right: none;
  min-width: unset;
}

.db-preview-caret-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 .45rem;
  border: 1px solid #d0d5dd;
  border-radius: 0 6px 6px 0;
  background: #fff;
  cursor: pointer;
  color: #1B2430;
  transition: background .15s, border-color .15s;
}

.db-preview-caret-btn:hover {
  background: #f0f2f5;
  border-color: #b0b8c1;
}

.db-insert-btn--toggle.active ~ .db-preview-caret-btn,
.db-preview-wrap:has(.db-insert-btn--toggle.active) .db-preview-caret-btn {
  background: #1B2430;
  color: #fff;
  border-color: #1B2430;
}

.db-preview-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  z-index: 500;
  padding: .3rem 0;
}

.db-preview-opt {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .45rem .8rem;
  background: none;
  border: none;
  font-size: .82rem;
  color: #1B2430;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background .1s;
}

.db-preview-opt:hover { background: #f4f6f8; }

.db-pmenu-check {
  width: 14px;
  flex-shrink: 0;
  font-size: .8rem;
  color: #27ae60;
  font-weight: 700;
}

.db-preview-opt-sep {
  border-top: 1px solid #eef0f3;
  margin: .3rem 0;
}

/* Quote picker modal */
.db-qpicker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.db-qpicker-modal {
  background: #fff;
  border-radius: 12px;
  width: min(700px, 94vw);
  max-height: 74vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
}

.db-qpicker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.25rem .8rem;
  border-bottom: 1px solid #eef0f3;
  flex-shrink: 0;
}

.db-qpicker-search-row {
  padding: .6rem 1.25rem;
  border-bottom: 1px solid #eef0f3;
  flex-shrink: 0;
}
.db-qpicker-search {
  width: 100%;
  box-sizing: border-box;
  padding: .42rem .75rem;
  font-size: .82rem;
  border: 1.5px solid #d0d4da;
  border-radius: 6px;
  outline: none;
  background: #f8f9fb;
  color: #1B2430;
}
.db-qpicker-search:focus {
  border-color: #3451b2;
  background: #fff;
}

.db-qpicker-title {
  font-size: .95rem;
  font-weight: 700;
  color: #1B2430;
}

.db-qpicker-subtitle {
  font-size: .73rem;
  color: #7a8390;
  margin-top: .25rem;
}

.db-qpicker-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #7a8390;
  line-height: 1;
  padding: .15rem .35rem;
  border-radius: 4px;
  margin-left: .5rem;
}

.db-qpicker-close:hover { background: #f4f6f8; color: #1B2430; }

.db-qpicker-body {
  overflow-y: auto;
  flex: 1;
}

.db-qpicker-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

.db-qpicker-table th {
  position: sticky;
  top: 0;
  background: #f8f9fb;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #7a8390;
  font-weight: 700;
  padding: .5rem .85rem;
  text-align: left;
  border-bottom: 1px solid #eef0f3;
}

.db-qpicker-table td {
  padding: .55rem .85rem;
  border-bottom: 1px solid #f4f6f8;
  color: #1B2430;
}

.db-qpicker-table tbody tr { cursor: pointer; }

.db-qpicker-table tbody tr:hover td { background: #f0f6ff; }

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

.db-qpicker-empty {
  text-align: center;
  color: #9aa0aa;
  padding: 2.5rem 1rem;
  font-size: .85rem;
  line-height: 1.6;
}

.db-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  height: 100%;
  min-height: 60px;
  background: #f8f9fa;
  border: 2px dashed #d0d5dd;
  border-radius: 4px;
  color: #9aa0aa;
  font-size: .75rem;
  cursor: pointer;
  box-sizing: border-box;
  margin-top: 12px;
}

.db-image-placeholder:hover {
  background: #f0f2f5;
  border-color: #b0b8c1;
}

.db-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 3px;
}

.db-block-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  margin-top: 12px;
}

.db-table-wrap {
  width: 100%;
  overflow: auto;
  margin-top: 12px;
  box-sizing: border-box;
}

.db-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: inherit;
  table-layout: fixed;
}

.db-table th,
.db-table td {
  padding: 3px 6px;
  word-break: break-word;
  min-width: 30px;
}

.db-table th {
  position: relative;
  background: #f0f2f5;
  font-weight: 600;
  text-align: left;
}

.db-table td[contenteditable]:focus,
.db-table th[contenteditable]:focus {
  outline: 2px solid #D4AF37;
  outline-offset: -2px;
}

.db-cell-drag-over {
  background: #eef3ff !important;
  outline: 2px dashed #3451b2 !important;
  outline-offset: -2px;
}

.db-cell-token {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  background: #eef3ff;
  color: #3451b2;
  border: 1px solid #c3d0f7;
  border-radius: 3px;
  font-family: monospace;
  font-size: .82em;
  padding: 0 2px 0 3px;
  white-space: nowrap;
  user-select: none;
  vertical-align: baseline;
  cursor: default;
}

.db-cell-token-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #3451b2;
  cursor: pointer;
  padding: 0 1px;
  font-size: 1em;
  line-height: 1;
  opacity: 0.5;
  transition: opacity .1s, color .1s;
}

.db-cell-token-x:hover {
  opacity: 1;
  color: #c0392b;
}

.db-cell-token--selected {
  background: #d0dbff;
  border-color: #3451b2;
  outline: 2px solid rgba(52, 81, 178, 0.28);
  outline-offset: 1px;
}

.db-var-item--token-highlight {
  background: #eef3ff;
  outline: 1.5px solid #c3d0f7;
  outline-offset: -1.5px;
}

.db-array-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fef9ec;
  color: #92600a;
  border: 1px solid #f6d860;
  border-radius: 3px;
  font-family: monospace;
  font-size: .82em;
  padding: 1px 3px;
  white-space: nowrap;
  user-select: none;
}

.db-array-badge-name {
  font-weight: 600;
}

.db-array-axis-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid #e8c96a;
  border-radius: 2px;
  color: #92600a;
  cursor: pointer;
  padding: 0 3px;
  font-size: .88em;
  line-height: 1.3;
  opacity: 0.65;
  transition: opacity .1s, background .1s;
}

.db-array-axis-btn:hover {
  opacity: 1;
  background: #fef3c7;
}

.db-array-axis-btn--active {
  opacity: 1;
  background: #f6d860;
  border-color: #92600a;
}

.db-array-headers {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

.db-array-header-input {
  font-size: .72em;
  font-family: inherit;
  border: 1px solid #e8c96a;
  border-radius: 2px;
  padding: 1px 4px;
  background: #fffdf0;
  color: #92600a;
  min-width: 56px;
  max-width: 110px;
  width: 7ch;
}

.db-array-header-input:focus {
  outline: 1.5px solid #b7791f;
  outline-offset: -1px;
  background: #fff;
}

.db-array-col-group {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.db-array-order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid #e8c96a;
  border-radius: 2px;
  color: #92600a;
  cursor: pointer;
  padding: 0 2px;
  font-size: .65em;
  line-height: 1.4;
  opacity: 0.55;
  transition: opacity .1s, background .1s;
}

.db-array-order-btn:hover:not(:disabled) {
  opacity: 1;
  background: #fef3c7;
}

.db-array-order-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

.db-array-sub-table th[contenteditable="true"] {
  cursor: text;
  outline: none;
}

.db-array-sub-table th[contenteditable="true"]:hover {
  background: rgba(52, 81, 178, 0.06);
}

.db-array-sub-table th[contenteditable="true"]:focus {
  background: rgba(52, 81, 178, 0.1);
  outline: 1.5px solid rgba(52, 81, 178, 0.35);
  outline-offset: -1.5px;
}

/* ── Variable friendly-name rename ────────────────────────────────────── */

/* Varlist item with a custom label gets a subtle left accent */
.db-var-item--labeled .db-var-name {
  color: #3451b2;
  font-style: italic;
}
.db-var-name-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.db-var-name-raw {
  font-size: 9px;
  color: #9ca3af;
  line-height: 1.1;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pencil rename button — hidden until item hover */
.db-var-rename-btn {
  display: none;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  font-size: 11px;
  color: #6b7280;
  line-height: 1;
}
.db-var-item:hover .db-var-rename-btn {
  display: inline-flex;
  align-items: center;
}
.db-var-rename-btn:hover {
  color: #3451b2;
}

/* Inline rename input inside the varlist */
.db-var-rename-input {
  width: 100%;
  font-size: 11px;
  font-family: inherit;
  padding: 1px 4px;
  border: 1.5px solid #3451b2;
  border-radius: 3px;
  background: #fff;
  outline: none;
  color: #111;
}

/* Inline rename input inside a token pill */
.db-token-rename-input {
  width: 80px;
  font-size: 10px;
  font-family: inherit;
  padding: 0 3px;
  border: 1.5px solid #3451b2;
  border-radius: 3px;
  background: #fff;
  outline: none;
  color: #111;
  vertical-align: middle;
}


.db-properties {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
  position: sticky;
  top: 1rem;
}

.db-props-empty {
  font-size: .8rem;
  color: #9aa0aa;
  font-style: italic;
}

.db-aspect-lock-row {
  display: flex;
  justify-content: flex-end;
  padding: .15rem 0;
}

.db-aspect-lock-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  font-size: .75rem;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  color: #5a6270;
  cursor: pointer;
  line-height: 1;
}

.db-aspect-lock-btn:hover {
  border-color: #b0b8c1;
  background: #f0f2f5;
}

.db-aspect-lock-btn--active {
  border-color: #D4AF37;
  background: #fffbea;
  color: #92720a;
}

body.db-mode #site-nav {
  display: none;
}

#db-save-template-btn {
  background: #1B2430;
  color: #fff;
  border-color: #1B2430;
}

#db-save-template-btn:hover {
  background: #2c3a4d;
  border-color: #2c3a4d;
}

/* ── Content Blocks sidebar ─────────────────────────────────────────────── */
.db-sidebar-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  margin-bottom: .5rem;
}

.db-cb-manage-link {
  font-size: .7rem;
  color: #5a6270;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.db-cb-manage-link:hover {
  color: #1B2430;
}

.db-sidebar-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #1B2430;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.db-sidebar-add-btn:hover {
  background: #f0f2f5;
  border-color: #b0b8c1;
}

.db-cb-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.db-cb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  padding: .3rem .4rem;
  border-radius: 4px;
  cursor: grab;
  border: 1px solid transparent;
}

.db-cb-item:hover {
  background: #f0f2f5;
  border-color: #e2e6ea;
}

.db-cb-label {
  font-size: .78rem;
  color: #1B2430;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.db-cb-actions {
  display: none;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.db-cb-item:hover .db-cb-actions {
  display: flex;
}

.db-cb-icon-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5a6270;
  padding: 0;
}

.db-cb-icon-btn:hover {
  background: #e2e6ea;
  color: #1B2430;
}

.db-cb-empty {
  font-size: .78rem;
  color: #9aa0aa;
  font-style: italic;
  padding: .35rem .4rem;
  list-style: none;
}

/* ── Content Block canvas element ───────────────────────────────────────── */
.db-cb-block-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  background: #1B2430;
  padding: 2px 6px;
  border-radius: 3px 3px 0 0;
  margin-top: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-cb-block-preview {
  font-size: .72rem;
  color: #3a4252;
  padding: 4px 6px 4px;
  line-height: 1.5;
  overflow: hidden;
  word-break: break-word;
}

.db-cb-block-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: inherit;
  margin: 3px 0;
}

.db-cb-block-preview th,
.db-cb-block-preview td {
  border: 1px solid #d0d5dd;
  padding: 2px 5px;
  text-align: left;
  font-size: inherit;
  vertical-align: top;
}

.db-cb-block-preview th {
  background: #f0f2f5;
  font-weight: 600;
  color: #1B2430;
}

.db-cb-var-token {
  display: inline-block;
  background: #eef3ff;
  color: #3451b2;
  border: 1px solid #c3d0f7;
  border-radius: 3px;
  padding: 0 4px;
  font-size: .66rem;
  font-family: monospace;
  white-space: nowrap;
  line-height: 1.6;
}

.db-prop-row {
  margin-bottom: .75rem;
}

.db-prop-label {
  font-size: .7rem;
  text-transform: uppercase;
  color: #5a6270;
  font-weight: 600;
  margin-bottom: .25rem;
}

.db-prop-input {
  width: 100%;
  padding: .3rem .4rem;
  font-size: .8rem;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  box-sizing: border-box;
}

.db-prop-section {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #5a6270;
  letter-spacing: .04em;
  margin: .9rem 0 .4rem;
  padding-top: .6rem;
  border-top: 1px solid #e8eaed;
}

.db-prop-check {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: #2d3748;
  cursor: pointer;
  user-select: none;
}

.db-col-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
}

.db-col-resize-handle:hover {
  background: rgba(52, 81, 178, 0.25);
}

/* Right-edge width-resize strip for var-list blocks — overlays the outer right table border */
.db-varlist-right-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: e-resize;
  z-index: 20;
}
.db-varlist-right-handle:hover,
.db-canvas-block--selected .db-varlist-right-handle {
  background: rgba(52, 81, 178, 0.2);
}

.db-toolbar {
  display: flex;
  gap: .5rem;
  align-items: center;
  width: 220px;
  flex-shrink: 0;
  justify-content: flex-end;
  margin-left: auto;
}

.db-tpl-list {
  list-style: none;
  padding: 0;
  margin: .5rem 0 0;
}

.db-tpl-item {
  padding: .4rem .5rem;
  font-size: .8rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.db-tpl-item:hover {
  background: #f0f2f5;
}

.db-tpl-item-name {
  font-weight: 500;
  color: #1B2430;
}

.db-block-toolbar {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

.db-block-btn {
  font-size: .75rem;
  padding: .25rem .6rem;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: #1B2430;
}

.db-block-btn:hover {
  background: #f0f2f5;
}

.db-block-btn--danger {
  border-color: #f5c2c2;
  color: #b91c1c;
}

.db-block-btn--danger:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.db-cell-col-btns {
  display: flex;
  gap: .4rem;
}

.db-cell-col-btns .db-block-btn {
  flex: 1;
  text-align: center;
}

.db-cell-props {
  border-top: 1px solid #e5e7eb;
  margin-top: .5rem;
  padding-top: .5rem;
}

.db-align-btn-group {
  display: flex;
  gap: 3px;
}

.db-align-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  color: #1B2430;
  flex-shrink: 0;
}

.db-align-btn:hover {
  background: #f0f2f5;
  border-color: #1B2430;
}

.db-cell-drop-target {
  background: rgba(27, 36, 48, 0.10) !important;
  outline: 2px solid #1B2430 !important;
  outline-offset: -2px;
}

.db-align-btn--active {
  background: #1B2430;
  border-color: #1B2430;
  color: #fff;
}

@media (max-width: 1100px) {
  .db-layout {
    grid-template-columns: 252px 1fr 252px;
  }
  .db-toolbar {
    width: 180px;
  }
  .db-canvas {
    width: 600px;
  }
}

@media (max-width: 860px) {
  .db-layout {
    grid-template-columns: 1fr;
  }
  .db-canvas-wrap {
    order: -1;
  }
}

/* ── Link Profiles to PMS ─────────────────────────────────────────────── */

.pmslink-show-linked {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  white-space: nowrap;
}

.pmslink-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}

.pmslink-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  min-height: 420px;
  max-height: 640px;
}

.pmslink-panel-header {
  padding: 0.6rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.pmslink-panel-footer {
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
}

.pmslink-list {
  flex: 1;
  overflow-y: auto;
}

.pmslink-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
}

.pmslink-item:hover { background: var(--gray-50); }
.pmslink-item.selected { background: var(--accent-light, #e8f0fe); }

.pmslink-item-main {
  flex: 1;
  min-width: 0;
}

.pmslink-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pmslink-item-sub {
  font-size: 0.78rem;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pmslink-linked-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  padding: 0 0.4em;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 4px;
  background: #1f9d55;
  color: var(--white);
  vertical-align: middle;
}

.pmslink-current-link {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--gray-50);
}

.pmslink-manual-search {
  padding: 0.75rem 0.9rem 0.5rem;
}

.pmslink-manual-search input {
  width: 100%;
}
