/* ============================================================================
 * services-date-picker.css — Services skin for the shared calendar (dtp-1,
 * 2026-11-10, MACE). Structure lives in date_picker.css; this file only
 * (a) styles a Services DATE cell and (b) maps --dtp-* onto the --sc-* ramp,
 * which data-svc-theme re-points for light.
 * ========================================================================== */

/* The cell: still a text box (manual typing), plus a calendar affordance. */
.svc-grid tbody td.td-date { position: relative; }
.svc-grid tbody td.td-date input.cell.cell-date {
  /* services-premium/-command set `padding: … !important` on every input.cell;
     only an !important with higher specificity reserves room for the glyph. */
  padding-right: 26px !important;
  font-variant-numeric: tabular-nums;
  cursor: text;
}
.svc-grid tbody td.td-date::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  pointer-events: none;
  opacity: .55;
  background-color: var(--sc-text-dim, #A8B0BE);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 0v2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-2V0h-2v2H6V0H4zm-2 6h12v8H2V6zm2 2v2h2V8H4zm3 0v2h2V8H7zm3 0v2h2V8h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 0v2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-2V0h-2v2H6V0H4zm-2 6h12v8H2V6zm2 2v2h2V8H4zm3 0v2h2V8H7zm3 0v2h2V8h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: opacity .12s ease;
}
.svc-grid tbody td.td-date:hover::after,
.svc-grid tbody td.td-date.td-date-open::after { opacity: 1; }

/* Typed text that is not a date yet / was rejected. */
.svc-grid tbody td.td-date input.cell.cell-date-invalid {
  box-shadow: inset 0 0 0 1.5px #F87171 !important;
  animation: svc-date-shake .28s ease;
}
@keyframes svc-date-shake {
  0%, 100% { transform: none; } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); }
}
@media (prefers-reduced-motion: reduce) {
  .svc-grid tbody td.td-date input.cell.cell-date-invalid { animation: none; }
}

/* The popover skin. */
.dtp.dtp--svc {
  --dtp-bg:        var(--sc-panel2, #1B1B1E);
  --dtp-ink:       var(--sc-text, #F2F4F7);
  --dtp-ink-dim:   var(--sc-text-dim, #A8B0BE);
  --dtp-ink-faint: var(--sc-text-faint, #6B7280);
  --dtp-line:      var(--sc-border2, #2A2A2D);
  --dtp-edge:      var(--sc-elev, #303035);
  --dtp-hover:     rgba(var(--sc-neutral-rgb, 168,164,155), .16);
  --dtp-shadow:    0 16px 40px rgba(var(--sc-shadow-color, 0,0,0), .5),
                   0 2px 8px rgba(var(--sc-shadow-color, 0,0,0), .3);
}
/* Light ramp: a heavier neutral on a pale panel, a darker today ring and a
   darker error ink so both stay readable. */
:root[data-svc-theme="light"] .dtp.dtp--svc {
  --dtp-hover:  rgba(var(--sc-neutral-rgb, 120,116,108), .22);
  --dtp-today:  #1D4ED8;
  --dtp-bad:    #B91C1C;
  --dtp-sel-bg: #1D4ED8;
  --dtp-shadow: 0 16px 40px rgba(var(--sc-shadow-color, 7,7,10), .18),
                0 2px 8px rgba(var(--sc-shadow-color, 7,7,10), .10);
}
:root[data-svc-theme="light"] .svc-grid tbody td.td-date input.cell.cell-date-invalid {
  box-shadow: inset 0 0 0 1.5px #B91C1C !important;
}

/* Column menu ▸ Cell Format ▸ Date: the inline DATE STYLE list (no flyout —
   the menu scrolls, and a scroll box clips anything positioned outside it). */
.svc-col-ctx-menu .ctx-item.ctx-date-style {
  padding-left: 40px !important;
  min-height: 30px;
}
.svc-col-ctx-menu .ctx-item.ctx-date-style .ctx-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}
.svc-col-ctx-menu .ctx-date-eg {
  font-size: 11px;
  font-weight: 500;
  color: var(--sc-text-dim, #A8B0BE);
}
.svc-col-ctx-menu .ctx-item.ctx-date-style.is-current .ctx-label { font-weight: 700; }
