/* =====================================================================
   VMS Portal Styles
   Scope: Front-end vendor portal only
   Notes:
   - Layout and form chrome for availability / portal pages
   - Shared 7-column calendar base (.vms-av-grid) lives in vms-ui.css
   ===================================================================== */

.vms-av-wrap {
    max-width: 980px;
}

.vms-av-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    padding: 14px;
    margin: 0 0 14px;
}

.vms-av-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.vms-av-row .field {
    min-width: 260px;
    flex: 1;
}

.vms-av-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vms-av-muted {
    opacity: .8;
}

.vms-av-help {
    font-size: 12px;
    opacity: .8;
    margin: 10px 0 0;
}

.vms-av-month details {
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
    margin: 0 0 12px;
    overflow: hidden;
}

.vms-av-month summary {
    cursor: pointer;
    list-style: none;
    padding: 12px 14px;
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vms-av-month summary::-webkit-details-marker {
    display: none;
}


/* ==========================================================================
   Manual Availability — Calendar Skin (Vendor Portal)
   Goal: match the “Schedule” calendar card style, not the old square buttons.
   ========================================================================== */

.vms-portal .vms-av-grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate !important;
  border-spacing: 10px !important; /* vms-ui.css sets 0 !important; override here */
  margin-top: 10px;
}

.vms-portal .vms-av-grid th {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 0;
  opacity: 0.75;
}

.vms-portal .vms-av-grid td {
  padding: 0;
  vertical-align: top;
  position: relative;
}

.vms-portal .vms-av-grid td.vms-av-empty {
  background: transparent !important;
  border: 0 !important;
}

.vms-portal .vms-av-day {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 3;
  pointer-events: none;
}

.vms-portal .vms-av-daynum {
  font-size: 12px;
  font-weight: 800;
  opacity: 0.8;
}

.vms-portal .vms-av-badge-booked {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 4;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  pointer-events: none;
}


.vms-portal .vms-av-btn,
.vms-portal .vms-av-readonly {
  width: 100% !important; /* vms-ui.css / theme styles can set fixed widths */
  max-width: none !important;
  min-height: 118px;
  box-sizing: border-box;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: #fff;
  color: #0f172a; /* force contrast (some themes force white button text) */
  padding: 30px 10px 16px; /* leaves room for the day number */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.vms-portal .vms-av-btn {
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.vms-portal .vms-av-btn:focus {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.vms-portal .vms-av-btn[data-visual="available"],
.vms-portal .vms-av-readonly.is-available {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.22);
}

.vms-portal .vms-av-btn[data-visual="unavailable"],
.vms-portal .vms-av-readonly.is-unavailable {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
}

.vms-portal .vms-av-grid td.vms-av-past .vms-av-btn,
.vms-portal .vms-av-grid td.vms-av-past .vms-av-readonly {
  opacity: 0.78;
  box-shadow: inset 0 0 0 9999px rgba(15, 23, 42, 0.03);
  border-style: dashed;
}

/* Out-of-season / inactive days (still shown, but clearly muted) */
.vms-portal .vms-av-grid td.vms-av-inactive .vms-av-btn,
.vms-portal .vms-av-grid td.vms-av-inactive .vms-av-readonly {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.08);
}

.vms-portal .vms-av-grid td.vms-av-inactive .vms-av-daynum {
  opacity: 0.45;
}

.vms-portal .vms-av-state {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.vms-portal .vms-av-src {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 14px;
  opacity: 0.7;
  pointer-events: none;
}


.vms-portal .vms-av-event-title {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0.95;
  pointer-events: none;
}

.vms-portal .vms-av-counts {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.75;
}

/* Mobile tightening */

/* ===========================================================
   Availability grid — narrow/mobile mode (vendor portal)
   Uses JS-added .vms-portal--narrow so it works even when
   viewport media queries are unreliable (e.g., "Request Desktop Site")
   =========================================================== */

.vms-portal.vms-portal--narrow .vms-av-card {
  padding: 8px !important;
}

.vms-portal.vms-portal--narrow .vms-av-month summary {
  padding: 10px 10px !important;
}

.vms-portal.vms-portal--narrow .vms-av-month details {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
}

.vms-portal.vms-portal--narrow .vms-av-grid {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 0 !important;
  border-spacing: 0 !important; /* no gaps; fit 7 columns on mobile */
  margin-top: 6px !important;
}

.vms-portal.vms-portal--narrow .vms-av-grid th {
  font-size: 10px !important;
  padding: 2px 0 !important;
}

.vms-portal.vms-portal--narrow .vms-av-btn,
.vms-portal.vms-portal--narrow .vms-av-readonly {
  /* Fill the cell and become true square tiles */
  width: 100% !important;
  max-width: none !important;
  min-height: 56px !important;
  height: auto !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  border-radius: 12px !important;
  display: block !important;
  position: relative !important;
}

.vms-portal.vms-portal--narrow .vms-av-day {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -55%) !important;
}

.vms-portal.vms-portal--narrow .vms-av-daynum {
  font-size: 16px !important;
}

.vms-portal.vms-portal--narrow .vms-av-event-title {
  display: none !important;
}

/* Mobile icon-only: show only icons (no text stacks) */
.vms-portal.vms-portal--narrow .vms-av-statewrap,
.vms-portal.vms-portal--narrow .vms-av-state,
.vms-portal.vms-portal--narrow .vms-av-actionhint {
  display: none !important;
}

.vms-portal.vms-portal--narrow .vms-av-btn::before,
.vms-portal.vms-portal--narrow .vms-av-readonly::before {
  content: "" !important;
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.85;
}

.vms-portal.vms-portal--narrow .vms-av-btn[data-visual="available"]::before,
.vms-portal.vms-portal--narrow .vms-av-readonly[data-visual="available"]::before {
  content: "✓" !important;
}

.vms-portal.vms-portal--narrow .vms-av-btn[data-visual="unavailable"]::before,
.vms-portal.vms-portal--narrow .vms-av-readonly[data-visual="unavailable"]::before {
  content: "×" !important;
}



/* Availability UI polish (vendor portal) */
.vms-portal .vms-av-monthlabel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vms-portal .vms-av-howto {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.10);
}

