/* Location-specific modal styles (base modal styles in application.css) */

/* Contact modal scrollbox */
.contact-search-results {
  min-height: 550px;
  max-height: 600px;
  overflow-y: auto;
}

/* Keep contact modal stable as search results shrink — prevents height flickering */
.contact-modal .modal-body {
  min-height: 680px;
}

/* Contact list row styling for modal */
.contact-list-row {
  cursor: pointer;
  font-size: 0.9rem;
}

/* Location name field width */
.location-name-field {
  max-width: 400px;
}

/* Locations table styles */
.locations-checkbox-col {
  width: 40px;
}

.locations-actions-col {
  width: 200px;
}
.cs-sitting-cell {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.cs-family-header {
  width: 260px;
}

.cs-family-cell {
  width: 130px;
  min-width: 130px;
  max-width: 130px;
}

.cs-flag-i-header,
.cs-flag-c-header,
.cs-flag-s-header {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  text-align: center;
}

.cs-flag-i-cell,
.cs-flag-c-cell,
.cs-flag-s-cell {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  text-align: center;
}

.cs-flag-circle {
  width: 30px !important;
  height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.85rem !important;
  line-height: 1 !important;
  border-radius: 50% !important;
  color: white !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  margin: 0 8px !important;
  vertical-align: middle !important;
  overflow: hidden !important;
}

.cs-flag-placeholder {
  display: inline-block;
  width: 0.6rem;
}

/* Force pms-badge when used as a flag to be a true circle */
.pms-badge.cs-flag-circle {
    padding: 2px 0 !important;
    min-width: 21.9846px !important;
    width: 21.9846px !important;
    height: 21.9846px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    line-height: 18px !important;
    margin: 0 1px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    transform: translateY(-0.5px) !important;
    text-align: center !important;
    -webkit-font-smoothing: antialiased !important;
    text-rendering: optimizeLegibility !important;
    letter-spacing: 0.09em !important;
} 



/* ensure status badges align with flag circles */
.cs-status-cell .pms-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

/* Wrapper cell that holds a horizontal layout of narrow flag slots */
.cs-flags-wrapper {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  text-align: center;
}

.cs-flags-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.cs-flag-slot {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.cs-flags-wrapper-header {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}

 

.cs-location-header {
  width: 130px;
  min-width: 130px;
  max-width: 130px;
}

.cs-location-cell {
  width: 130px;
}

.locations-table-header {
  cursor: pointer;
}

.locations-manager-label {
  min-width: 280px;
  white-space: nowrap;
}

.locations-update-btn {
  min-width: 160px;
}

.back-link-btn {
  display: inline-block !important;
  padding: 0.375rem 0.75rem;
  text-decoration: none;
  border-radius: 0.25rem;
  width: auto;
}

/* Clear button alignment fix - override Bootstrap's vertical-align: middle */
button.btn.btn-secondary.ms-2 {
  vertical-align: baseline !important;
  background-color: #6c757d !important;
  border-color: #6c757d !important;
}

/* Location form action buttons (location-update-btn in application.css) */
.location-cancel-btn {
  background-color: #8c5a5a;
  border-color: #8c5a5a;
  color: white;
  padding: 0.5rem 1rem;
  text-align: center;
}

.location-cancel-btn:hover {
  background-color: #9c6a6a;
  border-color: #9c6a6a;
  color: white;
  text-decoration: none;
}

/* Choose-slot page grid helpers (base rules in application.css) */

/* Staff Availability Calendar */
.availability-calendar {
  margin-bottom: 0;
  table-layout: fixed;
  width: 100%;
}

.availability-calendar td,
.availability-calendar th {
  width: 14.28%; /* 100% / 7 days */
  height: 80px;
  vertical-align: top;
  position: relative;
  text-align: center;
}

.availability-calendar .day-number {
  font-weight: bold;
  margin-bottom: 5px;
}

.availability-calendar .other-month {
  background-color: #f8f9fa;
  color: #6c757d;
}

.availability-calendar .today {
  background-color: #e7f1ff;
  border: 2px solid #5a7a9c !important;
}

.availability-calendar .today .date-number {
  color: #E08000;
  font-weight: bold;
}

.availability-calendar .clickable {
  cursor: pointer;
}

.availability-calendar .clickable:hover {
  background-color: #f8f9fa;
}

.availability-calendar .past-date {
  background-color: #f8f9fa;
  color: #999;
}

.availability-calendar .badge {
  font-size: 0.7rem;
  padding: 2px 6px;
}

.legend-box {
  display: inline-block;
  width: 20px;
  height: 20px;
}

.legend-box-available {
  border: 2px solid #dee2e6;
}

.legend-box-today {
  border: 2px solid #5a7a9c;
  background: #e7f1ff;
}

.legend-box-locked {
  border: 2px solid #f0ad4e;
  background: #fcf8e3;
}

.availability-calendar .within-notice {
  background-color: #fcf8e3;
  cursor: not-allowed;
}
/* Location form specific grid helpers */
.date-container { grid-column: span 2; }
.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.break-row { grid-column: 1 / span 2; padding: 0.25rem 0; text-align: center; font-weight: 600; background: #f8f9fa; }

/* Delete modal button styles */
.modal-cancel-btn {
  background-color: #8c6c6c;
  border-color: #8c6c6c;
  color: white;
  padding: 0.5rem 1rem;
}

.modal-cancel-btn:hover {
  background-color: #9c7c7c;
  border-color: #9c7c7c;
  color: white;
}

.modal-purge-btn {
  background-color: #7c6c8c;
  border: 1px solid #7c6c8c;
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  text-align: center;
  display: block;
  border-radius: 4px;
}

/* Customer Service Menu Cards */
.cs-menu-card {
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 250px;
}

.cs-menu-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.cs-menu-card .card-body {
  padding: 2rem;
}

.cs-menu-card .card-title {
  color: #495057;
  margin-bottom: 1rem;
}

/* Customer Service Card Equal Height */
.cs-card-equal-height {
  height: calc(100vh - 250px);
  display: flex;
  flex-direction: column;
}

.cs-card-equal-height .card-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cs-scrollbox {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 0.5rem;
}

.cs-sitting-item {
  margin-bottom: 0.5rem;
}

.cs-status-header {
  background-color: #f8f9fa;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
  width: 150px;
  min-width: 150px;
  text-align: left;
}

.cs-status-cell {
  width: 150px;
  min-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-session-item {
  border-left: 3px solid #dee2e6;
  padding: 0.5rem;
  margin-left: 1rem;
}

.cs-notes-display {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
  max-height: 300px;
  overflow-y: auto;
}

/* Staff Room - Calendar card matching height */
.staff-calendar-card {
  height: 100%;
}

.staff-calendar-body {
  overflow-y: auto;
  padding: 0.75rem;
}

/* Staff Room - Table row heights for alignment */
.staff-room-table-row-field {
  height: 80px;
}

.staff-room-table-row-button {
  height: 50px;
}

.staff-room-centered-button {
  width: 50%;
}

.staff-calendar-table {
  font-size: 0.875rem;
}

.staff-calendar-legend {
  font-size: 0.875rem;
}

.booking-badge {
  cursor: pointer;
}

/* Status modal styles */
.status-close-btn {
  font-size: 0.75rem;
  padding: 0.1rem 0.25rem;
  line-height: 1;
  color: #fff;
  opacity: 0.8;
  cursor: pointer;
}
.status-close-btn::before {
  content: "\00D7";
  font-size: 1rem;
  line-height: 1;
}
.status-close-btn:hover {
  opacity: 1;
}

/* Customer Service Orders Grouped View */
.cs-status-section {
  margin-bottom: 2rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
}
.cs-status-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}

.toggle-icon {
  transition: transform 0.2s ease;
  font-size: 1.25rem;
}

/* Additional helper: rotate using explicit class for reliability */
.production-open .accordion-header .toggle-icon.rotate-90 {
  transform: rotate(90deg);
}

/* Use our own left-side chevron for consistent visual behavior; hide
   Bootstrap's default accordion indicator for this accordion specifically */
#productionSittingsAccordion .accordion-button.no-default-chevron::after {
  display: none !important;
}
#productionSittingsAccordion .accordion-button.no-default-chevron {
  /* Slightly reduce right padding since the default indicator is hidden */
  padding-right: 1rem;
}

/* Collapse animation using max-height. This avoids Bootstrap JS and keeps CSP clean. */
#productionSittingsAccordion .collapse-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
#productionSittingsAccordion .collapse-content.show {
  max-height: 2000px; /* large enough for content; allows smooth expand */
}

