/* Shared TrimZ components. Palette and dimensions live in design-tokens.css. */
:root { font-family: var(--tz-font); font-size: 16px; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--background); line-height: 1.6; }
a { color: var(--accent); font-weight: 650; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
h1, h2, p, dl, ul { margin: 0; }
h1 { font-size: clamp(32px, 3.2vw, 42px); line-height: 1.08; letter-spacing: -.055em; font-weight: 800; overflow-wrap: anywhere; }
h2 { font-size: 21px; line-height: 1.25; letter-spacing: -.035em; font-weight: 750; }
h3 { font-size: 17px; line-height: 1.35; letter-spacing: -.025em; font-weight: 750; }
p, dd { overflow-wrap: anywhere; }
small { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; }
:focus-visible { outline: 3px solid var(--tz-blue); outline-offset: 4px; }
.tz-icon { width: 22px; height: 22px; flex: none; vertical-align: middle; }
.tz-wordmark { font-size: 38px; letter-spacing: -2.8px; font-weight: 900; line-height: 1; display: inline-flex; align-items: baseline; color: var(--tz-ink)!important; text-decoration: none!important; white-space: nowrap; }
.tz-wordmark>span:first-child { color: var(--tz-blue); }
.tz-brand-dot { width: 7px; height: 7px; display: block; background: var(--tz-red); border-radius: 50%; margin-left: 4px; align-self: flex-start; margin-top: 6px; }

/* Application navigation */
.team { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--tz-white); color: var(--tz-ink); border-right: 1px solid var(--tz-line); min-height: 100vh; height: 100dvh; position: sticky; top: 0; overflow: auto; display: flex; flex-direction: column; gap: 32px; padding: 28px 20px 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 750; color: inherit; line-height: 1.3; overflow-wrap: anywhere; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: none; background: var(--accent); color: var(--tz-white); border-radius: 12px; }
.team-brand { display: grid; align-content: start; gap: 20px; padding: 0 12px; }
.team-brand .tz-wordmark { font-size: 35px; }
.brand-context { display: block; font-size: 14px; font-weight: 750; letter-spacing: -.025em; }
.brand-context small { color: var(--muted); font-size: 11px; font-weight: 500; margin-top: 4px; letter-spacing: 0; }
.navigation, .sidebar-foot { display: grid; gap: 6px; }
.navigation a, .sidebar-foot>a { min-height: 48px; display: flex; align-items: center; gap: 13px; border-radius: 12px; padding: 11px 13px; color: var(--tz-muted); font-size: 13px; font-weight: 650; transition: color .18s, background .18s; }
.navigation a>span { display: inline-flex; min-width: 22px; }
.navigation a .tz-icon { width: 21px; height: 21px; }
.navigation a:hover { background: var(--tz-blue-soft); color: var(--tz-blue); text-decoration: none; }
.navigation .selected { background: var(--tz-blue); color: var(--tz-white); }
.navigation .selected:hover { background: var(--tz-blue-dark); color: var(--tz-white); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; }
.sidebar-foot>a { font-size: 12px; }
.profile { display: flex; align-items: center; gap: 10px; padding: 10px 12px 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }
.profile small { font-size: 11px; font-weight: 450; margin-top: 2px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 12px; background: var(--tz-blue-soft); color: var(--tz-blue); font-size: 12px; font-weight: 800; }
.link-button { display: inline-flex; align-items: center; color: var(--tz-blue); background: none; border: 0; cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 650; min-height: 44px; }
.link-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.sidebar-foot .link-button { color: var(--tz-muted); padding-inline: 12px; font-size: 12px; }
.mobile-menu, .agenda-mobile { display: none; }
.workspace { width: 100%; max-width: calc(var(--tz-content-width) + 2 * var(--tz-gutter)); margin: 0 auto; padding: 40px var(--tz-gutter) 64px; min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 30px; }
.page-heading p, .section-heading p, .muted { color: var(--muted); }
.page-heading p { margin-top: 12px; font-size: 14px; line-height: 1.7; max-width: 65ch; }
.section-heading p { margin-top: 8px; font-size: 13px; line-height: 1.7; }
.section-heading { margin-bottom: 22px; }
.stack>.section-heading { margin-bottom: 0; }
.section-row, .toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.eyebrow { color: var(--accent); font-weight: 800; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; }
.today { margin-bottom: 10px; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin: -5px 0 13px; font-size: 13px; }