.vms-portal .vms-av-lookback {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.06);
}

.vms-portal .vms-av-lookback label {
  font-weight: 700;
}

.vms-portal .vms-av-lookback select {
  max-width: 220px;
}

.vms-portal .vms-av-statewrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.vms-portal .vms-av-hint {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.70;
  display: none;
}


.vms-portal .vms-av-readonly {
  position: relative;
}

/* Small legend */
.vms-portal .vms-av-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.02);
}

.vms-portal .vms-av-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}

.vms-portal .vms-av-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #fff;
}

.vms-portal .vms-av-swatch.is-available {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
}

.vms-portal .vms-av-swatch.is-unavailable {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
}

.vms-portal .vms-av-swatch.is-booked {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.35);
}


/* Portal utilities */
.vms-portal .vms-m0{margin:0 !important;}
.vms-portal .vms-mb-0{margin-bottom:0 !important;}
.vms-portal .vms-mb-10{margin-bottom:10px !important;}
.vms-portal .vms-mb-12{margin-bottom:12px !important;}
.vms-portal .vms-mt-0{margin-top:0 !important;}
.vms-portal .vms-mt-2{margin-top:2px !important;}
.vms-portal .vms-mt-8{margin-top:8px !important;}
.vms-portal .vms-mt-10{margin-top:10px !important;}
.vms-portal .vms-mt-14{margin-top:14px !important;}
.vms-portal .vms-ml-10{margin-left:10px !important;}
.vms-portal .vms-opacity-85{opacity:0.85 !important;}
.vms-portal .vms-pt-12{padding-top:12px !important;}
.vms-portal .vms-pl-18{padding-left:18px !important;}
.vms-portal .vms-w-100{width:100% !important;}

.vms-portal .vms-portal-vendor-switch{margin:0 0 10px;}
.vms-portal .vms-portal-vendor-switch-label{display:block;font-weight:600;margin:0 0 4px;}
.vms-portal .vms-portal-vendor-switch-select{width:100%;max-width:420px;}
.vms-portal .vms-portal-header h2{margin:0 0 8px;}
.vms-portal .vms-portal-card h3{margin:0 0 6px;}
.vms-portal .vms-portal-hero-value{font-weight:900;font-size:18px;}

