/* Groups & Occupancy Mix Dashboard */

.container-wide {
  max-width: 1400px;
}

/* === Groups List + Detail Refresh === */
body.groups-page {
  background:
    radial-gradient(1100px 420px at 50% -180px, rgba(43, 108, 176, 0.18), rgba(43, 108, 176, 0)),
    linear-gradient(180deg, #eef4fb 0%, #edf2f7 38%, #edf2f7 100%);
}

body.groups-page .hero-banner {
  height: 164px;
  background-image:
    linear-gradient(125deg, rgba(3, 35, 69, 0.9), rgba(4, 78, 133, 0.75)),
    linear-gradient(180deg, rgba(2, 44, 79, 0.85), rgba(2, 44, 79, 0.5)),
    var(--hero-image, none);
  background-position: center 38%;
}

body.groups-page .hero-overlay-text .welcome-text {
  width: 100%;
  padding: 0 36px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

body.groups-page .app-shell {
  padding-top: 12px;
}

body.groups-page .sidebar {
  margin-top: -44px;
  border: 1px solid #d5e0ec;
  box-shadow: 0 10px 22px rgba(5, 31, 61, 0.12);
}

body.groups-page .main-content .container {
  max-width: 1320px;
  padding: 0 24px 44px;
}

body.groups-page .groups-page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}

body.groups-page .page-title {
  text-align: left;
  padding: 12px 0 6px;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #143255;
}

body.groups-page .page-subtitle {
  font-size: 15px;
  color: #516885;
}

body.groups-page .page-result-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid #c9d8ea;
  border-radius: 999px;
  background: #f8fbff;
  color: #1f446d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.groups-surface {
  background: #ffffff;
  border: 1px solid #dbe5f2;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(14, 39, 70, 0.05);
}

.filters-surface {
  padding: 14px;
  margin-bottom: 14px;
}

.filters-bar {
  display: grid;
  grid-template-columns: minmax(220px, 2.2fr) repeat(3, minmax(130px, 1fr)) auto;
  gap: 10px 12px;
  align-items: end;
}

.filter-group {
  min-width: 0;
}

.filter-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.filter-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.table-surface {
  padding: 12px 12px 8px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #dbe6f2;
  border-radius: 12px;
  background: #ffffff;
}

.funnel-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.funnel-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #dbe6f2;
  background: #eef4fb;
  color: #3a5576;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 700;
}

.funnel-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f8;
  color: #2a3f5c;
  vertical-align: middle;
}

.funnel-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.funnel-table tbody tr:hover {
  background: #f2f8ff;
}

.funnel-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-loading {
  text-align: center;
  padding: 36px 16px;
  color: #6f8298;
}

.badge-type,
.badge-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.badge-type-group {
  background: #e7f1ff;
  color: #2a5f9e;
}

.badge-type-company {
  background: #f3edff;
  color: #5e3f99;
}

.badge-status-open,
.badge-confirmed {
  background: #d9f3e2;
  color: #17693f;
}

.badge-status-closed,
.badge-checked-out {
  background: #e9edf3;
  color: #4d627c;
}

.badge-checked-in {
  background: #deedff;
  color: #295f9d;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 0;
  padding: 6px 4px 2px;
  border-top: 1px solid #e5edf6;
}

.pagination button {
  min-width: 84px;
  padding: 7px 14px;
  border: 1px solid #cddaea;
  background: #f9fcff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #2c5079;
}

.pagination button:hover:not(:disabled) {
  border-color: #b1c6df;
  background: #f0f7ff;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: default;
}

.pagination-info {
  font-size: 13px;
  color: #58708d;
}

body.groups-page .mix-summary-card {
  border-radius: 12px;
  border-color: #dbe6f2;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 4px 14px rgba(14, 39, 70, 0.05);
}

@media (max-width: 1024px) {
  body.groups-page .hero-banner {
    height: 132px;
  }

  body.groups-page .hero-overlay-text .welcome-text {
    font-size: 24px;
  }

  .filters-bar {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .filter-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  body.groups-page .hero-banner {
    height: 96px;
    min-height: 96px;
  }

  body.groups-page .hero-overlay-text .welcome-text {
    padding: 0 16px;
    font-size: 20px;
  }

  body.groups-page .sidebar {
    margin-top: 0;
  }

  body.groups-page .groups-page-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  body.groups-page .page-title {
    font-size: 30px;
  }

  .filters-surface {
    padding: 12px;
  }

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

  .table-surface {
    padding: 8px;
  }

  .funnel-table {
    min-width: 760px;
  }
}

/* === Controls Bar === */
.mix-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 12px;
  flex-wrap: wrap;
}

.mix-controls-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mix-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mix-date-range {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-left: 8px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text-primary);
  transition: background 0.15s;
}

