/* Presentation only. All layout overrides are screen <=760px; print/PC stay intact. */
.metis-mobile-only { display:none !important; }
@media screen and (max-width:760px) {
  body .metis-mobile-only { display:block !important; }
  body .metis-mobile-only[hidden] { display:none !important; }
  body .page { width:calc(100% - 24px); padding:18px 0 32px; }
  body .page * { min-width:0; }
  body .topbar { position:static; padding:12px; gap:10px; flex-wrap:wrap; }
  body .topbar .brand { margin-right:auto; }
  body .topbar .main-nav { display:flex; flex-wrap:wrap; order:3; flex-basis:100%; width:100%; gap:8px; justify-content:flex-start; }
  body .topbar .main-nav a { flex:1 1 140px; min-height:44px; padding:12px; }
  body.mobile-enhanced .topbar .main-nav:not(.mobile-menu-open),
  body.mobile-enhanced .topbar .logout-form:not(.mobile-menu-open) { display:none !important; }
  body .topbar .logout-form { order:4; width:100%; }
  body .topbar .logout-form button { min-height:44px; width:100%; }
  body .mobile-menu-button { background:white; border:1px solid #bfd0c6; border-radius:9px; min-height:44px; padding:10px 14px; color:var(--green); font-family:inherit; font-size:14px; font-weight:600; }
  body .mobile-current-section { flex-basis:100%; font-size:12px; color:var(--muted); }
  body .page input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  body .page select, body .page textarea { max-width:100%; min-height:44px; font-size:16px; }
  body .page textarea { width:100%; }
  body .page button, body .page .button, body .partners .partner-mini-button { min-height:44px; white-space:normal; }
  body .page p, body .page small, body .page a { overflow-wrap:anywhere; }
  body .page-heading, body .heading-actions, body .inline-form, body .form-actions,
  body .inline-payroll-form, body .salary-calculate-bar, body .partner-heading,
  body .income-status, body .income-conflict-item, body .income-activation form,
  body .profit-source, body .test-import { flex-direction:column; align-items:stretch; gap:12px; }
  body .page-heading h1, body .salary-title h1, body .partners h1 { font-size:30px; overflow-wrap:anywhere; }
  body .month-form { width:100%; flex-wrap:wrap; gap:8px; }
  body .month-form label { flex:1 1 110px; }
  body .month-form input { width:100%; }
  body .month-form>input, body .month-form>select { flex:1 1 150px; width:0; }
  body .panel, body .salary-surface, body .partner-card, body .outflow-view-panel { padding:15px; border-radius:13px; }
  body .panel-heading, body .outflow-view-heading, body .payroll-alert { flex-wrap:wrap; gap:10px; }
  body .panel h2, body .outflow-view-heading h2 { font-size:23px; }
  body .balance-grid, body .content-grid, body .analysis-grid, body .setup-grid,
  body .entry-grid, body .payroll-detail-grid, body .target-layout,
  body .salary-edit-grid, body .profit-cards, body .profit-bottom,
  body .cup-workspace .cup-stats, body .cup-settings-grid,
  body .cash-count-workspace, body .cash-currency-grid, body .cash-count-fields,
  body .cash-rec-tables, body .cash-rec-breakdown, body .partner-accounts,
  body .partner-summary, body .partner-account-tools { grid-template-columns:minmax(0,1fr); gap:12px; }
  body .metric-grid, body .summary-strip, body .finance-strip,
  body .outflow-summary-grid, body .employee-profile-strip, body .profit-partners { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  body .metric-card, body .outflow-summary-card { padding:12px; min-height:0; }
  body .outflow-summary-card strong { font-size:22px; overflow-wrap:anywhere; }
  body .balance-card { min-height:0; padding:18px; }
  body .card-icon { margin-bottom:12px; }
  body .summary-strip { padding:14px; }
  body .summary-strip div { padding:8px 0; border:0; }
  body .salary-tabs, body .cup-tabs, body .partner-tabs { display:flex; flex-wrap:wrap; gap:8px; }
  body .salary-tabs a, body .cup-tabs a, body .partner-tabs a { padding:11px 10px; min-height:44px; border:1px solid var(--line); border-radius:9px; font-size:13px; }
  body .salary-tabs a[aria-current], body .cup-tabs a[aria-current], body .partner-tabs a.active { background:var(--green-soft); color:var(--green); border-color:#aac9b9; }
  body .expense-view-options { flex-wrap:wrap; width:100%; gap:5px; }
  body .expense-view-options button { flex:1 1 100px; padding:10px; }
  body .expense-center-group>summary, body .expense-salary-group>summary { flex-wrap:wrap; padding:13px; }
  body .expense-salary-title { flex-wrap:wrap; }
  body .movement-save-bar, body .movement-save-actions { flex-wrap:wrap; gap:10px; }
  body .movement-save-actions { width:100%; }
  body .movement-save-actions button { flex:1 1 140px; }
  body .form-panel .stack-form { grid-template-columns:1fr; }
  body .form-panel .stack-form p { grid-column:1; }
  body .payroll-footer-actions, body .partner-actions { flex-wrap:wrap; gap:8px; }
  body .partner-actions>* { flex:1 1 140px; text-align:center; }
  body .partner-summary .partner-card:last-child { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
  body .partner-summary .partner-card:last-child .partner-balance { font-size:20px; margin:0; }
  body .partner-summary .partner-card:last-child p { margin:0; font-size:12px; flex-basis:100%; }
  body .partner-export { flex-wrap:wrap; }
  body .partner-export p { flex:1 1 100%; }
  body .partner-column-handle, body .partner-column-controls { display:none; }
  body .partner-form, body .auth-card { padding:18px; max-width:100%; }
  body .daily-list, body .income-recovery ul { max-height:none; overflow:visible; }
  body .site-footer { width:calc(100% - 24px); }
  body .site-footer nav { flex-wrap:wrap; }

  /* Same table nodes and successful form controls; no duplicated input values. */
  body .mobile-card-table { display:block; min-width:0 !important; width:100% !important; table-layout:auto; }
  body .mobile-card-table>colgroup, body .mobile-card-table>thead { display:none; }
  body .mobile-card-table>tbody, body .mobile-card-table>tfoot { display:block; width:100%; }
  body .mobile-card-table>tbody>tr, body .mobile-card-table>tfoot>tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; margin:10px 0; padding:10px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
  body .mobile-card-table>tbody>tr:nth-child(even) { background:#f5f8f6; }
  body .mobile-card-table>tbody>tr>*, body .mobile-card-table>tfoot>tr>* { display:block; width:auto; min-width:0; max-width:none; padding:8px; white-space:normal; text-align:left; border:0; overflow:visible; overflow-wrap:anywhere; font-size:15px; position:static; }
  body .mobile-card-table>tbody>tr>*::before, body .mobile-card-table>tfoot>tr>*::before { content:attr(data-mobile-label); display:block; color:var(--muted); font-size:11px; font-weight:500; letter-spacing:0; text-transform:none; margin-bottom:5px; }
  body .mobile-card-table>tbody>tr>*:first-child { grid-column:1/-1; font-weight:700; }
  body .mobile-card-table .mobile-wide-cell, body .mobile-card-table [colspan] { grid-column:1/-1; }
  body .mobile-card-table input:not([type=checkbox]), body .mobile-card-table select { width:100%; max-width:100%; }
  body .mobile-card-table .text-cell { text-overflow:clip; white-space:normal; }
  body .mobile-card-table>tbody>tr.partner-row-pending { border-color:#e6ce9c; background:#fff6e2; }
  body .mobile-card-table .partner-row-pending td { background:transparent; }
  body .mobile-card-table .partner-row-actions { gap:8px; }
  body .partner-ledger.mobile-card-table>tbody>tr>td:first-child { grid-column:auto; }
  body .partner-ledger.mobile-card-table>tbody>tr>td:nth-child(2), body .partner-ledger.mobile-card-table>tbody>tr>td:nth-child(3) { text-align:right; font-weight:700; font-size:19px; }
  body .partner-ledger.mobile-card-table>tbody>tr>td:nth-child(5) { grid-column:1/-1; text-align:left; border-top:1px solid var(--line); }
  body .partner-ledger .partner-flow-sign { display:inline !important; }
  body .partner-ledger.mobile-card-table>tbody>tr>td:nth-child(5) { order:2; }
  body .partner-ledger.mobile-card-table>tbody>tr>td:nth-child(6) { order:1; }
  body .partner-ledger.mobile-card-table>tbody>tr>td:nth-child(6)::before { display:none; }
  body .partner-ledger .partner-row-actions { flex-direction:row; gap:8px; }
  body .partner-ledger .partner-row-actions>* { flex:1 1 0; min-width:0; }
  body .partner-ledger .partner-row-actions .partner-mini-button { display:flex; align-items:center; justify-content:center; padding:8px 10px; min-height:44px; font-size:13px; background:#f4f6f5; color:#344e44; border-color:#cad7d0; }
  body .partner-ledger tr[data-kind="in"] .partner-mini-button { background:#deeee4; color:#195d40; border-color:#adcdb9; }
  body .partner-ledger tr[data-kind="out"] .partner-mini-button { background:#fbe2de; color:#8b332d; border-color:#e2b3ac; }
  body .partner-ledger .partner-mini-button:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
  body .mobile-card-table .mobile-empty-amount { display:none; }
  body .mobile-row-button { margin-top:10px; width:100%; color:var(--green); border:1px solid #c6dace; border-radius:8px; background:#edf5f0; font-family:inherit; font-size:13px; font-weight:600; padding:10px; }
  body .mobile-row-collapsible:not(.mobile-expanded)>td:not(:first-child):not(.mobile-row-essential) { display:none; }
  body .mobile-form-collapsed>:not(.panel-heading) { display:none; }
  body .mobile-form-collapsed .panel-heading { margin-bottom:0; }
  body .mobile-currency-hidden { display:none !important; }
  body .mobile-currency-picker, body .mobile-cup-picker { margin:12px 0; }
  body .mobile-currency-picker :is(button,a), body .mobile-cup-picker :is(button,a) { display:inline-flex; align-items:center; min-height:44px; margin:0 6px 6px 0; border:1px solid #c5d8cc; background:white; color:var(--ink); border-radius:9px; padding:10px 13px; text-decoration:none; }
  body .mobile-currency-picker [aria-pressed=true], body .mobile-cup-picker [aria-pressed=true] { background:var(--green); color:white; }
  body .cash-rec-tables table, body .cash-denomination-table { min-width:0; width:100%; table-layout:fixed; }
  body .cash-rec-tables input, body .cash-denomination-table input { height:44px; min-height:44px; font-size:16px; }
  body .cash-denomination-table td, body .cash-denomination-table th { padding:6px; white-space:normal; overflow-wrap:anywhere; }
  body .cash-rec-heading form { flex-wrap:wrap; width:100%; }
  body .cash-rec-heading form label { flex:1; }
  body .cash-rec-check, body .cash-rec-result { flex-wrap:wrap; }
  body .cash-receipt-preview { position:static; padding:16px; }
  body .cash-rec-tables th { letter-spacing:0; font-size:11px; }
  body .cash-rec-tables td { font-size:14px; }
  body .cash-rec-actions .button { width:100%; }
  body .cash-rec-breakdown dl, body .profits dl { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
  body .cash-rec-breakdown dd, body .profits dd { overflow-wrap:anywhere; }
  body .profit-table-head { display:none; }
  body .profit-table, body .profit-store { min-width:0; overflow:visible; }
  body .profit-store>summary { grid-template-columns:repeat(2,minmax(0,1fr)); padding:15px; gap:12px; }
  body .profit-store>summary>span:first-child { grid-column:1/-1; }
  body .profit-store>summary>span:not(:first-child), body .profit-store>summary>strong { text-align:left; overflow-wrap:anywhere; }
  body .profit-store>summary>*[data-mobile-label]::before { content:attr(data-mobile-label); display:block; color:var(--muted); font-size:11px; font-weight:400; margin-bottom:4px; }
  body .profit-store>summary>strong { grid-column:1/-1; font-size:22px; }
  body .profit-detail { grid-template-columns:1fr; padding:15px; gap:18px; }
  body .profit-partners article { padding:12px; }
  body .profit-partners strong { overflow-wrap:anywhere; }
  body .cup-calendar.mobile-card-table .cup-cell { grid-column:1/-1; }
  body .cup-calendar.mobile-card-table .cup-cell>input { width:100%; }
  body .cup-calendar.mobile-card-table .cup-cell label { font-size:13px; }
  body .cup-calendar.mobile-card-table .mobile-cup-hidden { display:none; }

  /* Income option A: original row folds open; fields stay in the original form. */
  body .income-help { font-size:12px; }
  body .income-store-picker>[data-select] { display:none; }
  body .income-store-picker { margin:8px 0; }
  body .income-store-picker.mobile-picker-closed>*:not(.mobile-store-button) { display:none; }
  body .mobile-store-button { width:100%; text-align:left; padding:12px; background:white; border:1px solid #c9dbd0; border-radius:10px; color:var(--green); font-weight:700; }
  body .income-scroll { overflow:visible; border:0; background:transparent; max-width:100%; }
  body .income-table { display:block; width:100%; table-layout:auto; }
  body .income-table>thead, body .income-table>colgroup { display:none; }
  body .income-table>caption { display:block; padding:12px 0; background:transparent; }
  body .income-table>tbody { display:block; }
  body .income-table>tbody>tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:8px; border:1px solid #cdded2; border-radius:10px; overflow:hidden; background:white; }
  body .income-table .income-day { display:block; grid-column:1/-1; position:static; width:auto; min-width:0; padding:0; box-shadow:none; text-align:left; }
  body .income-table .income-day>strong, body .income-table .income-day>small { display:none; }
  body .income-table .mobile-day-button { display:flex !important; align-items:center; justify-content:space-between; width:100%; gap:10px; padding:13px 12px; border:0; background:transparent; color:var(--ink); text-align:left; font-family:inherit; font-size:15px; font-weight:600; }
  body .mobile-day-amount { text-align:right; font-size:14px; }
  body .mobile-day-amount small { display:block; color:var(--muted); font-size:11px; font-weight:400; }
  body .income-table .income-day strong { font-size:16px; }
  body .income-table>tbody>tr>td { display:block; width:auto; min-width:0; padding:10px; border:0; text-align:left; }
  body .income-table .income-group-start { border-left:0; }
  body .income-table tr:not(.mobile-day-open)>td { display:none; }
  body .income-table .income-single::before { content:attr(data-mobile-label); display:block; font-size:12px; margin-bottom:6px; color:#3e5e4d; font-weight:600; }
  body .income-table input[type=number] { height:44px; min-height:44px; font-size:16px; font-weight:600; background:white; border:1px solid #c6d8cd; }
  body .income-table .income-cash, body .income-table .income-total { grid-column:1/-1; }
  body .income-table .income-cash { margin:0 10px; padding:10px; border:1px solid #c9dcce; border-radius:9px; background:#eaf3ed; }
  body .income-cash::before { content:'Efectivo'; display:block; font-size:13px; color:var(--green); font-weight:700; margin-bottom:9px; }
  body .income-cash-inputs { grid-template-columns:1fr 1.2fr .9fr; gap:6px; }
  body .income-cash-inputs label>span { position:static; width:auto; height:auto; clip-path:none; display:block; margin-bottom:5px; font-size:11px; }
  body .income-equivalent { margin-top:9px; font-size:12px; padding:0; flex-wrap:wrap; }
  body .income-equivalent strong { font-size:15px; }
  body .income-reference, body .income-conflict-cell small { font-size:11px; }
  body .income-table .income-total { display:flex; width:auto; min-width:0; align-items:center; justify-content:space-between; padding:14px 10px; gap:12px; }
  body .income-table tr:not(.mobile-day-open)>.income-total { display:none; }
  body .income-total::before { content:'Total del día · USD'; font-size:12px; }
  body .income-table .income-total strong { font-size:20px; }
  body .income-table .income-sunday:not(.mobile-day-open) .mobile-day-button { min-height:32px; padding:7px 12px; font-size:12px; }
  body .income-table .income-sunday-closed { grid-column:1/-1; }
  body .income-savebar { max-width:100%; margin-inline:0; gap:10px; padding:12px; }
  body .income-savebar button { flex:1 1 140px; }
  body .income-savebar small { max-width:none; }
  body .income-scroll [hidden] { display:none !important; }
}
