/* one color palette for the whole app: change a color here and it changes everywhere */
:root {
  --bg: #0b0d10;
  --panel: #11151a;
  --field: #0e1216;
  --raised: #151b21;
  --hover: #18232c;
  --line: #202731;
  --line-strong: #29323d;
  --line-bright: #33414b;
  --text: #eef2f7;
  --text-soft: #cbd5df;
  --muted: #8b97a3;
  --muted-light: #9aa7b4;
  --accent: #37b7ff;
  --accent-soft: #8fd3ff;
  --accent-strong: #168fd2;
  --good: #6ee7a0;
  --good-strong: #43d17d;
  --good-bg: #103724;
  --yellow: #ffd36d;
  --orange: #ffb547;
  --warn-bg: #3a2d0c;
  --bad: #ff6969;
  --bad-soft: #ff9292;
  --bad-bg: #401b1b;
}
* {
  box-sizing: border-box;
}
/* shared look for every form field; more specific rules below still win (:where adds no weight) */
:where(
  input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']),
  select,
  textarea
) {
  background: var(--bg);
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
}
:where(input, select, textarea):focus {
  outline: none;
  border-color: var(--accent);
}
:where(input[type='checkbox'], input[type='radio']) {
  accent-color: var(--accent);
}
::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
body {
  margin: 0;
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}
.app {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}
/* the ☰ menu button only shows on narrow screens (see the max-width: 980px rules) */
.menu-btn,
.menu-backdrop {
  display: none;
}
.side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  /* short screens: the menu scrolls on its own so the bottom links stay reachable */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.side::-webkit-scrollbar {
  width: 6px;
}
.side::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}
.brand {
  font-size: 23px;
  font-weight: 850;
  letter-spacing: 0.8px;
  margin: 5px 10px 30px;
}
.brand span {
  color: var(--accent);
}
.group {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  margin: 22px 11px 8px;
}
.nav {
  display: block;
  padding: 11px 12px;
  margin: 3px 0;
  border-radius: 9px;
  color: var(--muted-light);
  text-decoration: none;
}
.nav:hover,
.nav.active {
  background: var(--hover);
  color: white;
}
.nav.active {
  box-shadow: inset 3px 0 var(--accent);
}
.main {
  padding: 32px 38px;
}
.top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}
.title {
  font-size: 30px;
  margin: 5px 0;
}
.sub {
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 9px;
}
.btn {
  border: 1px solid var(--line-strong);
  background: var(--raised);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
}
.btn.primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 30px 0;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 19px;
}
.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.value {
  font-size: 26px;
  font-weight: 850;
  margin-top: 8px;
}
.accent {
  color: var(--accent);
}
.grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
}
.head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.head h2 {
  font-size: 16px;
  margin: 0;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.event {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}
.event:first-of-type {
  border-top: 0;
}
.event b {
  display: block;
  margin-bottom: 5px;
}
.pill {
  font-size: 10px;
  font-weight: 850;
  padding: 5px 8px;
  border-radius: 99px;
  background: var(--good-bg);
  color: var(--good);
  align-self: start;
}
.pill.quote {
  background: var(--warn-bg);
  color: var(--yellow);
}
.task {
  display: flex;
  gap: 11px;
  border-top: 1px solid var(--line);
  padding: 13px 0;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
  margin-top: 5px;
}
.activity {
  display: grid;
  gap: 10px;
}
.activity div {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
}
.footer {
  margin-top: 24px;
  color: #55616d;
  font-size: 11px;
}
@media (max-width: 980px) {
  /* tablets, phones and narrow windows: the sidebar is a slide-out menu opened by the ☰ button */
  .app {
    display: block;
  }
  .side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    height: 100vh;
    z-index: 45;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 18px rgba(0, 0, 0, 0.5);
  }
  body.menu-open .side {
    transform: none;
  }
  .menu-btn {
    display: block;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 40;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--panel);
    color: var(--text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
  }
  body.menu-open .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 44;
    background: rgba(0, 0, 0, 0.55);
  }
  /* profile pages (event, client, crew, vendor, sale) use the full width; room for the ☰ button above */
  .profile-page {
    left: 0 !important;
  }
  .main,
  .profile-page {
    padding-top: 62px !important;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 24px;
  }
}
@media (max-width: 600px) {
  /* bigger tap targets */
  .btn {
    min-height: 38px;
  }
  .backup-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .top {
    align-items: flex-start;
    flex-direction: column;
  }
  .main {
    padding: 18px;
  }
}
.crew-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 60;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.crew-dialog {
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 24px 70px #0009;
}
.crew-dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.crew-dialog-head h2 {
  margin: 0 0 5px;
  font-size: 20px;
}
.crew-dialog-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.crew-section {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.crew-section-title {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.crew-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.crew-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 750;
}
.crew-form-grid input,
.crew-form-grid select,
.crew-form-grid textarea {
  width: 100%;
  height: 42px;
  background: var(--bg);
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 400;
  outline: none;
}
.crew-form-grid textarea {
  height: 92px;
  padding: 11px 12px;
  resize: vertical;
}
.crew-form-grid input:focus,
.crew-form-grid select:focus,
.crew-form-grid textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #168fd222;
}
.crew-form-grid .span-2 {
  grid-column: 1/-1;
}
.money-input {
  position: relative;
}
.money-input b {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.money-input input {
  padding-left: 27px;
}
.crew-dialog-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 22px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
@media (max-width: 650px) {
  .crew-form-grid {
    grid-template-columns: 1fr;
  }
  .crew-form-grid .span-2 {
    grid-column: auto;
  }
  .crew-modal {
    padding: 8px;
  }
}
#clientModal .crew-dialog,
#eventModal .crew-dialog {
  width: min(760px, 96vw);
}
#clientModal select,
#eventModal select {
  width: 100%;
  height: 42px;
  background: var(--bg);
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  outline: none;
}
#clientModal input,
#eventModal input {
  min-width: 0;
}
#vendorModal input,
#vendorModal select {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px;
  border-radius: 8px;
}
#eventModal input,
#eventModal select {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px;
  border-radius: 8px;
}
#contactModal input {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px;
  border-radius: 8px;
}
#clientModal input {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px;
  border-radius: 8px;
  min-width: 0;
}
#ep-invoice input,
#ep-invoice select,
#ep-invoice textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 10px;
  border-radius: 8px;
  font: inherit;
}
#crewModal input,
#crewModal select,
#crewModal textarea {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font: inherit;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.cal-dow {
  padding: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cal-day {
  min-height: 125px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--field);
}
.cal-day.out {
  background: var(--bg);
  color: #4d5964;
}
.cal-num {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}
.cal-num.today {
  display: inline-flex;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--accent-strong);
  color: white;
  align-items: center;
  justify-content: center;
}
.cal-event {
  font-size: 11px;
  padding: 6px 7px;
  border-radius: 6px;
  margin: 4px 0;
  cursor: pointer;
  border-left: 3px solid var(--accent);
  background: #172d43;
  color: var(--text);
}
.cal-event.booked {
  background: var(--good-bg);
  border-color: var(--good-strong);
  color: #b9f3ce;
}
.cal-event.planning {
  background: var(--warn-bg);
  border-color: var(--orange);
  color: #ffe0a0;
}
.cal-event.quote {
  background: #172d43;
  border-color: var(--accent);
  color: #b9e8ff;
}
.cal-event.completed {
  background: var(--line);
  border-color: #66727e;
  color: var(--text-soft);
}
.cal-event.cancelled {
  background: var(--bad-bg);
  border-color: var(--bad);
  color: #ffc0c0;
}
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cal-weekday {
  min-height: 300px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.cal-list-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 15px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}