/* Production open page: avoid default accordion blue background so sitting headers match project styling */
.production-open .accordion-button {
  background-color: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
}

.production-open .accordion-header .pms-badge {
  vertical-align: middle;
}

/* Tighten sitting header spacing and align the View badge */
.production-open .accordion-item {
  padding: 0.5rem 2rem 0.5rem 0rem;
  margin-bottom: 0.5rem;
  border: var(--bs-accordion-border-width) solid var(--bs-accordion-border-color);
}

/* Fixed width for crossover badge so text replacement doesn't change layout */
.production-open .accordion-header .crossover-badge {
  min-width: 86px;
  display: inline-block;
  text-align: center;
}

.production-open .accordion-header {
  padding: 0 !important; /* remove vertical padding so header sits tight at top */
  align-items: center;
  margin: 0 !important;
}

.production-open .accordion-header .accordion-button {
  padding: 0.12rem 0.5rem; /* tighter vertical padding to reduce header height */
  display: inline-flex; /* allow badge to sit to the right in the flex header */
  align-items: baseline; /* align first line baseline of per-session column with sitting number */
  width: auto; /* don't force full width */
  border: none;
  background: transparent;
  line-height: 1; /* tighten line height */
}

.production-open .accordion-header > .ms-2 {
  margin-left: auto; /* push the badge to the far right */
  align-self: center;
}

