/* Grooming page (grooming.ts): week calendar with a dogs list, clients and dog profiles, services, earnings, vaccines. */

#page-grooming .tile:hover { translate: none; }
#gm-tabs { flex: none; max-width: 100%; overflow-x: auto; }
.gm-panel { flex: 1; min-height: 0; }
.gm-stack { display: flex; flex-direction: column; gap: 16px; }
.gm-section { padding: 18px 20px; }
.gm-section h2 { margin: 0 0 6px; font-size: 17px; }
.gm-toolbar { display: flex; align-items: center; gap: 8px; }
.gm-toolbar h2 { flex: 1; margin: 0 0 0 6px; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gm-today.current { border-color: rgba(185, 151, 245, 0.7); }

.gm-input { min-width: 0; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--tile-edge); background: rgba(0, 0, 0, 0.25); color: var(--text); font: inherit; font-size: 13px; color-scheme: dark; }
.gm-input::placeholder { color: var(--faint); }
.gm-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
select.gm-input option { background: #1b1b22; color: var(--text); }
#page-grooming .field input[type="date"], #page-grooming .field input[type="time"], .gm-dialog input[type="date"], .gm-dialog input[type="time"] { color-scheme: dark; }

/* ---- calendar ---- */

.gm-cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; min-height: 480px; }
.gm-cal { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 14px; }
.gm-picking { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: rgba(155, 116, 230, 0.18); font-size: 13px; }
.gm-grid-scroll { flex: 1; min-height: 0; margin-top: 10px; overflow: auto; border-radius: 14px; border: 1px solid var(--tile-edge); background: rgba(0, 0, 0, 0.18); }
.gm-grid { position: relative; display: grid; grid-template-columns: 56px repeat(7, minmax(96px, 1fr)); min-width: 728px; }

.gm-corner, .gm-dayhead { position: sticky; top: 0; z-index: 4; height: 54px; background: rgb(22, 22, 28); border-bottom: 1px solid var(--tile-edge); }
.gm-dayhead { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-left: 1px solid var(--tile-edge); }
.gm-dayhead small { font-size: 11px; color: var(--muted); }
.gm-dayhead b { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 999px; font-size: 15px; }
.gm-dayhead.today b { background: var(--accent); color: #fff; }
.gm-dayhead small.gm-count { font-size: 10.5px; min-height: 13px; }

.gm-times { position: relative; }
.gm-times span { position: absolute; right: 8px; margin-top: 2px; font-size: 11px; color: var(--faint); white-space: nowrap; }

.gm-day {
  position: relative;
  border-left: 1px solid var(--tile-edge);
  cursor: pointer;
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 1px, transparent 1px), linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% calc(var(--slot) * 4), 100% var(--slot);
}
.gm-day.past { background-color: rgba(0, 0, 0, 0.16); }
.gm-day.today { background-color: rgba(155, 116, 230, 0.07); }
.gm-grid.picking .gm-day { cursor: copy; }
.gm-grid.picking .gm-day:hover { background-color: rgba(155, 116, 230, 0.16); }

