.ny-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: .85rem; }
.ny-page .page-heading { margin-bottom: .12rem; }
.ny-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .5rem; margin: 0; }
.ny-metrics > div {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: .22rem;
  padding: .62rem .7rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--paper);
}
.ny-metrics > div:first-child { border-color: #ba8c72; background: var(--terracotta-wash); }
.ny-metrics dt { color: var(--muted); font-size: .79rem; line-height: 1.16; }
.ny-metrics dd { margin: 0; font-size: 1.6rem; font-weight: 800; line-height: 1.08; font-variant-numeric: tabular-nums; }
.ny-capacity {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .55rem;
  padding: .6rem .8rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--paper); font-size: .88rem;
}
.ny-capacity progress { flex: 1 1 10rem; min-width: 6rem; height: .75rem; accent-color: var(--terracotta); }
.ny-capacity.ny-near { background: var(--amber-wash); color: var(--amber); }
.ny-capacity.ny-over { background: #fae9e5; color: var(--danger); border-color: #dca69d; }
.ny-capacity[data-ny-capacity] { display: grid; }
.ny-slots { margin-top: .6rem; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--paper); }
.ny-slots h2 { font-size: .87rem; margin-bottom: .35rem; }
.ny-slots p { font-size: .86rem; }
.ny-slots ul { display: flex; gap: .3rem; padding: 0; overflow-x: auto; list-style: none; }
.ny-slots li { display: grid; flex: 0 0 auto; padding: .27rem .5rem; border: 1px solid var(--border); border-radius: .45rem; font-size: .76rem; }
.ny-slots li > span { font-variant-numeric: tabular-nums; color: var(--muted); }
.ny-slots li strong { font-size: .9rem; }
.ny-toolbar {
  position: sticky; z-index: 2; top: 0; padding-block: .35rem;
  background: var(--background); box-shadow: 0 3px 4px -4px #35211160;
}
.ny-filters { display: grid; gap: .55rem; }
.ny-search { display: flex; align-items: end; gap: .55rem; flex-wrap: wrap; }
.ny-search label:first-child { flex: 1 1 14rem; }
.ny-search label, .ny-report-sort { display: grid; gap: .25rem; font-size: .84rem; font-weight: 700; }
.ny-search :is(input, select), .ny-report-sort select, .ny-table-form input, .ny-page textarea, #dialog [data-form^="ny-"] textarea {
  min-width: 0; border: 1px solid var(--border); border-radius: .54rem; padding: .42rem .55rem;
  background: #fffdf8; color: var(--ink); font: inherit; font-size: max(.92rem, 16px);
}
.ny-search :is(input, select), .ny-report-sort select { min-height: 43px; }
.ny-filter-row, .ny-facets { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.ny-filter-row .button { min-height: 41px; padding: .33rem .56rem; }
.ny-facets .button[aria-pressed="true"], .ny-toolbar .button[aria-pressed="true"] { border-color: #ab785b; background: var(--terracotta-wash); }
.ny-results { color: var(--muted); font-size: .82rem; margin-bottom: .24rem; }
.ny-grid-scroll { margin-top: 0; border: 1px solid var(--border); border-radius: .75rem; background: var(--paper); box-shadow: var(--shadow); }
.ny-grid { width: 100%; min-width: 61rem; border-collapse: separate; border-spacing: 0; font-size: .79rem; }
.ny-grid.ny-team-grid { min-width: 48rem; }
.ny-grid :is(th, td) { padding: .34rem .35rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.ny-grid thead th { background: #eee1d0; color: #4a382d; font-size: .74rem; font-weight: 800; }
.ny-grid tbody tr:last-child > * { border-bottom: 0; }
.ny-grid tbody tr:nth-child(even) > * { background: #fcf4e8; }
.ny-grid tbody tr.ny-archived > * { background: #faeeeb; }
.ny-grid .ny-name { min-width: 6.5rem; max-width: 11rem; overflow-wrap: anywhere; font-size: .92rem; }
.ny-grid .ny-size { padding-inline: .5rem; text-align: center; }
.ny-size strong { display: inline-block; font-size: 1.28rem; line-height: 1; color: #773a2a; font-variant-numeric: tabular-nums; }
.ny-grid .ny-age { min-width: 1.8rem; text-align: center; }
.ny-grid .ny-age-head { width: 3.2rem; text-align: center; }
.ny-time, .ny-phone { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ny-phone a { display: inline-flex; min-height: 42px; align-items: center; color: #743b2c; text-underline-offset: .15em; }
.ny-grid .ny-notes { min-width: 7rem; max-width: 10.5rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.ny-grid .ny-tables { width: 7rem; }
.ny-table-form { display: flex; align-items: center; gap: .16rem; }
.ny-table-form input { width: 4.1rem; min-height: 42px; padding-inline: .3rem; }
.ny-table-form .icon-button, .ny-row-actions .icon-button { min-width: 40px; width: 40px; min-height: 42px; }
.ny-row-actions { display: flex; align-items: center; gap: .16rem; }
.ny-warning, .ny-status-date { display: block; font-size: .73rem; line-height: 1.25; }
.ny-warning { color: #824619; font-weight: 700; }
.ny-toggle, .ny-check { display: flex; align-items: center; gap: .24rem; min-height: 41px; cursor: pointer; }
.ny-toggle input, .ny-check input { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin: .15rem; accent-color: var(--terracotta); }
.ny-status, .ny-arrival { white-space: nowrap; }
.ny-grid .pill { font-size: .74rem; }
.pill.ny-pending { color: #733b10; background: #fae5c7; }
.pill.ny-confirmed { color: #1e573b; background: #dceee0; }
.pill.ny-cancelled { color: #85291c; background: #f5dcd7; }
.pill.ny-arrived { color: #244b64; background: #e0edf3; }
.ny-service-grid { min-width: 38rem; font-size: .93rem; }
.ny-service-grid .ny-name { font-size: 1.04rem; }
.ny-service-grid .ny-tables { width: 8rem; }
.ny-service-grid .ny-notes { max-width: 23rem; }
.ny-service-grid .ny-time { font-size: 1rem; font-weight: 700; }
.ny-service-grid .ny-size strong { font-size: 1.46rem; }
.ny-panel { border: 1px solid var(--border); border-radius: .7rem; background: var(--paper); }
.ny-panel > .button { display: flex; justify-content: flex-start; width: 100%; padding-inline: .75rem; }
.ny-panel > .button svg:last-child { margin-left: auto; }
.ny-panel > .button[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
.ny-panel-body { display: grid; gap: .6rem; padding: .7rem; border-top: 1px solid var(--border); }
.ny-report-sort { justify-self: start; }
.ny-report-row { display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: .45rem; }
.ny-report-row a { text-decoration: none; }
.ny-finance-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.ny-finance-table :is(th, td) { text-align: left; padding: .45rem; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.ny-finance-table tr > :last-child { text-align: right; white-space: nowrap; }
#dialog [data-form^="ny-"] textarea { resize: vertical; }
#dialog .ny-check { display: flex; }
.ny-form-flags { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.ny-quantities { padding: .55rem .65rem .65rem; }
.ny-quantities output { display: inline-block; margin-left: .4rem; padding-inline: .38rem; color: #773a2a; background: var(--terracotta-wash); border-radius: .4rem; }
.ny-quantity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.ny-quantity { display: grid; align-content: space-between; gap: .3rem; }
.ny-quantity > div { display: grid; grid-template-columns: 43px minmax(0, 4.5rem) 43px; align-items: center; gap: .22rem; }
.ny-quantity input { min-width: 0; text-align: center; }
.ny-quantity button { font-size: 1.2rem; }
.ny-history { display: grid; gap: .65rem; padding-left: 1.4rem; }
.ny-history ul { padding-left: 1.15rem; }
.ny-print main { padding: 1.5rem; }
.ny-print header { display: grid; justify-items: start; gap: .5rem; margin-bottom: .85rem; }
.ny-print-table { overflow-x: auto; }
.ny-print table { width: 100%; border-collapse: collapse; background: #fff; font-size: .85rem; }
.ny-print :is(th, td) { padding: .33rem; border: 1px solid #c7b9a9; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; vertical-align: top; }
.ny-print th { background: #eee1d0; }
@media (min-width: 781px) and (max-width: 1140px) {
  .layout:has(.ny-page) { grid-template-columns: 11.6rem minmax(0, 1fr); }
  .layout:has(.ny-page) .brand strong { font-size: 1rem; }
  main:has(.ny-page) { padding-inline: 1rem; }
}
@media (min-width: 781px) and (max-width: 1329px) {
  .ny-dashboard-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1330px) {
  .ny-dashboard-metrics { grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); }
}
@media (max-width: 780px) {
  .ny-toolbar { top: 0; }
  .ny-metrics { grid-template-columns: repeat(auto-fit, minmax(6.6rem, 1fr)); }
  .ny-grid-scroll { border-radius: .55rem; }
}
@media (max-width: 440px) {
  .ny-quantity-grid { grid-template-columns: 1fr; }
  .ny-toolbar .button { padding-inline: .4rem; }
}
@media print {
  @page new-year { size: A4 landscape; margin: 10mm; }
  body.ny-print { page: new-year; background: white; }
  .ny-print main { padding: 0; }
  .ny-print button { display: none; }
  .ny-print-table { overflow: visible; }
  .ny-print thead { display: table-header-group; }
  .ny-print tr { break-inside: avoid; }
  .ny-print table { font-size: 8.5pt; }
}