@media (max-width: 900px) {
  .cal-day {
    min-height: 95px;
    padding: 5px;
  }
  .cal-event {
    font-size: 9px;
    padding: 4px;
  }
  .cal-week {
    grid-template-columns: 1fr;
  }
  .cal-list-item {
    grid-template-columns: 90px 1fr;
  }
}
.nav.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.nav.disabled small {
  float: right;
  font-size: 8px;
  color: var(--muted);
  margin-top: 3px;
}
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  background: var(--hover);
  border: 1px solid var(--accent-strong);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 12px 40px #0008;
}
.pill.planning,
.pill.quote-status {
  background: var(--warn-bg);
  color: var(--yellow);
}
.pill.booked {
  background: var(--good-bg);
  color: var(--good);
}
.pill.completed {
  background: var(--line);
  color: var(--text-soft);
}
.pill.cancelled {
  background: var(--bad-bg);
  color: #ffc0c0;
}
@media (max-width: 600px) {
  #client-profile-page,
  #event-profile-page,
  #crew-profile-page,
  #vendor-profile-page {
    left: 0 !important;
    padding: 62px 18px 18px !important;
  }
  .actions {
    flex-wrap: wrap;
  }
  .client-contact-grid {
    grid-template-columns: 1fr !important;
  }
}
#catalogModal input,
#catalogModal select,
#catalogModal textarea,
#eventCatalogPicker input,
#eventCatalogPicker select {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font: inherit;
}
#equipment-page #catalogRows td {
  padding: 15px 18px !important;
  vertical-align: middle;
  line-height: 1.3;
}
#equipment-page table thead th {
  padding: 13px 18px !important;
  vertical-align: bottom;
  line-height: 1.2;
}
#equipment-page table thead th:nth-child(4),
#equipment-page table thead th:nth-child(5),
#equipment-page table thead th:nth-child(6),
#equipment-page table thead th:nth-child(7),
#equipment-page #catalogRows td:nth-child(4),
#equipment-page #catalogRows td:nth-child(5),
#equipment-page #catalogRows td:nth-child(6),
#equipment-page #catalogRows td:nth-child(7) {
  white-space: nowrap;
}
#equipment-page #catalogRows td:nth-child(9) {
  padding-left: 22px !important;
}
#equipment-page #catalogRows td:nth-child(9) > div {
  gap: 10px !important;
}
.layer-toggle {
  display: flex;
  gap: 6px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  padding: 4px;
  border-radius: 10px;
}
.layer-toggle .btn {
  min-width: 72px;
}
.crew-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-soft);
  border-radius: 50%;
  margin-right: 6px;
}
.crew-cal-list {
  margin-top: 4px;
  display: grid;
  gap: 3px;
}
.crew-cal-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 5px;
  border-radius: 5px;
  background: #10283a;
  border: 1px solid #1d4968;
  color: #bce4ff;
  font-size: 10px;
  line-height: 1.15;
  cursor: pointer;
  overflow: hidden;
}
.crew-cal-chip:hover {
  border-color: #58b7ee;
  background: #13344b;
}
.crew-cal-chip b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crew-cal-chip .role {
  color: #7fb9d8;
  white-space: nowrap;
}
.crew-cal-chip.conflict {
  background: #6e1717 !important;
  border: 1px solid var(--bad) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 1px #ff5a5a44 inset;
}
.crew-cal-chip.conflict .role {
  color: #ffd2d2;
}
.crew-conflict-badge {
  font-size: 9px;
  font-weight: 800;
  color: var(--bad-soft);
}
.crew-day-summary {
  font-size: 9px;
  color: #6f8da1;
  margin-top: 3px;
}
.crew-list-day {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.crew-list-event {
  margin: 6px 0 0 20px;
}
.crew-list-event .crew-cal-chip {
  display: inline-flex;
  margin: 3px 4px 0 0;
}
.calendar-day {
  min-height: 120px;
}
#invoices-page #invoiceDashboardRows td {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
#invoices-page thead th {
  padding: 12px;
  text-align: left;
}
.ar-overdue {
  color: var(--bad-soft);
}
.ar-paid {
  color: var(--good);
}
.aging-badge {
  font-size: 10px;
  color: var(--muted-light);
  white-space: nowrap;
}
#invoices-page {
  width: 100%;
  min-height: calc(100vh - 48px);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
