/* ==========================================================================
   CRM modules — dashboard, bookings, calendar, payments, services,
   accounts, reports, settings. Builds on crm.css (same look and spacing).
   ========================================================================== */

.ico {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn .ico { margin-right: -2px; }

a.nav-item { text-decoration: none; }

.small { font-size: 0.82rem; }
.num { text-align: right; white-space: nowrap; }
.warn-text { color: #8c3a26; }
.muted.small, p.muted { white-space: normal; }
code { font-size: 0.82rem; padding: 1px 5px; border-radius: 4px; background: var(--paper-deep); }

.demo-banner {
  margin: 0 0 18px;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--paper-deep);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.page-intro {
  max-width: 75ch;
  margin: -12px 0 22px;
  color: var(--ink-soft);
}

.readonly-note,
.info-box {
  margin: -8px 0 20px;
  padding: 12px 16px;
  border-left: 3px solid var(--sage);
  border-radius: 4px;
  background: #F1EFE6;
  font-size: 0.88rem;
}

.info-box { margin-top: 0; }

.info-count {
  display: inline-block;
  margin-left: 6px;
  font-weight: 600;
  color: var(--olive);
}

.back-link-crm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.back-link-crm:hover { color: var(--brown); }

.main-header h1 { outline: none; }

.count-dot {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--olive);
  font-size: 0.72rem;
  color: var(--white);
}

/* ---------- KPI tiles ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.kpi-grid .stat {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: inherit;
  text-decoration: none;
}

.kpi-grid .stat-value {
  font-size: 1.6rem;
  overflow-wrap: anywhere;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.stat-link {
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-link:hover {
  border-color: var(--olive);
  box-shadow: 0 10px 24px -20px rgba(76, 55, 19, 0.5);
}

@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .kpi-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Filters ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 8px;
}

.filter-bar .field { min-width: 130px; flex: 1 1 130px; }

.filter-bar .field input,
.filter-bar .field select,
.toolbar .field input,
.toolbar .field select {
  min-height: 42px;
  padding: 0.5em 0.8em;
}

.filter-bar .btn { min-height: 42px; }

.filter-summary {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.toolbar-5 { grid-template-columns: 2fr 1.4fr 1fr 1fr 1fr; }
.toolbar-4 { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
.toolbar-2 { grid-template-columns: 2fr 1fr; margin-top: 26px; }
.toolbar-check { min-height: 42px; }

@media (max-width: 1100px) {
  .toolbar-5, .toolbar-4 { grid-template-columns: 1fr 1fr; }
  .toolbar-5 .search-field, .toolbar-4 .search-field { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .toolbar-5, .toolbar-4, .toolbar-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Charts (single hue, thin marks, rounded data ends) ---------- */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1000px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }

