:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --ink: #202225;
  --muted: #6b6f76;
  --line: #dedbd2;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --rose: #b42355;
  --gold: #b7791f;
  --shadow: 0 18px 45px rgba(37, 34, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.sidebar {
  background: #1f2a2a;
  color: #f8faf9;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f3c677;
  color: #26302f;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
}

.brand p {
  color: #b8c5c1;
  font-size: 13px;
}

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

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  background: transparent;
  color: #dbe5e1;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

.topbar h2 {
  font-size: 30px;
  line-height: 1.15;
}

.date-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.sync-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.sync-status.online {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
}

.sync-status.error {
  border-color: rgba(180, 35, 85, 0.3);
  background: rgba(180, 35, 85, 0.08);
  color: var(--rose);
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(280px, 1.4fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel h3 {
  margin: 4px 0 0;
}

.auth-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.auth-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auth-note {
  grid-column: 2;
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

body.auth-required .nav-list,
body.auth-required .view,
body.auth-required #open-login,
body.auth-required #close-login {
  display: none !important;
}

body.auth-required .auth-panel:not(.hidden) {
  display: grid !important;
  max-width: 920px;
  margin: 48px auto 0;
}

body.password-change-required .nav-list,
body.password-change-required .view,
body.password-change-required #auth-panel,
body.password-change-required #forgot-password-panel,
body.password-change-required #open-password-change,
body.password-change-required #cancel-password-change {
  display: none !important;
}

body.password-change-required #password-change-panel {
  display: grid !important;
  max-width: 920px;
  margin: 48px auto 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 24px;
}

.dashboard-grid,
.work-grid,
.settings-grid {
  display: grid;
  gap: 16px;
}

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

.work-grid {
  grid-template-columns: minmax(0, 1fr);
}

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

.settings-actions {
  box-shadow: none;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 18px 18px;
}

.data-form-toggle.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.data-entry-form {
  display: none;
  grid-column: 1 / -1;
}

.data-entry-form.active {
  display: block;
}

.data-list-panel {
  display: none;
  grid-column: 1 / -1;
}

.data-list-panel.active {
  display: block;
}

.panel-wide {
  grid-column: 1 / -1;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.account-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-card h4 {
  margin: 0;
  font-size: 15px;
}

.account-card .account-balance {
  font-size: 20px;
  font-weight: 700;
}

.account-card .account-meta {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.form-panel {
  max-width: 980px;
}

.toggle-list-panel {
  max-width: 100%;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

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

.panel-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

tr.needs-review {
  background: rgba(185, 128, 22, 0.08);
}

/* Modulo Cierres: encabezado, formulario y listado apilados como tarjetas
   independientes (igual gap que .work-grid) ahora que el formulario se
   movio antes del historial en el DOM. */
.cash-module-head,
.cash-form-grid,
.cash-list-panel {
  margin-bottom: 16px;
}

.cash-list-panel {
  margin-bottom: 0;
}

/* Modulo Facturacion: mismo patron de espaciado que .cash-module-head para
   el encabezado con el boton general "Registrar cobro de cliente". */
.billing-module-head {
  margin-bottom: 16px;
}

.form-panel {
  padding-bottom: 18px;
}

form label {
  display: grid;
  gap: 7px;
  margin: 14px 18px 0;
  color: #3b4045;
  font-size: 13px;
  font-weight: 700;
}

.field-block {
  display: grid;
  gap: 7px;
  margin: 14px 18px 0;
}

.lookup-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.lookup-wrap > input {
  width: 100%;
}

.lookup-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 80;
  display: none;
  width: 100%;
  max-height: 210px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(32, 34, 37, 0.14);
}

.lookup-menu.active {
  display: block;
}

.lookup-option {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #f0ede6;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.lookup-option:hover,
.lookup-option:focus {
  background: #eef8f6;
}

.lookup-option:last-child {
  border-bottom: 0;
}

.field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #3b4045;
  font-size: 13px;
  font-weight: 700;
}

.readonly-hint {
  display: block;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 700;
}

/* Valores calculados de un cierre (Monto inicial, Egresos del dia): mismo
   componente visual que .readonly-hint (ya usado para el resumen de cliente
   en Facturacion), aplicado sobre <output> para que nunca parezcan un campo
   editable. margin-top separa el valor de su <label> igual que lo hacia el
   input/output por defecto. */
.calculated-value {
  margin-top: 6px;
}

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

.form-row > button {
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbc7bd;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.inline-search {
  max-width: 280px;
  padding: 9px 11px;
}

.primary-btn {
  margin: 18px 18px 0;
  width: calc(100% - 36px);
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  padding: 12px 14px;
  cursor: pointer;
}

.primary-btn:hover {
  background: var(--accent-strong);
}

.secondary-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-strong);
  font-weight: 800;
  padding: 10px 12px;
  cursor: pointer;
}

.secondary-btn:hover {
  border-color: var(--accent);
  background: #eef8f6;
}

.secondary-btn.compact {
  padding: 7px 10px;
  font-size: 12px;
}

.primary-btn.inline {
  width: auto;
  margin: 0;
  padding: 10px 12px;
}

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

.form-message {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.form-message.success {
  color: var(--accent-strong);
}

.form-message.error {
  color: var(--rose);
}

.compact-input {
  min-width: 150px;
  padding: 9px 10px;
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.success {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
}

.status-pill.danger {
  background: rgba(180, 35, 85, 0.1);
  color: var(--rose);
}

.status-pill.warning {
  background: rgba(185, 128, 22, 0.14);
  color: #8a5a00;
}

.row-busy {
  opacity: 0.55;
  pointer-events: none;
}

.user-permissions {
  min-width: 230px;
}

.user-permissions summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
}

.user-permission-grid {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  white-space: nowrap;
}

.user-permission-grid label {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
}

.app-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 420px;
  width: calc(100% - 40px);
  box-shadow: 0 20px 50px rgba(20, 15, 10, 0.25);
}

.invoice-modal-dialog {
  max-width: 650px !important;
  width: calc(100% - 32px);
}

.app-dialog::backdrop {
  background: rgba(20, 15, 10, 0.45);
}

.app-dialog .form-panel {
  box-shadow: none;
  margin: 0;
}

.reservation-details {
  display: grid;
  gap: 10px;
}

.reservation-detail-row {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.reservation-detail-row:last-child {
  border-bottom: 0;
}

.reservation-detail-row strong {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quick-create {
  margin: 12px 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.quick-create.hidden {
  display: none;
}

/* Estilos de Calendario y Horarios SeBen Service */
.booking-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--line, #e2e8f0);
  padding-bottom: 8px;
}

.booking-tab-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted, #64748b);
  transition: all 0.2s ease;
}

.booking-tab-btn.active {
  background: var(--accent, #6366f1);
  color: #ffffff;
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.calendar-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.calendar-day-card {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.calendar-day-header {
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line, #e2e8f0);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.slot-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px;
}

.slot-badge.available {
  background: #dcfce7;
  color: #166534;
}

.slot-badge.booked {
  background: #fee2e2;
  color: #991b1b;
}

.slot-badge.lunch {
  background: #fef3c7;
  color: #92400e;
}

.slot-badge.exception {
  background: #e0e7ff;
  color: #3730a3;
}

/* Estados de reserva (dimensión `estado`) en la Matriz Consolidada — ver
   outputs/app.js renderConsolidatedMatrix() y outputs/lib/booking-engine.js
   para el modelo de 3 dimensiones (estado/estadoDeposito/estadoConfirmacion). */
.slot-badge.preaprobada {
  background: #dbeafe;
  color: #1e40af;
}

.slot-badge.confirmada {
  background: #dcfce7;
  color: #166534;
}

.slot-badge.reprogramada {
  background: #e0e7ff;
  color: #3730a3;
}

.slot-badge.completada {
  background: #e2e8f0;
  color: #334155;
}

/* Indicadores pequeños de `estadoConfirmacion` (confirmación de asistencia)
   y `estadoDeposito` (verificación de comprobante), mostrados dentro de la
   celda junto al badge de estado principal — texto simple, no badges con
   fondo, para no competir visualmente con el color de la celda. */
.slot-confirm-note {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

.slot-confirm-note.programada { color: #64748b; }
.slot-confirm-note.pendiente-confirmar { color: #b45309; }
.slot-confirm-note.hora-confirmada { color: #166534; }
.slot-confirm-note.reagendada { color: #3730a3; }

.slot-deposit-note {
  font-size: 11px;
  font-weight: 600;
}

.slot-deposit-note.comprobante-recibido,
.slot-deposit-note.pendiente-verificacion { color: #b45309; }
.slot-deposit-note.verificado { color: #166534; }
.slot-deposit-note.rechazado { color: #b91c1c; }

/* Leyenda estática de la Matriz Consolidada */
.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  padding: 10px 12px;
  margin: 10px 0;
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  font-size: 12px;
}

.matrix-legend-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.matrix-legend-sep {
  width: 1px;
  align-self: stretch;
  background: var(--line, #e2e8f0);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.schedule-table th, .schedule-table td {
  padding: 8px 10px;
  border: 1px solid var(--line, #e2e8f0);
  text-align: left;
}

.schedule-table th {
  background: var(--bg-alt, #f8fafc);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.quick-create label {
  margin: 0 0 10px;
}

.quick-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.invoice-lines,
.invoice-summary {
  margin: 16px 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.section-title-row h4 {
  margin: 0;
  font-size: 14px;
}

.invoice-line-list {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.line-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 12px;
}

.invoice-line {
  border: 1px solid #e5e0d6;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

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

.line-head strong {
  font-size: 13px;
}

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

.line-grid label,
.invoice-summary label,
.tip-allocation label {
  margin: 0;
}

.invoice-summary {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.summary-row.total {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--ink);
}

.tip-allocation {
  display: grid;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fffdfa;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.paid {
  color: #11613d;
  background: #dcfce7;
}

.badge.credit {
  color: #92400e;
  background: #fef3c7;
}

.badge.pending {
  color: #9f1239;
  background: #ffe4e6;
}

.badge.voided {
  color: #52525b;
  background: #e4e4e7;
  text-decoration: line-through;
}

.appointments,
.simple-list {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
}

/* Linea de bono de nomina: concepto + monto + toggle TSS + quitar, no encaja
   en el grid de 3 columnas de .list-item (pensado para icono+texto+accion). */
.payroll-bonus-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}

.payroll-bonus-line .payroll-bonus-concept {
  flex: 2 1 160px;
}

.payroll-bonus-line .payroll-bonus-amount {
  flex: 1 1 100px;
}

.payroll-bonus-tss-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.appointment,
.list-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 12px;
}

.simple-list .list-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

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

.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-soft);
}

.check-list input {
  width: auto;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 18px;
}

.report-filters label {
  margin: 0;
}

.toggle-field {
  align-items: center;
  align-self: end;
  display: flex;
  gap: 8px;
  min-height: 44px;
}

.toggle-field input {
  width: auto;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 0;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 12px;
}

.report-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.report-card strong {
  font-size: 18px;
}

.appointment time {
  color: var(--accent);
  font-weight: 900;
}

.appointment strong,
.list-item strong {
  display: block;
}

.appointment span,
.list-item span,
.empty {
  color: var(--muted);
  font-size: 13px;
}

.amount {
  font-weight: 900;
  white-space: nowrap;
}

.danger {
  color: var(--rose);
}

.gold {
  color: var(--gold);
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 8px 10px;
  }

  .brand {
    margin-bottom: 8px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    font-size: 12px;
  }

  .nav-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(118px, 1fr);
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .nav-item {
    text-align: center;
    padding: 8px 7px;
    font-size: 13px;
  }

  .metrics-grid,
  .dashboard-grid,
  .work-grid,
  .settings-grid,
  .report-filters,
  .report-summary,
  .accounts-grid,
  .auth-panel,
  .auth-form {
    grid-template-columns: 1fr;
  }

  .auth-note {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 12px;
  }

  .brand {
    align-items: center;
  }

  .nav-list {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    min-width: 112px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

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

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

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

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-search {
    max-width: none;
  }

  .appointment,
  .list-item {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: flex-start;
  }
}