#invoices-page > .top {
  margin-top: 0;
}
#invoices-page .stats {
  margin-top: 0;
}
#invoices-page {
  padding-bottom: 40px;
}
.ar-kpi .value {
  font-size: 30px;
}
.ar-attention {
  margin: 18px 0;
}
.ar-attention-list {
  display: grid;
  gap: 8px;
}
.ar-attention-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--panel);
  border-left: 4px solid #58636d;
}
.ar-attention-row.danger {
  border-left-color: var(--bad);
  background: #221314;
}
.ar-attention-row.warn {
  border-left-color: var(--orange);
}
.ar-attention-row.soon {
  border-left-color: #5aa8d8;
}
.ar-attention-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ar-status-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 18px 0 10px;
}
.ar-controls {
  margin-bottom: 12px;
}
.ar-invoice-cards {
  display: grid;
  gap: 10px;
}
.ar-invoice-card {
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--field);
  overflow: hidden;
}
.ar-invoice-card.overdue {
  border-color: #713737;
}
.ar-invoice-main {
  display: grid;
  grid-template-columns: 145px minmax(220px, 1fr) 120px 120px 165px;
  gap: 16px;
  align-items: center;
  padding: 16px;
}
.ar-invoice-id h3 {
  margin: 3px 0 8px;
}
.ar-invoice-party {
  display: grid;
  gap: 3px;
}
.ar-invoice-party span {
  font-size: 12px;
}
.ar-money {
  display: grid;
  gap: 3px;
}
.ar-money span,
.ar-money small {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}
.ar-money b {
  font-size: 16px;
}
.ar-money.paid b {
  color: var(--good);
}
.ar-money.balance strong {
  font-size: 19px;
  color: var(--text);
}
.ar-invoice-card.overdue .ar-money.balance strong {
  color: var(--bad-soft);
}
.ar-invoice-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
#arPaymentModal input,
#arPaymentModal select,
#arPaymentModal textarea {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font: inherit;
}
@media (max-width: 1050px) {
  .ar-invoice-main {
    grid-template-columns: 1fr 1fr;
  }
  .ar-invoice-party {
    grid-column: span 2;
  }
  .ar-invoice-actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 650px) {
  .ar-invoice-main {
    grid-template-columns: 1fr;
  }
  .ar-invoice-party {
    grid-column: auto;
  }
  .ar-attention-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .ar-attention-actions {
    width: 100%;
    justify-content: space-between;
  }
}
.readiness-meter {
  height: 7px;
  background: var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.readiness-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--good-strong);
  transition: width 0.2s;
}
.readiness-row {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  align-items: flex-start;
}
.readiness-row:first-child {
  border-top: 0;
}
.readiness-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  flex: 0 0 20px;
}
.readiness-ok .readiness-icon {
  background: var(--good-bg);
  color: var(--good);
}
.readiness-warn .readiness-icon {
  background: var(--warn-bg);
  color: var(--yellow);
}
.readiness-bad .readiness-icon {
  background: var(--bad-bg);
  color: var(--bad-soft);
}
.attention-critical .dot {
  background: var(--bad);
}
.attention-warning .dot {
  background: var(--orange);
}
.attention-info .dot {
  background: var(--accent);
}
.po-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 18px 0 10px;
}
.po-list {
  display: grid;
  gap: 10px;
}
.po-card {
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--field);
  overflow: hidden;
}
.po-main {
  display: grid;
  grid-template-columns: 135px minmax(180px, 1fr) minmax(180px, 1fr) 130px 130px;
  gap: 14px;
  align-items: center;
  padding: 16px;
}
.po-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.po-total {
  display: flex;
  justify-content: flex-end;
  gap: 25px;
  align-items: center;
  border-top: 1px solid var(--line-strong);
  margin-top: 15px;
  padding-top: 15px;
}
.po-total strong {
  font-size: 23px;
  color: var(--accent);
}
#poModal input,
#poModal select,
#poModal textarea {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font: inherit;
}
#poLineRows td {
  padding: 8px;
  border-top: 1px solid var(--line);
}
#poLineRows input {
  width: 100%;
}
@media (max-width: 950px) {
  .po-main {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .po-main {
    grid-template-columns: 1fr;
  }
}
#purchase-orders-page {
  width: 100%;
  min-height: calc(100vh - 64px);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
#purchase-orders-page > .top {
  margin-top: 0;
}
.equipment-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #b38cff;
  border-radius: 50%;
  margin-right: 6px;
}
.equipment-cal-list {
  margin-top: 4px;
  display: grid;
  gap: 3px;
}
.equipment-cal-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 5px;
  border-radius: 5px;
  background: #241a38;
  border: 1px solid #543d7a;
  color: #dfceff;
  font-size: 10px;
  line-height: 1.15;
  cursor: pointer;
  overflow: hidden;
}
.equipment-cal-chip:hover {
  border-color: #9d79d6;
  background: #30204b;
}
.equipment-cal-chip b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.equipment-cal-chip .qty {
  color: #bda4e8;
  white-space: nowrap;
}
.equipment-cal-chip.conflict {
  background: #6e1717 !important;
  border: 1px solid var(--bad) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 1px #ff5a5a44 inset;
}
.equipment-cal-chip.conflict .qty {
  color: #ffd2d2;
}
.equipment-short {
  font-size: 9px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.equipment-day-summary {
  font-size: 9px;
  color: #a991cf;
  margin-top: 3px;
}
.quick-event-dialog {
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: auto;
}
.quick-status-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 2px 14px;
}
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.quick-section {
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 14px;
  min-height: 145px;
}
.quick-section h3 {
  margin: 0;
}
.quick-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.quick-row:first-child {
  border-top: 0;
}
.quick-row-main {
  min-width: 0;
}
.quick-row-main b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-row .right {
  text-align: right;
  white-space: nowrap;
}
.quick-empty {
  color: var(--muted);
  padding: 14px 0;
}
.quick-conflict {
  color: var(--bad-soft);
}
.quick-good {
  color: var(--good);
}
.quick-warn {
  color: var(--yellow);
}
@media (max-width: 760px) {
  .quick-grid {
    grid-template-columns: 1fr;
  }
}
.money-input {
  position: relative !important;
  display: block !important;
  width: 100% !important;
}
.money-input > b {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 2 !important;
  width: 14px !important;
  line-height: 1 !important;
  pointer-events: none !important;
  color: var(--muted-light) !important;
  text-align: center !important;
}
.money-input > input {
  width: 100% !important;
  box-sizing: border-box !important;
  padding-left: 40px !important;
  padding-right: 12px !important;
}
.money-input > input[type='number'] {
  appearance: textfield;
}
.money-input > input[type='number']::-webkit-inner-spin-button,
.money-input > input[type='number']::-webkit-outer-spin-button {
  margin-left: 6px;
}
.profit-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.profit-line {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.profit-line:first-child {
  border-top: 0;
}
.profit-line span {
  color: var(--muted-light);
}
.profit-line b {
  white-space: nowrap;
}
.profit-total {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--line-bright);
  padding-top: 14px;
  margin-top: 8px;
}
.profit-total strong {
  font-size: 20px;
  color: var(--accent);
}
.profit-analysis {
  margin-top: 16px;
}
.profit-analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.profit-analysis-grid > div {
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 13px;
}
.profit-analysis-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.profit-analysis-grid strong {
  font-size: 18px;
}
.profit-meter {
  height: 8px;
  background: var(--line);
  border-radius: 20px;
  overflow: hidden;
  margin: 16px 0 10px;
}
.profit-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--good-strong);
  transition: 0.2s;
}
.margin-good {
  color: var(--good) !important;
}
.margin-watch {
  color: var(--yellow) !important;
}
.margin-low {
  color: var(--bad-soft) !important;
}
#expenseRows td {
  vertical-align: middle;
}
@media (max-width: 850px) {
  .profit-layout {
    grid-template-columns: 1fr;
  }
  .profit-analysis-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .profit-analysis-grid {
    grid-template-columns: 1fr;
  }
}
.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.7fr);
  gap: 16px;
}
.quote-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}
.quote-table th,
.quote-table td {
  padding: 10px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.quote-table input,
.quote-detail-grid input,
.quote-detail-grid textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 10px;
  border-radius: 8px;
}
.quote-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.quote-detail-grid label {
  display: grid;
  gap: 6px;
}
.quote-detail-grid label > span {
  font-size: 11px;
  color: var(--muted-light);
  text-transform: uppercase;
}
.quote-detail-grid textarea {
  min-height: 78px;
  resize: vertical;
}
.quote-total {
  display: flex;
  justify-content: flex-end;
  gap: 34px;
  padding-top: 15px;
  margin-top: 8px;
  border-top: 1px solid var(--line-bright);
}
.quote-total strong {
  font-size: 24px;
  color: var(--accent);
}
.quote-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.quote-diff {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin: 0 0 16px;
  padding: 13px 15px;
  border: 1px solid #8a6a2a;
  background: #271f0d;
  border-radius: 10px;
}
.quote-history-row {
  display: grid;
  grid-template-columns: 130px 120px 1fr 130px 200px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.quote-history-row:first-child {
  border-top: 0;
}
.quote-locked input {
  opacity: 0.72;
  pointer-events: none;
}
@media (max-width: 980px) {
  .quote-layout {
    grid-template-columns: 1fr;
  }
  .quote-history-row {
    grid-template-columns: 1fr 1fr;
  }
  .quote-history-row .history-actions {
    grid-column: span 2;
  }
}
@media (max-width: 600px) {
  .quote-detail-grid {
    grid-template-columns: 1fr;
  }
  .quote-detail-grid .span-2 {
    grid-column: auto;
  }
}
.quote-pdf-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 4px 0 8px;
}
.quote-pdf-choice {
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  padding: 18px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 8px;
  font: inherit;
}
.quote-pdf-choice:hover {
  border-color: var(--accent);
  background: var(--raised);
}
.quote-pdf-choice b {
  font-size: 16px;
  color: var(--accent);
}
.quote-pdf-choice span {
  line-height: 1.4;
  color: var(--text-soft);
}
.quote-pdf-choice small {
  color: var(--muted);
  line-height: 1.35;
}
@media (max-width: 620px) {
  .quote-pdf-options {
    grid-template-columns: 1fr;
  }
}
#scheduleSnapshot .schedule-snap-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
}
.schedule-snap-time {
  color: #c9eaff;
  font-weight: 750;
  font-size: 12px;
}
.schedule-snap-main b {
  display: block;
  margin-bottom: 3px;
}
.schedule-snap-done {
  color: var(--good);
  font-size: 10px;
  font-weight: 850;
}
.schedule-snap-upcoming {
  color: var(--yellow);
  font-size: 10px;
  font-weight: 850;
}
@media (max-width: 650px) {
  #scheduleSnapshot .schedule-snap-row {
    grid-template-columns: 1fr;
  }
}
#scheduleSnapshot .schedule-snap-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
}
.schedule-snap-time {
  color: #c9eaff;
  font-weight: 750;
  font-size: 12px;
}
.schedule-snap-main b {
  display: block;
  margin-bottom: 3px;
}
.schedule-snap-done {
  color: var(--good);
  font-size: 10px;
  font-weight: 850;
}
.schedule-snap-upcoming {
  color: var(--yellow);
  font-size: 10px;
  font-weight: 850;
}
@media (max-width: 650px) {
  #scheduleSnapshot .schedule-snap-row {
    grid-template-columns: 1fr;
  }
}
.schedule-order-buttons {
  display: flex;
  gap: 4px;
}
.schedule-order-buttons .btn {
  padding: 5px 8px;
  min-width: 30px;
  font-size: 14px;
}
.schedule-order-buttons .btn:hover {
  border-color: var(--accent);
  color: #72cffc;
}
#scheduleRows tr {
  transition: background 0.12s;
}
#scheduleRows tr:hover {
  background: var(--raised);
}
.schedule-order-buttons {
  align-items: center;
}
.schedule-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-bright);
  border-radius: 7px;
  color: var(--accent-soft);
  background: var(--panel);
  cursor: grab;
  font-weight: 900;
  letter-spacing: -2px;
  user-select: none;
}
.schedule-drag-handle:hover {
  border-color: var(--accent);
  background: var(--hover);
}
.schedule-drag-handle:active {
  cursor: grabbing;
}
.schedule-dragging {
  opacity: 0.46;
  background: var(--hover) !important;
}
.schedule-drag-over {
  box-shadow: inset 0 2px 0 var(--accent);
}
.schedule-drag-over td {
  background: var(--raised);
}
#manualEquipmentModal input,
#manualEquipmentModal select {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font: inherit;
}
.equipment-edit-cell {
  display: flex;
  gap: 6px;
}
.profit-source-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}
#eventEndDateLabel {
  flex-direction: column;
  gap: 7px;
}
#eventDurationInput {
  cursor: pointer;
}
.expense-dialog {
  width: min(940px, 96vw);
}
.expense-form-section {
  border-top: 1px solid var(--line-strong);
  padding-top: 14px;
  margin-top: 14px;
}
.expense-form-section:first-of-type {
  border-top: 0;
  margin-top: 0;
}
.expense-form-title,
.expense-field-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-bottom: 9px;
}
.expense-check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}
.expense-check input {
  width: auto;
}
.expense-stats {
  grid-template-columns: repeat(4, 1fr);
}
.expense-stats.second {
  margin-top: -6px;
}
.expense-filters {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) repeat(3, minmax(150px, 220px));
  gap: 9px;
}
.expense-filters input,
.expense-filters select {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 11px;
  border-radius: 8px;
}
.expense-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1450px;
}
.expense-table th,
.expense-table td {
  padding: 11px 9px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
.expense-actions {
  display: flex;
  gap: 5px;
}
.expense-possible-duplicate {
  border-left: 3px solid var(--orange);
}
.expense-billable {
  color: var(--accent-soft);
  font-weight: 700;
  font-size: 10px;
}
.expense-reimb {
  color: var(--yellow);
  font-size: 10px;
  font-weight: 700;
}
@media (max-width: 900px) {
  .expense-filters {
    grid-template-columns: 1fr 1fr;
  }
  .expense-stats {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .expense-filters,
  .expense-stats {
    grid-template-columns: 1fr;
  }
}
.expense-global-filters {
  display: grid;
  grid-template-columns: 1fr 220px 220px;
  gap: 9px;
}
.expense-global-filters input,
.expense-global-filters select {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 11px;
  border-radius: 8px;
}
@media (max-width: 800px) {
  .expense-global-filters {
    grid-template-columns: 1fr;
  }
}
#expenses-page {
  width: 100%;
  min-height: calc(100vh - 60px);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
#expenses-page > .top {
  margin-top: 0;
}
.po-profile-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.po-profile-section input,
.po-profile-section select,
.po-profile-section textarea {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 11px;
  border-radius: 8px;
  font: inherit;
}
.po-rich-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* columns follow the colgroup widths, so the table fits the page */
  min-width: 860px;
}
.po-rich-table th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.po-rich-table td.pp-total {
  white-space: nowrap;
}
.po-rich-table input {
  padding-left: 8px;
  padding-right: 6px;
}
.po-rich-table .pp-remove {
  padding: 6px 0;
  width: 32px;
}
.po-rich-table th,
.po-rich-table td {
  padding: 8px;
  border-top: 1px solid var(--line);
}
.po-rich-table input {
  width: 100%;
  box-sizing: border-box;
}
.po-notes {
  width: 100%;
  min-height: 190px;
  box-sizing: border-box;
  resize: vertical;
}
.po-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.po-summary-row:first-child {
  border-top: 0;
}
.po-vendor-typeahead {
  position: relative;
}
.po-vendor-matches {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 66px;
  z-index: 80;
  background: var(--field);
  border: 1px solid var(--line-bright);
  border-radius: 9px;
  max-height: 245px;
  overflow: auto;
  box-shadow: 0 12px 35px #0009;
}
.po-vendor-match {
  padding: 10px 12px;
  cursor: pointer;
  border-top: 1px solid var(--line);
}
.po-vendor-match:first-child {
  border-top: 0;
}
.po-vendor-match:hover,
.po-vendor-match.active {
  background: var(--hover);
}
.po-vendor-match b {
  display: block;
}
.po-vendor-match small {
  color: var(--muted);
}
.po-vendor-no-match {
  padding: 12px;
  color: var(--muted);
}
.po-vendor-selected {
  color: var(--good);
}
.po-filter-grid {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.6fr) minmax(180px, 1fr)
    130px 165px 165px auto;
  gap: 9px;
  align-items: end;
}
.po-filter-grid > input,
.po-filter-grid select,
.po-filter-grid label > input {
  width: 100%;
  box-sizing: border-box;
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 10px;
  border-radius: 9px;
}
.po-filter-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
}
@media (max-width: 1150px) {
  .po-filter-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 650px) {
  .po-filter-grid {
    grid-template-columns: 1fr;
  }
}
.quote-pricing-card {
  margin-top: 0;
}
.quote-price-settings {
  display: grid;
  /* the Pricing card is narrow: two columns that always fit, the reason on its own row */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quote-price-settings label:has(#quoteDiscountReason) {
  grid-column: 1 / -1;
}
.quote-price-settings label > * {
  min-width: 0;
}
.quote-price-settings label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}
.quote-price-settings input,
.quote-price-settings select {
  width: 100%;
  box-sizing: border-box;
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 10px;
  border-radius: 8px;
}
.quote-percent-input {
  position: relative;
}
.quote-percent-input input {
  padding-right: 30px;
}
.quote-percent-input b {
  position: absolute;
  right: 11px;
  top: 10px;
  color: var(--muted);
}
.quote-discount-money.percent > b {
  left: auto !important;
  right: 12px !important;
}
.quote-discount-money.percent > input {
  padding-left: 12px !important;
  padding-right: 38px !important;
}
.quote-price-summary {
  margin-top: 14px;
  border-top: 1px solid var(--line-strong);
  padding-top: 10px;
}
.quote-price-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}
.quote-price-summary .grand {
  font-size: 18px;
  border-top: 1px solid var(--line-bright);
  margin-top: 5px;
  padding-top: 10px;
}
.quote-price-summary .grand strong {
  color: var(--accent);
}
.quote-tax-note {
  margin-top: 8px;
  font-size: 10px;
}
.quote-category-row td {
  padding: 10px !important;
  background: var(--raised) !important;
  color: #62c7f4;
  font-weight: 850;
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  border-top: 1px solid #345064 !important;
}
@media (max-width: 900px) {
  .quote-price-settings {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 550px) {
  .quote-price-settings {
    grid-template-columns: 1fr;
  }
}
#quotes-page {
  width: 100%;
  min-height: calc(100vh - 60px);
}
.quote-dashboard-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 16px 0 10px;
}
.quote-dashboard-filter {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 9px;
}
.quote-dashboard-filter input,
.quote-dashboard-filter select {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 11px;
  border-radius: 8px;
}
.quote-dashboard-list {
  display: grid;
  gap: 9px;
}
.quote-dashboard-row {
  display: grid;
  grid-template-columns:
    150px minmax(180px, 1fr) minmax(180px, 1fr)
    130px 140px 130px;
  gap: 12px;
  align-items: center;
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 13px;
}
.quote-dashboard-row .amount {
  font-size: 17px;
  font-weight: 850;
}
.quote-dashboard-row button {
  justify-self: end;
}
@media (max-width: 950px) {
  .quote-dashboard-row {
    grid-template-columns: 1fr 1fr;
  }
  .quote-dashboard-filter {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .quote-dashboard-row {
    grid-template-columns: 1fr;
  }
}
.quick-quote-dialog {
  width: min(1050px, 97vw);
}
.qq-section {
  border-top: 1px solid var(--line-strong);
  padding-top: 15px;
  margin-top: 15px;
}
.qq-section:first-of-type {
  border-top: 0;
  margin-top: 0;
}
.qq-section-title {
  font-size: 10px;
  color: var(--muted-light);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-bottom: 9px;
}
.quick-quote-dialog input,
.quick-quote-dialog select,
.quick-quote-dialog textarea {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 10px;
  border-radius: 8px;
  font: inherit;
}
.quick-quote-dialog textarea {
  min-height: 75px;
}
.qq-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.qq-table th,
.qq-table td {
  padding: 8px;
  border-top: 1px solid var(--line);
}
.qq-table input,
.qq-table select {
  width: 100%;
  box-sizing: border-box;
}
.qq-total {
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-bright);
}
.qq-total strong {
  font-size: 22px;
  color: var(--accent);
}
#quick-quote-profile-page {
  width: 100%;
  min-height: calc(100vh - 60px);
}
.qqp-basic-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.qqp-basic-grid label,
.qqp-more-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}
.qqp-basic-grid input,
.qqp-basic-grid select,
.qqp-more-grid input,
.qqp-more-grid select,
.qqp-more-grid textarea,
.qqp-row input,
.qqp-row select {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font: inherit;
}
.qqp-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}
.qqp-list {
  display: grid;
  gap: 8px;
}
.qqp-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) 90px 90px 130px 130px auto;
  gap: 8px;
  align-items: center;
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px;
}
.qqp-row.vendor {
  grid-template-columns:
    minmax(220px, 1.6fr) minmax(170px, 1fr)
    140px 130px auto;
}
.qqp-row .total {
  text-align: right;
  font-weight: 850;
  color: var(--accent);
}
.qqp-more {
  margin-top: 16px;
}
.qqp-more summary {
  cursor: pointer;
  font-weight: 800;
}
.qqp-more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.qqp-more-grid textarea {
  min-height: 90px;
}
@media (max-width: 900px) {
  .qqp-basic-grid {
    grid-template-columns: 1fr 1fr;
  }
  .qqp-row,
  .qqp-row.vendor {
    grid-template-columns: 1fr 1fr;
  }
  .qqp-more-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 550px) {
  .qqp-basic-grid,
  .qqp-row,
  .qqp-row.vendor {
    grid-template-columns: 1fr;
  }
}
.qqp-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.qqp-section > .top {
  margin-bottom: 12px;
}
.qqp-empty {
  padding: 20px 4px;
}
.qqp-section .qqp-list:not(:empty) + .qqp-empty {
  display: none;
}
.qqp-section .card {
  margin-bottom: 0;
}
.qqp-row {
  align-items: end !important;
}
.qqp-row-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.qqp-row-field > span {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}
.qqp-row-field input,
.qqp-row-field select {
  width: 100%;
  box-sizing: border-box;
}
.qqp-money {
  position: relative;
}
.qqp-money b {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.qqp-money input {
  padding-left: 28px !important;
}
.qqp-row .total-field strong {
  display: flex;
  align-items: center;
  min-height: 39px;
  color: var(--accent);
  font-size: 14px;
}
.qqp-row .action-field button {
  min-height: 39px;
}
.qqp-row.vendor {
  grid-template-columns:
    minmax(220px, 1.6fr) minmax(180px, 1fr)
    150px 130px auto !important;
}
@media (max-width: 900px) {
  .qqp-row,
  .qqp-row.vendor {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media (max-width: 550px) {
  .qqp-row,
  .qqp-row.vendor {
    grid-template-columns: 1fr !important;
  }
}

/* ==================== Layout helpers (moved out of inline style attributes) ==================== */
.m-0 {
  margin: 0;
}
.mt-5 {
  margin-top: 5px;
}
.mt-8 {
  margin-top: 8px;
}
.mt-10 {
  margin-top: 10px;
}
.mt-12 {
  margin-top: 12px;
}
.mt-14 {
  margin-top: 14px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-18 {
  margin-top: 18px;
}
.mt-20 {
  margin-top: 20px;
}
.mt-30 {
  margin-top: 30px;
}
.head h2.mb-5 {
  margin-bottom: 5px;
}
.mb-16 {
  margin-bottom: 16px;
}
.head h2.ml-10 {
  margin-left: 10px;
}
.mr-2 {
  margin-right: 2px;
}
.top-compact {
  margin: 8px 0 18px;
}
.legend-line {
  margin: -2px 0 12px;
}
.summary-line {
  margin: 9px 0 4px;
}
.pull-up {
  margin-top: -15px;
}
.p-11 {
  padding: 11px;
}
.fs-12 {
  font-size: 12px;
}
.fs-15 {
  font-size: 15px;
}
.fs-18 {
  font-size: 18px;
}
.fs-20 {
  font-size: 20px;
}
.fs-22 {
  font-size: 22px;
}
.fs-24 {
  font-size: 24px;
}
.text-green {
  color: var(--good-strong);
}
.text-amber {
  color: var(--orange);
}
.text-blue {
  color: var(--accent);
}
.text-gray {
  color: var(--muted);
}
.text-red {
  color: var(--bad);
}
.text-red-soft {
  color: var(--bad-soft);
}
.text-right-note {
  text-align: right;
  margin-top: 4px;
}
.head-row {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
}
.overflow-auto {
  overflow: auto;
}
.row-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.row-wrap-end {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}
.row-6 {
  display: flex;
  gap: 6px;
}
.row-center {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.totals-row {
  display: flex;
  gap: 28px;
  text-align: right;
}
.wrap-items {
  flex-wrap: wrap;
}
.stack-6 {
  display: grid;
  gap: 6px;
}
.stack-10 {
  display: grid;
  gap: 10px;
}
.stack-12 {
  display: grid;
  gap: 12px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid-2-wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.full-row {
  grid-column: 1/-1;
}
.filter-label {
  display: grid;
  gap: 5px;
}
.minw-130 {
  min-width: 130px;
}
.minw-160 {
  min-width: 160px;
}
.minw-170 {
  min-width: 170px;
}
.divider-top {
  border-top: 1px solid var(--line-strong);
  padding-top: 14px;
}
.empty-state {
  padding: 20px 8px;
}
.wide-table {
  width: 100%;
  border-collapse: collapse;
}
.minw-760 {
  min-width: 760px;
}
.minw-850 {
  min-width: 850px;
}
.minw-900 {
  min-width: 900px;
}
.minw-920 {
  min-width: 920px;
}
.minw-980 {
  min-width: 980px;
}
.minw-1000 {
  min-width: 1000px;
}
.minw-1050 {
  min-width: 1050px;
}
.minw-1250 {
  min-width: 1250px;
}
.minw-1320 {
  min-width: 1320px;
}
.w-8p {
  width: 8%;
}
.w-9p {
  width: 9%;
}
.w-10p {
  width: 10%;
}
.w-14p {
  width: 14%;
}
.w-24p {
  width: 24%;
}
.w-112 {
  width: 112px;
}
.w-130 {
  width: 130px;
}
.dlg-560 {
  width: min(560px, 94vw);
}
.dlg-620 {
  width: min(620px, 96vw);
}
.dlg-620-narrow {
  width: min(620px, 94vw);
}
.dlg-650 {
  width: min(650px, 96vw);
}
.dlg-650-narrow {
  width: min(650px, 95vw);
}
.dlg-680 {
  width: min(680px, 96vw);
}
.dlg-720 {
  width: min(720px, 96vw);
}
.dlg-720-narrow {
  width: min(720px, 92vw);
}
.dlg-760 {
  width: min(760px, 96vw);
}
.dlg-760-narrow {
  width: min(760px, 94vw);
}
.dlg-900 {
  width: min(900px, 96vw);
}
.overlay {
  position: fixed;
  inset: 0;
  background: #000b;
  align-items: center;
  justify-content: center;
}
.profile-page {
  position: fixed;
  inset: 0 0 0 250px;
  background: var(--bg);
  overflow: auto;
  padding: 32px 38px;
}
.field {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 10px;
  border-radius: 9px;
}
.field-dim {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
  padding: 10px;
  border-radius: 9px;
}
.search-field {
  flex: 1;
  min-width: 260px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px 14px;
  border-radius: 9px;
}
.outline-none {
  outline: none;
}
.notes-area {
  width: 100%;
  min-height: 280px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 14px;
  border-radius: 9px;
  font: inherit;
}
.btn-danger-outline {
  border-color: #713737;
  color: var(--bad-soft);
}
.btn-success-outline {
  border-color: #2e7650;
  color: var(--good);
}
.btn.primary.btn-convert {
  background: #23874f;
}
.card-button {
  text-align: left;
  cursor: pointer;
  color: var(--text);
}
.dot-green {
  background: var(--good);
}
.dot-blue {
  background: var(--accent);
}
.calendar-layer-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.calendar-layer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 12px;
}
.w-16p-pad {
  padding: 14px 18px;
  width: 16%;
}
.short-notes-area {
  width: 100%;
  height: 100px;
  margin-top: 10px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font: inherit;
}
.totals-box {
  margin-left: auto;
  max-width: 380px;
  margin-top: 20px;
}
.long-notes-area {
  width: 100%;
  height: 160px;
  resize: vertical;
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 14px;
  border-radius: 9px;
  font: inherit;
}
#eventSearch {
  flex: 1;
  min-width: 250px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px 14px;
  border-radius: 9px;
}
#catalogEmpty {
  padding: 22px 10px;
}
#invoiceDashboardEmpty {
  padding: 22px 8px;
}
#poEmpty {
  padding: 18px 0;
}
#vendor-profile-page {
  z-index: 27;
}
#vendorModal {
  z-index: 45;
}
#crew-profile-page {
  z-index: 26;
}
#event-profile-page {
  z-index: 25;
}
#invAddress {
  height: 78px;
  resize: none;
}
#invPaymentNotes {
  width: 100%;
  height: 95px;
  margin-top: 6px;
}
#client-profile-page {
  z-index: 10;
}
#clientContactsGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
}
#contactModal {
  z-index: 70;
}
#contactNotes {
  width: 100%;
  height: 100px;
  margin-top: 16px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: white;
  padding: 12px;
  border-radius: 8px;
}
#arPayBalance {
  font-size: 20px;
  margin-bottom: 16px;
}