.chart-card {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.chart-title {
  margin: 0 0 4px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
}

.chart-note {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.chart-empty {
  padding: 30px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.vbars {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 180px;
  padding-top: 8px;
  border-bottom: 1px solid var(--line);
}

.vbar {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  outline-offset: 2px;
  cursor: default;
}

.vbar-track {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.vbar-fill {
  width: min(70%, 26px);
  min-height: 0;
  border-radius: 4px 4px 0 0;
  background: var(--olive);
  transition: background 0.15s;
}

.vbar:hover .vbar-fill,
.vbar:focus .vbar-fill { background: var(--brown); }

.vbar-label {
  padding: 6px 0 2px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.hbars {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.hbars li {
  display: grid;
  grid-template-columns: minmax(90px, 34%) 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.85rem;
  outline-offset: 2px;
}

.hbar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brown);
}

.hbar-track {
  height: 10px;
  border-radius: 0 4px 4px 0;
  background: transparent;
  border-left: 1px solid var(--line-strong);
}

.hbar-fill {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--olive);
}

.hbars li:hover .hbar-fill,
.hbars li:focus .hbar-fill { background: var(--brown); }

.hbar-value {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.chart-table {
  margin-top: 10px;
  font-size: 0.8rem;
}

.chart-table summary {
  cursor: pointer;
  color: var(--olive);
}

.chart-table table {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
}

.chart-table th,
.chart-table td {
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}

.chart-table td { text-align: right; }

.chart-tip {
  position: fixed;
  z-index: 100;
  max-width: 260px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--ink);
  font-size: 0.78rem;
  color: var(--white);
  pointer-events: none;
}

.chart-tip[hidden] { display: none; }

.definitions ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.definitions li { margin-bottom: 6px; }

/* ---------- Payment pills ---------- */
.pay-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.pay-pending  { background: #f3e6c8; color: #7a5a1e; }
.pay-rejected { background: #f0dcd6; color: #8c3a26; }
.pay-partial  { background: #e8ead9; color: #4d5236; }
.pay-paid     { background: #dfe3cc; color: #3d4228; }

.status-pending     { background: #f3e6c8; color: #7a5a1e; }
.status-in-progress { background: #dfe3cc; color: #3d4228; }

.flag-dot {
  display: inline-flex;
  margin-left: 4px;
  color: #a5532f;
  vertical-align: -2px;
}

.flag-text {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #a5532f;
}

.bookings-table td.num .cell-main { font-weight: 600; }

/* ---------- Ops cards (logistics) ---------- */
.ops-list .empty-state { padding: 40px 20px; }

.ops-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.ops-card:last-child { border-bottom: 0; }
.ops-card:hover { background: var(--paper); }

.ops-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: none;
  width: 52px;
  padding: 6px 0;
  border-radius: 8px;
  background: #F1EFE6;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--olive);
}

.ops-date b {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--brown);
}

.ops-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ops-main strong { color: var(--brown); font-weight: 600; }
.ops-main small { color: var(--ink-soft); }

.ops-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* ---------- Booking details ---------- */
.detail-header { align-items: flex-start; }

.detail-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.status-control label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.status-control select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.flag-box {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-left: 3px solid #a5532f;
  border-radius: 4px;
  background: #f8ece8;
  font-size: 0.88rem;
  color: #6f2d1e;
}

.flag-box p { margin: 4px 0 0; }
.flag-box .ico { margin-top: 2px; }
.flag-box.small { margin: 12px 0 0; font-size: 0.82rem; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 1100px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }

.detail-card {
  min-width: 0;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.detail-grid > .detail-card { margin-bottom: 0; }

.detail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-card-head h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
}

.detail-actions { display: flex; gap: 8px; }

.detail-card .detail-list { grid-template-columns: minmax(110px, 38%) 1fr; font-size: 0.9rem; }

.money-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  margin: 0;
  font-size: 0.9rem;
}

.money-list:empty { display: none; }
.money-list dt { color: var(--ink-soft); }
.money-list dd { margin: 0; text-align: right; font-weight: 600; color: var(--brown); }

#mTotals { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.payment-state { margin: 14px 0 0; font-size: 0.85rem; color: var(--ink-soft); }

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.detail-table th {
  padding: 8px 10px 8px 0;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.detail-table th.num { text-align: right; }

.detail-table td {
  padding: 10px 10px 10px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.detail-table small {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.detail-table strong { font-weight: 600; color: var(--brown); }
.detail-table tfoot td { border-bottom: 0; font-weight: 600; }

@media (max-width: 760px) {
  .detail-table thead { display: none; }
  .detail-table, .detail-table tbody, .detail-table tfoot, .detail-table tr, .detail-table td { display: block; }
  .detail-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .detail-table td { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; border: 0; text-align: right; }
  .detail-table td > small, .detail-table td > .thumb-row { text-align: left; }
  .detail-table td[data-label]::before { content: attr(data-label); flex: none; font-size: 0.78rem; color: var(--ink-soft); text-align: left; }
  .detail-table td { flex-wrap: wrap; }
  .detail-table td.cell-actions { justify-content: flex-start; }
}

.quote-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f3e6c8;
  font-size: 0.75rem;
  color: #7a5a1e;
}

.btn-mini {
  min-height: 0;
  padding: 2px 4px;
  font-size: 0.8rem;
}

.btn-link.danger { color: #8c3a26; }

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.plain-list li:last-child { border-bottom: 0; }
.plain-list small { display: block; color: var(--ink-soft); font-size: 0.8rem; }
.plain-list strong { font-weight: 600; color: var(--brown); }

.row-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.mini-select {
  min-height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--white);
  font-size: 0.8rem;
}

.assign-form {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.assign-form .field input,
.assign-form .field select { min-height: 40px; padding: 0.4em 0.7em; }

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

.note-form { flex-direction: column; align-items: stretch; }

.note-form-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.note-form-row select { min-height: 40px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--white); font-size: 0.85rem; }

.note-tag {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  background: var(--paper-deep);
}

.note-tag.operational { background: #e8ead9; color: #4d5236; }

.activity-log {
  margin-top: 4px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.85rem;
}

.activity-log summary { cursor: pointer; font-weight: 600; color: var(--brown); }
.activity-log ul { margin: 10px 0 0; padding: 0; list-style: none; }
.activity-log li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.activity-log time { color: var(--ink-soft); font-size: 0.78rem; }
.activity-log.small { margin-top: 12px; padding: 10px 14px; }

.ops-services { margin: 0; padding: 0; list-style: none; }
.ops-services li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.ops-services small { display: block; color: var(--ink-soft); }

.thumb-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.thumb {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper-deep);
  cursor: zoom-in;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Dialog content ---------- */
.modal-wide { width: min(720px, calc(100vw - 32px)); }

#crmDialogBody { display: flex; flex-direction: column; gap: 14px; }

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.span-2 { grid-column: 1 / -1; }

@media (max-width: 560px) {
  .dialog-grid { grid-template-columns: minmax(0, 1fr); }
}

.dialog-text { margin: 0; color: var(--ink-soft); }

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--brown);
  cursor: pointer;
}

.check-line input { width: 17px; height: 17px; accent-color: var(--olive); flex: none; }

.checks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--paper);
}

@media (max-width: 560px) { .checks-grid { grid-template-columns: 1fr; } }

.review-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
}

@media (max-width: 600px) { .review-layout { grid-template-columns: 1fr; } }

.review-receipt { display: flex; flex-direction: column; gap: 4px; }

.receipt-btn {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-deep);
  cursor: zoom-in;
}

.receipt-btn img { width: 100%; max-height: 300px; object-fit: contain; background: #fff; }

.review-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.review-choice legend { padding: 0 6px; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.review-choice label { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; cursor: pointer; }
.review-choice input { accent-color: var(--olive); }

.image-viewer {
  max-width: min(900px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--white);
}

.image-viewer::backdrop { background: rgba(47, 38, 21, 0.7); }
.image-viewer img { max-width: 100%; max-height: calc(100dvh - 110px); margin: 0 auto; object-fit: contain; }
.image-viewer .icon-btn { display: block; margin: 0 0 8px auto; }

/* ---------- Manual booking ---------- */
.manual-form .detail-card { margin-bottom: 14px; }

.add-line {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.add-line .field { flex: 1; }
.add-line select { min-height: 42px; }

.mline {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.mline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.mline-head strong { color: var(--brown); }
.mline-head .btn-link { margin-left: auto; }

.mline-row {
  display: grid;
  grid-template-columns: 2fr 90px 130px 1fr;
  align-items: end;
  gap: 10px;
}

.mline-row .field select,
.mline-row .field input { min-height: 42px; padding: 0.4em 0.7em; }

.mline-price { display: flex; flex-direction: column; align-items: flex-end; padding-bottom: 8px; font-size: 0.85rem; }
.mline-price strong { color: var(--brown); }

@media (max-width: 700px) {
  .mline-row { grid-template-columns: 1fr 1fr; }
  .mline-row .field:first-child { grid-column: 1 / -1; }
}

.form-actions-page { justify-content: flex-end; margin: 6px 0 30px; }

/* ---------- Calendar ---------- */
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav .icon-btn { display: grid; place-items: center; }

.cal-title {
  margin: 0 0 0 8px;
  font-size: 1.25rem;
}

.segmented-crm {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
}

.segmented-crm button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.segmented-crm button[aria-pressed="true"] {
  background: var(--olive);
  color: var(--white);
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .check-line { margin-left: auto; font-size: 0.8rem; }

.cal-swatch { width: 12px; height: 12px; border-radius: 3px; }

/* Status colours: a light fill + a solid left edge, label always in text */
.cal-pending     { --cal-edge: #b8892f; --cal-fill: #f6ecd4; }
.cal-confirmed   { --cal-edge: #646348; --cal-fill: #e6e7d6; }
.cal-in-progress { --cal-edge: #4d6b4f; --cal-fill: #dde8dc; }
.cal-completed   { --cal-edge: #8a7d6a; --cal-fill: #ece6dc; }
.cal-cancelled   { --cal-edge: #a5532f; --cal-fill: #f4e0d8; }

.cal-swatch { background: var(--cal-fill); border: 2px solid var(--cal-edge); }

.cal-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.cal-dow {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cal-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 108px;
  padding: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.is-other { background: var(--paper); }
.cal-cell.is-other .cal-daynum { opacity: 0.5; }

.cal-daynum {
  align-self: flex-start;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brown);
  cursor: pointer;
}

.cal-daynum:hover { background: var(--paper-deep); }
.cal-cell.is-today .cal-daynum { background: var(--olive); color: var(--white); }

.cal-chip {
  display: block;
  padding: 3px 6px;
  border-left: 3px solid var(--cal-edge);
  border-radius: 3px;
  background: var(--cal-fill);
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-chip:hover { filter: brightness(0.97); text-decoration: underline; }
.cal-chip.cal-cancelled { text-decoration: line-through; }

.cal-more {
  align-self: flex-start;
  padding: 0 4px;
  border: 0;
  background: none;
  font-size: 0.72rem;
  color: var(--olive);
  cursor: pointer;
}

@media (max-width: 760px) {
  .cal-month { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-cell { min-height: 64px; padding: 3px; }
  .cal-chip { font-size: 0; padding: 0; height: 6px; border-left-width: 0; background: var(--cal-edge); }
  .cal-chip b { display: none; }
  .cal-dow { padding: 6px 2px; font-size: 0.62rem; }
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 1100px) { .cal-week { grid-template-columns: minmax(0, 1fr); } }

.cal-week-day {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.cal-week-day.is-today { border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }
.cal-week-day h3 { margin: 0 0 8px; font-family: var(--font-sans); font-size: 0.82rem; font-weight: 600; }

.cal-day-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--brown);
  cursor: pointer;
}

.cal-day-link:hover { text-decoration: underline; }

.cal-card {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-left: 4px solid var(--cal-edge);
  border-radius: 6px;
  background: var(--cal-fill);
  font-size: 0.85rem;
}

.cal-week .cal-card { flex-direction: column; gap: 4px; }

.cal-card-time { flex: none; min-width: 80px; font-weight: 600; color: var(--brown); }
.cal-card-time small { display: block; font-weight: 400; color: var(--ink-soft); }
.cal-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-card-main a { color: var(--brown); }
.cal-card-main small { color: var(--ink-soft); }
.cal-card-side { align-self: flex-start; }

.cal-day { max-width: 860px; }

/* ---------- Services Management ---------- */
.order-cell { white-space: nowrap; }

.icon-btn.small {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
}

.icon-btn[disabled] { opacity: 0.3; cursor: default; }

.svc-name { display: flex; align-items: center; gap: 10px; }

.svc-thumb {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--paper-deep);
}

.svc-thumb.is-icon { padding: 3px; background: #F1EFE6; object-fit: contain; }
.svc-thumb.is-empty { display: inline-block; }

.svc-image-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.svc-image-edit input[type="file"] { min-height: 0; padding: 6px; font-size: 0.82rem; }

.qr-thumb { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

.svc-table td, .cat-table td { vertical-align: middle; }

.pkg-row td { padding: 0 !important; background: var(--paper); }
.pkg-panel { padding: 14px 20px 18px; }

.pkg-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pkg-panel .detail-table { background: var(--white); }
.pkg-panel .detail-table td, .pkg-panel .detail-table th { padding-left: 10px; }

@media (max-width: 760px) {
  .requests-table .pkg-row { display: block; padding: 0; }
}

/* ---------- Accounts ---------- */
.role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

@media (max-width: 1000px) { .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .role-grid { grid-template-columns: 1fr; } }

.role-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  font-size: 0.82rem;
}

.role-card strong { color: var(--brown); }
.role-card p { margin: 4px 0 0; color: var(--ink-soft); }

.role-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--paper-deep);
}

.role-developer { background: #e4ddd2; color: #4c3713; }
.role-owner     { background: var(--olive); color: var(--white); }
.role-partner   { background: #dfe3cc; color: #3d4228; }
.role-logistics { background: #f3e6c8; color: #7a5a1e; }

/* ---------- Reports & settings ---------- */
.report-table td:first-child { text-align: left; }

.dev-tools { margin-top: 10px; border-style: dashed; }
.dev-tools p { margin-top: 0; }

#settingsForm .detail-card textarea { min-height: 80px; }

.detail-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

/* ---------- Recording in-person payments ---------- */
.pay-progress {
  height: 8px;
  margin-bottom: 6px;
  border-radius: 4px;
  background: var(--paper-deep);
  overflow: hidden;
}

.pay-progress span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--olive);
}

.pay-progress-label {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.pay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.paid-note {
  margin: 12px 0 0;
  font-weight: 600;
  color: var(--olive);
}

.rp-wrap { display: flex; flex-direction: column; gap: 14px; }

.rp-balance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rp-balance div {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--paper);
}

.rp-balance span { display: block; font-size: 0.75rem; color: var(--ink-soft); }
.rp-balance strong { color: var(--brown); }

.rp-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.rp-types legend {
  margin-bottom: 6px;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.rp-type { position: relative; cursor: pointer; }
.rp-type input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.rp-type span {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
}

.rp-type small { font-size: 0.78rem; color: var(--ink-soft); }
.rp-type input:checked + span { border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); background: #F1EFE6; }
.rp-type input:focus-visible + span { outline: 2px solid var(--olive); outline-offset: 2px; }
.rp-type input:disabled + span { opacity: 0.5; cursor: not-allowed; }

#rpAmount[readonly] { background: var(--paper); }

.rp-preview {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--olive);
  border-radius: 4px;
  background: #F1EFE6;
  font-size: 0.88rem;
}

@media (max-width: 560px) { .rp-balance { grid-template-columns: 1fr; } }

/* ---------- Team page & profile photos ---------- */
.user-avatar { overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sage);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--white);
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 60px; height: 60px; font-size: 1.15rem; }
.avatar-xl { width: 112px; height: 112px; font-size: 2rem; box-shadow: 0 0 0 4px var(--white), 0 0 0 5px var(--line); }

.my-profile {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
  margin-bottom: 26px;
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--olive);
  border-radius: var(--radius);
  background: var(--white);
}

.my-profile-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.my-profile-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.my-profile-actions label { cursor: pointer; }
.my-profile-actions label:focus-within { outline: 2px solid var(--olive); outline-offset: 2px; }

.my-profile-info { flex: 1 1 320px; min-width: 0; }
.my-profile-info .eyebrow { margin-bottom: 4px; }
.my-profile-info h2 { margin: 0 0 14px; font-size: 1.5rem; }
.my-profile-info .detail-list { max-width: 460px; margin-bottom: 12px; }

.team-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.team-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.team-card.is-me { border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }

.team-card-head { display: flex; align-items: center; gap: 14px; }
.team-card-name { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.team-card-name h3 { margin: 0; font-family: var(--font-sans); font-size: 1rem; font-weight: 600; }
.team-card-name small { font-size: 0.8rem; color: var(--ink-soft); }

.team-role-note { margin: 0; font-size: 0.84rem; color: var(--ink-soft); }

.team-card-section { padding-top: 12px; border-top: 1px solid var(--line); }

.team-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive);
}

.team-tasks { margin: 0; padding: 0; list-style: none; }
.team-tasks li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.team-tasks li:last-child { border-bottom: 0; }
.team-tasks a { color: var(--brown); text-decoration: none; }
.team-tasks a:hover { text-decoration: underline; }
.team-tasks small { display: block; color: var(--ink-soft); }
.team-empty, .team-more { margin: 0; font-size: 0.84rem; color: var(--ink-soft); }

.team-admin-note {
  margin-top: 20px;
  padding: 12px 16px;
  border-left: 3px solid var(--sage);
  border-radius: 4px;
  background: #F1EFE6;
  font-size: 0.86rem;
}

.team-admin-note p { margin: 4px 0; }

@media (max-width: 560px) {
  .my-profile { justify-content: center; text-align: left; }
}

/* ---------- Logistics & attendants on the booking page ---------- */
.assign-list { margin: 0 0 4px; padding: 0; list-style: none; }

.assign-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.assign-list li:last-child { border-bottom: 0; }
.assign-list .avatar { width: 36px; height: 36px; font-size: 0.8rem; }
.assign-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.assign-main strong { font-weight: 600; color: var(--brown); }
.assign-main small { color: var(--ink-soft); font-size: 0.8rem; }

.assign-form-wide { grid-template-columns: 1.2fr 1.4fr 0.8fr 0.8fr; }
.assign-form-wide .assign-notes { grid-column: 1 / -2; }
.assign-form-wide button { align-self: end; }

.detail-card-head h2 .count-dot { margin-left: 6px; vertical-align: 2px; }

@media (max-width: 760px) {
  .assign-form-wide { grid-template-columns: 1fr 1fr; }
  .assign-form-wide .field:nth-child(1),
  .assign-form-wide .field:nth-child(2),
  .assign-form-wide .assign-notes { grid-column: 1 / -1; }
  .assign-list li { flex-wrap: wrap; }
  .assign-list .row-buttons { width: 100%; justify-content: flex-start; padding-left: 48px; }
}
