:root {
  --brand: #8617e7;
  --brand-pressed: #6700b8;
  --header: #360e69;
  --accent: #ffff6e;
  --bg: #f5f4f8;
  --panel: #ffffff;
  --border: #e3e0ea;
  --text: #1b1430;
  --muted: #6b6580;
  --ok: #1f9d55;
  --warn: #b7791f;
  --danger: #d23b3b;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a {
  color: var(--brand);
  text-decoration: none;
}

.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--header);
  color: #fff;
  padding: 18px 14px;
}

.sidebar .brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.sidebar nav a {
  display: block;
  color: #d9d2ec;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: var(--radius);
  margin-bottom: 4px;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar nav a.active {
  background: var(--brand);
  color: #fff;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.content {
  padding: 24px;
  min-width: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  max-width: 100%;
  overflow-x: auto;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 16px;
}

h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
}

table.data th,
table.data td {
  text-align: left;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

table.data th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}

.btn:hover {
  background: var(--brand-pressed);
}

.btn[aria-disabled="true"] {
  opacity: 0.65;
  pointer-events: none;
}

.btn.secondary {
  background: #efedf4;
  color: var(--text);
}

.btn.danger {
  background: var(--danger);
}

.btn.small {
  min-height: 40px;
  padding: 6px 10px;
  font-size: 12px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
}

.chip {
  display: inline-block;
  background: #efedf4;
  color: var(--text);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  margin: 2px 2px 2px 0;
}

.chip.ok {
  background: #e3f5ea;
  color: var(--ok);
}

.chip.off {
  background: #fbe7e7;
  color: var(--danger);
}

form.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.error {
  background: #fbe7e7;
  color: var(--danger);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.kpi .num {
  font-size: 28px;
  font-weight: 700;
}

.kpi .lbl {
  color: var(--muted);
  font-size: 12px;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--header);
}

.login-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 30px;
  width: 340px;
}

.login-card .brand {
  font-weight: 700;
  font-size: 22px;
  color: var(--brand);
  margin-bottom: 18px;
  text-align: center;
}

