/* Staff Portal styles — extends styles.v7.css */

/* Login */
.login-card {
  max-width: 400px;
  margin: 40px auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px;
  text-align: center;
}
.login-logo {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  background: white;
  padding: 6px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.10);
  margin-bottom: 16px;
}
.login-card h1 {
  margin: 0 0 6px 0;
  font-size: 26px;
}
.login-card .form {
  text-align: left;
  margin-top: 18px;
}
.login-error {
  background: rgba(211,47,47,0.08);
  color: #d32f2f;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 14px;
}

/* Portal header */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.portal-header h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}
.portal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* View toggle */
.view-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  background: rgba(0,0,0,0.04);
  border-radius: 14px;
  padding: 4px;
  width: fit-content;
  flex-wrap: wrap;
}
.view-toggle__btn {
  border: none;
  background: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 750;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}
.view-toggle__btn:hover {
  background: rgba(0,0,0,0.05);
}
.view-toggle__btn.active {
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

/* Portal Calendar */
.portal-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.portal-cal-daynames {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  color: rgba(0,0,0,0.55);
  margin-bottom: 6px;
}
.portal-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.pcal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 70px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  border: 2px solid transparent;
  background: none;
  transition: background 0.12s, border-color 0.12s;
  padding: 6px 2px;
  position: relative;
}
.pcal-day:hover:not(.pcal-day--empty):not(.pcal-day--other) {
  background: rgba(140,207,138,0.15);
  border-color: rgba(140,207,138,0.4);
}
.pcal-day--today {
  border-color: var(--orange) !important;
}
.pcal-day--selected {
  background: rgba(140,207,138,0.20) !important;
  border-color: var(--green) !important;
}
.pcal-day--other {
  color: rgba(0,0,0,0.2);
  cursor: default;
}
.pcal-day--empty {
  cursor: default;
}
.pcal-day__num {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 2px;
}
.pcal-day__dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
}
.pcal-day__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
}
.pcal-day__dot--pending {
  background: var(--orange);
}
.pcal-day__dot--cancelled {
  background: rgba(0,0,0,0.15);
}
.pcal-day__count {
  font-size: 10px;
  font-weight: 800;
  color: rgba(0,0,0,0.5);
}
.pcal-day__count--full {
  color: #d32f2f;
}

/* Day detail */
.day-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.booking-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(140,207,138,0.06);
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 8px;
  transition: background 0.12s;
  cursor: pointer;
}
.booking-item:hover {
  background: rgba(140,207,138,0.14);
}
.booking-item--pending {
  background: rgba(245,124,0,0.06);
  border-color: rgba(245,124,0,0.12);
}
.booking-item--pending:hover {
  background: rgba(245,124,0,0.12);
}
.booking-item--cancelled {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.06);
  opacity: 0.6;
}
.booking-item__info h3 {
  margin: 0 0 2px 0;
  font-size: 15px;
}
.booking-item__info p {
  margin: 0;
  font-size: 13px;
  color: rgba(0,0,0,0.6);
}
.booking-phone {
  font-weight: 650;
  color: rgba(0,0,0,0.7);
}

.booking-item__badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
}
.badge--confirmed {
  background: rgba(140,207,138,0.25);
  color: #2e7d32;
}
.badge--pending {
  background: rgba(245,124,0,0.18);
  color: #e65100;
}
.badge--cancelled {
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.5);
}
.badge--created {
  background: rgba(33,150,243,0.18);
  color: #1565c0;
}