/* Surfaces and content */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--tz-radius-card); padding: 26px; min-width: 0; box-shadow: var(--tz-shadow); }
.stack { display: grid; align-content: start; gap: 18px; }
.two-column, .dashboard-grid, .booking-grid { display: grid; gap: 24px; align-items: start; }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid { grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); }
.workspace>.two-column+.two-column, .workspace>.two-column+.panel { margin-top: 24px; }
.toolbar { margin-bottom: 24px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric { padding: 22px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--tz-radius-card); display: grid; gap: 12px; color: var(--ink); box-shadow: var(--tz-shadow); font-variant-numeric: tabular-nums; }
a.metric:hover { text-decoration: none; border-color: var(--tz-blue-line); }
.metric>span { font-weight: 650; color: var(--muted); font-size: 12px; }
.metric>strong { font-size: clamp(26px, 2.5vw, 36px); line-height: 1; letter-spacing: -.06em; overflow-wrap: anywhere; }
.metric>small { font-weight: 650; color: var(--accent); font-size: 11px; }
.empty { color: var(--muted); padding: 22px 0; font-size: 14px; line-height: 1.75; }
.table-panel .empty { min-height: 96px; }
.list { padding: 0; list-style: none; margin: 0 0 16px; }
.list li { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list li>span { min-width: 0; overflow-wrap: anywhere; }
.compact { margin-bottom: 14px; }
.table-scroll { overflow: auto; min-width: 0; max-width: 100%; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--tz-soft); color: var(--tz-muted); font-size: 11px; white-space: nowrap; font-weight: 750; }
td strong, td small { display: block; }
td small { margin-top: 4px; font-size: 11px; }
td a { white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: var(--tz-radius-pill); padding: 5px 10px; background: var(--tz-soft); color: var(--tz-muted); font-size: 11px; line-height: 1.4; font-weight: 750; white-space: nowrap; }
.badge.booked, .badge.waiting { background: var(--tz-blue-soft); color: var(--tz-blue-dark); }
.badge.serving { background: var(--tz-blue); color: var(--tz-white); }
.badge.completed { background: var(--tz-blue-soft); color: var(--tz-blue-dark); }
.badge.cancelled, .badge.no_show, .badge.stock { background: var(--tz-red-soft); color: var(--tz-red-dark); }
.stock-text { color: var(--tz-red-dark); font-weight: 750; }