/* ==================== Reports page ==================== */
.report-year {
  display: grid;
  gap: 5px;
  min-width: 120px;
}
.report-stats {
  margin: 0 0 4px;
}
.report-stats .value.neg,
.report-table td.neg {
  color: var(--bad-soft);
}
.report-intro {
  color: var(--text-soft);
  line-height: 1.5;
}
.report-card .head {
  align-items: flex-start;
  gap: 16px;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.report-table th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 9px 10px;
  white-space: nowrap;
}
.report-table td {
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.report-table .num {
  text-align: right;
  white-space: nowrap;
}
.report-table a {
  color: var(--accent);
  text-decoration: none;
}
.report-table .report-total td {
  font-weight: 800;
  border-top: 1px solid var(--line-bright);
}
.report-warn {
  color: var(--yellow);
}

/* ==================== Crew pay page ==================== */
.pay-earlier {
  min-height: 40px;
}
.pay-run-buttons {
  margin-left: auto;
}
.pay-schedule summary {
  cursor: pointer;
}
.pay-section {
  margin-bottom: 0;
}
/* Crew time chips on the calendar */
.crew-time-list {
  margin-top: 4px;
  display: grid;
  gap: 3px;
}
.crew-time-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 5px;
  border-radius: 5px;
  background: var(--warn-bg);
  border: 1px solid #6b5418;
  color: #ffe2a1;
  font-size: 10px;
  line-height: 1.15;
  cursor: pointer;
  overflow: hidden;
}
.crew-time-chip:hover {
  border-color: var(--yellow);
}
.crew-time-chip b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crew-time-chip span {
  color: #d9b86a;
  white-space: nowrap;
}
.crew-time-total {
  font-size: 18px;
  padding: 8px 0;
}
/* Events page filters */
.event-filter-search {
  flex: 1;
  min-width: 260px;
}
.event-filters .field {
  width: 100%;
}
#crewTimeCrewHelp {
  display: block;
  margin-top: 6px;
}
#crewTimeCrewHelp a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
/* Crew on the calendar: event name under each crew chip (Crew view) */
.crew-cal-chip.with-event {
  display: block;
}
.crew-chip-top {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}
.crew-chip-event {
  margin-top: 2px;
  color: #8fc6e6;
  font-size: 9.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crew-cal-chip.conflict .crew-chip-event {
  color: #ffd2d2;
}
/* Crew listed inside their event chip (Crew + Events / All views) */
.cal-event-crew {
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 2px;
}
.cal-event-crew-line {
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-event-crew-line span {
  opacity: 0.7;
}
.cal-event-crew-line.conflict {
  color: #ffb3b3;
  font-weight: 700;
}
.cal-event-crew-more {
  font-size: 9px;
  opacity: 0.7;
}
/* ==================== Documents ==================== */
.doc-actions {
  white-space: nowrap;
  text-align: right;
}
.doc-actions .btn + .btn {
  margin-left: 5px;
}
.dot.doc-dot-warn,
.doc-dot-warn {
  background: var(--orange);
}
.doc-attention-text {
  flex: 1;
}
.doc-po-note {
  margin-bottom: 12px;
  color: var(--text-soft);
}
.doc-notes {
  display: grid;
  gap: 5px;
}
.doc-preview-dialog {
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.doc-preview-body {
  flex: 1;
  min-height: 300px;
  overflow: auto;
  background: var(--bg);
  border-radius: 9px;
}
.doc-preview-frame {
  width: 100%;
  height: 70vh;
  border: 0;
  background: var(--text);
  border-radius: 9px;
}
.doc-preview-image {
  display: block;
  max-width: 100%;
  margin: 0 auto;
}
#docUploadBox .field,
#docLinkBox .field {
  width: 100%;
}
/* Client import */
.import-skip td {
  opacity: 0.55;
}
.import-template-link {
  color: var(--accent);
}
#clientImportMapping select {
  width: 100%;
}
/* Pay Run: Paid by picker on each payee card */
.pay-method-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.pay-method-pick .field {
  padding: 6px 8px;
}
/* Pay Run: Paid checkbox on each payee card */
.pay-paid-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.pay-paid-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--good-strong);
  cursor: pointer;
}
/* In-page dialog (messages, "Are you sure?" questions, typed answers) */
.crm-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.crm-dialog {
  width: min(460px, 94vw);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.crm-dialog-message {
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--text);
}
.crm-dialog-input {
  width: 100%;
  margin-top: 14px;
}
.crm-dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* client profile: discounted events */
#clientDiscounts a {
  color: var(--accent);
  font-weight: 700;
}