/* List view */
.list-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.list-controls select {
  width: auto;
  margin-top: 0;
  min-width: 160px;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
}
.list-table th,
.list-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 14px;
}
.list-table th {
  font-weight: 800;
  background: rgba(0,0,0,0.03);
  position: sticky;
  top: 0;
}
.list-table tr {
  cursor: pointer;
  transition: background 0.12s;
}
.list-table tbody tr:hover {
  background: rgba(140,207,138,0.08);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-header h2 {
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 10px;
  color: rgba(0,0,0,0.45);
  transition: background 0.12s;
}
.modal-close:hover {
  background: rgba(0,0,0,0.08);
}
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.req {
  color: #d32f2f;
}

/* Loading */
.loading-spinner {
  text-align: center;
  padding: 30px;
  color: rgba(0,0,0,0.45);
  font-weight: 650;
}

/* Staff Notes */
.staff-notes-label {
  display: inline-block;
  background: rgba(103,58,183,0.12);
  color: #5e35b1;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: middle;
}
.staff-notes-inline {
  margin-top: 4px;
  padding: 6px 10px;
  background: rgba(103,58,183,0.06);
  border-radius: 8px;
  font-size: 12px;
  color: rgba(0,0,0,0.7);
  border-left: 3px solid #7c4dff;
}
.staff-notes-tag {
  display: inline-block;
  background: rgba(103,58,183,0.12);
  color: #5e35b1;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  margin-right: 4px;
}
.staff-note-cell {
  font-size: 12px;
  color: #5e35b1;
  font-weight: 650;
}

/* Modal Calendar (multi-date picker) */
.modal-cal {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 12px;
  margin-top: 6px;
  background: rgba(0,0,0,0.015);
}
.modal-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 14px;
}
.modal-cal-header .cal-nav {
  background: none;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: background 0.12s;
}
.modal-cal-header .cal-nav:hover {
  background: rgba(0,0,0,0.05);
}
.modal-cal-daynames {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 800;
  font-size: 11px;
  color: rgba(0,0,0,0.45);
  margin-bottom: 4px;
}
.modal-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.mcal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  border: 2px solid transparent;
  background: none;
  transition: background 0.12s, border-color 0.12s;
  padding: 3px 1px;
}
.mcal-day:hover:not(.mcal-day--empty) {
  background: rgba(140,207,138,0.15);
  border-color: rgba(140,207,138,0.4);
}
.mcal-day--empty {
  cursor: default;
}
.mcal-day--today {
  border-color: var(--orange) !important;
}
.mcal-day--selected {
  background: rgba(140,207,138,0.25) !important;
  border-color: var(--green) !important;
}
.mcal-day--full {
  background: rgba(211,47,47,0.06);
  color: rgba(0,0,0,0.35);
}
.mcal-day--full:hover {
  background: rgba(211,47,47,0.10);
  border-color: rgba(211,47,47,0.3);
}
.mcal-day__count {
  font-size: 8px;
  font-weight: 800;
  color: rgba(0,0,0,0.4);
  line-height: 1;
}
.mcal-day__count--full {
  color: #d32f2f;
}

/* Selected date chips */
.selected-modal-dates {
  margin-top: 8px;
}
.selected-dates-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(140,207,138,0.18);
  color: #2e7d32;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.date-chip__remove {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: #2e7d32;
  padding: 0 2px;
  line-height: 1;
  font-weight: 800;
  opacity: 0.7;
  transition: opacity 0.12s;
}
.date-chip__remove:hover {
  opacity: 1;
}

/* Autocomplete */
.ac-wrap {
  position: relative;
}
.ac-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 2px;
}
.ac-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ac-option:first-child {
  border-radius: 10px 10px 0 0;
}
.ac-option:last-child {
  border-radius: 0 0 10px 10px;
}
.ac-option:only-child {
  border-radius: 10px;
}
.ac-option:hover {
  background: rgba(140,207,138,0.12);
}
.ac-option strong {
  font-weight: 750;
}
.ac-owner {
  color: rgba(0,0,0,0.5);
  font-size: 13px;
}