.gm-appt {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 3px 6px 3px 7px;
  overflow: hidden;
  border: 0;
  border-left: 3px solid #c9adff;
  border-radius: 8px;
  background: rgb(88, 54, 168);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.gm-appt:hover, .gm-appt:focus-visible { z-index: 3; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 6px 16px rgba(0, 0, 0, 0.45); }
.gm-appt-top { display: flex; align-items: center; gap: 4px; max-width: 100%; }
.gm-appt b { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-appt small { max-width: 100%; font-size: 11px; color: rgba(255, 255, 255, 0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-appt.done { background: rgb(30, 110, 74); border-left-color: #8ff0b8; }
.gm-appt.noshow { background: rgb(92, 52, 52); border-left-color: #ff9a8a; }
.gm-appt.cancelled { background: rgb(54, 54, 62); border-left-color: #9a9aa6; }
.gm-appt.cancelled b { text-decoration: line-through; }
.gm-appt.unpaid::after { content: "$"; position: absolute; bottom: 2px; right: 6px; font-size: 11px; font-weight: 800; color: #ffd38a; }
.gm-warn-ico { width: 13px; height: 13px; flex: none; stroke: #ffcf7a; stroke-width: 2.2; }
.item-row .gm-warn-ico { margin-left: auto; width: 15px; height: 15px; }

.gm-now { position: absolute; left: 0; right: 0; z-index: 2; height: 2px; background: #ff6b6b; pointer-events: none; }
.gm-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ff6b6b; }
.gm-drop { position: absolute; left: 2px; right: 2px; z-index: 2; padding: 2px 6px; border: 2px dashed rgba(201, 173, 255, 0.95); border-radius: 8px; background: rgba(155, 116, 230, 0.22); color: #fff; font-size: 11px; font-weight: 600; pointer-events: none; }

/* ---- dogs beside the calendar ---- */

.gm-dogs { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; padding: 14px; }
.gm-dogs .search { width: 100%; }
.gm-dog-list { flex: 1; min-height: 120px; overflow-y: auto; }
.gm-dog-row { cursor: grab; }
.gm-dog-row .item-txt { flex: 1; }
.gm-dog-row .gm-badges { flex: none; max-width: 42%; justify-content: flex-end; }
.gm-quick { display: flex; flex-direction: column; gap: 8px; max-height: 58%; overflow-y: auto; padding-top: 12px; border-top: 1px solid var(--tile-edge); }
.gm-quick-head { display: flex; align-items: center; gap: 12px; }
.gm-quick-head h3 { margin: 0; font-size: 17px; }
.gm-quick-head .icon-btn { margin-left: auto; }
.gm-quick .fields { margin: 0; }
.gm-quick .frow { grid-template-columns: 76px minmax(0, 1fr); padding: 7px 0; }
.gm-quick .actions { margin-top: 0; padding-top: 2px; }

.gm-pic { overflow: hidden; }
.gm-pic img { width: 100%; height: 100%; object-fit: cover; }

.gm-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.gm-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.4; }
.gm-badge.warn { background: rgba(255, 123, 123, 0.16); color: #ffb3b3; border: 1px solid rgba(255, 123, 123, 0.35); }
.gm-badge.info { background: rgba(90, 209, 196, 0.12); color: #a3f0e7; border: 1px solid rgba(90, 209, 196, 0.3); }
.gm-badge.more { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.gm-badge.removable button { display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.gm-badge.removable .ico { width: 12px; height: 12px; stroke: currentColor; }

.gm-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.gm-tag { padding: 2px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); font-size: 12px; }
.gm-tag.warn { background: rgba(255, 123, 123, 0.13); color: #ffb3b3; }
.vax-expired { background: rgba(255, 123, 123, 0.15); color: #ffb3b3; }
.vax-soon { background: rgba(242, 184, 102, 0.15); color: #ffd8a1; }
.vax-ok { background: rgba(110, 231, 160, 0.12); color: #a9f2c8; }
.vax-none { color: var(--muted); }
.gm-pill { flex: none; margin-left: auto; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.gm-pill.vax-none { background: rgba(255, 255, 255, 0.07); }

/* ---- clients ---- */

.gm-client-list-tile { display: flex; flex-direction: column; }
.gm-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.gm-list-head .search { flex: 1; width: auto; min-width: 150px; }
.gm-client-actions { margin-top: 0; padding-top: 4px; }
.gm-dogs-head { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 10px; }
.gm-dogs-head h3 { margin: 0; font-size: 17px; }
.gm-dog-cards { display: flex; flex-direction: column; gap: 12px; }
.gm-dog-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--tile-edge); background: rgba(255, 255, 255, 0.025); }
.gm-dog-head { display: flex; align-items: center; gap: 14px; }
.gm-dog-head h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.gm-dog-card .fields { margin: 0; }
.gm-dog-card .frow { grid-template-columns: 136px minmax(0, 1fr); }
.gm-dog-card .actions { margin-top: 0; padding-top: 0; }

.gm-photo-row { display: flex; align-items: center; gap: 16px; }
.gm-photo .avatar.lg { width: 76px; height: 76px; border-radius: 20px; font-size: 30px; }
.gm-photo-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.gm-dog-form .field-pair { align-items: end; }
.gm-fixed { align-self: center; }
.gm-age { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }

.gm-chips { min-width: 0; margin: 0; padding: 0; border: 0; }
.gm-chips legend { margin-bottom: 8px; padding: 0; font-size: 12px; color: var(--muted); }
.chip-set { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-opt { padding: 4px 11px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18); background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.chip-opt:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.4); }
.chip-opt[aria-pressed="true"] { background: rgba(155, 116, 230, 0.32); border-color: rgba(201, 173, 255, 0.85); color: #fff; }
.chip-opt.warn[aria-pressed="true"] { background: rgba(255, 123, 123, 0.24); border-color: rgba(255, 140, 140, 0.8); }
.chip-new { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 10px; border-radius: 999px; border: 1px dashed rgba(255, 255, 255, 0.24); }
.chip-new input { width: 110px; padding: 4px 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 12px; }
.chip-new input::placeholder { color: var(--faint); }
.chip-new:focus-within { border-color: rgba(201, 173, 255, 0.8); }
.chip-new .icon-btn { width: 24px; height: 24px; background: transparent; }
.gm-add-flag { display: flex; gap: 8px; margin-top: 8px; }
.gm-add-flag input { flex: 1; }
.gm-add-flag .pill.compact { flex: none; }
#gd-warnings:empty, #gd-info:empty { display: none; }
.gm-vax-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gm-vax-row input[type="text"] { flex: 1; }
#gd-vax-add, #gm-svc-add, #gm-size-add, #gm-extra-add { align-self: flex-start; font-size: 13px; }

/* ---- services ---- */

.gm-svc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.gm-svc-row, .gm-extra-row { display: grid; grid-template-columns: minmax(0, 1fr) 124px 100px 84px 30px; align-items: center; gap: 8px; }
.gm-extra-row { grid-template-columns: minmax(0, 1fr) 100px 30px; max-width: 520px; }
.gm-h3 { margin: 6px 0 2px; font-size: 14px; }
.gm-size-list { display: flex; flex-wrap: wrap; gap: 8px; }
.gm-size-chip { display: inline-flex; align-items: center; gap: 2px; }
.gm-size-chip .gm-input { width: 96px; }
.gm-size-toggle.on { border-color: rgba(201, 173, 255, 0.8); color: #fff; }
.gm-svc-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 8px 0 6px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.gm-svc-sizes[hidden] { display: none; }
.gm-size-price { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.gm-amount.bad { border-color: var(--danger); }
#gm-services-form .actions { margin-top: 0; }
.gm-hours { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px; max-width: 440px; margin: 10px 0 8px; }
.gm-hours .field { flex: 1; gap: 10px; }
.gm-hours .field span { color: var(--muted); font-size: 13px; }
.gm-hours p { flex-basis: 100%; }
.gm-hours p:empty { display: none; }
.gm-custom-group h3 { margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---- earnings ---- */

.gm-earn-bar { padding: 10px 14px; }
.gm-earn-bar h2 { flex: none; min-width: 200px; text-align: center; font-size: 16px; }
.gm-earn-bar .tabs { margin-right: auto; }
.gm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.gm-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; }
.gm-stat small { font-size: 12px; color: var(--muted); }
.gm-stat b { font-size: 24px; font-variant-numeric: tabular-nums; }
.gm-stat.ok b { color: var(--ok); }
.gm-stat.warn b { color: #ffc27a; }
.gm-earn-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.gm-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; }
.gm-table th { padding: 6px 4px; border-bottom: 1px solid var(--tile-edge); text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); }
.gm-table td { padding: 8px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.gm-table th:not(:first-child), .gm-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.gm-unpaid { display: flex; flex-direction: column; margin: 8px 0 0; padding: 0; list-style: none; }
.gm-unpaid-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.gm-unpaid-row .item-txt { flex: 1; }

/* ---- vaccines ---- */

#gm-vax-list { margin-top: 10px; }
#gm-vax-list .item-txt { flex: 1; }

/* ---- appointment dialog ---- */

.gm-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px 26px;
  border-radius: 22px;
  border: 1px solid var(--edge);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 40%), rgb(24, 24, 31);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.gm-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.gm-dialog .actions { margin-top: 4px; }
.gm-repeat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }

/* Booking dialog: priced lines, popups to add services and add-ons, total, vaccine warning. */
.gm-vax-warn { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255, 123, 123, 0.7); background: rgba(255, 90, 90, 0.16); color: #ffd0d0; font-size: 13px; }
.gm-vax-warn .ico { grid-row: span 2; width: 22px; height: 22px; stroke: #ff9a9a; stroke-width: 2; }
.gm-vax-warn b { color: #fff; font-size: 14px; }
.gm-bill { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--tile-edge); background: rgba(255, 255, 255, 0.03); }
.gm-bill-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.gm-lines { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.gm-line { display: grid; grid-template-columns: minmax(0, 1fr) 92px 30px; align-items: center; gap: 8px; font-size: 13px; }
.gm-line.none { display: block; color: var(--muted); font-size: 12.5px; }
.gm-line-name { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.gm-line-name small { font-size: 11px; color: var(--muted); }
.gm-amount { text-align: right; font-variant-numeric: tabular-nums; }
.gm-bill-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gm-menu-wrap { position: relative; }
.gm-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 6; width: min(340px, 80vw); max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 14px; border: 1px solid var(--edge); background: rgb(30, 30, 38); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); }
.gm-menu[hidden] { display: none; }
.gm-menu-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; font-size: 13px; cursor: pointer; }
.gm-menu-row:hover { background: rgba(255, 255, 255, 0.06); }
.gm-menu-row input { margin: 0; accent-color: var(--accent); }
.gm-menu-row small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.gm-menu-own { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding: 10px 8px 4px; border-top: 1px solid var(--tile-edge); font-size: 12.5px; }
.gm-menu-fields { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 6px; }
.gm-menu-fields select { grid-column: span 2; }
.gm-menu-own .pill.compact { align-self: flex-start; }
.gm-total { margin: 0 0 0 auto; font-size: 13px; color: var(--muted); }
.gm-total b { margin-left: 6px; font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.gm-badge { max-width: 100%; overflow-wrap: anywhere; }
.gm-dog-row .gm-badge { display: inline-block; max-width: 110px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

@media (max-width: 1100px) {
  .gm-cal-wrap { grid-template-columns: minmax(0, 1fr) 250px; }
}
@media (max-width: 900px) {
  .gm-cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .gm-cal { min-height: 540px; }
  .gm-dogs { max-height: 460px; }
  .gm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gm-earn-split { grid-template-columns: 1fr; }
  .gm-svc-row { grid-template-columns: minmax(0, 1fr) 96px 76px 76px 30px; }
  .gm-earn-bar h2 { min-width: 0; flex: 1; }
  .gm-dog-card .frow { grid-template-columns: 96px minmax(0, 1fr); }
}

/* Read by screen readers, not shown. */
.gm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
