/* Shared admin layouts. Loaded after each page's legacy styles. */
:root { --admin-header: calc(64px + env(safe-area-inset-top, 0px)); --navbar-height: var(--admin-header); }
html { -webkit-text-size-adjust: 100%; }
body { overflow-wrap: normal; }
button, input, select, textarea { font-family: inherit; }
button, a, summary { touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #946b13; outline-offset: 3px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #946b13; outline-offset: 2px; }
[hidden] { display: none !important; }
.admin-topbar {
  position: fixed; inset: 0 0 auto; height: var(--admin-header); z-index: 1000;
  display: flex; align-items: center; gap: 16px; color: #fff; background: #111;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
}
.admin-brand { display: flex; align-items: center; gap: 10px; color: #fff; flex: 0 0 auto; font-weight: 700; }
.admin-brand:hover { color: #eec160; }
.admin-brand img { background: #fff; border-radius: 50%; }
.admin-brand small { display: block; color: #eec160; font-size: 12px; line-height: 1.2; }
.admin-topbar .location-tabs-topbar {
  display: flex; flex: 0 1 auto; min-width: 0; max-width: min(52vw, 760px); gap: 6px;
  margin: 0; padding: 0; border: 0; overflow-x: auto; scrollbar-width: thin;
}
.admin-topbar .location-tab {
  flex: 0 0 auto; min-height: 36px; margin: 0; padding: 6px 12px; border-color: #555;
  background: #222; color: #fff;
}
.admin-topbar .location-tab:hover { border-color: #eec160; }
.admin-topbar .location-tab.active { border-color: #eec160; background: #eec160; color: #111; }
#admin-current-screen { flex: 1; min-width: 0; font-size: 14px; text-align: right; }
#admin-menu-toggle { border: 1px solid #555; background: #222; color: #fff; border-radius: 8px; padding: 8px 12px; min-height: 44px; font: inherit; cursor: pointer; }
.admin-dashboard #admin-app { height: calc(100vh - var(--admin-header)); height: calc(100dvh - var(--admin-header)); margin-top: var(--admin-header); min-width: 0; }
.admin-dashboard .sidebar { flex: 0 0 208px; overflow-y: auto; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
.admin-dashboard .sidebar a { flex-shrink: 0; min-height: 48px; }
.admin-dashboard .sidebar a i { width: 20px; text-align: center; }
.admin-dashboard .content { min-width: 0; min-height: 0; scrollbar-gutter: auto; padding: 16px; }
.admin-dashboard .screen { min-width: 0; }
.admin-dashboard .screen:not(#calendar-screen) { flex: 0 0 auto; height: auto; min-height: 100%; overflow: visible; }
.admin-dashboard #calendar-screen { scrollbar-gutter: auto; }
.admin-dashboard .screen > div:first-child { flex-shrink: 0; gap: 12px; flex-wrap: wrap; }
.admin-dashboard .button { margin-left: 0; min-height: 44px; padding: 10px 14px; line-height: 1.3; }
.admin-dashboard .screen h2 { font-size: 1.4rem; }
.admin-dashboard input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
.admin-dashboard select, .admin-dashboard textarea { max-width: 100%; min-height: 44px; font-size: 16px; }
.admin-dashboard input[type=checkbox], .admin-dashboard input[type=radio] { display: inline-block; width: 20px; height: 20px; margin: 0; flex: 0 0 20px; accent-color: #a57b21; }
.admin-dashboard label:has(> input[type=checkbox]) { min-height: 44px; }
.admin-dashboard #login-screen { z-index: 1010; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); overflow-y: auto; background: #f5f5f5; }
.admin-dashboard #login-screen > div { width: min(100%, 380px) !important; margin: auto; border: 1px solid #ddd; box-shadow: 0 8px 32px #0001; }
.admin-dashboard .location-menu { display: none; }
.admin-dashboard #calendar-toolbar { display: flex !important; padding-bottom: 12px; gap: 8px; }
.admin-dashboard #calendar-toolbar-list { display: flex !important; }
.admin-dashboard .mobile-header { display: none !important; }
.admin-dashboard .cal-stylist-label { width: auto; margin: 0; }
.admin-dashboard .cal-stylist-select { margin: 0; }
.admin-dashboard .cal-view-btn, .admin-dashboard .cal-day-nav button, .admin-dashboard .cal-tool-btn { min-height: 44px; }
.admin-dashboard #day-view { min-height: 340px; flex: 1 0 340px; }
.admin-dashboard #day-view-body { overscroll-behavior: contain; }
.admin-dashboard #calendar { flex: 1 0 auto; }
.admin-dashboard .fc .fc-toolbar { flex-wrap: wrap; gap: 8px; }
.admin-dashboard .fc .fc-toolbar-title { font-size: 1.2rem; }
.admin-dashboard .fc .fc-button { min-height: 44px; }
.admin-dashboard .table-scroll { width: 100%; overflow-x: auto; margin-top: 12px; flex: 0 0 auto; }
.admin-dashboard #appointments-table-wrap { overflow: visible; flex: 0 0 auto; }
.admin-dashboard #appointments-table-wrap .table-scroll { margin-top: 0; }
.admin-dashboard .admin-data-table { min-width: 760px; background: #fff; table-layout: auto; }
.admin-dashboard .admin-data-table th { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.admin-dashboard .admin-data-table td { overflow-wrap: normal; word-break: normal; }
.admin-dashboard .admin-data-table td .button { display: inline-flex; align-items: center; justify-content: center; margin: 3px; }
.admin-dashboard #appointments-table { min-width: 1120px; }
.admin-dashboard #appointments-table :is(th, td):nth-child(1) { min-width: 10ch; white-space: nowrap; }
.admin-dashboard #appointments-table :is(th, td):nth-child(2) { min-width: 8ch; white-space: nowrap; }
.admin-dashboard #appointments-table :is(th, td):nth-child(7),
.admin-dashboard #appointments-table :is(th, td):nth-child(8),
.admin-dashboard #appointments-table :is(th, td):nth-child(10),
.admin-dashboard #appointments-table :is(th, td):nth-child(11) { width: 1%; white-space: nowrap; }
.admin-dashboard #appointments-table :is(th, td):nth-child(7) { min-width: 9ch; }
.admin-dashboard #appointments-table :is(th, td):nth-child(8) { min-width: 8ch; }
.admin-dashboard #appointments-table :is(th, td):nth-child(10) { min-width: 10ch; }
.admin-dashboard #appointments-table :is(th, td):nth-child(11) { min-width: 7ch; }
.admin-dashboard #appointments-table td:nth-child(11) button { white-space: nowrap; }
.admin-dashboard #stylists-table { min-width: 980px; }
.admin-dashboard #stylists-table :is(th, td):nth-child(1),
.admin-dashboard #stylists-table :is(th, td):nth-child(2),
.admin-dashboard #stylists-table :is(th, td):nth-child(3),
.admin-dashboard #stylists-table :is(th, td):nth-child(5),
.admin-dashboard #stylists-table :is(th, td):nth-child(6),
.admin-dashboard #stylists-table :is(th, td):nth-child(7),
.admin-dashboard #stylists-table :is(th, td):nth-child(8) { width: 1%; }
.admin-dashboard #stylists-table :is(th, td):nth-child(3),
.admin-dashboard #stylists-table :is(th, td):nth-child(6),
.admin-dashboard #stylists-table :is(th, td):nth-child(7) { white-space: nowrap; }
.admin-dashboard #stylists-table :is(th, td):nth-child(5) { min-width: 13ch; }
.admin-dashboard #stylists-table :is(th, td):nth-child(6) { min-width: 10ch; }
.admin-dashboard #stylists-table :is(th, td):nth-child(7) { min-width: 8ch; }
.admin-dashboard #stylists-table :is(th, td):nth-child(8) { min-width: 8ch; }
.admin-dashboard #stylists-table :is(th, td):nth-child(4) { min-width: 10ch; max-width: 22rem; overflow-wrap: anywhere; }
.admin-dashboard .stylist-name-line,
.admin-dashboard .stylist-appointments-line,
.admin-dashboard .stylist-availability-day,
.admin-dashboard .stylist-availability-time { display: block; white-space: nowrap; }
.admin-dashboard .stylist-name-cell .badge-approval { display: block; width: max-content; margin: 5px 0 0; }
.admin-dashboard .stylist-appointments-link { display: inline-block; margin-top: 4px; }
.admin-dashboard .stylist-actions-cell button { display: block; margin: 0; white-space: nowrap; }
.admin-dashboard .stylist-actions-cell button + button { margin-top: 6px; }
.admin-dashboard .stylist-availability-block + .stylist-availability-block { display: block; margin-top: 5px; }
.admin-dashboard .stylist-vacations { display: block; max-width: 22rem; white-space: normal; }
.admin-dashboard #customers-table { min-width: 900px; }
.admin-dashboard #customers-table :is(th, td):nth-child(4),
.admin-dashboard #customers-table :is(th, td):nth-child(7) { width: 1%; white-space: nowrap; }
.admin-dashboard #customers-table :is(th, td):nth-child(4) { min-width: 10ch; }
.admin-dashboard #customers-table :is(th, td):nth-child(7) { min-width: 10ch; }
.admin-dashboard #customers-table :is(th, td):nth-child(6) { min-width: 10ch; max-width: 18rem; overflow-wrap: anywhere; }
.admin-dashboard #customers-table .customer-email-cell { width: 18ch; max-width: 24ch; }
.admin-dashboard .customer-email,
.admin-dashboard .customer-email-part { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.admin-dashboard .appointments-search input { min-width: 0; }
.admin-dashboard .appointments-search-pills { flex-wrap: wrap; }
.admin-dashboard .appointments-search-pill { min-height: 44px; }
.admin-dashboard .services-sticky-panel { position: static; }
.admin-dashboard #services-menu-wrap { overflow: visible; flex: 0 0 auto; }
.admin-dashboard .services-header-row { flex-wrap: wrap; gap: 8px; }
.admin-dashboard .service-category-tile { min-height: 44px; }
.admin-dashboard .gc-filters > input, .admin-dashboard .gc-filters > select { width: auto; margin: 0; }
.admin-dashboard .gc-filters > #gc-f-search { flex: 1 1 370px !important; min-width: 370px !important; }
.admin-dashboard .gc-filters > #gc-f-phone { flex: 0 1 140px; width: 140px; min-width: 120px !important; }
.admin-dashboard .gc-filters > select { flex: 0 0 128px; width: 128px; min-width: 128px !important; }
.admin-dashboard .modal { padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.admin-dashboard .modal-content { width: min(100%, 640px); max-height: 100%; padding: 20px; overscroll-behavior: contain; scroll-padding: 56px 0 24px; }
.admin-dashboard .modal-close { position: sticky; top: 0; float: right; z-index: 2; width: 44px; height: 44px; margin: -8px -8px 0 4px; border: 1px solid #ddd; border-radius: 50%; background: #fff; color: #222; }
.admin-dashboard #modal-body > h3, .admin-dashboard #modal-body > h2 { padding-right: 44px; }
.admin-dashboard .dv-panel-overlay { inset: 0; z-index: 1200; }
.admin-dashboard .dv-panel { max-width: 100%; width: 420px; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.admin-dashboard .dv-panel-head { flex: 0 0 auto; }
.admin-dashboard .dv-panel-body { min-height: 0; overscroll-behavior: contain; }
.admin-dashboard .dv-panel-actions { flex-shrink: 0; }
.admin-dashboard .dv-panel-close, .admin-dashboard .dv-wl-del, .admin-dashboard .dv-icon-btn { min-width: 44px; min-height: 44px; flex-shrink: 0; }
.admin-dashboard .dv-panel-times > *, .admin-dashboard .dv-panel-row > div { min-width: 0; }
.admin-dashboard .dv-dropdown, .admin-dashboard .dv-popover { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.admin-dashboard .dv-check, .admin-dashboard .dv-choice-tile, .admin-dashboard .time-slot, .admin-dashboard .dv-combobox-opt { min-height: 44px; }
  .admin-dashboard .dv-create-service-card > div { min-width: 0; }
  .admin-dashboard .appt-service-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .admin-dashboard .appt-service-row > label:first-of-type { grid-column: 1 / -1; }
  .admin-dashboard .appt-remove-service { grid-column: 2; }
.admin-dashboard .dv-dur-input { min-height: 32px !important; }
.admin-dashboard .manage-category-row, .admin-dashboard .manage-category-actions { flex-wrap: wrap; }
.admin-dashboard .manage-category-edit-input { min-width: 0; }
.admin-dashboard #tvb .tvb-bar, .admin-dashboard #tvb .slide .top { flex-wrap: wrap; gap: 8px; }
.admin-dashboard #tvb .field { min-width: 0; max-width: 100%; }
.admin-dashboard #tvb button { min-height: 44px; }
.admin-dashboard #tvb input[type=checkbox] { display: inline-block; width: 20px; }
.admin-dashboard #tvb .media-del { width: 44px; height: 44px; }
.admin-dashboard #tvb .tvb-toast { max-width: calc(100vw - 24px); bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
.admin-dashboard #tvb-uprog { padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
@media (max-width: 1100px) {
  .admin-topbar .location-tabs-topbar { display: none; }
  .admin-dashboard .sidebar { position: fixed; z-index: 1300; top: var(--admin-header); bottom: 0; left: 0; right: auto; width: min(320px, 88vw); height: auto; flex-direction: column; align-items: stretch; justify-content: flex-start; padding-top: 8px; visibility: hidden; transform: translateX(-100%); }
  .admin-dashboard.nav-open .sidebar { visibility: visible; transform: none; }
  .admin-dashboard .location-menu { display: block; flex: 0 0 auto; padding: 8px 20px 12px; border-bottom: 1px solid #444; }
  .admin-dashboard .location-menu label { width: auto; margin: 0 0 5px; color: #eec160; font-size: 12px; font-weight: 700; }
  .admin-dashboard .location-menu select { width: 100%; margin: 0; border: 1px solid #666; background: #222; color: #fff; }
  .admin-dashboard .sidebar a { flex: 0 0 auto; height: auto; flex-direction: row; justify-content: flex-start; padding: 12px 20px; gap: 12px; }
  .admin-dashboard .sidebar a span { display: inline; }
  .admin-dashboard .sidebar a i { font-size: 20px; }
  .admin-dashboard .sidebar #logout-link { display: flex; border-top: 1px solid #444; margin-top: 8px; }
  #admin-nav-backdrop { position: fixed; inset: var(--admin-header) 0 0; border: 0; background: #0007; z-index: 1250; }
  .admin-dashboard .content { width: 100%; height: 100%; padding: 12px max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
}
@media (max-width: 900px) {
  .admin-dashboard .admin-data-table { display: block; min-width: 0; border: 0; background: transparent; }
  .admin-dashboard .admin-data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .admin-dashboard .admin-data-table tbody { display: grid; gap: 12px; }
  .admin-dashboard .admin-data-table tr { display: block; border: 1px solid #ddd; border-radius: 10px; background: #fff; padding: 8px 12px; }
  .admin-dashboard .admin-data-table td { display: grid; grid-template-columns: minmax(80px, 32%) minmax(0, 1fr); align-items: start; gap: 8px; border: 0; border-bottom: 1px solid #eee; padding: 8px 0; max-width: none !important; white-space: normal; }
  .admin-dashboard .admin-data-table td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: #666; }
  .admin-dashboard .admin-data-table td:last-child { border-bottom: 0; }
  .admin-dashboard .admin-data-table td[colspan] { display: block; padding: 12px 0; }
  .admin-dashboard .admin-data-table td[colspan]::before { content: none; }
  .admin-dashboard .admin-data-table td .cell-value { min-width: 0; overflow-wrap: anywhere; word-break: normal; }
  .admin-dashboard .stylist-name-line,
  .admin-dashboard .stylist-appointments-line,
  .admin-dashboard .stylist-availability-day,
  .admin-dashboard .stylist-availability-time,
  .admin-dashboard .customer-email-part { white-space: normal; }
  .admin-dashboard .customer-email-part { overflow-wrap: anywhere; word-break: break-word; }
  .admin-dashboard .stylist-actions-cell button { display: inline-flex; margin: 3px; }
  .admin-dashboard .stylist-actions-cell button + button { margin-top: 3px; }
  .admin-dashboard .gc-filters > #gc-f-search { flex: 1 1 100% !important; min-width: min(100%, 370px) !important; }
  .admin-dashboard .gc-filters > #gc-f-phone,
  .admin-dashboard .gc-filters > select { flex: 1 1 128px; width: auto; min-width: 0 !important; }
  .admin-dashboard .screen > div:first-child > div { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .admin-topbar { gap: 10px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  #admin-current-screen { font-size: 12px; }
  .admin-brand { font-size: 14px; gap: 6px; }
  .admin-brand img { width: 30px; height: 30px; }
  #admin-menu-toggle { padding: 8px; font-size: 14px; }
  .admin-dashboard #calendar-toolbar { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .admin-dashboard .cal-day-nav { gap: 4px; }
  .admin-dashboard .cal-day-nav button { padding: 6px 10px; }
  .admin-dashboard .cal-view-toggle { width: 100%; }
  .admin-dashboard .cal-view-btn { flex: 1; padding: 7px 5px; }
  .admin-dashboard .cal-stylist-filter { min-width: 0; }
  .admin-dashboard .cal-stylist-label { display: none; }
  .admin-dashboard .cal-stylist-select { min-width: 0; width: 100%; padding: 6px; }
  .admin-dashboard .cal-extra-tools, .admin-dashboard .cal-day-tools { gap: 4px; }
  .admin-dashboard .cal-tool-btn { flex: 1; padding: 6px 8px; }
  .admin-dashboard #add-appt-btn-calendar { grid-column: 1 / -1; width: 100%; margin: 0; }
  .admin-dashboard .dv-touch-hint { text-align: left; font-size: 12px; }
  .admin-dashboard .appointments-search-pills { padding-left: 0; gap: 4px; }
  .admin-dashboard .appointments-search-pill { flex: 1; padding: 6px; }
  .admin-dashboard .services-categories-left { min-width: 0; }
  .admin-dashboard #service-categories-list { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding: 3px; }
  .admin-dashboard .service-category-tile { flex-shrink: 0; max-width: 240px; }
  .admin-dashboard .svc-row { padding: 12px; gap: 8px; }
  .admin-dashboard .svc-row-price { white-space: normal; max-width: 35%; padding-left: 0; }
  .admin-dashboard .modal { padding: 0; }
  .admin-dashboard .modal-content { max-width: none; width: 100%; height: 100%; max-height: 100%; border-radius: 0; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .admin-dashboard .dv-panel { width: 100%; }
  .admin-dashboard .dv-panel-head, .admin-dashboard .dv-panel-body, .admin-dashboard .dv-panel-actions { padding: 12px 16px; }
  .admin-dashboard .tier-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px; border: 1px solid #ddd; border-radius: 8px; background: #fff; }
  .admin-dashboard .tiers-head { display: none; }
  .admin-dashboard .tier-row .tier-remove { min-height: 44px; justify-self: end; width: 44px; }
  .admin-dashboard .time-inputs { flex-wrap: wrap; }
  .admin-dashboard .time-inputs > * { min-width: 0; flex: 1 1 100px; }
  .admin-dashboard #tvb-main, .admin-dashboard #tvb-monitor { padding: 12px; }
  .admin-dashboard #tvb .tvb-bar, .admin-dashboard #tvb .card, .admin-dashboard #tvb .slide { padding: 12px; }
  .admin-dashboard #tvb .grid2 { grid-template-columns: minmax(0, 1fr); }
  .admin-dashboard #tvb .field { flex: 1 1 100%; }
  .admin-dashboard #tvb .tvb-bar select { width: 100%; }
  .admin-dashboard #tvb .tvb-sp { display: none; }
}
/* The same input, safe-area and dialog rules apply to both stylist entry points. */
.stylist-portal input, .stylist-portal select, .stylist-calendar input, .stylist-calendar select { font-size: 16px; min-width: 0; max-width: 100%; min-height: 44px; }
.stylist-portal button, .stylist-calendar button { min-height: 44px; }
.stylist-calendar .close { min-width: 44px; flex-shrink: 0; }
.stylist-calendar .modal { padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px)); }
.stylist-calendar .modal-card { max-height: 100%; overscroll-behavior: contain; }
.stylist-calendar #pinGate { overflow-y: auto; }
.stylist-calendar #pinGate > * { margin: auto; max-width: 100%; }
.stylist-calendar .actions { flex-wrap: wrap; }
.stylist-calendar .mobile-date-jump { display: block; position: relative; }
.stylist-calendar .mobile-date-jump button { min-width: 88px; border-radius: 7px; }
.stylist-calendar .mobile-date-jump input {
  /* Laid invisibly over the "View Date" button so the tap lands on the input
     itself: iOS Safari only opens a date picker from a real tap on the field
     (a 1px pointer-events:none input + showPicker() did nothing on iPhone). */
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; min-height: 0; max-width: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: transparent;
  opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; font-size: 16px;
}
.stylist-calendar .mobile-date-jump input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.stylist-calendar .calendar-options input[type=checkbox] { width: 18px; height: 18px; min-height: 18px; margin: 0; }
@media (max-width: 700px) {
  .stylist-portal { padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px)); }
  .stylist-portal .card { padding: 14px; }
  .stylist-portal .row > div { min-width: 0; }
  .stylist-calendar .page { padding: max(10px, env(safe-area-inset-top, 0px)) 10px max(12px, env(safe-area-inset-bottom, 0px)); }
  .stylist-calendar .hint { margin-bottom: 6px; }
  .stylist-calendar #stylistActions { margin-bottom: 6px; }
  .stylist-calendar .salon-schedule-button { display: none; }
  .stylist-calendar .toolbar { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px; }
  .stylist-calendar .toolbar .nav { justify-content: flex-start; width: 100%; }
  .stylist-calendar .toolbar .views { justify-content: center; }
  .stylist-calendar .toolbar #calendarTitle { grid-column: auto; grid-row: 1; }
  .stylist-calendar .toolbar .views button { flex: 1; }
  .stylist-calendar .mobile-date-jump { margin-left: auto; }
  .stylist-calendar .calendar-options { gap: 2px 8px; padding: 1px 8px; line-height: 1.15; }
  .stylist-calendar .calendar-options label { margin: 0; }
  .stylist-calendar #calendar { padding-top: 3px; }
  .stylist-calendar .modal { padding: 0; }
  .stylist-calendar .modal-card { width: 100%; height: 100%; border-radius: 0; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.admin-dashboard .cp-panel { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.admin-dashboard .modal, .admin-dashboard .dv-panel-overlay, .admin-dashboard .cp-overlay, .stylist-calendar .modal {
  top: var(--admin-visible-top, 0px); bottom: auto;
  height: var(--admin-visible-height, 100dvh);
}
body.admin-dialog-open { overflow: hidden; }
.admin-dashboard.admin-dialog-open .content { overflow: hidden; }
@media (max-width: 700px) {
  .stylist-calendar .actions { position: static; margin: 16px 0 0; padding: 12px 0 0; }
}
.admin-dashboard #tvb-monitor .mon-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
@media (max-width: 600px) {
  .admin-dashboard input.cal-date-field { font-size: 16px; padding-left: 6px; padding-right: 6px; }
  .admin-dashboard .flatpickr-calendar { max-width: calc(100vw - 16px); }
}
.admin-dashboard button { min-height: 44px; }
.admin-dashboard td button { min-width: 44px; padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; background: #fff; font: inherit; cursor: pointer; }
.admin-dashboard textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; min-height: 88px; resize: vertical; }
.admin-dashboard .tier-field { margin: 0; min-width: 0; }
.admin-dashboard .tier-field > span { display: none; }
.admin-dashboard #tvb .media-cell { height: 144px; }
.admin-dashboard #tvb .media-cell .prev { height: 100px; }
.admin-dashboard #tvb .media-move { position: absolute; bottom: 0; left: 0; right: 0; display: flex; }
.admin-dashboard #tvb .media-move button { flex: 1; border-radius: 0; padding: 4px; }
.admin-dashboard #tvb button:disabled { opacity: .45; cursor: default; }
@media (max-width: 700px) {
  .admin-dashboard .services-categories-left { width: 100%; flex-direction: column; }
  .admin-dashboard #service-categories-list { width: 100%; flex: 0 0 auto; }
}
@media (max-width: 600px) {
  .admin-dashboard .tier-field > span { display: block; margin-bottom: 4px; color: #555; font-size: 13px; }
  .admin-dashboard .tier-name-field { grid-column: 1 / -1; }
}
.admin-dashboard #cal-prev, .admin-dashboard #cal-next, .admin-dashboard #category-toggle { min-width: 44px; }
.admin-dashboard #tvb .card { text-align: left; }
.admin-dashboard #tvb .field label { margin: 0 0 6px; }
.admin-dashboard #tvb .field input, .admin-dashboard #tvb .field select { margin: 0; }
.admin-dashboard #tvb .row { row-gap: 12px; }

.admin-dashboard .dv-panel-head, .admin-dashboard .dv-panel-body, .admin-dashboard .dv-panel-actions {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.stylist-portal, .stylist-calendar .page {
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
}
.admin-dashboard .admin-contact-link { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; color: #73530f; text-decoration: underline; }
.first-session-done { display: none !important; }

/* Calendar toolbar — same layout in Day / Week / Month (index.php markup):
   left group = arrows + Today (+ Waitlist / settings in Day), pinned to the
   calendar's left edge; right group = date (Day) or range title (Week/Month),
   Day/Week/Month, Stylist, Filters, + Add Appointment. The right group is the
   same in every view, so the view toggle doesn't move, and it wraps as one unit
   (keeping + Add at its right end) when the row runs out of room. FullCalendar's
   own header row is replaced by these controls (calendar-day.js setMode). */
.admin-dashboard #calendar .fc-header-toolbar { display: none !important; }
.admin-dashboard #calendar-toolbar { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.admin-dashboard .cal-toolbar-left,
.admin-dashboard .cal-toolbar-right { display: flex; align-items: center; gap: 8px; }
.admin-dashboard .cal-toolbar-left { flex: 0 0 auto; }
.admin-dashboard .cal-toolbar-right { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.admin-dashboard .cal-day-tools { display: inline-flex; align-items: center; gap: 8px; }
.admin-dashboard input.cal-date-field { min-width: 0; flex: 0 0 auto; }
.admin-dashboard #calendar-toolbar.cal-toolbar-fc .cal-date-field { display: none; }
.admin-dashboard .cal-range-title { margin: 0 4px 0 0; font-size: 1.15rem; font-weight: 700; line-height: 1.2; white-space: nowrap; }
/* Laptop / tablet widths: trim redundant labels so Day fits on one row. */
@media (max-width: 1400px) {
  .admin-dashboard .cal-stylist-label { display: none; }
  .admin-dashboard #cal-waitlist-btn .cal-btn-text { display: none; }
  .admin-dashboard .cal-view-btn { padding-left: 12px; padding-right: 12px; }
}
/* Phones: the two groups dissolve into the existing two-column grid. */
@media (max-width: 600px) {
  .admin-dashboard .cal-toolbar-left,
  .admin-dashboard .cal-toolbar-right { display: contents; }
  .admin-dashboard .cal-day-nav { order: 1; grid-column: 1 / 2; }
  .admin-dashboard input.cal-date-field,
  .admin-dashboard .cal-range-title { order: 2; grid-column: 2 / 3; align-self: center; }
  .admin-dashboard input.cal-date-field { width: 100% !important; }
  .admin-dashboard .cal-range-title { font-size: 1rem; white-space: normal; }
  .admin-dashboard .cal-view-toggle { order: 3; }
  .admin-dashboard .cal-stylist-filter { order: 4; }
  .admin-dashboard .cal-extra-tools { order: 5; grid-column: 1 / -1; }
  .admin-dashboard #calendar-toolbar:not(.cal-toolbar-fc) .cal-extra-tools { grid-column: 1 / 2; }
  .admin-dashboard .cal-day-tools { order: 6; grid-column: 2 / 3; }
  .admin-dashboard .cal-day-tools .cal-tool-btn { flex: 1; }
  .admin-dashboard #cal-waitlist-btn .cal-btn-text { display: inline; }
  .admin-dashboard #add-appt-btn-calendar { order: 7; }
}