.permlist {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.navgroup {
  margin: 16px 0 4px;
  padding: 0 12px;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #b6abd6;
}

.formgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.formgrid input {
  width: auto;
  min-width: 140px;
}

.formgrid > label:not(.check) {
  flex: 1 1 160px;
  min-width: 140px;
  margin: 0;
}

.formgrid > label:not(.check) input,
.formgrid > label:not(.check) select {
  width: 100%;
  min-width: 0;
  margin-top: 4px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.permission-grid .check {
  align-items: flex-start;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}

.permission-grid small {
  color: var(--muted);
}

.role-permissions {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
}

.role-permissions summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
}

.compact-field {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.compact-field input,
.compact-field select {
  width: 100%;
  min-width: 0;
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

label.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

label.check input {
  width: auto;
}

.room-formgrid {
  align-items: end;
}

.room-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.room-field span,
.room-create-status > span:first-child,
.room-capacity-fields span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.room-field input {
  width: 100%;
  min-width: 0;
}

.room-field-main {
  flex: 1 1 220px;
}

.room-field-secondary,
.room-field-notes {
  flex: 1 1 180px;
}

.room-field-capacity,
.room-field-order,
.room-create-status {
  flex: 0 1 140px;
}

.room-create-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-settings-table td {
  vertical-align: top;
}

.room-name-cell {
  min-width: 220px;
}

.room-name-cell strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.room-code {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.room-capacity-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 8px;
  min-width: 168px;
}

.room-capacity-fields label {
  margin: 0;
}

.room-capacity-fields input {
  min-width: 0;
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.room-empty {
  max-width: 520px;
  padding: 32px 0;
}

.room-empty h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.room-empty p {
  margin: 0;
  color: var(--muted);
}

table.data input {
  width: 100%;
  padding: 5px 7px;
  font-size: 13px;
}

table.data input[type="checkbox"] {
  width: 40px;
  height: 40px;
  min-height: 40px;
}

.warehouse-photo-cell {
  min-width: 150px;
  display: grid;
  gap: 6px;
  align-items: start;
}

.product-photo-preview {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.product-photo-preview img,
.product-photo-trigger img,
.l-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-empty {
  color: var(--muted);
  font-size: 13px;
}

.warehouse-photo-cell small {
  color: var(--muted);
  line-height: 1.35;
}

.file-field {
  display: grid;
  gap: 4px;
}

.file-control {
  position: relative;
  min-height: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 6px;
  color: var(--text);
}

.file-control input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 6px;
  background: #efedf4;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-field-compact {
  margin: 0;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

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

.booking-page {
  display: grid;
  gap: 16px;
}

.booking-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.booking-header h1 {
  margin-bottom: 6px;
}

.booking-header p,
.booking-helper,
.booking-empty-note span,
.booking-panel-list dt {
  color: var(--muted);
}

.booking-header p,
.booking-helper {
  margin: 0;
  line-height: 1.5;
}

.booking-primary {
  flex: 0 0 auto;
}

.booking-controls {
  display: grid;
  gap: 12px;
}

.booking-date-nav,
.booking-filter,
.booking-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.booking-filter label {
  margin: 0;
}

.booking-filter input,
.booking-filter select {
  min-width: 150px;
}

.booking-cancelled-filter {
  min-height: 38px;
}

.booking-legend-item {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.booking-calendar {
  overflow-x: auto;
}

.booking-grid {
  display: grid;
  min-width: max-content;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.booking-grid-head,
.booking-time-cell {
  min-height: 52px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  padding: 8px;
}

.booking-grid-head {
  display: grid;
  align-content: center;
  gap: 2px;
  font-size: 12px;
}

.booking-grid-head strong {
  font-size: 14px;
  line-height: 1.2;
}

.booking-grid-head span,
.booking-grid-head em {
  color: var(--muted);
  font-style: normal;
}

.booking-time-cell {
  width: 68px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.booking-time-head {
  width: 68px;
}

.booking-slot {
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  border: 1px solid;
  border-width: 0 1px 1px 0;
  border-radius: 0;
  padding: 7px 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.booking-slot strong {
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.booking-slot span {
  font-size: 12px;
  line-height: 1.3;
}

.booking-slot:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.booking-slot.is-selectable {
  cursor: pointer;
}

.booking-slot.is-booking {
  text-decoration: none;
}

.booking-slot.is-selectable:hover,
.booking-slot.is-selectable:focus,
.booking-slot.is-booking:hover,
.booking-slot.is-booking:focus {
  border-color: #8617e7;
  outline: 2px solid rgba(134, 23, 231, 0.18);
  outline-offset: -2px;
}

.booking-slot.is-conflict {
  border-color: #d23b3b;
  outline: 2px solid rgba(210, 59, 59, 0.22);
  outline-offset: -2px;
}

.slot-label {
  font-weight: 600;
}

.slot-money {
  display: inline-block;
  width: fit-content;
  background: #ffff6e;
  color: #1b1430;
  border-radius: 4px;
  padding: 1px 5px;
}

.status-free {
  background: #ffffff;
  border-color: #e3e0ea;
  color: #1b1430;
}

.status-draft {
  background: #fff4ce;
  border-color: #b7791f;
  color: #1b1430;
}

.status-prepaid {
  background: #dff6fb;
  border-color: #10a7c9;
  color: #1b1430;
}

.status-paid,
.status-completed {
  background: #e3f5ea;
  border-color: #1f9d55;
  color: #1b1430;
}

.status-cleaning,
.status-disabled {
  background: #efedf4;
  border-color: #6b6580;
  color: #1b1430;
}

.status-cancelled,
.status-conflict {
  background: #fbe7e7;
  border-color: #d23b3b;
  color: #1b1430;
}

.booking-panel {
  width: 360px;
  min-width: 0;
}

.booking-panel h2,
.booking-no-rooms h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.booking-panel-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.booking-panel-list div {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.booking-panel-list dt,
.booking-panel-list dd {
  margin: 0;
}

.success {
  background: #e3f5ea;
  color: var(--ok);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
}

.booking-summary-strip {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  background: #ffff6e;
  border: 1px solid #e8e05b;
  border-radius: var(--radius);
  padding: 10px;
  color: #1b1430;
  font-size: 13px;
}

.booking-policy-warning,
.booking-search-warning,
.booking-family-empty {
  border: 1px solid #b7791f;
  border-radius: var(--radius);
  background: #fff4ce;
  color: #1b1430;
  padding: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.booking-policy-warning.is-required {
  border-color: #d23b3b;
  background: #fbe7e7;
}

.booking-crm-search,
.booking-family-results,
.booking-family-summary,
.booking-inline-create {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.booking-crm-search {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.booking-crm-search label,
.booking-inline-create label {
  margin: 0;
}

.booking-family-result {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  color: var(--text);
}

.booking-family-result:hover,
.booking-family-result:focus {
  border-color: #8617e7;
  outline: 2px solid rgba(134, 23, 231, 0.18);
  outline-offset: -2px;
}

.booking-family-result span,
.booking-family-summary span,
.booking-family-summary small,
.booking-snapshot-fields span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.booking-family-summary {
  border: 1px solid #1f9d55;
  border-radius: var(--radius);
  background: #e3f5ea;
  padding: 10px;
}

.booking-child-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.booking-child-chips input {
  width: auto;
  margin-right: 4px;
}

.booking-inline-create h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.booking-snapshot-fields {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.booking-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.booking-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.booking-form label {
  margin: 0;
}

.booking-save {
  width: 100%;
  min-height: 44px;
}

.booking-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.booking-history {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.booking-history h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.booking-history-list {
  display: grid;
  gap: 8px;
}

.booking-history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  font-size: 12px;
}

.booking-history-row span {
  color: var(--muted);
}

.booking-history-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text);
}

.booking-history-empty {
  margin: 0;
  color: var(--muted);
}

.booking-empty-note,
.booking-no-rooms {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.booking-empty-note {
  display: grid;
  gap: 4px;
}

.booking-no-rooms {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.booking-no-rooms p {
  margin: 0;
  color: var(--muted);
}

/* ----- Daily reports ----- */

.report-page {
  display: grid;
  gap: 16px;
}

.report-header-panel {
  display: grid;
  gap: 16px;
}

.report-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.report-title-row h1 {
  margin-bottom: 6px;
}

.report-muted {
  margin: 0;
  color: var(--muted);
}

.report-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.report-state-row {
  display: grid;
  gap: 8px;
}

.report-controls label {
  margin: 0;
}

.report-controls input,
.report-controls select {
  min-width: 150px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border: 1px solid #6b6580;
  border-radius: var(--radius);
  background: #efedf4;
  color: #6b6580;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.4;
}

.status-chip.ok {
  border-color: #1f9d55;
  background: #e3f5ea;
  color: #1f9d55;
}

.status-chip.warning {
  border-color: #b7791f;
  background: #fff4ce;
  color: #b7791f;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.report-summary .kpi .num {
  font-size: 20px;
  font-weight: 600;
}

.report-total {
  background: var(--accent);
}

.report-table td {
  vertical-align: top;
}

.report-table .is-aggregate td {
  font-weight: 600;
}

.report-comment {
  min-width: 180px;
  white-space: normal;
}

.report-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.report-bookings-panel {
  grid-column: 1 / -1;
}

.report-empty {
  display: grid;
  gap: 8px;
  padding-top: 32px;
  padding-bottom: 32px;
}

.report-empty h2 {
  margin: 0;
}

.report-empty p {
  margin: 0;
  color: var(--muted);
}

.finance-page {
  display: grid;
  gap: 16px;
}

.finance-summary {
  margin-bottom: 0;
}

.finance-state-stack {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.finance-state-stack p {
  max-width: 260px;
  margin: 0;
  text-align: right;
}

.finance-profit {
  border-color: #1f9d55;
}

.finance-dashboard-grid,
.finance-due-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.finance-due-grid {
  margin-bottom: 14px;
}

.finance-due-grid div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.finance-due-grid strong,
.finance-due-grid span {
  display: block;
}

.finance-due-grid span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.finance-formgrid select,
.finance-formgrid input {
  flex: 1 1 160px;
  min-width: 160px;
}

.finance-formgrid .compact-field {
  flex: 1 1 160px;
  min-width: 160px;
}

.finance-view-only {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.finance-view-only p {
  margin: 0;
}

.finance-table td {
  vertical-align: top;
}

.finance-inline-form {
  margin: 0;
}

.finance-result {
  border-color: var(--ok);
}

.finance-error {
  border-color: var(--danger);
}

/* ----- Payroll admin ----- */

.payroll-page {
  display: grid;
  gap: 16px;
}

.payroll-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
}

.payroll-header h1 {
  margin-bottom: 6px;
}

.payroll-summary {
  margin-bottom: 0;
}

.payroll-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.payroll-panel {
  margin-bottom: 0;
}

.payroll-formgrid {
  margin-bottom: 14px;
}

.payroll-formgrid select,
.payroll-formgrid input {
  flex: 1 1 180px;
  min-width: 180px;
}

.payroll-formgrid .compact-field {
  flex: 1 1 180px;
  min-width: 180px;
}

.payroll-run-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payroll-run-form label {
  margin: 0;
}

.payroll-run-form .payroll-wide,
.payroll-run-form .btn {
  grid-column: 1 / -1;
}

.payroll-table td {
  vertical-align: top;
}

.payroll-table td span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.payroll-inline-form,
.payroll-adjustment-list,
.payroll-actions,
.payroll-adjustment-form {
  display: grid;
  gap: 8px;
}

.payroll-inline-form {
  min-width: 220px;
}

.payroll-inline-form .compact-field,
.payroll-adjustment-form .compact-field {
  min-width: 0;
}

.payroll-inline-form .check {
  width: fit-content;
}

.payroll-adjustment-list strong {
  color: var(--text);
}

.payroll-adjustment-row {
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

.payroll-adjustment-row em {
  color: var(--text);
  font-style: normal;
  font-weight: 600;
}

.payroll-actions {
  min-width: 220px;
}

.payroll-adjustment-form {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* ----- Phase 6 dashboard ----- */

.dashboard-page {
  display: grid;
  gap: 16px;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-header h1 {
  margin-bottom: 6px;
}

.dashboard-subtitle,
.dashboard-loading-state,
.dashboard-empty,
.dashboard-table td span {
  color: var(--muted);
}

.dashboard-subtitle,
.dashboard-loading-state,
.dashboard-empty {
  margin: 0;
  line-height: 1.5;
}

.dashboard-actions {
  flex: 0 0 auto;
}

.dashboard-kpis .dashboard-kpi .num {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.dashboard-kpi a {
  min-height: 44px;
  display: grid;
  align-content: center;
  color: inherit;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}

.dashboard-left {
  display: grid;
  gap: 16px;
}

.dashboard-panel {
  margin-bottom: 0;
}

.dashboard-table td {
  vertical-align: top;
}

.dashboard-notifications {
  margin-bottom: 0;
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  color: var(--text);
}

.notification-row strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.notification-row span:not(.chip) {
  grid-column: 2 / -1;
  color: var(--muted);
  line-height: 1.4;
}

.notification-row time {
  color: var(--muted);
  font-size: 12px;
}

.notification-row.is-error {
  border-color: #d23b3b;
  background: #fbe7e7;
}

.notification-row.is-warning {
  border-color: #b7791f;
  background: #fff4ce;
}

.notification-row.is-info {
  border-color: #10a7c9;
  background: #dff6fb;
}

.notification-row.is-ok {
  border-color: #1f9d55;
  background: #e3f5ea;
}

.chip.warning {
  background: #fff4ce;
  color: #b7791f;
}

.chip.info {
  background: #dff6fb;
  color: #10a7c9;
}

.chip.error {
  background: #fbe7e7;
  color: #d23b3b;
}

.chip.neutral {
  background: #efedf4;
  color: #6b6580;
}

/* ----- Admin clients CRM ----- */

.clients-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.clients-header h1 {
  margin-bottom: 4px;
}

.clients-header p {
  margin: 0;
  color: var(--muted);
}

.clients-search-panel,
.clients-list-panel,
.clients-create-panel {
  overflow-x: auto;
}

.clients-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}

.clients-detail-layout > div {
  min-width: 0;
}

.clients-side {
  position: sticky;
  top: 20px;
}

.clients-side form {
  margin-top: 12px;
}

.clients-attention {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #b7791f;
  border-radius: var(--radius);
  background: #fff4ce;
  color: #6f4a10;
  font-weight: 600;
}

.clients-birthday-list {
  display: grid;
  gap: 8px;
}

.clients-birthday-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.clients-birthday-list span,
.clients-muted {
  color: var(--muted);
}

.clients-whatsapp-link,
.birthday-whatsapp-link {
  width: fit-content;
}

.clients-whatsapp-disabled,
.birthday-whatsapp-disabled {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  border: 1px solid #b7791f;
  border-radius: var(--radius);
  background: #fff4ce;
  padding: 8px;
}

.clients-whatsapp-disabled span,
.birthday-whatsapp-disabled span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.child-row {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ----- Admin birthday calendar ----- */

.birthdays-page {
  display: grid;
  gap: 16px;
}

.birthdays-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.birthdays-header h1 {
  margin-bottom: 4px;
}

.birthdays-header p,
.birthdays-empty,
.birthday-reminder-card dt,
.birthday-list-row span,
.birthday-child span {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.birthdays-controls {
  display: grid;
  gap: 12px;
}

.birthdays-month-nav,
.birthdays-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.birthdays-filter label {
  margin: 0;
}

.birthdays-filter input,
.birthdays-filter select {
  min-width: 150px;
}

.birthdays-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}

.birthdays-calendar {
  overflow-x: auto;
}

.birthdays-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(128px, 1fr));
  min-width: 760px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.birthdays-grid-head,
.birthday-day-cell {
  min-height: 52px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  background: #ffffff;
}

.birthdays-grid-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.birthday-day-cell {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 132px;
}

.birthday-day-cell.is-muted {
  background: #f5f4f8;
  color: var(--muted);
}

.birthday-date {
  font-weight: 600;
  line-height: 1.2;
}

.birthday-child-list,
.birthday-day-list,
.birthday-reminder-list,
.birthday-reminder-form,
.birthday-delete-form {
  display: grid;
  gap: 8px;
}

.birthday-child,
.birthday-list-row,
.birthday-reminder-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  background: #ffffff;
}

.birthday-child strong,
.birthday-list-row strong,
.birthday-reminder-card strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.birthday-day-list {
  display: none;
}

.birthday-day-group h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.birthdays-side {
  width: 360px;
  min-width: 0;
  position: sticky;
  top: 20px;
}

.birthday-reminder-card {
  background: #ffffff;
}

.birthday-reminder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.birthday-reminder-card dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.birthday-reminder-card dl div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
}

.birthday-reminder-card dt,
.birthday-reminder-card dd {
  margin: 0;
}

.birthday-reminder-form {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.birthday-reminder-form label {
  margin: 0;
}

.birthday-reminder-form textarea {
  resize: vertical;
}

.birthday-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.birthday-delete-form {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.birthday-delete-form p {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

.desktop-empty {
  margin-top: 12px;
}

/* ----- Admin offline queue ----- */

.offline-admin-page {
  display: grid;
  gap: 16px;
}

.offline-admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.offline-admin-header h1 {
  margin-bottom: 6px;
}

.offline-admin-muted,
.offline-admin-empty,
.offline-admin-key,
.offline-admin-no-action,
.offline-admin-action-form label span,
.offline-admin-destructive-copy {
  color: var(--muted);
}

.offline-admin-muted,
.offline-admin-empty,
.offline-admin-destructive-copy {
  margin: 0;
  line-height: 1.5;
}

.offline-admin-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 12px;
}

.offline-admin-counter {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}

.offline-admin-counter strong {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.offline-admin-counter span {
  font-size: 12px;
  line-height: 1.4;
}

.offline-admin-counter.is-ok {
  border-color: #1f9d55;
  background: #e3f5ea;
}

.offline-admin-counter.is-warning {
  border-color: #b7791f;
  background: #fff4ce;
}

.offline-admin-counter.is-info {
  border-color: #10a7c9;
  background: #dff6fb;
}

.offline-admin-counter.is-error {
  border-color: #d23b3b;
  background: #fbe7e7;
}

.offline-admin-panel {
  margin-bottom: 0;
}

.offline-admin-table td {
  vertical-align: top;
}

.offline-admin-key {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.offline-admin-error {
  min-width: 180px;
  white-space: normal;
}

.offline-admin-actions {
  min-width: 240px;
}

.offline-admin-actions,
.offline-admin-action-form {
  display: grid;
  gap: 8px;
}

.offline-admin-action-form {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.offline-admin-action-form label {
  margin: 0;
}

.offline-admin-action-form input {
  min-width: 220px;
}

.offline-admin-actions .btn {
  min-height: 44px;
  width: fit-content;
  white-space: normal;
}

.offline-admin-destructive-copy {
  font-size: 12px;
}

/* ----- Launch UAT checklist ----- */

.launch-page {
  display: grid;
  gap: 16px;
}

.launch-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.launch-header h1 {
  margin-bottom: 6px;
}

.launch-muted,
.launch-item-key,
.launch-signoff-grid span,
.launch-remove-signoff label span,
.launch-signoff-form label span,
.launch-destructive-copy {
  color: var(--muted);
}

.launch-muted,
.launch-destructive-copy,
.launch-signoff-summary p {
  margin: 0;
  line-height: 1.5;
}

.launch-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 12px;
}

.launch-counter {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}

.launch-counter strong {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.launch-counter span {
  font-size: 12px;
  line-height: 1.4;
}

.launch-counter.is-ok {
  border-color: #1f9d55;
  background: #e3f5ea;
}

.launch-counter.is-warning {
  border-color: #b7791f;
  background: #fff4ce;
}

.launch-counter.is-error {
  border-color: #d23b3b;
  background: #fbe7e7;
}

.launch-counter.is-neutral {
  border-color: #6b6580;
  background: #efedf4;
}

.launch-panel,
.launch-signoff {
  margin-bottom: 0;
}

.launch-table td {
  vertical-align: top;
}

.launch-item-key {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.launch-table select,
.launch-table input,
.launch-table textarea,
.launch-remove-signoff input,
.launch-remove-signoff textarea,
.launch-signoff-form textarea {
  width: 100%;
  min-width: 160px;
}

.launch-table textarea,
.launch-remove-signoff textarea,
.launch-signoff-form textarea {
  resize: vertical;
}

.launch-actions .btn {
  min-height: 44px;
  white-space: normal;
}

.launch-signoff,
.launch-signoff-summary,
.launch-remove-signoff,
.launch-signoff-form {
  display: grid;
  gap: 12px;
}

.launch-signoff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.launch-signoff-grid div {
  display: grid;
  gap: 4px;
}

.launch-notes ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.launch-remove-signoff,
.launch-signoff-form {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.launch-remove-signoff label,
.launch-signoff-form label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.launch-destructive-copy {
  font-size: 12px;
}

.launch-signoff .btn {
  width: fit-content;
  min-height: 44px;
}

/* ----- Backups ----- */

.backup-page {
  display: grid;
  gap: 16px;
}

.backup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.backup-header h1 {
  margin-bottom: 6px;
}

.backup-muted,
.backup-error-copy {
  color: var(--muted);
}

.backup-muted {
  margin: 0;
  line-height: 1.5;
}

.backup-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.backup-card .num {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.backup-path-card .num {
  font-size: 14px;
  font-weight: 400;
}

.backup-failure {
  display: flex;
  align-items: center;
  gap: 8px;
  border-color: #d23b3b;
  background: #fbe7e7;
  color: #1b1430;
}

.backup-table td {
  vertical-align: top;
}

.backup-path {
  min-width: 220px;
  overflow-wrap: anywhere;
}

.backup-error-copy {
  margin-top: 4px;
  color: #d23b3b;
}

.backup-row-error {
  background: #fbe7e7;
}

@media (max-width: 1080px) {
  .booking-layout {
    grid-template-columns: 1fr;
  }

  .booking-panel {
    width: 100%;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .booking-form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .app {
    display: block;
  }

  .sidebar {
    padding: 8px 14px;
  }

  .sidebar .brand {
    margin-bottom: 0;
  }

  .sidebar nav {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 0 6px;
  }

  .sidebar nav.is-open {
    display: grid;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .sidebar nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 0;
  }

  .btn,
  .btn.small,
  button,
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
  select {
    min-height: 44px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 22px;
    height: 22px;
  }

  .navgroup {
    grid-column: 1 / -1;
    margin-top: 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }

  .topbar .user {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }

  .topbar .user span {
    display: none;
  }

  .content {
    padding: 16px;
  }

  .panel {
    padding: 16px;
  }

  .formgrid {
    align-items: stretch;
  }

  .formgrid input {
    width: 100%;
    min-width: 0;
  }

  .formgrid > label:not(.check) {
    flex-basis: 100%;
    min-width: 0;
  }

  table.settings-table,
  table.settings-table tbody,
  table.settings-table tr,
  table.settings-table td {
    display: block;
    width: 100%;
  }

  table.settings-table thead {
    display: none;
  }

  table.settings-table tr {
    display: grid;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
  }

  table.settings-table td {
    display: grid;
    grid-template-columns: minmax(96px, 0.35fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 0;
    padding: 0;
  }

  table.settings-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
  }

  table.settings-table td.settings-actions {
    display: flex;
    flex-wrap: wrap;
    padding-top: 4px;
  }

  table.settings-table td.settings-actions::before {
    flex-basis: 100%;
  }

  table.responsive-data,
  table.responsive-data tbody,
  table.responsive-data tr,
  table.responsive-data td {
    display: block;
    width: 100%;
  }

  table.responsive-data thead {
    display: none;
  }

  table.responsive-data tr {
    display: grid;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
  }

  table.responsive-data td {
    display: grid;
    grid-template-columns: minmax(112px, 0.4fr) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    border: 0;
    padding: 0;
    overflow-wrap: anywhere;
  }

  table.responsive-data td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
  }

  table.responsive-data td details,
  table.responsive-data td form {
    min-width: 0;
    width: 100%;
  }

  .room-field,
  .room-field-main,
  .room-field-secondary,
  .room-field-notes,
  .room-field-capacity,
  .room-field-order,
  .room-create-status {
    flex-basis: 100%;
  }

  .room-capacity-fields {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .booking-header,
  .booking-filter,
  .booking-date-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .booking-primary,
  .booking-filter input,
  .booking-filter select,
  .booking-filter button {
    width: 100%;
  }

  .booking-calendar {
    padding: 10px;
  }

  .booking-page {
    gap: 12px;
  }

  .booking-header p {
    font-size: 12px;
  }

  .booking-layout {
    gap: 12px;
  }

  .booking-panel {
    width: 100%;
  }

  .booking-panel .panel {
    padding: 14px;
  }

  .booking-crm-search {
    grid-template-columns: 1fr;
  }

  .booking-inline-create,
  .booking-snapshot-fields,
  .booking-form-grid {
    gap: 8px;
  }

  .booking-panel-list div {
    grid-template-columns: 1fr;
  }

  .report-title-row,
  .report-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .report-controls input,
  .report-controls select,
  .report-controls .btn,
  .report-controls button {
    width: 100%;
  }

  .report-detail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .finance-dashboard-grid,
  .finance-due-grid {
    grid-template-columns: 1fr;
  }

  .finance-state-stack {
    justify-items: start;
  }

  .finance-state-stack p {
    max-width: none;
    text-align: left;
  }

  .finance-view-only {
    align-items: flex-start;
    flex-direction: column;
  }

  .payroll-header {
    align-items: stretch;
    flex-direction: column;
  }

  .payroll-grid,
  .payroll-run-form {
    grid-template-columns: 1fr;
  }

  .payroll-formgrid select,
  .payroll-formgrid input,
  .finance-formgrid .compact-field,
  .payroll-formgrid .compact-field,
  .payroll-run-form .btn {
    width: 100%;
    min-width: 0;
  }

  .dashboard-header {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-header {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-header .btn {
    width: 100%;
  }

  .backup-summary {
    grid-template-columns: 1fr;
  }

  .dashboard-page.has-blockers .dashboard-grid {
    display: contents;
  }

  .dashboard-page.has-blockers .dashboard-notifications {
    order: 1;
  }

  .dashboard-page.has-blockers .dashboard-kpis {
    order: 2;
  }

  .dashboard-page.has-blockers .dashboard-left {
    order: 3;
  }

  .dashboard-actions,
  .dashboard-actions .btn {
    width: 100%;
  }

  .notification-row {
    grid-template-columns: 1fr;
  }

  .notification-row span:not(.chip) {
    grid-column: auto;
  }

  .clients-header {
    align-items: stretch;
    flex-direction: column;
  }

  .clients-header .btn {
    width: 100%;
  }

  .clients-detail-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .clients-side {
    position: static;
  }

  .clients-birthday-list div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .birthdays-header,
  .birthdays-filter,
  .birthdays-month-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .birthdays-header .btn,
  .birthdays-filter input,
  .birthdays-filter select,
  .birthdays-filter button,
  .birthdays-month-nav .btn {
    width: 100%;
  }

  .birthdays-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .birthdays-side {
    position: static;
    width: 100%;
  }

  .birthdays-calendar-grid {
    display: none;
  }

  .birthday-day-list {
    display: grid;
  }

  .desktop-empty {
    display: none;
  }

  .birthday-reminder-card dl div {
    grid-template-columns: 1fr;
  }
}

/* ----- Cashier touch-first surface ----- */

body.cashier {
  background: var(--bg);
  font-size: 16px;
}

.cashier-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.cashier-bar {
  background: var(--header);
  color: #fff;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cashier-brand {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.5px;
}

.cashier-brand span {
  color: var(--accent);
  font-weight: 600;
  margin-left: 6px;
}

.cashier-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cashier-nav .tbtn {
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
}

.cashier-nav .active {
  background: var(--brand);
  color: #ffffff;
}

.cashier-id {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cashier-id .who {
  font-weight: 600;
}

.cashier-id .desk {
  background: var(--brand);
  border-radius: var(--radius);
  padding: 4px 12px;
  font-size: 14px;
}

.cashier-content {
  flex: 1;
  padding: 22px;
  min-width: 0;
}

.tbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border: none;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

.tbtn:hover {
  background: var(--brand-pressed);
}

.tbtn.primary {
  background: var(--brand);
}

.tbtn.ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.cashier-content .tbtn.ghost {
  background: #efedf4;
  color: var(--text);
}

.tbtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cashier-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 560px;
}

.cashier-error {
  background: #fbe7e7;
  color: var(--danger);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 15px;
}

.cashier-booking-card {
  max-width: 640px;
}

.cashier-booking-card h1 {
  margin-top: 0;
}

.cashier-booking-form {
  display: grid;
  gap: 16px;
}

.cashier-family-lookup,
.cashier-family-results,
.cashier-family-summary,
.cashier-minimal-family {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.cashier-family-lookup,
.cashier-minimal-family {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.cashier-family-lookup .tbtn,
.cashier-minimal-family .tbtn {
  width: fit-content;
}

.cashier-policy-warning,
.cashier-family-warning,
.cashier-family-empty {
  border: 1px solid #b7791f;
  border-radius: var(--radius);
  background: #fff4ce;
  color: #1b1430;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.4;
}

.cashier-policy-warning.is-required {
  border-color: #d23b3b;
  background: #fbe7e7;
}

.cashier-family-result {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
}

.cashier-family-result span,
.cashier-family-summary span,
.cashier-family-summary small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.cashier-family-summary {
  border: 1px solid #1f9d55;
  border-radius: var(--radius);
  background: #e3f5ea;
  padding: 14px;
}

.cashier-child-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cashier-child-chips input {
  width: auto;
  min-height: auto;
  margin-right: 4px;
}

.cashier-minimal-family h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.cashier-booking-form .fld span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.cashier-booking-form input,
.cashier-booking-form select,
.cashier-booking-form textarea {
  min-height: 50px;
  font-size: 17px;
}

.cashier-booking-form .tbtn {
  min-height: 52px;
}

.cashier-shift-gate {
  display: grid;
  gap: 8px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: #fff4ce;
  padding: 14px;
}

.cashier-shift-gate span {
  color: var(--muted);
  font-size: 14px;
}

.cashier-shift-gate .tbtn,
.booking-success .tbtn {
  width: fit-content;
}

.offline-queue-strip {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.offline-queue-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.offline-queue-main strong {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.offline-queue-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--ok);
}

.offline-queue-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 8px;
  background: #efedf4;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.offline-queue-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.offline-queue-details {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #efedf4;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.offline-queue-strip[data-offline-queue-status="offline"] {
  border-color: var(--warn);
  background: #fff4ce;
}

.offline-queue-strip[data-offline-queue-status="offline"] .offline-queue-dot,
.offline-queue-strip[data-offline-queue-status="syncing"] .offline-queue-dot {
  background: #b7791f;
}

.offline-queue-strip[data-offline-queue-status="offline"] .offline-queue-count,
.offline-queue-strip[data-offline-queue-status="conflict"] .offline-queue-count {
  background: var(--accent);
}

.offline-queue-strip[data-offline-queue-status="syncing"] {
  border-color: #10a7c9;
  background: #dff6fb;
}

.offline-queue-strip[data-offline-queue-status="conflict"] {
  border-color: var(--danger);
  background: #fbe7e7;
}

.offline-queue-strip[data-offline-queue-status="conflict"] .offline-queue-dot {
  background: var(--danger);
}

.booking-success {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.booking-success span {
  color: var(--text);
}

.shift-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shift-form .fld span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.shift-form input,
.shift-form select,
.shift-form textarea {
  min-height: 50px;
  font-size: 17px;
}

.shift-form .checks {
  display: grid;
  gap: 10px;
}

.tcheck {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 16px;
}

.tcheck input {
  width: 24px;
  height: 24px;
  min-height: 0;
}

.tcheck.warn {
  border-color: var(--warn);
}

.expected {
  font-size: 18px;
  margin-bottom: 16px;
}

.close-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.close-totals strong {
  color: var(--text);
}

.pos {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 22px;
  align-items: start;
}

.pos-tickets h2,
.pos-receipt h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.ticket-grid,
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.ticket-btn,
.product-btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 90px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  text-align: left;
}

.ticket-btn:hover,
.product-btn:hover {
  border-color: var(--brand);
}

.product-card {
  min-height: 92px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.product-card:hover {
  border-color: var(--brand);
}

.product-card .product-btn {
  min-height: 90px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.product-card .product-btn:hover {
  border-color: transparent;
}

.product-photo-trigger,
.product-photo-placeholder {
  width: 68px;
  min-height: 90px;
  border: 0;
  border-right: 1px solid var(--border);
  background: #ffffff;
}

.product-photo-trigger {
  padding: 0;
  cursor: zoom-in;
}

.product-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.ticket-btn .t-name,
.product-btn .t-name {
  font-weight: 600;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.ticket-btn .t-price,
.product-btn .t-price {
  color: var(--muted);
  font-size: 15px;
}

.product-grid {
  margin-bottom: 18px;
}

.family {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.family-search-row,
.family-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.family-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.family-actions #family-create-toggle {
  grid-column: 1 / -1;
}

.family-create-panel {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.family-create-panel[hidden] {
  display: none;
}

.family-create-panel h3 {
  margin: 0;
  font-size: 16px;
}

.family-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.family-create-grid .fld:first-child,
.family-create-grid .fld:nth-child(4) {
  grid-column: 1 / -1;
}

.family-create-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.family .fld {
  margin: 0;
}

.family .fld span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.family input {
  min-height: 50px;
  font-size: 17px;
}

.family-policy,
.family-search-warning {
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: #fff4ce;
  color: #1b1430;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
}

.family-results {
  display: grid;
  gap: 8px;
}

.family-result-row {
  min-height: 52px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.family-result-row:hover,
.family-result-row:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(134, 23, 231, 0.18);
  outline-offset: -2px;
}

.family-result-row strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.family-result-row span,
.family-result-row em,
.family-selected span,
.family-result-empty {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
}

.family-selected {
  display: grid;
  gap: 10px;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px 12px;
}

.family-selected > div:first-child {
  display: grid;
  gap: 3px;
}

.family-selected strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.family-child-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.family-child-chip {
  min-height: 34px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.family-child-chip.is-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.pos-error {
  margin-top: 14px;
  background: #fbe7e7;
  color: var(--danger);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 15px;
}

.pos-receipt {
  position: sticky;
  top: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.parked-receipts {
  display: grid;
  gap: 10px;
  padding: 12px 0 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.parked-count {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  place-items: center;
  margin-left: 4px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--text);
  font-size: 13px;
}

.parked-receipts-list {
  display: grid;
  gap: 8px;
}

.parked-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.parked-receipt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.parked-receipt-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.parked-receipt-details {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.parked-receipt-details strong,
.parked-receipt-details span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.parked-receipt-details strong {
  font-size: 14px;
}

.parked-receipt-details span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.parked-resume {
  min-height: 40px;
  padding-inline: 12px;
}

.receipt-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.receipt-line {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
}

.l-photo-slot {
  width: 38px;
  height: 38px;
  display: block;
}

.l-photo {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  cursor: zoom-in;
}

.receipt-line .l-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.receipt-line .l-qty {
  color: var(--muted);
}

.receipt-line .l-total {
  font-weight: 600;
}

.receipt-line .l-remove {
  width: 40px;
  min-height: 40px;
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(18, 13, 32, 0.72);
  cursor: zoom-out;
}

.photo-lightbox-dialog {
  position: relative;
  width: min(760px, 92vw);
  max-height: 88vh;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(16, 16, 28, 0.32);
}

.photo-lightbox-dialog img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  justify-self: center;
}

.photo-lightbox-image-slot {
  min-height: 160px;
  display: grid;
  place-items: center;
}

.photo-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--danger);
  cursor: pointer;
}

.photo-lightbox-dialog strong {
  font-size: 15px;
  line-height: 1.3;
}

.receipt-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 700;
}

.payment-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.mini-btn {
  min-height: 40px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius);
  background: #efedf4;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.mini-btn.danger {
  color: var(--danger);
}

.tender-rows {
  display: grid;
  gap: 8px;
}

.tender-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 0.6fr) 40px;
  gap: 8px;
  align-items: center;
}

.tender-cash,
.tender-reference {
  grid-column: 1 / 3;
}

.tender-row input,
.tender-row select {
  min-height: 42px;
  font-size: 15px;
}

.payment-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.payment-summary strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.payment-success {
  background: #e3f5ea;
  color: var(--ok);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
}

.receipt-loyalty {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.receipt-loyalty .family-search-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.settings-band {
  margin-bottom: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.settings-grid > form {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.loyalty-campaign-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.loyalty-campaign-row div {
  display: grid;
  gap: 4px;
}

.loyalty-campaign-row span {
  color: var(--muted);
}

.receipt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.receipt-actions #btn-pay {
  grid-column: 1 / -1;
}

.receipt-actions .refund-link {
  grid-column: 1 / -1;
}

.lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.refund-card {
  max-width: 760px;
}

.refund-summary {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.refund-summary h2 {
  margin: 0;
  font-size: 18px;
}

@media (max-width: 760px) {
  .cashier-bar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
  }

  .cashier-id {
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cashier-nav {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cashier-nav .tbtn {
    width: 100%;
  }

  .cashier-id .who {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .cashier-content {
    padding: 16px;
  }

  .pos {
    grid-template-columns: 1fr;
  }

  .pos-receipt {
    position: static;
  }

  .offline-queue-strip,
  .offline-queue-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .close-totals,
  .payment-summary,
  .family-search-row,
  .family-actions,
  .family-create-grid,
  .family-create-actions,
  .lookup-form,
  .tender-row {
    grid-template-columns: 1fr;
  }

  .tender-cash,
  .tender-reference {
    grid-column: auto;
  }

  .settings-grid,
  .receipt-loyalty .family-search-row {
    grid-template-columns: 1fr;
  }
}

.inventory-form .formgrid {
  grid-template-columns: minmax(180px, 2fr) minmax(180px, 1fr) minmax(180px, 1fr);
}

.inventory-table td:last-child,
.inventory-table th:last-child {
  width: 120px;
}

.inventory-table input[type="number"] {
  max-width: 104px;
}

.inventory-table tr[hidden] {
  display: none;
}

.inventory-draft-summary,
.inventory-progress {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.inventory-draft-summary span,
.inventory-progress span {
  color: var(--muted);
}

.inventory-progress {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.inventory-actions {
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .inventory-form .formgrid {
    grid-template-columns: 1fr;
  }

  .inventory-table input[type="number"] {
    max-width: 88px;
  }
}