/* W-2 payroll page */
.payroll-stats {
  grid-template-columns: repeat(5, 1fr);
}
.payroll-card .payroll-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.payroll-card .totals-box {
  margin: 0;
  max-width: none;
}
.payroll-card .totals-box .head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 0;
}
.payroll-card .totals-box .head b {
  white-space: nowrap;
}
.payroll-company {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}
@media (max-width: 900px) {
  .payroll-stats,
  .payroll-card .payroll-columns {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .payroll-stats,
  .payroll-card .payroll-columns {
    grid-template-columns: 1fr;
  }
  .payroll-company {
    border-left: 0;
    padding-left: 0;
  }
}

/* Calendar Admin view */
.admin-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 3px 0 4px;
}
.admin-chip {
  display: inline-block;
  font-size: 11px;
  line-height: 1.3;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.admin-chip:hover {
  filter: brightness(1.2);
}
.admin-payday {
  color: var(--accent-soft);
  border-color: #2c6c93;
  background: #12293a;
}
.admin-payday.admin-done {
  color: #8fe0b0;
  border-color: #2d6b48;
  background: #12271c;
}
.admin-period {
  color: var(--muted-light);
  border-color: var(--line-bright);
  background: transparent;
  border-style: dashed;
}
.admin-invoice {
  color: #ffd38a;
  border-color: #7a5a1f;
  background: #2a2112;
}
.admin-overdue {
  color: var(--bad-soft);
  border-color: #7b2f2f;
  background: #2b1515;
}
.admin-po {
  color: #d3b5ff;
  border-color: #5b3f86;
  background: #21182f;
}
.admin-filing {
  color: #ffb3b3;
  border-color: #a24848;
  background: transparent;
  font-weight: 700;
}
#adminCalendarLegend .admin-chip {
  cursor: default;
}