.btn-icon:hover {
  background: var(--color-bg-page);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* === Sync Status === */
.mix-sync-status {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.mix-sync-status .sync-stale {
  color: var(--color-danger);
  font-weight: 600;
}

/* === Chart Wrapper === */
.mix-chart-wrapper {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 16px 16px;
  margin-bottom: 16px;
  position: relative;
  min-height: 480px;
}

.mix-chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 80px 0;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mix-chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  display: none;
}

.mix-chart-scroll.loaded {
  display: block;
}

/* === The Chart === */
.mix-chart {
  display: flex;
  align-items: flex-end;
  gap: 0;
  min-width: fit-content;
  position: relative;
}

/* Y-Axis */
.mix-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  width: 48px;
  flex-shrink: 0;
  padding-right: 6px;
  position: relative;
}

.mix-yaxis-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  position: absolute;
  right: 6px;
  transform: translateY(50%);
  white-space: nowrap;
}

/* Grid lines container */
.mix-grid {
  position: absolute;
  left: 48px;
  right: 0;
  bottom: 56px;
  top: 0;
  pointer-events: none;
}

.mix-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed #e2e8f0;
}

/* Bar column */
.mix-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
  min-width: 60px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}

.mix-bar-col:hover .mix-bar-stack {
  filter: brightness(1.08);
}

.mix-bar-col.is-today {
  background: rgba(43, 108, 176, 0.06);
  border-radius: 4px 4px 0 0;
}

.mix-bar-col.is-weekend {
  background: rgba(0, 0, 0, 0.02);
}

/* Header above bar */
.mix-bar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-bottom: 4px;
  min-height: 42px;
}

.mix-bar-avail {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.mix-bar-avail.negative {
  color: var(--color-danger);
}

.mix-bar-pct {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  padding: 1px 6px;
  border-radius: 3px;
}

.mix-bar-pct.pct-low {
  color: var(--color-text-secondary);
}

.mix-bar-pct.pct-mid {
  color: #b7791f;
}

.mix-bar-pct.pct-high {
  background: #c6f6d5;
  color: #276749;
}

.mix-bar-pct.pct-over {
  background: #fed7d7;
  color: #9b2c2c;
}

/* Stacked bar */
.mix-bar-stack {
  width: 42px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 3px 3px 0 0;
  overflow: visible;
  transition: filter 0.15s;
  position: relative;
}

/* Capacity container — outlined box showing total room inventory */
.mix-bar-capacity {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border: 1.5px solid #cbd5e0;
  border-radius: 3px 3px 0 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(203, 213, 224, 0.08) 4px,
    rgba(203, 213, 224, 0.08) 8px
  );
  pointer-events: none;
  z-index: 0;
}

.mix-bar-seg {
  width: 100%;
  min-height: 0;
  transition: height 0.3s ease;
  position: relative;
  z-index: 1;
}

/* Date label below bar */
.mix-bar-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
  min-height: 36px;
}

.mix-bar-dow {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: capitalize;
}

.mix-bar-day {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.mix-bar-month {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
}

/* === Tooltip === */
.mix-tooltip {
  display: none;
  position: fixed;
  background: #1a202c;
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  z-index: 1000;
  pointer-events: none;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.mix-tooltip.visible {
  display: block;
}

.mix-tooltip-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 14px;
}

.mix-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
}

.mix-tooltip-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.mix-tooltip-label {
  flex: 1;
}

.mix-tooltip-value {
  font-weight: 600;
  text-align: right;
}

.mix-tooltip-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin: 4px 0;
}

/* === Legend === */
.mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding: 0 4px;
}

.mix-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.mix-legend-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* === Summary Cards === */
.mix-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.mix-summary-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.mix-summary-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.mix-summary-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.mix-summary-sub {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* === Quick Links === */
.mix-quick-links {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.mix-quick-links .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mix-quick-links .material-icons {
  font-size: 18px;
}

/* === Responsive === */
@media (max-width: 768px) {
  .mix-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .mix-bar-col {
    width: 48px;
    min-width: 48px;
  }

  .mix-bar-stack {
    width: 34px;
  }

  .mix-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== STATUS BADGES (for groups/requests page) ===== */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.status-new { background: #e0e7ff; color: #3730a3; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #d1fae5; color: #065f46; }
.status-completed { background: #dbeafe; color: #1e40af; }
.status-canceled, .status-cancelled { background: #fee2e2; color: #991b1b; }
.status-contacted { background: #e0e7ff; color: #3730a3; }
.status-proposal_sent { background: #dbeafe; color: #1e40af; }
.status-negotiating { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-declined { background: #fee2e2; color: #991b1b; }
.status-scheduled { background: #dbeafe; color: #1e40af; }

/* Approve / Decline button styles */
.btn-approve { background: #059669; color: #fff; border: none; font-weight: 600; }
.btn-approve:hover { background: #047857; }
.btn-decline { background: #dc2626; color: #fff; border: none; font-weight: 600; }
.btn-decline:hover { background: #b91c1c; }

/* Modal styles for groups/requests */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-height: 85vh; display: flex; flex-direction: column; width: 95%;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; border-bottom: 1px solid #e2e8f0;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer; color: #666;
  padding: 4px;
}
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
body.modal-open { overflow: hidden; }