/* Responsive — tablets and small screens */
@media (max-width: 760px) {
  .portal-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .portal-actions {
    width: 100%;
  }
  .portal-actions .button {
    flex: 1;
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .view-toggle {
    width: 100%;
  }
  .view-toggle__btn {
    flex: 1;
    text-align: center;
    min-height: 44px;
  }
  .pcal-day {
    min-height: 50px;
    font-size: 12px;
  }
  .pcal-day__dot {
    width: 5px;
    height: 5px;
  }
  .pcal-day__count {
    font-size: 8px;
  }
  .booking-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .day-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .day-detail-header .button {
    width: 100%;
    text-align: center;
    min-height: 44px;
  }

  /* List view: hide table, show cards */
  .list-table thead { display: none; }
  .list-table,
  .list-table tbody,
  .list-table tr,
  .list-table td {
    display: block;
    width: 100%;
  }
  .list-table tr {
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
  }
  .list-table td {
    padding: 3px 0;
    border-bottom: none;
    font-size: 14px;
  }
  .list-table td::before {
    content: attr(data-label);
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(0,0,0,0.45);
    display: block;
    margin-bottom: 1px;
  }

  /* Modal — full screen on phones */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-content {
    max-width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    padding: 18px;
    box-shadow: none;
  }
  .modal-actions {
    flex-direction: column;
  }
  .modal-actions .button {
    width: 100%;
    text-align: center;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mcal-day {
    min-height: 38px;
    font-size: 12px;
  }
  .mcal-day__count {
    font-size: 7px;
  }
}

/* Responsive — small phones (iPhone SE, etc.) */
@media (max-width: 420px) {
  .portal-cal-daynames {
    font-size: 11px;
  }
  .pcal-day {
    min-height: 42px;
    padding: 4px 1px;
    font-size: 11px;
    border-width: 1.5px;
  }
  .pcal-day__num {
    font-size: 12px;
  }
  .pcal-day__dots {
    gap: 2px;
  }
  .pcal-day__dot {
    width: 4px;
    height: 4px;
  }
  .portal-cal-grid {
    gap: 2px;
  }
  .card {
    padding: 14px;
  }
  .login-card {
    padding: 24px 16px;
    margin: 20px auto;
  }
  .modal-content {
    padding: 14px;
  }
  .mcal-day {
    min-height: 34px;
    font-size: 11px;
  }
}

/* Invoice Form */
.inv-card {
  overflow: visible;
}
/* Invoice amount display (auto-calculated) */
.inv-amount-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(140,207,138,0.12);
  border-radius: 10px;
  border: 1px solid rgba(140,207,138,0.3);
  font-size: 14px;
  color: rgba(0,0,0,0.7);
}
.inv-amount-display strong {
  font-size: 18px;
  font-weight: 800;
  color: #2e7d32;
}
.inv-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.inv-form-actions .button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.inv-form-actions .button.primary {
  flex: 1;
}
.invoice-preview {
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  padding: 20px;
  background: rgba(245,124,0,0.03);
  margin-top: 8px;
}
.invoice-preview h3 {
  margin: 0 0 14px 0;
  font-size: 18px;
  text-align: center;
  color: var(--orange);
}
.inv-section {
  margin-bottom: 14px;
}
.inv-section-title {
  font-weight: 700;
  color: #6b7280;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.inv-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
  gap: 8px;
}
.inv-row strong {
  font-weight: 700;
}
.inv-amount {
  text-align: center;
  padding: 14px;
  background: var(--orange);
  border-radius: 12px;
  color: white;
  margin: 12px 0;
}
.inv-amount .label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}
.inv-amount .value {
  font-size: 28px;
  font-weight: 800;
}
.inv-payment-box {
  padding: 12px 16px;
  background: rgba(0,0,0,0.03);
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.06);
}
.inv-ref {
  text-align: center;
  padding: 10px;
  background: rgba(245,124,0,0.06);
  border-radius: 10px;
  border: 1px solid rgba(245,124,0,0.15);
  font-size: 13px;
  margin-top: 10px;
}
.inv-signoff {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(0,0,0,0.7);
}

/* Invoice status messages */
.invoice-success {
  background: rgba(140,207,138,0.15);
  color: #2e7d32;
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 14px;
  margin-top: 10px;
}
.inv-open-email-link {
  display: inline-block;
  margin-top: 8px;
  background: none;
  border: 1px solid #2e7d32;
  color: #2e7d32;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}
.inv-open-email-link:hover {
  background: rgba(140,207,138,0.15);
}
.invoice-error {
  background: rgba(211,47,47,0.08);
  color: #d32f2f;
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 14px;
  margin-top: 10px;
}
.invoice-warning {
  background: rgba(245,124,0,0.10);
  color: #e65100;
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 14px;
  margin-top: 10px;
}

/* Invoice History */
.invoice-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.invoice-history-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(245,124,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.invoice-history-item:hover {
  background: rgba(245,124,0,0.08);
}
.invoice-history-item__main {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.invoice-history-item__info h3 {
  margin: 0 0 2px 0;
  font-size: 15px;
}
.invoice-history-item__info h3 .subtle {
  font-weight: 500;
  color: rgba(0,0,0,0.5);
}
.invoice-history-item__info p {
  margin: 0;
  font-size: 13px;
  color: rgba(0,0,0,0.6);
}
.invoice-history-item__right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.invoice-history-item__amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--orange);
}
.invoice-history-item__date {
  font-size: 11px;
  color: rgba(0,0,0,0.4);
  font-weight: 650;
}
.invoice-history-item__detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.inv-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  font-size: 13px;
}
.inv-detail-grid strong {
  font-weight: 700;
  color: rgba(0,0,0,0.6);
}