.vms-portal form.vms-av-row{margin:0;}
.vms-portal .vms-label-block{display:block;margin-bottom:8px;}
.vms-portal .vms-field-tight{flex:0 0 auto;min-width:240px;}

.vms-portal .vms-av-card--plain{border:none;margin:0;padding:14px;}

.vms-portal .vms-flex{display:flex;}
.vms-portal .vms-wrap{flex-wrap:wrap;}
.vms-portal .vms-ai-center{align-items:center;}
.vms-portal .vms-gap-6{gap:6px;}
.vms-portal .vms-gap-8{gap:8px;}
.vms-portal .vms-gap-10{gap:10px;}

.vms-portal .vms-av-lookback .vms-av-muted{margin-left:10px;}

.vms-portal .vms-portal-logo-thumb{max-width:180px;height:auto;border:1px solid #ddd;border-radius:8px;padding:6px;background:#fff;}
.vms-mt-18{margin-top:18px;}
.vms-mb-8{margin-bottom:8px;}
.vms-ai-start{align-items:flex-start;}

/* Staff portal – month toggle + month cards */
.vms-month-toggle{
  width:100%;
  border:1px solid #ddd;
  background:#f7f7f7;
  padding:12px 10px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  font-size:14px;
}

.vms-portal .vms-portal-month{
  margin:0 0 14px;
  background:#fff;
  border:1px solid #e5e5e5;
  border-radius:14px;
  padding:10px 12px;
}

.vms-portal .vms-portal-month summary{
  cursor:pointer;
  font-weight:700;
  font-size:15px;
}

.vms-portal .vms-portal-month[open] summary{
  border-bottom:1px solid #eee;
  padding-bottom:10px;
  margin-bottom:10px;
}

.vms-portal .vms-portal-month table.widefat{
  margin-top:10px;
}

.vms-mb-14{margin-bottom:14px;}
.vms-mt-0{margin-top:0;}

/* ==========================================================
 * All Vendors (portal) — Schedule-style month grid
 * ========================================================== */
.vms-portal details.vms-sch-month {
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  margin: 16px 0;
}

.vms-portal details.vms-sch-month > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.vms-portal details.vms-sch-month[open] > summary {
  border-bottom: 1px solid #eee;
}

.vms-portal .vms-sch-monthlabel {
  font-size: 18px;
  line-height: 1.2;
}

.vms-portal table.vms-sch-grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 10px;
  background: transparent;
  margin: 0;
}

.vms-portal .vms-sch-dow {
  text-align: center;
  color: #6b7280;
  font-weight: 600;
  padding: 6px 0;
}

.vms-portal .vms-sch-cell {
  min-height: 92px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-sizing: border-box;
}

.vms-portal td.is-past .vms-sch-cell {
  background: #fafafa;
  opacity: .65;
}

.vms-portal td.is-today .vms-sch-cell {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 2px rgba(199,210,254,.5);
}

.vms-portal .vms-sch-daynum {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 6px;
  color: #111827;
}

.vms-portal .vms-sch-planline {
  margin-top: 6px;
}

.vms-portal .vms-sch-venue-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vms-portal .vms-sch-planitem {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eef2ff;
  color: #1f2937;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .vms-portal table.vms-sch-grid {
    border-spacing: 0;
  }

  .vms-portal .vms-sch-cell {
    min-height: 78px;
    padding: 6px;
    border-radius: 12px;
  }

  .vms-portal .vms-sch-dow {
    font-size: 12px;
    padding: 4px 0;
  }

  .vms-portal .vms-sch-daynum {
    font-size: 13px;
  }

  .vms-portal .vms-sch-venue-tag {
    font-size: 10px;
    padding: 2px 6px;
  }

  .vms-portal .vms-sch-planitem {
    font-size: 11px;
    padding: 2px 6px;
  }
}

.vms-portal .vms-av-month summary {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
}