/* Small visual tweak: slightly smaller chevron spacing */
.production-open .accordion-header .toggle-icon {
  margin-right: .5rem;
}

/* Compact per-session lines inside header */
.production-open .accordion-header .flex-column span {
  line-height: 1;
  margin-bottom: 0.15rem;
}
.production-open .accordion-header .flex-column span:last-child {
  margin-bottom: 0;
}

/* Ensure the accordion body maintains padding regardless of collapsed state */
#productionSittingsAccordion .collapse-content .accordion-body {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

/* Make session card body padding symmetric and modest */
.production-open .card-body {
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
}

/* Read-only mode: hide actionable buttons and prevent interaction on directory inputs */
[data-read-only="true"] .read-protect { display: none !important; }
[data-read-only="true"] .directory-input { pointer-events: none; opacity: 0.9; background-color: #f8f9fa; }

.cs-count-badge {
  display: inline-block;
  background-color: var(--pms-color-blue);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
}

.cs-status-content {
  display: none;
  padding: 1.5rem;
}

.cs-status-content.show {
  display: block;
}

.cs-date-section {
  margin-bottom: 2rem;
}

.cs-date-header {
  font-size: 1.25rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #dee2e6;
}

.cs-select-header {
  /* Explicit select-header width to align the column on the right */
  width: 150px;
  text-align: center;
}
.cs-town-header {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

/* Shipping & Receiving hero cards */
.sr-hero { min-height: 180px; border-radius: 6px; }
.sr-hero .card-body i { font-size: 36px }
.sr-hero-card { width: 48%; }
@media (max-width: 767px) {
  .sr-hero-card { width: 100%; }
}
}

/* Order show: prevent phone/fax/email wrapping in header and reduce font-size when needed */
.order-contact-line {
  gap: 1rem;
}
.order-contact-line span {
  white-space: nowrap;
  display: inline-block;
  font-size: 0.9rem;
}

@media (max-width: 767px) {
  .order-contact-line {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center !important;
  }
  .order-contact-line span {
    white-space: normal;
    font-size: 0.85rem;
  }
}

/* Ensure the location name sits on its own line without shifting other header elements */
.location-name-line { margin-top: 0.75rem; display: block; }

.cs-orders-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  table-layout: fixed; /* enforce consistent column alignment */
} 

.cs-orders-table thead {
  background-color: #f8f9fa;
}

.cs-orders-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
}

.cs-orders-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #dee2e6;
  vertical-align: middle; /* center content vertically for better alignment */
}

.cs-orders-table tbody tr:hover {
  background-color: #f8f9fa;
}

.cs-no-sale-row {
  background-color: #fff3cd;
}

.cs-no-sale-row:hover {
  background-color: #ffe69c;
}

.cs-actions-cell {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
}

.cs-actions-cell form {
  margin: 0;
  display: inline-flex;
}

.cs-action-badge {
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0.25rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  vertical-align: bottom;
  font-weight: 700;
  min-width: 70px;
  justify-content: center;
  white-space: nowrap;
}

/* Menu card summary badges (transparent with subtle border for contrast) */
.cs-badge {
  background-color: transparent !important;
  border: 1px solid rgba(0,0,0,0.08);
  color: inherit !important;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.85rem;
}
.cs-menu-count {
  background-color: transparent !important;
  border: 1px solid rgba(0,0,0,0.12);
  color: inherit !important;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
}

/* CS Order Activity Timeline (orders/show.html.erb) */
.cs-order-timeline {
  max-width: 680px;
}

.cs-timeline-table td {
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
  border-top: 1px solid #f0f0f0;
  vertical-align: middle;
}

.cs-timeline-table tr:first-child td {
  border-top: none;
}

.cs-timeline-label {
  width: 200px;
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
}

.cs-timeline-value {
  width: 200px;
  color: #212529;
  white-space: nowrap;
}

.cs-timeline-by {
  color: #6c757d;
  font-style: italic;
  font-size: 0.8rem;
}

.cs-timeline-pending .cs-timeline-label,
.cs-timeline-pending .cs-timeline-value,
.cs-timeline-pending .cs-timeline-by {
  color: #adb5bd;
}

.phone-type-select {
  width: auto;
  flex: 0 0 auto;
  min-width: 90px;
}