@media (max-width: 760px) {
  .invoice-history-item__main {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .invoice-history-item__right {
    text-align: left;
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .inv-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Confirmation Modal */
.inv-confirm-modal {
  max-width: 460px;
}
.inv-confirm-summary {
  margin-bottom: 18px;
}
.inv-confirm-detail {
  background: rgba(0,0,0,0.025);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(0,0,0,0.06);
}
.inv-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.inv-confirm-row:last-child {
  border-bottom: none;
}
.inv-confirm-label {
  font-weight: 700;
  color: rgba(0,0,0,0.55);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.inv-confirm-amount {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 2px solid var(--orange);
  font-size: 18px;
  font-weight: 800;
  color: var(--orange);
}
.inv-confirm-amount .inv-confirm-label {
  font-size: 13px;
  color: var(--orange);
}
.inv-confirm-note {
  font-size: 13px;
  color: rgba(0,0,0,0.6);
  margin-top: 14px;
  line-height: 1.5;
}
.inv-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inv-confirm-actions .button {
  width: 100%;
  text-align: center;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Invoice History — Resend */
.inv-history-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.06);
  flex-wrap: wrap;
}
.inv-resend-btn {
  background: var(--orange);
  color: white;
  border: none;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 750;
}
.inv-resend-btn:hover {
  opacity: 0.9;
}
.inv-resend-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.inv-resend-status {
  font-size: 13px;
  font-weight: 650;
}
.inv-resend-ok {
  color: #2e7d32;
}
.inv-resend-error {
  color: #d32f2f;
}

/* ── Mobile-friendly invoice layout ─────────────────── */
@media (max-width: 760px) {
  /* Invoice form: full-width buttons, better spacing */
  .inv-form-actions {
    flex-direction: column;
  }
  .inv-form-actions .button {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
  }

  /* Invoice preview: tighter on mobile */
  .invoice-preview {
    padding: 14px;
  }
  .invoice-preview h3 {
    font-size: 16px;
  }
  .inv-row {
    flex-direction: column;
    gap: 2px;
  }
  .inv-amount .value {
    font-size: 24px;
  }
  .inv-payment-box {
    padding: 10px 12px;
  }

  /* Invoice history items — stacked for touch */
  .invoice-history-item {
    padding: 16px;
  }
  .invoice-history-item__info h3 {
    font-size: 14px;
    line-height: 1.3;
  }
  .inv-history-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .inv-resend-btn {
    min-height: 48px;
    font-size: 15px;
    width: 100%;
    text-align: center;
  }
  .inv-resend-status {
    text-align: center;
  }

  /* Confirmation modal — full screen on phones */
  #invoiceConfirmModal .modal-content {
    max-width: 100%;
    max-height: 100vh;
    min-height: auto;
    border-radius: 18px 18px 0 0;
  }
  .inv-confirm-row {
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
  }
  .inv-confirm-amount {
    flex-direction: row;
  }
}

/* ── Small phones (iPhone SE, etc.) ───────────────── */
@media (max-width: 420px) {
  .inv-card {
    padding: 14px;
  }
  .invoice-preview {
    padding: 10px;
    border-radius: 10px;
  }
  .inv-amount {
    padding: 10px;
    border-radius: 10px;
  }
  .inv-amount .value {
    font-size: 22px;
  }
  .inv-confirm-detail {
    padding: 12px;
  }
  .invoice-history-item {
    padding: 12px;
    border-radius: 12px;
  }
  .inv-detail-grid {
    gap: 4px 10px;
    font-size: 12px;
  }
}

/* ── Staff Google Calendar View ───────────────────── */
.staff-cal-header {
  margin-bottom: 14px;
}
.staff-cal-header h2 {
  margin-bottom: 4px;
}
.staff-cal-embed {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  margin-bottom: 14px;
}
.staff-cal-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.staff-cal-controls .button {
  min-height: 40px;
}
.active-cal-btn {
  background: var(--green) !important;
  color: white !important;
  border-color: var(--green) !important;
}

@media (max-width: 760px) {
  .staff-cal-embed iframe {
    height: 450px !important;
  }
  .staff-cal-controls {
    justify-content: stretch;
  }
  .staff-cal-controls .button {
    flex: 1;
    text-align: center;
    min-height: 44px;
  }
}

/* ── Assessment Booking View ──────────────────────── */
.assess-card {
  overflow: visible;
}
.assess-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.assess-form-actions .button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}
.assess-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.assess-history-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(140,207,138,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.assess-history-item:hover {
  background: rgba(140,207,138,0.08);
}
.assess-history-item__main {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.assess-history-item__info h3 {
  margin: 0 0 2px 0;
  font-size: 15px;
}
.assess-history-item__info h3 .subtle {
  font-weight: 500;
  color: rgba(0,0,0,0.5);
}
.assess-history-item__info p {
  margin: 0;
  font-size: 13px;
  color: rgba(0,0,0,0.6);
}
.assess-history-item__right {
  text-align: right;
}
.assess-history-item__detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

@media (max-width: 760px) {
  .assess-history-item__main {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .assess-history-item__right {
    text-align: left;
  }
  .assess-form-actions {
    flex-direction: column;
  }
  .assess-form-actions .button {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .assess-card {
    padding: 14px;
  }
  .assess-history-item {
    padding: 12px;
    border-radius: 12px;
  }
}

/* ── Pet Services View ─────────────────────────────── */
.pet-card {
  overflow: visible;
}
.pet-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.pet-form-actions .button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}
.pet-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.pet-history-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(249,177,90,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.pet-history-item:hover {
  background: rgba(249,177,90,0.08);
}
.pet-history-item__main {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.pet-history-item__info h3 {
  margin: 0 0 2px 0;
  font-size: 15px;
}
.pet-history-item__info h3 .subtle {
  font-weight: 500;
  color: rgba(0,0,0,0.5);
}
.pet-history-item__info p {
  margin: 0;
  font-size: 13px;
  color: rgba(0,0,0,0.6);
}
.pet-history-item__right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.pet-history-item__date {
  font-size: 11px;
  color: rgba(0,0,0,0.4);
  font-weight: 650;
}
.pet-history-item__detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.pet-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  font-size: 13px;
}
.pet-detail-grid strong {
  font-weight: 700;
  color: rgba(0,0,0,0.6);
}
.pet-detail-note {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(249,177,90,0.06);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(0,0,0,0.7);
}
.pet-history-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.06);
  flex-wrap: wrap;
}

/* Pet service badges */
.badge--ps-walk {
  background: rgba(140,207,138,0.18);
  color: #2e7d32;
}
.badge--ps-adventure {
  background: rgba(249,177,90,0.2);
  color: #e65100;
}
.badge--ps-popin {
  background: rgba(143,208,255,0.25);
  color: #1565c0;
}
.badge--ps-taxi {
  background: rgba(156,39,176,0.12);
  color: #7b1fa2;
}
.badge--ps-pickup {
  background: rgba(121,85,72,0.12);
  color: #5d4037;
}

/* Pet service status messages */
.pet-service-success {
  background: rgba(140,207,138,0.15);
  color: #2e7d32;
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 14px;
  margin-top: 10px;
}
.pet-service-error {
  background: rgba(211,47,47,0.08);
  color: #d32f2f;
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 14px;
  margin-top: 10px;
}

/* ── Pet Services responsive (tablets and phones) ──── */
@media (max-width: 760px) {
  .pet-history-item__main {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .pet-history-item__right {
    text-align: left;
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .pet-detail-grid {
    grid-template-columns: 1fr;
  }
  .pet-form-actions {
    flex-direction: column;
  }
  .pet-form-actions .button {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
  }
  .pet-history-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .pet-history-actions .button {
    width: 100%;
    text-align: center;
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .pet-card {
    padding: 14px;
  }
  .pet-history-item {
    padding: 12px;
    border-radius: 12px;
  }
  .pet-detail-grid {
    gap: 4px 10px;
    font-size: 12px;
  }
}
