/* Shared workflow refinements; loaded after the design system and feedback skin. */
:root{--ds-focus:#f97316;--ds-ring:0 0 0 3px rgb(249 115 22 / 22%)}
input:focus,select:focus,textarea:focus{outline:3px solid var(--ds-focus)!important;outline-offset:1px;border-color:var(--ds-focus)!important;box-shadow:none!important}
button:focus-visible,a:focus-visible,summary:focus-visible,[tabindex]:not([tabindex="-1"]):focus-visible{outline:3px solid var(--ds-focus)!important;outline-offset:3px}
h1[tabindex="-1"]:focus,.app-main[tabindex="-1"]:focus{outline:none!important;box-shadow:none!important}
.ds-btn--back{background:#e8f0ff;border-color:#a8c3f5;color:#17489c}
.ds-btn--back:hover{background:#d9e7ff;border-color:#729ee9;color:#123b80}
.ds-btn--back:active{background:#cbdfff}
.ds-filter-heading{display:flex;align-items:center;gap:6px;white-space:nowrap}
th.ds-r>.ds-filter-heading{justify-content:flex-end}
th.ds-c>.ds-filter-heading{justify-content:center}
.ds-column-filter{width:30px;height:30px;display:inline-grid;place-items:center;flex:none;padding:5px;border:1px solid transparent;border-radius:7px;background:transparent;color:#64748b;cursor:pointer}
.ds-column-filter svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round}
.ds-column-filter:hover{background:#e8f0ff;color:#17489c;border-color:#c9daf9}
.ds-column-filter.is-active{background:#1a56db;color:#fff;border-color:#1a56db}
.ds-column-filter.is-active svg{fill:currentColor;stroke:#fff}
.ds-filter-content{text-align:left;text-transform:none;letter-spacing:normal;font-size:13px;font-weight:400;white-space:normal}
.ds-table th>dialog.ds-modal{text-transform:none;letter-spacing:normal;text-align:left;font-weight:400;white-space:normal}
.ds-filter-content>.ds-input{margin-top:5px}
.ds-filter-tools{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
.ds-filter-values{max-height:280px;overflow:auto;border:1px solid var(--ds-border);border-radius:8px;padding:6px}
.ds-filter-values .ds-check{display:flex;gap:10px;min-height:34px;padding:7px 8px;align-items:flex-start;cursor:pointer;overflow-wrap:anywhere}
.ds-filter-values .ds-check:hover{background:#f0f5ff}
.ds-filter-content>p{margin:12px 0 0;line-height:1.45}
.rec-picker-search{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;margin-bottom:12px}
.menu-card--submenu{font:inherit;cursor:pointer;width:100%;border-color:#b9cfee;background:linear-gradient(145deg,#fff,#edf4ff)}
.menu-card--submenu small{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:500;color:#526b8b}
.menu-card--submenu small svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.menu-submenu-hint{margin:0 0 16px;color:var(--ds-muted);font-size:13px}
.menu-submenu-grid .menu-card{min-height:112px;justify-content:center}
.book-page>.book-totals{flex:none}
.book-totals{display:flex;align-items:center;gap:16px;padding:10px 16px}
.book-totals h2{font-size:12px;line-height:1.4;margin:0;color:#17489c;font-weight:700;flex:0 0 160px}
.book-totals h2 span{display:block;font-size:10px;font-weight:400;color:var(--ds-muted);margin-top:2px}
.book-totals dl{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;flex:1;min-width:0;margin:0}
.book-totals dl>div{border-left:1px solid var(--ds-border);padding-left:12px;min-width:0}
.book-totals dt{font-size:11px;color:var(--ds-muted);font-weight:500}
.book-totals dd{font-size:16px;font-weight:650;line-height:1.4;margin:1px 0 0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.book-totals__grand dd{color:var(--ds-primary);font-weight:800}
@media(max-width:900px){.book-page{height:auto;min-height:100%}.book-page>.ds-table-wrap{flex:none;min-height:180px;max-height:60dvh}.book-totals{display:block}.book-totals h2{margin-bottom:10px}.book-totals dl{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.book-totals dd{font-size:14px}}
@media(max-width:420px){.book-totals dl{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.ds-page--paged-list{height:auto;min-height:100%}.ds-page--paged-list>.ds-table-wrap{flex:none;min-height:180px;max-height:65dvh;overflow:auto}}
.ds-back-to-top{position:fixed;right:24px;bottom:24px;z-index:80;width:46px;height:46px;display:grid;place-items:center;border:1px solid #fff5;border-radius:50%;background:var(--ds-primary);color:#fff;box-shadow:0 5px 18px #173c7440;cursor:pointer}
.ds-back-to-top:hover{background:var(--ds-primary-hover);transform:translateY(-2px)}
.ds-back-to-top[hidden]{display:none}
.ds-back-to-top svg{width:23px;height:23px}
@media(max-width:900px){.ds-back-to-top{right:16px;bottom:88px}}
.ed-modal--products{width:960px}
.ed-modal-grid .ed-lookup-table{width:100%;min-width:560px;border-collapse:collapse;font-size:13px;table-layout:auto}
.ed-lookup-table th{position:sticky;top:0;z-index:1;padding:11px 12px;text-align:left;white-space:nowrap}
.ed-lookup-table td{padding:10px 12px;border-bottom:1px solid #edf1f5}
.ed-lookup-table .r{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.ed-lookup-table--products th:first-child{width:16%}
.ed-lookup-table--products th:nth-child(2){width:54%}
.ed-lookup-table--products th:nth-child(n+3){width:15%}
.ed-lookup-table tr.sel td{background:#dbeafe}
.ed-lookup-table tr:hover td{background:#eef5ff}
.ds-search-match{padding:0 1px;border-radius:3px;background:#ffdb82;color:#583600;font-weight:750}
.ds-file__control:focus-within{border-color:var(--ds-focus);box-shadow:var(--ds-ring)}
.ds-file__input:focus{outline:none!important}
.product-editor{display:flex;flex-direction:column;gap:18px}
.product-editor__intro{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-bottom:16px;border-bottom:1px solid #e2e8f0}
.product-editor__intro>div{min-width:0}
.product-editor__intro strong{font-size:17px;color:#173754;overflow-wrap:anywhere}
.product-editor__intro p{margin:6px 0 0;color:#64748b;font-size:13px;line-height:1.5}
.product-editor__status{flex:none;background:#eaf6ef;color:#166447;border:1px solid #cae8d6;border-radius:99px;padding:5px 10px;font-size:12px;font-weight:650}
.product-editor__fields{border:0;margin:0;padding:0;min-width:0}
.product-editor__layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.product-editor__section{min-width:0;border:1px solid #dce5ef;border-radius:10px;padding:16px;background:#fff}
.product-editor__section--wide{grid-column:1/-1}
.product-editor__section h3{display:flex;align-items:center;gap:10px;font-size:14px;color:#174c7d;line-height:1.4;margin:0 0 16px}
.product-editor__section h3>span{display:grid;place-items:center;width:28px;height:28px;flex:none;border-radius:7px;color:#fff;background:var(--ds-primary);font-size:11px}
.product-editor__section--prices{background:linear-gradient(135deg,#f3f8ff,#fff);border-color:#c4d9f1}
.product-editor__sale{font-weight:750;color:#174c7d}
.product-editor__tax{margin:14px 0 0;font-size:12px;color:#526b83;line-height:1.6}
.product-editor__inventory{display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) minmax(230px,1.2fr);gap:16px;align-items:start}
.product-editor__active{display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid #dce5ef;border-radius:8px;background:#f8fafc;cursor:pointer}
.product-editor__active input{margin-top:3px;accent-color:var(--ds-primary)}
.product-editor__active strong{display:block;font-size:13px;color:#29445e}
.product-editor__active small{display:block;font-size:12px;color:#64748b;line-height:1.5;margin-top:4px}
.product-editor .ds-form-grid{gap:14px}
.product-editor__last-purchase{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.product-editor__purchase{background:#f8fafc}
.product-editor__purchase input[readonly]{background:#f1f5f9;color:#526579}
.product-editor__pack-picker{display:grid;grid-template-columns:minmax(140px,1fr) minmax(160px,1.4fr) 88px auto;gap:12px;align-items:end;margin:16px 0}
.product-editor__pack-picker .ds-search{width:100%;min-width:0}
.product-editor__pack-table{max-height:260px;overflow:auto}
.product-editor__pack-table .ds-table{min-width:520px}
.product-editor__pack-table th{position:sticky;top:0;z-index:1}
.product-editor__pack-table input{width:90px;min-width:70px}
@media(max-width:760px){.product-editor__layout,.product-editor__inventory{grid-template-columns:minmax(0,1fr)}.product-editor__section{padding:12px}.product-editor__intro{flex-wrap:wrap}}
@media(max-width:760px){.product-editor__last-purchase,.product-editor__pack-picker{grid-template-columns:minmax(0,1fr)}}
.ds-alert>div{flex:1;min-width:0}
.ds-alert__close{align-self:flex-start;flex:none;border:0;background:transparent;color:inherit;border-radius:6px;width:32px;height:32px;font-size:24px;line-height:1;cursor:pointer}
.ds-alert__close:hover{background:rgb(0 0 0 / 7%)}
.gd-document-type{min-width:260px;flex:0 1 300px}
.gd-filter{margin-left:auto;flex:1 1 260px;max-width:420px;min-width:220px}
.ed-sech,.ed-tot .ds-totals-title{background:var(--ds-primary,#1a56db);color:#fff;padding:9px 12px}
.ed-sech .ed-chev{color:#fff}
.ed-tot .ds-totals-title{border-radius:8px}
.ct-tabs{gap:8px;padding:8px;background:#edf3fa;border:1px solid #d7e2ef;border-radius:12px}
.ct-tabs .ds-tab{flex:1 1 160px;min-height:48px;padding:12px 16px;font-size:14px;line-height:1.45;white-space:normal;border-radius:8px;border:1px solid transparent;color:#334155;font-weight:600}
.ct-tabs .ds-tab.is-active{background:var(--ds-primary,#1a56db);color:#fff;box-shadow:0 2px 5px #1a56db25}
.ic-section{border:1px solid #d7e2ef;border-radius:12px;overflow:hidden;margin:16px 0;background:#fff;padding:18px}
.ic-section>.ds-form-section{background:#edf4fc;color:#124b83;padding:12px 16px;margin:-18px -18px 18px;border-bottom:1px solid #d7e2ef}
.ic-section .ic-grid{gap:14px 16px;margin:0}
.ic-section .ds-input,.ic-section .ds-select{min-height:36px;font-size:14px}
.ic-section .ds-label{font-size:12px;line-height:1.4;margin-bottom:6px}
.ic-section--totals{background:#f3f7fc;border-top:3px solid var(--ds-primary,#1a56db)}
.rec-selected{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border:1px solid #9dc4ef;border-left:5px solid #1a56db;border-radius:10px;padding:14px 18px;background:#edf5ff;color:#17477a}
.rec-selected__title{font-size:17px;font-weight:700}
.rec-selected__actions{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}
.rec-editor-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.rec-days{display:flex;gap:14px;flex-wrap:wrap;padding:12px 0}
.rec-lines input{min-width:90px}
.ds-format-button{display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:6px 12px;border:1px solid #bfd2e6;border-radius:9px;background:#f7fbff;color:#174d80;font-size:12px;font-weight:600;text-decoration:none;cursor:pointer}
.ds-format-button:hover{background:#e9f3ff;border-color:#3173b8;color:#10395e}
.ds-format-button svg{width:25px;height:29px;flex:none;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}
.ds-format-button--ticket{color:#176849;background:#f3fbf7;border-color:#b8ddcd}
.ds-format-button--oficio{color:#755420;background:#fffaf0;border-color:#e5d3ad}
.ds-format-form{display:inline-block;margin:2px}
.rec-route-select{border:0;background:none;color:#17477a;text-align:left;font:inherit;font-weight:650;cursor:pointer;padding:8px 2px;display:flex;align-items:center;gap:10px}
.rcv-page{gap:12px;min-height:0;min-width:0}
.rcv-page .ds-page-header{flex:none;margin:0}
.rcv-page .ds-page-title{font-size:24px}
.rcv-controls{flex:none;min-width:0}
.rcv-controls .ds-toolbar{gap:10px;padding:10px 12px}
.rcv-controls .ds-field{margin:0;min-width:0}
.rcv-month{flex:0 0 118px}
.rcv-year{flex:0 0 78px}
.rcv-state{flex:0 0 150px}
.rcv-count{display:flex;flex-direction:column;justify-content:center;align-self:center;gap:3px;color:var(--ds-text-muted,#64748b);font-size:11px;line-height:1.4}
.rcv-count strong{font-size:12px;color:var(--ds-text,#1e293b);font-weight:600}
.rcv-search{flex:1 1 190px;margin-left:auto!important;max-width:320px}
.rcv-results{display:flex;flex-direction:column;flex:1;min-height:0;gap:12px;overflow:hidden}
.rcv-detail{flex:1;min-height:0;min-width:0;overflow:auto}
.rcv-detail>.ds-table-wrap{height:100%;overflow:auto;box-sizing:border-box}
.rcv-page .ds-table th{position:sticky;top:0;z-index:1;white-space:nowrap}
.rcv-page .ds-table td{white-space:nowrap;font-variant-numeric:tabular-nums}
.rcv-detail .ds-table{font-size:13px}
.rcv-detail .ds-table th{font-size:11px;padding:8px 9px}
.rcv-detail .ds-table td{padding:6px 9px;line-height:1.4}
.rcv-pagination{flex:none}
.rcv-pagination .ds-pagination{font-size:12px;gap:8px}
.rcv-pagination .ds-btn{min-height:30px;padding:4px 9px}
.rcv-summaries{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;flex:0 0 clamp(170px,29vh,260px);min-height:0}
.rcv-summary{display:flex;flex-direction:column;gap:8px;min-height:0;min-width:0;overflow:hidden;padding:10px}
.rcv-summary-title{flex:none;font-size:12px;font-weight:700;line-height:1.4;text-transform:uppercase;color:#fff;background:var(--ds-primary,#1a56db);padding:9px 12px;border-radius:6px;margin:0}
.rcv-summary-content{flex:1;min-height:0;overflow:auto}
.rcv-summary-content>.ds-table-wrap{height:100%;box-sizing:border-box;overflow:auto;box-shadow:none}
.rcv-summary .ds-table{font-size:12px}
.rcv-summary .ds-table th{font-size:10px;line-height:1.3;padding:6px;white-space:normal}
.rcv-summary .ds-table td{padding:5px 6px;line-height:1.4}
.rcv-summary .ds-table th:not(:first-child){text-align:right}
.rcv-summary .ds-table td:first-child{min-width:120px;white-space:normal}
.rcv-summary .ds-table td.rcv-total{position:sticky;bottom:0;z-index:2;background:#e8eff7;font-weight:700;border-top:1px solid #b7cce4}
@media(min-width:901px){.app-main:has(.rcv-page){overflow:hidden}.rcv-page{height:100%;overflow:hidden}}
@media(max-width:900px){
 .rcv-page{height:auto;overflow:visible}
 .rcv-results{flex:none;overflow:visible}
 .rcv-detail{flex:none;height:36vh;min-height:220px}
 .rcv-summaries{flex:none;grid-template-columns:1fr;grid-auto-rows:220px}
 .rcv-search{max-width:none}
}
.reprint-viewer{margin:0;display:flex;flex-direction:column;height:100dvh;background:#eef3f9;font-family:var(--ds-font,sans-serif)}
.reprint-viewer__bar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:16px 24px;background:#fff;border-bottom:1px solid #d7e2ef}
.reprint-viewer__note{margin:0;padding:10px 24px;font-size:12px;color:#475569}
.reprint-viewer iframe{flex:1;width:100%;min-height:0;border:0}
#reprint-error{margin:0;padding:12px 24px;color:#a51d2d;background:#fff0f1}
#reprint-error[hidden]{display:none}
@media(max-width:900px){.ed-split{align-items:stretch}.ed-main{width:100%;min-width:0}.ed-main>.ed-grid{width:100%;min-width:0}}
@media(min-width:901px){
 .ed-main{height:100%;overflow:auto}
 .ed-main>.ed-grid{flex:1 0 140px;max-height:none}
 .ed-main>.ed-grid table{height:auto}
 .folios-layout{align-items:stretch;height:100%;overflow:hidden}
 .folios-main{height:auto;min-height:0;align-self:stretch;box-sizing:border-box}
}
@media(max-width:700px){.gd-filter{max-width:none;min-width:0;flex-basis:100%;margin-left:0}.rec-editor-grid{grid-template-columns:1fr}.rec-selected__actions{margin-left:0}.ic-section{padding:12px}.ic-section>.ds-form-section{margin:-12px -12px 14px}.ct-tabs .ds-tab{flex-basis:130px}}

/* Mis pagos: read-only account, totals separate from the filtered document list. */
.mis-pagos__identity{display:grid;grid-template-columns:220px minmax(0,1fr);gap:16px;padding:16px;background:var(--ds-surface,#fff);border:1px solid var(--ds-border,#dce3ec);border-radius:12px}
.mis-pagos__layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px;align-items:start}
.mis-pagos__account{min-width:0;display:flex;flex-direction:column;gap:12px}
.mis-pagos__account>.ds-table-wrap{min-height:230px;max-height:46dvh;overflow:auto}
.mis-pagos__account .ds-toolbar{align-items:end;margin:0;flex-wrap:wrap}
.mis-pagos__account .ds-field{margin:0;min-width:150px}
.mis-pagos__status{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--ds-muted,#64748b);font-size:13px}
.mis-pagos__bank,.mis-pagos__totals,.mis-pagos__empty{padding:18px;background:var(--ds-surface,#fff);border:1px solid var(--ds-border,#dce3ec);border-radius:12px}
.mis-pagos__bank h2{font-size:16px;margin:0 0 14px;font-weight:700}
.mis-pagos__bank img{display:block;width:100%;height:auto;border-radius:8px}
.mis-pagos__bank p{font-size:13px;margin:14px 0;line-height:1.6}
.mis-pagos__bank small{display:block;color:var(--ds-muted,#64748b);font-size:11px;line-height:1.5;margin-top:14px}
.mis-pagos__bank-actions{display:flex;flex-wrap:wrap;gap:8px}
.mis-pagos__bank-actions .ds-btn{font-size:12px}
.mis-pagos__totals dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:0}
.mis-pagos__totals dt{font-size:11px;font-weight:500;color:var(--ds-muted,#64748b)}
.mis-pagos__totals dd{font-size:20px;font-weight:700;margin:4px 0 0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.mis-pagos__balance dd{color:var(--ds-primary,#1554cf)}
.mis-pagos__totals p{font-size:11px;color:var(--ds-muted,#64748b);margin:12px 0 0}
.mis-pagos__empty{text-align:center;padding:48px 16px;color:var(--ds-muted,#64748b)}
.mis-pagos__empty i{font-size:32px}.mis-pagos__empty h2{font-size:17px;color:var(--ds-text,#172337);margin:12px 0 8px}.mis-pagos__empty p{margin:0}
@media(max-width:1100px){.mis-pagos__layout{grid-template-columns:minmax(0,1fr)}.mis-pagos__bank{max-width:560px}.mis-pagos__bank img{max-width:360px}}
@media(max-width:600px){.mis-pagos__identity{grid-template-columns:minmax(0,1fr)}.mis-pagos__totals{padding:14px}.mis-pagos__totals dl{gap:10px}.mis-pagos__totals dd{font-size:16px}.mis-pagos__totals dt{font-size:10px}.mis-pagos__account>.ds-table-wrap{max-height:55dvh}.mis-pagos__status{flex-wrap:wrap}}
@media(min-width:1101px) and (min-height:700px){
  .mis-pagos{height:100%;min-height:0;gap:16px}
  .mis-pagos>.ds-page-header,.mis-pagos__identity{flex-shrink:0}
  .mis-pagos__identity{padding:12px 16px;grid-template-columns:270px minmax(0,1fr)}
  .mis-pagos__identity .ds-field{display:flex;align-items:center;gap:12px;margin:0;min-width:0}
  .mis-pagos__identity .ds-label{margin:0;white-space:nowrap}
  .mis-pagos__identity .ds-input{min-width:0}
  .mis-pagos__layout{flex:1;min-height:0}
  .mis-pagos__account{height:100%;min-height:0;gap:10px}
  .mis-pagos__account>.ds-table-wrap{flex:1;min-height:120px;max-height:none}
  .mis-pagos__account>.ds-toolbar,.mis-pagos__status,.mis-pagos__account>.ds-pagination,.mis-pagos__totals{flex-shrink:0}
  .mis-pagos__totals{padding:12px 16px}.mis-pagos__totals p{margin-top:8px}.mis-pagos__totals dd{font-size:18px}
}
@media(min-width:1101px) and (min-height:700px){.mis-pagos__identity .ds-field{flex-direction:row}.mis-pagos__identity .ds-label{flex:none}.mis-pagos__identity .ds-input{flex:1;width:0}}

/* Wider document type without changing other compact reprint filters. */
.reprint-page .reprint-doc-type{width:310px;max-width:100%;flex:0 1 310px;min-width:0}
.reprint-doc-type .ds-select{width:100%;min-width:0}
@media(max-width:600px){.reprint-page .reprint-doc-type{width:100%;flex:1 1 100%}}

/* Keep company keyboard focus inside the card, clear of the scroll clipping edge. */
.empresa-list{padding:6px;scroll-padding-block:6px;gap:8px}
.empresa-list .empresa-item:focus,.empresa-list .empresa-item:focus-visible{
  outline:none!important;border-color:var(--ds-focus);background:linear-gradient(105deg,#fff1e5,#fffaf5 55%,#fff);
  box-shadow:inset 4px 0 0 var(--ds-focus),inset 0 0 0 1px rgb(249 115 22 / 30%),0 2px 8px rgb(15 23 42 / 8%);
}
@media(max-width:480px){
  .auth-card-emp{padding:24px 20px}
  .empresa-list .empresa-item{display:grid;grid-template-columns:34px minmax(0,1fr);column-gap:10px;row-gap:4px}
  .empresa-list .empresa-ico{grid-row:1 / span 2;align-self:center}
  .empresa-list .empresa-txt{grid-column:2}
  .empresa-list .empresa-nombre{white-space:normal;overflow-wrap:anywhere;line-height:1.35}
  .empresa-list .empresa-rut{white-space:nowrap}
  .empresa-list .empresa-tag{grid-column:2;justify-self:start}
}