/* Supabase sign-in screen and save status */
.cloud-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cloud-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cloud-card h2 {
  margin: 6px 0 2px;
}
.cloud-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cloud-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted-light);
}
.cloud-card input {
  background: var(--field);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font-size: 15px;
}
.cloud-logo {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0.8px;
}
.cloud-logo span {
  color: var(--accent);
}
.cloud-env {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: #ffd38a;
  border: 1px solid #7a5a1f;
  border-radius: 6px;
  padding: 2px 6px;
}
.cloud-msg {
  font-size: 13px;
  color: var(--muted-light);
  min-height: 1em;
}
.cloud-err {
  color: var(--bad-soft);
}
.cloud-link {
  font-size: 13px;
  color: var(--accent);
}
.cloud-status {
  margin-top: 24px;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-light);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cloud-user {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cloud-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--good-strong);
}
.cloud-dot.cloud-pending,
.cloud-dot.cloud-saving {
  background: var(--orange);
}
.cloud-dot.cloud-error,
.cloud-dot.cloud-paused {
  background: var(--bad);
}

/* live "each paycheck" preview on the crew pay form */
.pay-preview-grid {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 4px 24px;
  margin-top: 6px;
  font-size: 13px;
}
.pay-preview-grid b {
  text-align: right;
}
.pay-preview-grid .pay-preview-net {
  font-size: 15px;
}
.pay-preview-warn {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  font-size: 12px;
}

