/* Usability layer: readable forms, clear actions and comfortable touch targets. */
:root {
  --muted: #606c86;
}

html { scroll-padding-top: 20px; }
body.modal-open { overflow: hidden; }
a, button, input, select { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #5b43e8;
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 12px 18px;
  transform: translateY(-180%);
  border-radius: 9px;
  color: #fff;
  background: var(--violet);
}
.skip-link:focus { transform: none; }
.workspace-summary { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 13px; }
.workspace-summary > div { min-width: 0; }
.workspace-summary strong, .workspace-summary small { display: block; }
.workspace-summary small { color: var(--muted); font-size: 12px; }
.sidebar { overflow-y: auto; }
.sidebar-close { position: absolute; top: 16px; right: 10px; }
.sidebar-overlay { display: none; }
.nav-item { min-height: 46px; }
.primary-button, .secondary-button, .outline-button, .soft-button,
.collection-action, .filter-button, .tab, .grid-pager button { min-height: 44px; }
.primary-button, .secondary-button, .outline-button, .soft-button, .collection-action { font-size: 13px; }
.text-button { min-height: 44px; }
.icon-button, .mobile-menu, .notification-button { min-width: 44px; min-height: 44px; }
.help-button { min-height: 44px; }
.eyebrow, .nav-label { color: #69748d; font-size: 11px; }
.banner-copy .status-pill { color: #fff; background: rgba(0, 60, 45, .22); }
.banner-copy > p, .banner-stats span { color: #f2efff; }
.banner-stats span { font-size: 12px; }
.metric-card p, .metric-detail, .panel-heading p, .numbers-summary,
.numbers-summary strong, .grid-pager, .selection-total span,
.drawer-note, .empty-selection, .empty-state p { color: var(--muted); font-size: 13px; }
.metric-detail { line-height: 1.5; }
.metric-card h3 { overflow-wrap: anywhere; }
.panel-heading { flex-wrap: wrap; }
.panel-heading h2 { font-size: 17px; }
th { color: #69748d; font-size: 11px; }
td, .customer-cell strong, .seller-info strong { font-size: 13px; }
.customer-cell span, .seller-info span { color: var(--muted); font-size: 12px; }
.table-status { font-size: 11px; }
.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.quick-actions > button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  min-height: 92px;
  padding: 16px 18px;
  border: 1px solid #e0ddf4;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}
.quick-actions > button:hover { border-color: var(--violet); background: #faf9ff; }
.quick-actions strong { color: var(--violet); font-size: 15px; }
.quick-actions span { color: var(--muted); font-size: 13px; }
.sales-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 22px; padding: 0; list-style: none; }
.sales-steps li { display: flex; align-items: center; gap: 9px; color: #515d78; font-size: 13px; }
.sales-steps b { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; color: var(--violet); background: var(--violet-soft); }
.numbers-toolbar { flex-wrap: wrap; }
.numbers-toolbar .search-control { flex: 1 1 200px; }
.search-control { min-height: 46px; height: auto; }
.search-control input { min-width: 0; min-height: 44px; font-size: 16px; }
.search-control button { flex: 0 0 40px; min-height: 44px; color: #5e6983; }
.search-control:focus-within { border-color: var(--violet); outline: 3px solid rgba(91, 67, 232, .18); }
.numbers-filter { flex-wrap: wrap; }
.filter-button { color: #5e6983; font-size: 12px; }
.number-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.numbers-summary .legend-dot.paid { background: #249474; }
.search-control input:focus-visible { outline: none; }
.search-control input::-webkit-search-cancel-button { -webkit-appearance: none; }
.personal-summary { display: grid; gap: 0; margin: 16px 0; }
.personal-summary > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.personal-summary span { color: var(--muted); font-size: 13px; }
.personal-summary strong { font-size: 17px; white-space: nowrap; }
.sale-drawer form > label + label { margin-top: 14px; }
.sale-drawer details { margin: 16px 0; }
summary { cursor: pointer; min-height: 44px; padding: 10px 0; color: #5945be; font-size: 13px; }
summary:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.field-hint, .field-error { display: block; }
.field-hint:empty, .field-error:empty { display: none; }
.collection-search > label { display: block; font-size: 13px; font-weight: 650; }
.receipt-numbers { color: var(--violet); font-family: "SF Mono", Monaco, monospace; font-size: 18px; font-weight: 800; }
.workspace-summary:hover { background: #fff; }
.number-chip { min-height: 48px; font-size: 15px; }
.number-chip.paid { color: #16694f; }
.number-chip.pending { color: #88500c; }
.number-chip.held { color: #6557ac; }
.sale-drawer { scroll-margin-top: 20px; }
.sale-drawer h2 { font-size: 19px; }
.selected-token { gap: 6px; padding: 3px 3px 3px 10px; font-size: 14px; }
.selected-token button { width: 38px; height: 38px; font-size: 20px; line-height: 1; }
.selection-total strong { font-size: 18px; }
form label, legend { font-size: 13px; }
label input { min-height: 46px; font-size: 16px; }
label input::placeholder { color: #7b859b; }
input[aria-invalid="true"] { border-color: #b23d38; }
.field-hint { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; font-weight: 400; }
.field-error { margin: 5px 0 0; color: #a22e29; font-size: 13px; font-weight: 600; }
.payment-option span { min-height: 70px; padding-top: 12px; }
.payment-option strong { font-size: 13px; }
.payment-option small { color: #66718a; font-size: 12px; }
.payment-option input:focus-visible + span, .digit-options input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 3px; }
.payment-option input:checked + span, .digit-options input:checked + span { border-color: var(--violet); background: #f5f2ff; }
.payment-option input:checked + span strong, .digit-options input:checked + span b { color: var(--violet); }
.digit-options b { font-size: 13px; }
.digit-options small { color: #66718a; font-size: 12px; }
.digit-options input:disabled + span { opacity: .6; cursor: not-allowed; }
.reservation-notice { margin: 14px 0; padding: 11px 12px; border-radius: 9px; color: #4c3e9a; background: #f2efff; font-size: 13px; }
.reservation-notice.urgent { color: #88500c; background: #fff1d7; }
.selection-mobile-bar { display: none; }
.collection-search { margin: 0 0 18px; }
.collection-search .search-control { width: min(100%, 480px); font-weight: 400; }
.collection-search > label { margin-bottom: 6px; }
.help-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.help-card { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.help-card h2 { margin: 0 0 10px; font-size: 19px; }
.help-card p, .help-card li { color: var(--muted); font-size: 14px; line-height: 1.65; }
.help-card ol, .help-card ul { padding-left: 20px; }
.help-card .primary-button, .help-card .secondary-button { margin-top: 8px; }
.demo-notice, .form-notice { padding: 13px 15px; border: 1px solid #e3def9; border-radius: 10px; color: #5a507c; background: #f6f3ff; font-size: 13px; line-height: 1.6; }
.demo-notice { margin: 20px 0; }
.form-notice { margin: 15px 0; }
.modal-copy { color: var(--muted); font-size: 14px; line-height: 1.6; }
.receipt-summary { display: grid; gap: 10px; margin: 20px 0; padding: 16px; border-radius: 12px; background: #f7f8fc; font-size: 14px; }
.receipt-summary p { margin: 0; }
.receipt-numbers { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.receipt-numbers span { padding: 7px 12px; border-radius: 7px; color: var(--violet); background: var(--violet-soft); font-family: "SF Mono", Monaco, monospace; font-size: 17px; font-weight: 800; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 21px; border-top: 1px solid var(--line); }
.history-item strong { display: block; font-size: 15px; }
.history-item p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.history-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toast { font-size: 14px; }
.toast span { font-size: 13px; }

@media (max-width: 1160px) and (min-width: 921px) {
  .page, .topbar { padding-left: 24px; padding-right: 24px; }
  .sales-layout { grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; }
  .sale-drawer { padding: 16px; }
  .numbers-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .numbers-toolbar .search-control { flex: 0 0 auto; width: 100%; }
  .numbers-filter { align-self: flex-start; }
  .numbers-summary { flex-wrap: wrap; gap: 9px; }
  .numbers-summary strong { width: 100%; margin-left: 0; }
}

@media (max-width: 920px) {
  .quick-actions { grid-template-columns: 1fr; gap: 8px; }
  .quick-actions > button { min-height: 76px; }
  .help-grid { grid-template-columns: 1fr; }
  .sales-steps { gap: 8px; }
  .sales-steps li { align-items: flex-start; font-size: 12px; }
  .sales-steps b { flex-basis: 25px; height: 25px; }
  .selection-mobile-bar {
    position: fixed;
    z-index: 30;
    bottom: 0;
    left: 224px;
    right: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #ded9f3;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -5px 24px rgba(34, 43, 76, .1);
  }
  .selection-mobile-bar > span { color: var(--muted); font-size: 13px; }
  .selection-mobile-bar > button { position: relative; margin: 0; width: auto; }
  .selection-mobile-bar strong { display: block; color: var(--ink); font-size: 16px; }
  .sales-view { padding-bottom: 120px; }
  body:has(.selection-mobile-bar:not(.hidden)) .toast-area { bottom: 100px; }
}

@media (max-width: 700px) {
  body.menu-open { overflow: hidden; }
  .sidebar { width: min(290px, calc(100vw - 52px)); z-index: 42; }
  .sidebar-overlay:not(.hidden) { position: fixed; z-index: 41; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(23, 28, 47, .45); }
  .help-button { display: flex; }
  .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .breadcrumb { min-width: 0; font-size: 12px; }
  .breadcrumb span { margin: 0 4px; }
  .topbar-actions { margin-left: auto; }
  .page-heading { flex-wrap: wrap; }
  .page-heading .primary-button, .page-heading .secondary-button { min-height: 44px; }
  .active-raffle-banner { flex-wrap: wrap; gap: 18px; }
  .banner-copy { flex-basis: 100%; }
  .soft-button.light { display: inline-flex; width: 100%; }
  .banner-stats { gap: 16px; }
  .banner-stats div:last-child { display: flex; }
  .banner-stats strong { font-size: 16px; }
  .quick-actions { grid-template-columns: 1fr; }
  .quick-actions > button { padding: 14px 16px; }
  .sales-steps { grid-template-columns: 1fr; gap: 8px; }
  .sales-steps li { align-items: center; font-size: 13px; }
  .numbers-toolbar .search-control { flex: 0 0 auto; }
  .number-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  .number-chip { min-height: 48px; font-size: 15px; }
  .numbers-filter { width: 100%; }
  .filter-button { flex: 1; padding-left: 7px; padding-right: 7px; }
  .selection-mobile-bar { left: 0; padding-left: 17px; padding-right: 17px; }
  .sale-drawer { padding: 17px; }
  .collection-tabs { gap: 15px; margin-top: 0; }
  .tab { font-size: 13px; }
  .collection-table { border-collapse: separate; border-spacing: 0 12px; white-space: normal; }
  .collection-table thead { display: none; }
  .collection-table tbody, .collection-table tr { display: block; width: 100%; }
  .collection-table tr { margin-bottom: 12px; padding: 13px 15px; border: 1px solid #e4e6ef; border-radius: 12px; background: #fff; }
  .collection-table td[data-label] { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border: 0; text-align: right; }
  .collection-table td[data-label]::before { flex: 0 0 auto; content: attr(data-label); color: var(--muted); text-align: left; font-size: 12px; font-weight: 600; }
  .collection-table td[data-label="Comprador"] { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
  .collection-table .customer-cell { min-width: 0; text-align: left; }
  .collection-table .customer-cell strong, .collection-table .customer-cell span { overflow-wrap: anywhere; white-space: normal; }
  .collection-table .customer-cell .avatar { flex-shrink: 0; }
  .collection-table td:last-child { padding-bottom: 0; }
  .collection-table td:last-child .collection-action { flex: 1; }
  .panel:has(.collection-table) { border: 0; background: transparent; box-shadow: none; }
  .history-item { align-items: flex-start; flex-direction: column; }
  .history-actions { width: 100%; }
  .history-actions button { flex: 1; }
  .modal { max-height: calc(100dvh - 24px); padding: 18px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions button { flex: 1 1 auto; }
  .help-card { padding: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