/* Inputs and actions */
.button, input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: var(--tz-button-height); border: 1px solid var(--tz-input-line); border-radius: var(--tz-radius-control); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; padding: 12px 20px; cursor: pointer; font-size: 13px; line-height: 1.4; font-weight: 750; text-align: center; text-decoration: none; transition: background .18s, border-color .18s, box-shadow .18s, transform .18s; }
.button:hover { text-decoration: none; box-shadow: 0 5px 16px #1414160a; }
.button .tz-icon { width: 18px; height: 18px; }
.primary { color: var(--tz-white); background: var(--accent); border-color: var(--accent); }
.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.secondary { color: var(--tz-ink); background: var(--tz-white); border-color: var(--tz-input-line); }
.secondary:hover { background: var(--tz-soft); border-color: var(--tz-input-line); }
.danger { color: var(--tz-white); background: var(--danger); border-color: var(--danger); }
.danger:hover { background: var(--tz-red-dark); border-color: var(--tz-red-dark); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; box-shadow: none; }
.button.small { min-height: 44px; padding: 9px 14px; font-size: 12px; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; }
.agenda-actions { flex-wrap: wrap; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; min-width: 0; padding: 12px 14px; background: var(--tz-white); color: var(--ink); font-size: 14px; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: var(--tz-subtle); }
input[readonly] { color: var(--muted); background: var(--tz-soft); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; background: var(--tz-soft); }
input[type="checkbox"], input[type="radio"] { margin: 0; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
textarea { font: inherit; min-height: 110px; resize: vertical; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 650; min-width: 0; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { font-size: 14px; font-weight: 750; margin-bottom: 12px; padding: 0; }
.fields { display: grid; gap: 16px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; }
.filters label { flex: 1 0 140px; }
.filters .button { white-space: nowrap; }
.week { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.quantity { min-width: 72px!important; width: 82px!important; }
.notice { padding: 14px 17px; border-radius: 12px; margin: 0 0 20px; font-size: 14px; line-height: 1.6; }
.notice.error { background: var(--tz-red-soft); color: var(--tz-red-dark); border: 1px solid var(--tz-red-line); }
.notice.success { background: var(--tz-blue-soft); color: var(--tz-blue-dark); border: 1px solid var(--tz-blue-line); }
.stack>.notice { margin: 0; }
.details div, .inline-total { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 12px 0; }
.details div { border-bottom: 1px solid var(--line); font-size: 13px; }
.details dt { color: var(--muted); }
.details dd { text-align: right; margin: 0; min-width: 0; }
.inline-total { background: var(--tz-blue-soft); border-radius: 12px; padding: 16px 18px; color: var(--accent-dark); font-size: 14px; font-variant-numeric: tabular-nums; }
.inline-total strong { text-align: right; font-size: 17px; font-weight: 800; }
details { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
details>:not(summary) { margin-top: 16px; }
summary { color: var(--tz-ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.receipt { max-width: 760px; }

/* Public and booking surfaces */
.public-header { max-width: calc(var(--tz-content-width) + 2 * var(--tz-gutter)); margin: 0 auto; padding: 22px var(--tz-gutter); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.internal-header { border-bottom: 1px solid var(--line); }
.shell-context { color: var(--tz-muted); font-size: 12px; }
.public-link { font-size: 13px; white-space: nowrap; }
.public-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 20px; }
.public-content { max-width: calc(var(--tz-content-width) + 2 * var(--tz-gutter)); margin: 0 auto; padding: 36px var(--tz-gutter) 64px; }
.booking-heading { margin: 0 0 28px; padding: 36px; border-radius: var(--tz-radius-hero); background: var(--tz-blue); color: var(--tz-white); }
.booking-heading .eyebrow { color: var(--tz-white); opacity: .85; margin-bottom: 14px; }
.booking-heading h1 { font-size: clamp(36px, 4.6vw, 58px); }
.booking-heading p:last-child { margin-top: 16px; color: var(--tz-white); opacity: .9; max-width: 500px; font-size: 14px; line-height: 1.7; }
.booking-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.booking-grid.internal { max-width: 1100px; }
.service-options { display: grid; gap: 10px; }
.service-option { display: flex; align-items: center; gap: 12px; padding: 15px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; min-height: 64px; font-size: 13px; }
.service-option>span { flex: 1; }
.service-option small { font-size: 11px; font-weight: 450; margin-top: 3px; }
.service-option:has(input:checked) { border-color: var(--tz-blue); background: var(--tz-blue-soft); }
.slot-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 10px; max-height: 210px; overflow: auto; padding: 4px; margin: -4px; }
.slot { position: relative; cursor: pointer; }
.slot input { position: absolute; opacity: 0; }
.slot span { display: grid; place-items: center; min-height: 48px; padding: 11px 6px; border: 1px solid var(--tz-input-line); border-radius: var(--tz-radius-control); text-align: center; white-space: nowrap; font-size: 13px; font-weight: 650; }
.slot input:checked+span { background: var(--accent); border-color: var(--accent); color: var(--tz-white); }
.slot input:focus-visible+span { outline: 3px solid var(--tz-blue); outline-offset: 3px; }
.booking-placeholder { display: grid; min-height: 160px; place-items: center; border: 1px dashed var(--tz-blue-line); border-radius: 14px; background: var(--tz-blue-soft); color: var(--tz-blue); }
.booking-placeholder .tz-icon { width: 42px; height: 42px; }
.booking-results { scroll-margin-top: 140px; }
.contact { margin: 24px 0; font-size: 13px; }
.narrow { width: min(100%, 540px); margin: 12px auto; }
.narrow h1 { font-size: clamp(30px, 3.2vw, 40px); }
.confirmation { text-align: center; padding: 44px 26px; }
.confirmation .button { margin-top: 20px; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 100; top: 8px; left: 8px; background: var(--tz-white); padding: 12px; border-radius: var(--tz-radius-control); }
.install-app { display: flex; justify-content: center; padding: 0 20px 20px; }
.team>.install-app { grid-column: 2; }

@media (max-width: 1100px) {
  .team { grid-template-columns: 214px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .workspace>.two-column, .workspace form.two-column { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 790px) {
  .team { display: block; }
  .sidebar { position: relative; min-height: 0; height: auto; padding: 16px var(--tz-gutter); overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .team-brand { display: flex; gap: 18px; padding: 0; max-width: calc(100% - 64px); }
  .team-brand .tz-wordmark { font-size: 31px; }
  .brand-context { font-size: 12px; }
  .brand-context small { display: none; }
  .navigation { position: fixed; z-index: 70; inset: auto 0 0; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: var(--tz-white); box-shadow: 0 -5px 25px #14141606; }
  .navigation a { min-height: 50px; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; font-size: 10px; white-space: nowrap; border-radius: 11px; }
  .navigation a>span { justify-content: center; }
  .navigation a .tz-icon { width: 20px; height: 20px; }
  .navigation a.nav-admin, .sidebar-foot { display: none; }
  .mobile-menu { display: block; position: absolute; top: 10px; right: var(--tz-gutter); z-index: 80; border: 0; padding: 0; }
  .mobile-menu summary { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; color: var(--tz-ink); border: 1px solid var(--line); border-radius: 50%; list-style: none; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu-panel { position: absolute; right: 0; width: min(270px, 85vw); padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--tz-white); box-shadow: var(--tz-shadow-raised); }
  .mobile-menu-panel p { padding: 10px 12px; color: var(--tz-muted); font-size: 12px; }
  .mobile-menu-panel a, .mobile-menu-panel button { display: flex; align-items: center; min-height: 44px; padding-inline: 12px; color: var(--tz-ink); font-size: 13px; border-radius: 8px; }
  .mobile-menu-panel a:hover { background: var(--tz-blue-soft); color: var(--tz-blue); text-decoration: none; }
  .workspace { padding: 28px var(--tz-gutter) calc(94px + env(safe-area-inset-bottom)); }
  .team>.install-app { margin-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  .two-column, .booking-grid { grid-template-columns: minmax(0, 1fr); }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 20px; }
  .public-content { padding-top: 28px; }
}
@media (max-width: 600px) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
  .panel { padding: 22px; }
  .metrics { gap: 12px; }
  .metric { padding: 17px; gap: 10px; }
  .metric>strong { font-size: 28px; }
  .metric>span { font-size: 11px; }
  .page-heading, .toolbar { align-items: stretch; flex-direction: column; gap: 16px; }
  .page-heading>.button { align-self: flex-start; }
  .public-content { padding-bottom: 40px; }
  .public-header { padding-top: 18px; padding-bottom: 18px; }
  .booking-heading { padding: 28px 24px; }
  .booking-heading h1 { font-size: 40px; }
  .booking-heading p:last-child { font-size: 13px; }
  .inline-total { flex-wrap: wrap; gap: 8px 12px; }
  .inline-total>span { font-size: 13px; }
  .inline-total strong { font-size: 16px; }
  .agenda-desktop { display: none; }
  .agenda-mobile { display: grid; gap: 14px; padding: 0; list-style: none; }
  .agenda-mobile li { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--tz-white); }
  .agenda-mobile-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
  .agenda-mobile-head small { display: inline; }
  .agenda-mobile a { display: inline-flex; align-items: center; min-height: 44px; width: fit-content; font-size: 13px; }
  .list li { flex-wrap: wrap; }
  .button-row>.button { max-width: 100%; }
  .booking-grid { gap: 18px; }
  .team-brand { gap: 13px; }
  .brand-context { font-size: 11px; }
}
@media (max-width: 360px) {
  .fields.two { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 18px; }
  .metric { padding: 14px; }
  .metric>strong { font-size: 25px; }
  .brand-context { max-width: 125px; }
  .team-brand .tz-wordmark { font-size: 29px; }
}
@media (max-width: 600px) {
  .fields.two { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  body, .team { display: block; background: var(--tz-white); color: var(--tz-ink); }
  .sidebar, .public-header, .tz-header, .skip, .back, .print-control, .receipt details, .receipt .notice.success, .install-app { display: none; }
  .workspace, .public-content { max-width: none; padding: 0; }
  .panel, .metric { box-shadow: none; }
  .receipt { max-width: none; border: 0; padding: 0; }
  .receipt .table-scroll { overflow: visible; }
}