/* ---------- Sales (section 36) ---------- */
.sale-totals {
  margin: 14px 0 0 auto;
  max-width: 320px;
  border-top: 1px solid var(--line-bright);
  padding: 10px 8px 0 0;
}
.sale-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 3px 0;
  font-size: 13px;
}
.sale-totals .sale-total {
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid var(--line-bright);
  font-size: 15px;
}
.sale-totals .sale-total b {
  color: var(--accent);
}
.sale-same {
  margin-left: 10px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.sale-same input {
  width: auto;
  margin: 0 4px 0 0;
  vertical-align: middle;
}
.sale-payment {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.sale-payment span {
  flex: 1;
}
.sale-notes {
  width: 100%;
  margin-top: 8px;
}
#saleShipTo:disabled {
  opacity: 0.6;
}
.quotes-view-tabs {
  margin-bottom: 16px;
}

/* ---------- Sale page (section 36) ---------- */
#sale-profile-page {
  z-index: 25;
}
@media (max-width: 600px) {
  #sale-profile-page {
    left: 0 !important;
    padding: 62px 18px 18px !important;
  }
}
.sale-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .sale-cols {
    grid-template-columns: 1fr;
  }
}
.sale-progress {
  margin-top: 8px;
}
.sale-step {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  color: var(--muted);
}
.sale-step span {
  width: 16px;
}
.sale-step.done {
  color: inherit;
}
.sale-step.done span {
  color: var(--good-strong);
}
.sale-part-fields {
  margin-top: 12px;
}
.sale-items input {
  min-width: 70px;
}
.sale-items td:first-child input {
  min-width: 260px;
}
.sale-part-bottom {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}
@media (max-width: 900px) {
  .sale-part-bottom {
    grid-template-columns: 1fr;
  }
}
.sale-part-bottom .sale-totals {
  margin: 0;
  max-width: none;
}
.sale-profit-lines {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-bright);
  color: var(--muted);
}
.sale-profit-lines > div {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 13px;
}
.sale-totals .neg b,
td.neg {
  color: var(--bad-soft);
}
.sale-part-danger {
  margin-top: 22px;
  text-align: right;
}
.sale-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sale-check input {
  width: auto;
}
.sale-address {
  white-space: pre-line;
}
.sale-items input {
  height: 38px;
  background: var(--bg);
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  outline: none;
}
.sale-items input:focus {
  border-color: var(--accent);
}
.sale-totals > .sale-profit-lines {
  display: block;
}
.sale-revisions {
  margin-top: 22px;
}

