/* ov2-heatmap14.css — namespaced occupancy calendar */

.hm14-card {
  position: relative;
  overflow: hidden;
}
.hm14-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.hm14-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.hm14-help {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 12px;
  cursor: help;
}
.hm14-range {
  flex-basis: 100%;
  color: var(--text-2);
  font-size: 12px;
}
.hm14-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.hm14-controls button,
.hm14-toggle button,
.hm14-drawer-actions button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-xs);
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.hm14-controls button:hover,
.hm14-toggle button:hover,
.hm14-drawer-actions button:hover {
  background: var(--hover);
}
.hm14-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px;
  gap: 2px;
  background: var(--surface-alt);
}
.hm14-toggle button {
  border: 0;
  padding: 5px 9px;
  background: transparent;
  color: var(--text-2);
}
.hm14-toggle button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.hm14-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 12px;
  margin-bottom: 12px;
}
.hm14-stats strong {
  color: var(--text);
  font-weight: 500;
}
.hm14-stats .danger,
.hm14-stats .danger strong {
  color: #dc2626;
}
.hm14-legend {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 12px;
  margin: -34px 0 14px;
}
.hm14-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.hm14-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  font-style: normal;
  line-height: 10px;
}
.hm14-legend .inhouse { background: #0d8a72; }
.hm14-legend .booked { background: rgba(13, 138, 114, 0.28); }
.hm14-legend .free {
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.hm14-legend .arrdep {
  color: #e58420;
  width: auto;
}
.hm14-legend .pay {
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a 0 25%, #d97706 25% 50%, #dc2626 50% 75%, #2563eb 75% 100%);
}
.hm14-legend .overdue {
  border: 2px solid #dc2626;
  background: transparent;
}
.hm14-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
}
.hm14-scroll::-webkit-scrollbar { height: 8px; }
.hm14-scroll::-webkit-scrollbar-track { background: transparent; }
.hm14-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-3) 36%, transparent);
  border-radius: 999px;
}
.hm14-grid {
  display: grid;
  gap: 4px;
  min-width: max-content;
  align-items: stretch;
}
.hm14-corner,
.hm14-cabin {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--surface);
}
.hm14-day-head {
  min-height: 44px;
  border-radius: var(--radius-xs);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 11px;
  background: color-mix(in srgb, var(--surface-alt) 55%, transparent);
}
.hm14-day-head strong {
  color: var(--text);
  font-weight: 500;
  margin-top: 4px;
}
.hm14-day-head.weekend {
  color: var(--text-3);
  background: color-mix(in srgb, var(--surface-alt) 78%, transparent);
}
.hm14-day-head.today {
  outline: 2px solid var(--info);
  outline-offset: -2px;
}
.hm14-day-head.today span,
.hm14-day-head.today strong {
  color: var(--info);
}
.hm14-cabin {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 76px;
  padding-right: 14px;
  border-right: 1px solid var(--border);
}
.hm14-cabin strong {
  font-size: 14px;
  font-weight: 500;
}
.hm14-cabin span {
  color: var(--text-3);
  font-size: 11px;
  margin-top: 3px;
}
.hm14-cell {
  min-height: 76px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
  color: var(--text);
  padding: 8px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  transition: transform 80ms, border-color 80ms, box-shadow 80ms, background 80ms;
}
.hm14-cell:hover {
  transform: translateY(-1px);
  border-color: var(--info);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.hm14-cell.weekend {
  background: color-mix(in srgb, var(--surface-alt) 86%, var(--surface));
}
.hm14-cell.today {
  outline: 2px solid var(--info);
  outline-offset: -2px;
}
.hm14-cell.booked {
  background: color-mix(in srgb, #0d8a72 24%, var(--surface));
}
.hm14-cell.checkedout {
  background: color-mix(in srgb, #0d8a72 12%, var(--surface));
  color: var(--text-2);
}
.hm14-cell.inhouse {
  background: #0d8a72;
  color: #fff;
  border-color: #0d8a72;
}
.hm14-cell.overdue {
  border-color: #dc2626;
  box-shadow: inset 0 0 0 1px #dc2626;
}
.hm14-cell.blocked {
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background:
    repeating-linear-gradient(135deg, transparent 0, transparent 6px, color-mix(in srgb, var(--text-3) 24%, transparent) 6px, color-mix(in srgb, var(--text-3) 24%, transparent) 8px),
    var(--surface-alt);
}
.hm14-free-label {
  min-height: 1px;
}
.hm14-blocked-label {
  font-size: 11px;
  font-weight: 500;
}
.hm14-cell-top,
.hm14-markers,
.hm14-guest {
  display: flex;
  align-items: center;
}
.hm14-cell-top {
  justify-content: space-between;
  gap: 8px;
}
.hm14-guest {
  min-width: 0;
  gap: 4px;
  font-size: 12px;
}
.hm14-guest strong {
  font-size: 13px;
  font-weight: 500;
}
.hm14-guest em {
  color: inherit;
  opacity: 0.75;
  font-style: normal;
  font-size: 10px;
}
.hm14-markers {
  gap: 4px;
  flex-shrink: 0;
}
.hm14-arr,
.hm14-dep {
  color: #e58420;
  font-size: 10px;
  line-height: 1;
}
.hm14-task-badge {
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  min-width: 18px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
}
.hm14-pay-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  display: inline-block;
}
.hm14-pay-dot.paid { background: #16a34a; color: #16a34a; }
.hm14-pay-dot.partial { background: #d97706; color: #d97706; }
.hm14-pay-dot.unpaid { background: #dc2626; color: #dc2626; }
.hm14-pay-dot.hold { background: #2563eb; color: #2563eb; }
.hm14-cell-meta {
  color: inherit;
  opacity: 0.82;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm14-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: auto;
}
.hm14-pills span {
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  color: var(--text-2);
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hm14-cell.inhouse .hm14-pills span {
  background: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.86);
}
.hm14-pills .task.high { color: #dc2626; }
.hm14-tooltip {
  position: fixed;
  z-index: 2500;
  transform: translate(-50%, -100%);
  max-width: 300px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
  font-size: 12px;
  pointer-events: none;
}
.hm14-tooltip-title {
  font-weight: 500;
}
.hm14-tooltip-sep {
  height: 1px;
  margin: 7px 0;
  background: color-mix(in srgb, var(--surface) 22%, transparent);
}
.hm14-tooltip-muted,
.hm14-tooltip-task {
  color: color-mix(in srgb, var(--surface) 78%, transparent);
  margin-top: 3px;
}
.hm14-tooltip-pay {
  margin-top: 4px;
  font-weight: 500;
}
.hm14-tooltip-pay.paid { color: #86efac; }
.hm14-tooltip-pay.partial,
.hm14-tooltip-pay.hold { color: #fcd34d; }
.hm14-tooltip-pay.unpaid { color: #fca5a5; }
.hm14-tooltip-flags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.hm14-tooltip-flags span,
.hm14-tooltip-task {
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 12%, transparent);
  padding: 2px 7px;
  display: inline-flex;
}
.hm14-overlay {
  position: fixed;
  inset: 0;
  z-index: 2998;
  background: rgba(0,0,0,0.18);
}
.hm14-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 2999;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 50px rgba(0,0,0,0.14);
  display: flex;
  flex-direction: column;
  animation: hm14SlideIn 250ms ease-out;
}
@keyframes hm14SlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.hm14-drawer-head {
  min-height: 92px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.hm14-drawer-title {
  color: var(--text);
  font-size: 22px;
  font-weight: 500;
}
.hm14-drawer-sub {
  color: var(--text-2);
  margin-top: 5px;
}
.hm14-drawer-head button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.hm14-drawer-body {
  overflow: auto;
  padding: 20px 24px 24px;
  display: grid;
  gap: 18px;
}
.hm14-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.hm14-summary div {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface);
}
.hm14-summary span {
  display: block;
  color: var(--text-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hm14-summary strong {
  display: block;
  margin-top: 7px;
  font-size: 17px;
  font-weight: 500;
}
.hm14-summary .pay.paid strong { color: #16a34a; }
.hm14-summary .pay.partial strong,
.hm14-summary .pay.hold strong { color: #d97706; }
.hm14-summary .pay.unpaid strong { color: #dc2626; }
.hm14-drawer-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.hm14-drawer-section h4,
.hm14-note h4 {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.hm14-op-note {
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--info) 8%, var(--surface));
  color: var(--text);
  padding: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.hm14-task-list {
  display: grid;
  gap: 8px;
}
.hm14-task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text);
  font-size: 13px;
}
.hm14-task.high { border-left: 3px solid #dc2626; }
.hm14-task.med { border-left: 3px solid #d97706; }
.hm14-task.low { border-left: 3px solid var(--text-3); }
.hm14-task.done span {
  color: var(--text-3);
  text-decoration: line-through;
}
.hm14-task em {
  color: var(--text-3);
  font-style: normal;
  font-size: 11px;
}
.hm14-empty-tasks {
  color: var(--text-3);
  font-size: 13px;
  padding: 10px 0;
}
.hm14-drawer-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  font-size: 13px;
}
.hm14-drawer-row span {
  color: var(--text-2);
}
.hm14-drawer-row strong {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}
.hm14-note {
  border-left: 3px solid var(--info);
  padding: 10px 12px;
  background: color-mix(in srgb, var(--info) 7%, var(--surface));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.hm14-note div {
  color: var(--text-2);
  font-style: italic;
  font-size: 13px;
  line-height: 1.45;
}
.hm14-drawer-actions {
  margin-top: auto;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hm14-drawer-actions .danger {
  color: #dc2626;
  border-color: color-mix(in srgb, #dc2626 50%, var(--border));
}

[data-theme="dark"] .hm14-cell.inhouse {
  color: #fff;
}

@media (max-width: 900px) {
  .hm14-top {
    flex-direction: column;
  }
  .hm14-legend {
    justify-content: flex-start;
    margin: 0 0 14px;
  }
}
@media (max-width: 600px) {
  .hm14-cell {
    min-height: 86px;
    padding: 7px;
  }
  .hm14-cabin {
    min-height: 86px;
  }
  .hm14-summary {
    grid-template-columns: 1fr;
  }
  .hm14-drawer {
    top: auto;
    bottom: 0;
    height: 88vh;
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
  }
  .hm14-drawer-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .hm14-drawer-row strong {
    text-align: left;
  }
}