/* ---------- Event contract (section 37) ---------- */
.contract-money {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.contract-money > div {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
}
.contract-money span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
@media (max-width: 900px) {
  .contract-money {
    grid-template-columns: 1fr 1fr;
  }
}
.contract-warn {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--orange);
  font-size: 13px;
}
.crew-form-grid label.sale-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}
.crew-form-grid label.sale-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  flex: none;
}

.sale-discount {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
}

/* quick quote Scope & Terms: fields keep their own height (no stretching to the tall box beside them) */
.qqp-more-grid label {
  align-content: start;
}
.qqp-more-grid input,
.qqp-more-grid select,
.qqp-more-grid textarea {
  font-size: 13px;
  text-transform: none;
}
.qqp-more-grid input,
.qqp-more-grid select {
  height: 42px;
  padding-top: 0;
  padding-bottom: 0;
}

/* deposit on the event overview and invoice */
.ep-deposit {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-strong);
}
.ep-deposit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.inv-deposit-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.inv-deposit-right .btn {
  padding: 4px 10px;
  font-size: 12px;
}
.sale-totals b .btn {
  padding: 3px 8px;
  font-size: 11px;
  margin-right: 6px;
}

/* invoice totals: the deposit line (amount, then a status line under it) */
.inv-deposit {
  padding: 10px 0 8px;
}
.inv-deposit-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.inv-deposit-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
}
.inv-deposit-paid {
  color: var(--good-strong);
  font-weight: 600;
}
.inv-deposit-btn {
  padding: 5px 12px;
  font-size: 12px;
}
.link-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  color: var(--accent-soft);
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover {
  color: var(--text);
}

/* weekly backup reminder (dashboard) */
.backup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
  color: var(--yellow);
  font-size: 13px;
}
.cloud-backup-due {
  color: var(--orange);
}

/* global search (top of the menu) */
.side-search {
  position: relative;
  margin: 4px 0 14px;
}
.side-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.side-search input:focus {
  border-color: var(--accent);
}
.search-results {
  position: fixed;
  width: 420px;
  max-width: calc(100vw - 24px);
  max-height: 70vh;
  overflow: auto;
  z-index: 80;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.search-group {
  padding: 8px 10px 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.search-item b {
  display: block;
  font-size: 13px;
}
.search-item span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.search-item.active,
.search-item:hover {
  background: var(--hover);
}
.search-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}
/* dashboard Open Items */
.open-items {
  display: grid;
  gap: 8px;
}
.open-item {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.open-item:hover {
  border-color: var(--accent);
}
.open-item b {
  font-size: 13px;
}
.open-item .muted {
  font-size: 12px;
}
.open-item-kind {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-soft);
}
.open-item-kind.warn {
  color: var(--orange);
}
.open-item-kind.bad {
  color: var(--bad-soft);
}

/* calendar: times, multi-day bars, sale ship dates, agenda, layer switches */
.cal-day,
.cal-weekday {
  cursor: pointer;
}
.cal-day:hover,
.cal-weekday:hover {
  background: #121920;
}
.cal-day.out:hover {
  background: var(--field);
}
.cal-event b,
.cal-sale b {
  display: block;
  line-height: 1.25;
}
.cal-time {
  font-weight: 700;
  margin-top: 2px;
}
.cal-sub {
  opacity: 0.8;
  margin-top: 1px;
}
.cal-cont {
  display: block;
  opacity: 0.7;
  font-style: italic;
}
.cal-day .cal-event.span-next {
  margin-right: -9px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.cal-day .cal-event.span-prev {
  margin-left: -9px;
  border-left-width: 0;
  padding-left: 10px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.cal-sale {
  font-size: 11px;
  padding: 6px 7px;
  border-radius: 6px;
  margin: 4px 0;
  cursor: pointer;
  border-left: 3px solid #b38cff;
  background: #241a38;
  color: #dfceff;
}
.cal-sale.shipped {
  opacity: 0.65;
}
.cal-sale-dot {
  color: #b38cff;
}
.cal-weekday.today {
  border-color: var(--accent-strong);
}
.layer-btn.primary {
  background: var(--hover);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.cal-agenda {
  display: grid;
  gap: 10px;
}
.cal-agenda-day {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.cal-agenda-day > h3 {
  grid-row: span 20;
  margin: 4px 0 0;
  font-size: 14px;
}
.cal-agenda-day > :not(h3) {
  grid-column: 2;
}
.cal-agenda-day.past {
  opacity: 0.6;
}
.cal-agenda-day .cal-event,
.cal-agenda-day .cal-sale {
  font-size: 13px;
  padding: 9px 12px;
  margin: 0;
}
.cal-today-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--accent-strong);
  color: #fff;
  font-size: 10px;
  vertical-align: middle;
}
@media (max-width: 900px) {
  .cal-day .cal-event.span-next {
    margin-right: -6px;
  }
  .cal-day .cal-event.span-prev {
    margin-left: -6px;
  }
  .cal-sale {
    font-size: 9px;
    padding: 4px;
  }
}
@media (max-width: 600px) {
  #calendar-page .head,
  .calendar-layer-head,
  .layer-toggle,
  .calendar-layer-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .calendar-layer-head {
    flex-direction: column;
    align-items: flex-start;
  }
  /* month grid on a phone: names only, so they fit */
  .cal-day {
    min-height: 70px;
    padding: 3px;
  }
  .cal-day .cal-sub,
  .cal-day .cal-time,
  .cal-day .cal-event-crew,
  .cal-day .crew-cal-list,
  .cal-day .equipment-cal-list,
  .cal-day .crew-time-list {
    display: none;
  }
  .cal-day .cal-event,
  .cal-day .cal-sale {
    font-size: 9px;
    padding: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
  }
  .cal-day .cal-event.span-next {
    margin-right: -4px;
  }
  .cal-day .cal-event.span-prev {
    margin-left: -4px;
  }
  .cal-dow {
    padding: 6px 0;
  }
  .cal-agenda-day {
    grid-template-columns: 1fr;
  }
  .cal-agenda-day > h3 {
    grid-row: auto;
  }
  .cal-agenda-day > :not(h3) {
    grid-column: 1;
  }
}

/* Settings: Outlook calendar link */
.feed-link-row {
  display: flex;
  gap: 8px;
}
.feed-link-row input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-family: Consolas, monospace;
}
.feed-steps {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}
@media (max-width: 600px) {
  .feed-link-row {
    flex-direction: column;
  }
}
