/* Los paneles se muestran sin animar opacity/transform: evita el área en blanco reproducida en Safari al cambiar de sección. */
:root{--ink:#0b0b0e;--ink-2:#1a1a1f;--paper:#fbfaf6;--linen:#ece9df;--stone:#6e6b62;--line:#d9d5c8;--orange:#ff6600;--red:#cc0000;--purple:#660099;--green:#1f8a5b;--amber:#e08400;--danger:#b33a3a;--blue:#2a6fdb;--radius:.35rem;--shadow:0 .8rem 2.5rem rgba(11,11,14,.08)}
[hidden]{display:none!important}
.client-brand{display:flex;align-items:center;gap:.65rem;color:var(--ink)}.client-brand span{display:grid;place-items:center;width:2.1rem;height:2.1rem;background:var(--orange);color:#fff;font:800 .68rem/1 ui-monospace,"Cascadia Code",monospace;letter-spacing:-.05em}.client-brand strong{font-size:.72rem;letter-spacing:.1em}.client-brand.inverse{color:#fff}.made-by{display:grid;gap:.55rem}.made-by small{color:#85837c;font:700 .56rem/1 ui-monospace,"Cascadia Code",monospace;letter-spacing:.14em}.valorsa-lockup{display:flex;align-items:center;gap:.45rem;font-size:.7rem;letter-spacing:.12em}.valorsa-lockup img{width:1.75rem;height:1.75rem;object-fit:contain}.login-credit{justify-items:center;margin-top:.2rem;padding-top:1rem;border-top:1px solid var(--line)}.mobile-credit{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:.3rem;color:#77756e;font-size:.55rem;letter-spacing:.04em}.mobile-credit img{width:1.05rem;height:1.05rem;object-fit:contain}.mobile-credit strong{color:#d7d5cd;letter-spacing:.08em}
.sidebar-foot .made-by{margin-top:1rem;padding-top:1rem;border-top:1px solid #303036}
*{box-sizing:border-box}html{font-size:16px}body{margin:0;background:var(--paper);color:var(--ink);font-family:"Aptos","Segoe UI",sans-serif;line-height:1.5}button,input,select,textarea{font:inherit}button{color:inherit}.grain{position:fixed;inset:0;pointer-events:none;opacity:.035;z-index:100;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E")}.eyebrow{margin:0 0 .6rem;color:var(--orange);font-family:ui-monospace,"Cascadia Code",monospace;font-size:.7rem;font-weight:700;letter-spacing:.15em}.eyebrow.light{color:#ff9b59}.wordmark{display:flex;align-items:center;gap:.7rem;font-weight:800;letter-spacing:.12em}.wordmark span{display:grid;place-items:center;width:2rem;height:2rem;background:var(--ink);color:var(--paper);font-family:Georgia,serif;font-size:1.25rem}.wordmark.inverse{color:#fff}.wordmark.inverse span{background:var(--orange)}
.login-shell{min-height:100vh;display:grid}.login-art{position:relative;display:none;background:var(--ink);color:#fff;padding:clamp(2rem,6vw,6rem);overflow:hidden}.login-art:after{content:"";position:absolute;width:38rem;height:38rem;right:-15rem;bottom:-12rem;border:1px solid rgba(255,255,255,.16);border-radius:50%;box-shadow:0 0 0 5rem rgba(255,255,255,.025),0 0 0 10rem rgba(255,255,255,.025)}.brand-ribbon{position:absolute;inset:0 auto 0 0;width:.45rem;background:linear-gradient(var(--orange),var(--red),var(--purple))}.login-art h1{margin:auto 0 1.5rem;font:500 clamp(3rem,6vw,6.5rem)/.92 Georgia,"Times New Roman",serif;letter-spacing:-.055em}.login-art h1 em{color:#ff8a3c;font-weight:400}.login-copy{max-width:34rem;color:#b9b7af;font-size:1.05rem}.coordinates{position:absolute;right:4rem;top:4rem;color:#77756e;font:500 .7rem/1.7 ui-monospace,monospace;text-align:right}.login-panel{display:grid;place-items:center;padding:1.5rem}.login-form{width:min(100%,25rem);display:grid;gap:1.35rem}.login-form h2,.page-head h2,.modal h2{margin:0;font:500 clamp(2rem,5vw,3.2rem)/1 Georgia,serif;letter-spacing:-.035em}.field-label{display:grid;gap:.45rem;color:var(--stone);font-size:.82rem;font-weight:700}.field-label input,.field-label textarea,.toolbar input,.toolbar select{width:100%;min-height:3rem;border:1px solid var(--line);border-radius:var(--radius);background:#fff;color:var(--ink);padding:.7rem .9rem;outline:none}.field-label input:focus,.field-label textarea:focus,.toolbar input:focus,.toolbar select:focus{border-color:var(--orange);box-shadow:0 0 0 3px rgba(255,102,0,.12)}.password-wrap{position:relative}.password-wrap input{padding-right:4rem}.icon-button{display:grid;place-items:center;min-width:2.75rem;min-height:2.75rem;border:0;background:transparent;cursor:pointer}.password-wrap .icon-button{position:absolute;right:.15rem;top:.15rem;color:var(--stone);font-size:.75rem;font-weight:700}.button{min-height:2.8rem;border:1px solid transparent;border-radius:var(--radius);padding:.65rem 1rem;font-weight:750;cursor:pointer;transition:transform .18s,box-shadow .18s,background .18s}.button:hover{transform:translateY(-1px)}.button:disabled{opacity:.5;cursor:wait;transform:none}.button.primary{background:var(--ink);color:#fff}.button.primary:hover{box-shadow:0 .5rem 1.4rem rgba(11,11,14,.18)}.button.primary span{color:var(--orange);font-size:1.2rem}.button.secondary{border-color:var(--line);background:#fff}.button.small{min-height:2.5rem;font-size:.82rem}.button.wide{display:flex;justify-content:space-between;align-items:center;width:100%}.form-error{min-height:1.25rem;margin:0;color:var(--danger);font-size:.82rem}.secure-note{text-align:center;color:#96938a;font-size:.72rem}
.app-shell{min-height:100vh}.sidebar{display:none}.mobile-header{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;height:4.5rem;padding:0 1rem;background:rgba(251,250,246,.94);border-bottom:1px solid var(--line);backdrop-filter:blur(12px)}.text-button{min-height:2.75rem;border:0;background:transparent;color:var(--stone);font-weight:700;cursor:pointer}.workspace{padding:1rem 1rem 6.5rem}.tab-panel{display:none}.tab-panel.active{display:block}@keyframes reveal{from{opacity:0;transform:translateY(.5rem)}to{opacity:1;transform:none}}.page-head{display:flex;align-items:end;justify-content:space-between;gap:1rem;margin-bottom:1.5rem}.page-head h2{font-size:clamp(2.1rem,7vw,4rem)}.metric-grid{display:grid;gap:.75rem;margin-bottom:1rem}.metric-card{position:relative;overflow:hidden;min-height:9rem;padding:1rem;background:#fff;border:1px solid var(--line);border-top:3px solid var(--blue)}.metric-card:after{content:"";position:absolute;width:5rem;height:5rem;right:-2rem;bottom:-2rem;border:1px solid var(--line);border-radius:50%}.metric-card:nth-child(2){border-top-color:var(--green)}.metric-card.alert{border-top-color:var(--danger)}.metric-card p{margin:0;color:var(--stone);font-size:.76rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em}.metric-card strong{display:block;margin:.7rem 0 .2rem;font:500 2rem Georgia,serif}.metric-card small{color:#96938a}.toolbar{display:grid;gap:.6rem;margin:1rem 0}.search{position:relative}.search span{position:absolute;left:.9rem;top:.65rem;font-size:1.2rem}.search input{padding-left:2.5rem}.table-shell,.list-card{background:#fff;border:1px solid var(--line);box-shadow:0 .2rem 1.2rem rgba(11,11,14,.03)}.table-shell{overflow:auto}table{width:100%;min-width:48rem;border-collapse:collapse}th,td{text-align:left;padding:.85rem 1rem;border-bottom:1px solid #ebe8df}th{color:var(--stone);font-size:.7rem;text-transform:uppercase;letter-spacing:.08em}td{font-size:.88rem}.status{display:inline-flex;align-items:center;gap:.35rem;padding:.25rem .5rem;border-radius:2rem;background:#eee;color:var(--stone);font-size:.7rem;font-weight:800}.status:before{content:"";width:.4rem;height:.4rem;border-radius:50%;background:currentColor}.status.procesada,.status.enviado{background:#e5f4ec;color:var(--green)}.status.error{background:#fae8e8;color:var(--danger)}.status.procesando,.status.pendiente{background:#fff2db;color:var(--amber)}.empty-state{padding:4rem 1rem;text-align:center}.empty-state span{font-size:2.5rem;color:var(--line)}.empty-state h3{margin:.5rem 0;font:500 1.4rem Georgia,serif}.empty-state p{margin:0;color:var(--stone)}.news-layout,.contacts-grid{display:grid;gap:1rem}.feature-card{position:relative;display:flex;justify-content:space-between;min-height:14rem;padding:1.5rem;background:var(--ink);color:#fff;overflow:hidden}.feature-card:before{content:"";position:absolute;inset:auto 0 0;height:.3rem;background:linear-gradient(90deg,var(--orange),var(--red),var(--purple))}.feature-card h3{max-width:18ch;margin:1.5rem 0 .5rem;font:500 2rem/1.05 Georgia,serif}.feature-card p{color:#a5a39c}.feature-mark{align-self:end;color:#29292e;font:500 8rem/.75 Georgia,serif}.list-head{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--line)}.list-head h3{margin:0;font:500 1.25rem Georgia,serif}.news-item,.contact-item{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem;border-bottom:1px solid #ebe8df}.news-item:last-child,.contact-item:last-child{border:0}.news-item h4,.contact-item h4{margin:0 0 .2rem;font-size:.9rem}.news-item p,.contact-item p{margin:0;color:var(--stone);font-size:.78rem}.news-actions{display:flex;align-items:center;gap:.5rem}.danger-link{min-height:2.75rem;border:0;background:transparent;color:var(--danger);font-size:.75rem;font-weight:800;cursor:pointer}
.bottom-nav{position:fixed;z-index:30;bottom:0;left:0;right:0;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));background:var(--ink);padding:max(.4rem,env(safe-area-inset-bottom)) .25rem .4rem}.bottom-nav button{min-height:3.8rem;border:0;background:transparent;color:#888780;font-size:.66rem;font-weight:700}.bottom-nav button span{display:block;margin-bottom:.1rem;font-size:1rem}.bottom-nav button.active{color:#fff}.bottom-nav button.active span{color:var(--orange)}
.modal{width:min(calc(100% - 1.5rem),36rem);max-height:calc(100vh - 1.5rem);border:0;border-radius:var(--radius);padding:0;background:var(--paper);box-shadow:0 2rem 6rem rgba(0,0,0,.28)}.modal::backdrop{background:rgba(11,11,14,.64);backdrop-filter:blur(4px)}.modal form{padding:1.25rem}.wide-modal{width:min(calc(100% - 1.5rem),58rem)}.small-modal{width:min(calc(100% - 1.5rem),30rem)}.modal-head{display:flex;align-items:start;justify-content:space-between;margin-bottom:1.4rem}.modal-head h2{font-size:2.1rem}.dropzone{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:14rem;border:1px dashed #a6a399;background:#fff;text-align:center;cursor:pointer;padding:1rem;transition:border .2s,background .2s}.dropzone:hover{border-color:var(--orange);background:#fffaf6}.dropzone input{position:absolute;width:1px;height:1px;opacity:0}.drop-icon{color:var(--orange);font-size:2.2rem}.dropzone small,.dropzone em{margin-top:.3rem;color:var(--stone);font-size:.75rem}.dropzone em{color:var(--green);font-style:normal;font-weight:700}.helper{padding:.8rem;background:var(--linen);color:var(--stone);font-size:.78rem}.modal-actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}.form-grid,.form-stack{display:grid;gap:1rem}.dropzone.compact{min-height:12rem}fieldset{margin:0;border:1px solid var(--line);padding:.8rem}legend{padding:0 .35rem;color:var(--stone);font-size:.78rem;font-weight:700}.check-list{display:grid;gap:.45rem;max-height:9rem;overflow:auto}.check-list label{display:flex;align-items:center;gap:.5rem;font-size:.84rem}
.check-line{display:flex;align-items:center;gap:.5rem;font-size:.84rem}.check-list input{width:1.1rem;height:1.1rem;accent-color:var(--orange)}.muted{color:var(--stone);font-size:.82rem}.toast-region{position:fixed;z-index:80;right:1rem;bottom:5.5rem;display:grid;gap:.5rem}.toast{width:min(22rem,calc(100vw - 2rem));padding:.85rem 1rem;background:var(--ink);color:#fff;border-left:.25rem solid var(--orange);box-shadow:var(--shadow);animation:reveal .2s ease}.toast.error{border-left-color:var(--danger)}
@media(min-width:640px){.metric-grid{grid-template-columns:repeat(3,1fr)}.toolbar{grid-template-columns:minmax(16rem,1fr) 11rem 11rem}.form-grid{grid-template-columns:minmax(15rem,.8fr) 1.2fr}.modal form{padding:1.75rem}.news-layout{grid-template-columns:minmax(16rem,.7fr) 1.3fr}.contacts-grid{grid-template-columns:1fr 1fr}}
@media(min-width:600px){.app-shell{display:grid;grid-template-columns:15rem minmax(0,1fr)}.sidebar{position:sticky;top:0;display:flex;flex-direction:column;height:100vh;padding:1.5rem 1rem;background:var(--ink);color:#fff}.nav-list{display:grid;gap:.35rem;margin-top:4rem}.nav-item{display:flex;align-items:center;gap:1rem;min-height:3.25rem;border:0;border-left:2px solid transparent;background:transparent;color:#8e8c85;text-align:left;font-weight:700;cursor:pointer}.nav-item span{font:600 .64rem ui-monospace,monospace}.nav-item.active{border-left-color:var(--orange);color:#fff;background:linear-gradient(90deg,rgba(255,102,0,.1),transparent)}.sidebar-foot{margin-top:auto;border-top:1px solid #303036;padding-top:1rem}.sidebar-foot p{color:#77756e;font:600 .65rem ui-monospace,monospace}.sidebar-foot .text-button{color:#aaa8a0;padding:0}.mobile-header,.bottom-nav{display:none}.workspace{padding:2.25rem clamp(2rem,4vw,4.5rem) 4rem;overflow:hidden}.page-head{margin-bottom:2rem}.toast-region{bottom:1rem}}
@media(min-width:1440px){.workspace{max-width:110rem;width:100%;margin:0 auto}.metric-card{padding:1.35rem}.metric-card strong{font-size:2.5rem}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
@media(min-width:860px){.login-shell{grid-template-columns:minmax(0,1.3fr) minmax(26rem,.7fr)}.login-art{display:flex;flex-direction:column}}
.field-columns{display:grid;gap:1rem}@media(min-width:640px){.field-columns{grid-template-columns:1fr 1fr}}
.row-actions{white-space:nowrap;text-align:right}.row-actions button{min-height:2.4rem;border:0;background:transparent;font-size:.75rem;font-weight:800;cursor:pointer}.row-actions .edit{color:var(--blue)}

/* Expedientes, biblioteca y centro de correos: mismos controles del portal. */
.op-stack { display: grid; gap: 16px; }
.op-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:16px 0; border-bottom:1px solid #e6e2dc; }
.op-row > div:first-child { flex:1; min-width:180px; }
.op-actions,.op-tabs { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:12px 0; }
.op-tabs .button { flex:1; }
.op-prewrap { white-space:pre-wrap; overflow-wrap:anywhere; }
.operations-dialog { width:min(880px,94vw); max-height:90vh; overflow:auto; }
.operations-dialog form { margin-top:20px; }
.operations-dialog select[multiple] { min-height:110px; }
#op-companies,#op-product-detail,#op-products-list { margin-bottom:20px; }
#tab-fichas > input { width:100%; margin-bottom:18px; }
#op-mails summary { cursor:pointer; font-weight:600; }
.op-load-error { overflow-wrap:anywhere; }
@media(max-width:760px) {
  .bottom-nav { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .bottom-nav > button { font-size:10px; }
  .op-actions > label { flex:1; min-width:130px; }
  .operations-dialog { padding:18px; }
}

#op-companies, #op-products-list, #op-product-detail, #op-mail-list > .list-card, #op-dossier .list-card { padding:20px; }
.op-actions > input, #tab-fichas > input { min-height:44px; padding:10px 12px; border:1px solid var(--line); background:#fff; border-radius:4px; }
.op-actions > input { flex:1; min-width:200px; }
@media(max-width:1023px) { .bottom-nav { grid-template-columns:repeat(6,minmax(0,1fr)); } .contacts-grid { grid-template-columns:minmax(0,1fr); } }
.op-actions select { width:100%; min-height:44px; padding:10px 12px; border:1px solid var(--line); border-radius:4px; background:#fff; color:var(--ink); font:inherit; }

/* Índice jerárquico: navegación a la izquierda, trabajo a la derecha. */
.sidebar { overflow-y:auto; }
.nav-list { margin-top:2.5rem; padding-bottom:1.5rem; }
.nav-item { width:100%; padding:.6rem .7rem; border-radius:0 .4rem .4rem 0; }
.nav-parent { gap:.75rem; }
.nav-chevron { margin-left:auto; transition:transform .15s; }
.nav-parent[aria-expanded="true"] .nav-chevron { transform:rotate(180deg); }
.nav-children { margin:.25rem 0 .6rem 1.2rem; padding-left:.45rem; border-left:1px solid #36363c; }
.nav-children[hidden] { display:none; }
.nav-child { min-height:2.65rem; gap:.6rem; font-size:.82rem; font-weight:500; }
.nav-child span { min-width:1.4rem; color:#aaa8a0; }
.nav-child.active span { color:var(--orange); }
.nav-item:hover { color:#fff; background:#252529; }
.nav-item:focus-visible { outline:2px solid var(--orange); outline-offset:2px; }
#app-view:not(.operations-ready) .nav-children,
#app-view:not(.operations-ready) .nav-chevron { display:none; }
.nav-backdrop { position:fixed; inset:0; z-index:29; border:0; background:rgba(0,0,0,.35); }
@media(min-width:600px) {
  .nav-backdrop { display:none; }
  .workspace { min-width:0; padding:2rem clamp(1.25rem,3vw,4.5rem) 4rem; }
  .sidebar-foot { flex-shrink:0; }
}
@media(max-width:599px) {
  .navigation-open .sidebar { position:fixed; inset:0 auto 0 0; z-index:30; display:flex; flex-direction:column; width:min(18rem,85vw); height:100dvh; padding:1.5rem 1rem; background:var(--ink); color:#fff; box-shadow:8px 0 30px #0003; }
  .nav-list { display:grid; gap:.35rem; }
  .nav-item { display:flex; align-items:center; gap:.75rem; min-height:3rem; border:0; border-left:2px solid transparent; background:transparent; color:#aaa8a0; text-align:left; font-weight:600; cursor:pointer; }
  .nav-item span { font:600 .7rem ui-monospace,monospace; }
  .nav-item.active { color:#fff; border-left-color:var(--orange); background:#ffffff0d; }
  .sidebar-foot { margin-top:auto; }
  .sidebar-foot .text-button { color:#aaa8a0; }
  .mobile-header .client-brand { font-size:.7rem; }
}

@media(min-width:600px) and (max-width:900px) { .app-shell { grid-template-columns:12rem minmax(0,1fr); } .sidebar { padding:1.25rem .65rem; } .sidebar .client-brand { gap:.5rem; font-size:.7rem; } .nav-item { font-size:.78rem; gap:.55rem; } .nav-children { margin-left:.7rem; } .nav-child { font-size:.76rem; } .workspace { padding:1.5rem 1rem 3rem; } .op-row { flex-wrap:wrap; } }
.list-card > .search { display:block; margin:1rem 1rem .25rem; }
.list-card > .search input { width:100%; min-height:2.75rem; padding:.6rem .9rem .6rem 2.5rem; border:1px solid var(--line); border-radius:var(--radius); background:#fff; color:var(--ink); outline:none; }
.list-card > .search input:focus { border-color:var(--ink); }
.list-card > .search span { top:50%; transform:translateY(-50%); color:var(--stone); line-height:1; pointer-events:none; }
.contact-list > .muted { margin:0; padding:1.25rem 1rem; }
#tab-embarques table { min-width:60rem; }
#tab-embarques th { padding:1rem 1.25rem; }
#tab-embarques td { padding:1.1rem 1.25rem; vertical-align:top; line-height:1.45; }
#tab-embarques tbody tr:hover { background:#fbfaf6; }
#tab-embarques .cell-client { min-width:16rem; max-width:24rem; }
#tab-embarques .cell-client strong { display:block; font-size:.95rem; }
#tab-embarques .cell-emails { display:flex; flex-direction:column; gap:.1rem; margin-top:.35rem; color:var(--stone); font-size:.76rem; overflow-wrap:anywhere; }
#tab-embarques .cell-sub { margin-top:.2rem; color:var(--stone); font-size:.74rem; }
#tab-embarques .cell-code { font-family:ui-monospace,"Cascadia Code",monospace; font-size:.82rem; white-space:nowrap; }
#tab-embarques .cell-dates { white-space:nowrap; font-size:.84rem; }
#tab-embarques .cell-dates div + div { margin-top:.25rem; }
#tab-embarques .cell-label { display:inline-block; width:2.4rem; color:var(--stone); font-size:.66rem; font-weight:800; letter-spacing:.06em; }
#tab-embarques .row-actions { vertical-align:middle; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* Componentes operativos: escala y distribución compartidas. */
.app-shell .page-head h2, #op-mails h2 { font:700 clamp(1.75rem,2.3vw,2rem)/1.2 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; letter-spacing:-.025em; }
.modal h2 { font:700 1.5rem/1.25 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; letter-spacing:-.02em; }
.app-shell h3, .modal h3, .app-shell .list-head h3 { font-family:inherit; font-size:1rem; font-weight:650; line-height:1.4; }
.page-head { align-items:center; gap:1rem; }
.app-shell .button, .modal .button { min-height:44px; font-size:.875rem; }
.app-shell .text-button, .modal .text-button { min-height:44px; padding:.45rem .5rem; font-size:.875rem; }
.modal .icon-button { min-width:44px; min-height:44px; }
.app-shell a.button, .modal a.button { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.app-shell a.button.secondary, .modal a.button.secondary { color:var(--ink); }
.field-label select, .search input { width:100%; min-height:44px; padding:.65rem .8rem; border:1px solid var(--line); border-radius:var(--radius); background:#fff; color:var(--ink); font:inherit; }
.field-label select:focus-visible, .search input:focus-visible { outline:2px solid var(--orange); outline-offset:2px; }
.operations-dialog { width:min(720px,calc(100vw - 32px)); padding:24px; border-radius:12px; }
.operations-dialog .modal-head { align-items:center; margin:0 0 20px; }
.operations-dialog form { padding:0; margin-top:0; }
.operations-dialog .field-label { font-size:.875rem; color:var(--ink); gap:8px; }
.operations-dialog input, .operations-dialog textarea, .operations-dialog select { font:inherit; }
.operations-dialog textarea { min-height:110px; resize:vertical; }
.operations-dialog > .button { margin-top:16px; }
.form-stack { gap:18px; }
#op-mails .page-head { margin-bottom:0; }
#op-mails > .button { justify-self:start; }
#op-mails > p { margin:0; }
.op-choice-list { display:grid; gap:10px; max-height:220px; overflow:auto; border-radius:8px; }
.op-choice-list label, .document-choices label, .modal .check-line { cursor:pointer; min-height:44px; }
.op-choice-list input, .attachment-row > input { accent-color:var(--orange); flex-shrink:0; }
.attachment-picker { border:1px solid var(--line); padding:16px; border-radius:8px; background:#fff; }
.attachment-picker h3 { margin:0; }
.attachment-picker p { margin:8px 0; font-size:.8rem; line-height:1.4; }
.attachment-picker .op-actions { margin:10px 0; }
.operations-dialog .form-error:empty { display:none; }
.attachment-list { display:grid; gap:10px; }
.attachment-row { display:flex; gap:12px; align-items:center; padding:10px; border:1px solid var(--line); border-radius:8px; }
.attachment-info { flex:1; min-width:0; display:grid; gap:5px; overflow-wrap:anywhere; }
.attachment-info small { color:var(--stone); }
.attachment-info select { min-height:36px; padding:6px; border:1px solid var(--line); border-radius:4px; background:#fff; }
.attachment-thumb, .file-marker { width:56px; height:56px; flex-shrink:0; border-radius:6px; object-fit:contain; background:var(--linen); }
.file-marker { display:grid; place-items:center; font-size:.75rem; font-weight:700; }
.document-choices { display:grid; gap:8px; max-height:340px; overflow:auto; margin:16px 0; }
.mail-photo { display:block; max-width:100%; max-height:600px; height:auto; object-fit:contain; margin:16px 0; }
.document-link { display:block; margin:12px 0; color:var(--ink); overflow-wrap:anywhere; }
.mail-preview { border:1px solid var(--line); border-radius:8px; padding:18px; margin-bottom:20px; background:#fff; }
.mail-preview h3 { margin-top:0; }
.recipient-preview { margin-bottom:20px; }
.mail-history { padding:0; border-radius:8px; overflow:hidden; }
.mail-history > h3, .mail-history > summary { margin:0; padding:16px 20px; border-bottom:1px solid var(--line); font-size:1rem; font-weight:650; line-height:1.4; }
.mail-history > p { margin:0; padding:24px 20px; }
.mail-history-item { padding:16px 20px; border-bottom:1px solid var(--line); }
.mail-history-item:last-child { border-bottom:0; }
.mail-history-item > summary { display:grid; grid-template-columns:10rem minmax(0,1fr) auto; gap:16px; align-items:center; cursor:pointer; }
.mail-history-item > summary time { font-size:.8rem; font-weight:400; color:var(--stone); }
.mail-history-info { display:grid; gap:5px; min-width:0; }
.mail-history-info strong { overflow-wrap:anywhere; font-size:.92rem; }
.mail-history-info small { color:var(--stone); font-size:.8rem; font-weight:400; }
.mail-state { border-radius:20px; padding:5px 10px; font-size:.75rem; font-weight:650; white-space:nowrap; background:var(--linen); color:var(--stone); }
.mail-state.ok { background:#e5f4ec; color:var(--green); }
.mail-state.warning, .mail-state.pending { background:#fff2db; color:#80530d; }
.mail-state.error { background:#fae8e8; color:var(--danger); }
.mail-history-item[open] > summary { margin-bottom:16px; }
.product-filters { display:flex; flex-wrap:wrap; align-items:flex-start; gap:10px; margin:0 0 20px; }
.filter-menu { position:relative; min-width:140px; max-width:100%; }
.filter-menu summary { min-height:44px; padding:11px 14px; border:1px solid var(--line); border-radius:8px; background:#fff; font-size:.875rem; cursor:pointer; }
.filter-menu select { min-height:44px; margin-top:6px; max-width:100%; width:100%; border:1px solid var(--line); background:#fff; font:inherit; }
.filter-menu[open] summary { border-color:var(--orange); }
#op-product-detail[hidden] { display:none; }
#op-product-detail { margin-top:20px; border-radius:8px; }
.contact-item { flex-wrap:wrap; }
.contact-item .news-actions { flex-wrap:wrap; }
.search { display:block; margin:16px; }
.search input { padding-left:2.5rem; }
@media(max-width:1000px) { .mail-history-item > summary { grid-template-columns:minmax(0,1fr) auto; gap:10px; } .mail-history-item > summary time { grid-column:1/-1; } }
@media(max-width:599px) { .operations-dialog { padding:18px; } .page-head { flex-wrap:wrap; } .attachment-row { flex-wrap:wrap; } .product-filters > * { flex:1 1 140px; } }

.embarque-toolbar{grid-template-columns:1fr}.segmented{display:flex;flex-wrap:wrap;gap:.4rem}.segmented button{min-height:2.5rem;padding:.35rem .8rem;border:1px solid var(--line);border-radius:2rem;background:#fff;color:var(--stone);font-size:.78rem;font-weight:700;cursor:pointer}.segmented button.active{background:var(--ink);border-color:var(--ink);color:#fff}.segmented span{opacity:.75}
.cell-state{min-width:11rem}.cell-state > * + *{margin-top:.15rem}.cell-state a{font-size:.75rem}.missing-list{display:flex;flex-wrap:wrap;gap:.25rem}.missing-list span{padding:.15rem .45rem;border-radius:2rem;background:#fff2db;color:var(--amber);font-size:.68rem;font-weight:800}
.bl-reader{display:grid;gap:.6rem;margin-bottom:1rem;padding:.9rem;border:1px dashed var(--line);background:var(--paper)}.bl-reader small{display:block;color:var(--stone);font-size:.75rem}.bl-reader p{margin:0;font-size:.78rem}.bl-reader label.button{justify-self:start;cursor:pointer}
@media(min-width:900px){.embarque-toolbar{grid-template-columns:minmax(16rem,1fr) auto;align-items:center}.bl-reader{grid-template-columns:1fr auto;align-items:center}.bl-reader p{grid-column:1/-1}}
.row-actions button{display:block;margin-left:auto}#embarque-active-table table{min-width:72rem}#embarque-history-table table{min-width:60rem}
.button.danger{background:#fff;border-color:var(--danger);color:var(--danger)}.op-sheet-product{padding:1rem}.op-sheet-product h3{margin:0 0 .5rem;font:500 1.05rem Georgia,serif}.op-sheet-product .attachment-row{display:flex;align-items:center;gap:.6rem;padding:.4rem 0}.op-sheet-product .attachment-row span{flex:1}

.contacts-grid.companies-only { grid-template-columns: 1fr; }

.shipment-detail td { background: #f4f2ec; padding: 20px; }
.shipment-fields { display:grid;grid-template-columns: minmax(120px,1fr) minmax(180px,3fr); gap:8px 18px;white-space:normal; }
.shipment-fields dt {font-weight:600;}.shipment-fields dd {margin:0;overflow-wrap:anywhere;}

.bl-reader{border:1px solid var(--line);border-left:4px solid var(--orange,#ff6600);padding:20px;gap:18px;margin:18px 0 24px;grid-template-columns:1fr;background:#fffaf5}.bl-intro h3{font-size:22px;margin:8px 0}.bl-intro p{font-size:14px;line-height:1.5}.bl-upload{display:flex;align-items:flex-start;gap:8px;flex-direction:column}.bl-upload .button{min-height:48px;font-size:15px}.bl-upload small{font-size:12px}.bl-upload p{overflow-wrap:anywhere}.bl-steps{display:flex;flex-wrap:wrap;gap:12px 32px;margin:0;padding-left:20px;font-size:12px;color:var(--stone)}#bl-result{grid-column:1/-1;overflow-wrap:anywhere}.bl-reader .shipment-fields{margin:10px 0}#consultas-list{display:grid;gap:12px;padding:20px}

#consultas-form .modal-head{padding:20px 20px 0}#consultas-list .list-card{padding:16px}#consultas-list h3{font-size:16px;margin:0 0 8px}#consultas-list p{font-size:14px;overflow-wrap:anywhere}
.bl-reader{grid-template-columns:minmax(0,1fr)}.bl-reader>*{min-width:0}.bl-reader .shipment-fields{grid-template-columns:minmax(0,1fr) minmax(0,2fr)}.bl-reader h3,.bl-reader p,.bl-reader small,.bl-reader dt{overflow-wrap:anywhere}
@media(max-width:480px){.bl-reader{padding:16px}.bl-reader .shipment-fields{grid-template-columns:minmax(0,1fr)}.bl-reader .shipment-fields dd{margin-bottom:10px}}

.row-actions button:disabled{color:var(--stone);cursor:not-allowed;opacity:.65}

/* Los encabezados accesibles absolutos deben quedar dentro del área desplazable,
   no anclados al viewport: de otro modo ensanchan toda la página en móvil. */
.table-shell{position:relative;max-width:100%;min-width:0}
.table-shell th{position:relative}
.workspace,.tab-panel{min-width:0}
.row-actions button{min-height:2.75rem}
@media(min-width:1024px){
  #embarque-active-table table{min-width:64rem}
  #tab-embarques .cell-client{min-width:12rem}
  #tab-embarques th,#tab-embarques td{padding:.85rem .75rem}
}

/* 4.4 Boletín de precios: resumen, boletines generados y selector de columnas. */
#op-boletin{padding:24px;border-radius:8px;display:grid;gap:18px}
#op-boletin>.eyebrow{margin:0}
.boletin-stats{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(13rem,1fr))}
.boletin-stat{display:grid;gap:4px;padding:14px 16px;border:1px solid var(--line);border-left:4px solid var(--line);border-radius:8px;background:var(--paper)}
.boletin-stat.ok{border-left-color:var(--green)}
.boletin-stat.warning{border-left-color:var(--amber);background:#fffaf0}
.boletin-stat small{color:var(--stone);font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.boletin-stat strong{font-size:1.05rem;line-height:1.3}
.boletin-stat p{margin:0;color:var(--stone);font-size:.8rem;line-height:1.45;overflow-wrap:anywhere}
.boletin-actions{margin:0}
.boletin-subtitle{margin:6px 0 0;font-size:.95rem;font-weight:650}
.boletin-empty{margin:0;padding:18px;border:1px dashed var(--line);border-radius:8px;color:var(--stone);font-size:.85rem;text-align:center}
.boletin-card{display:grid;gap:14px;padding:16px;border:1px solid var(--line);border-radius:8px;background:#fff}
.boletin-card-info{display:grid;gap:10px;min-width:0}
.boletin-card-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.boletin-card-head strong{overflow-wrap:anywhere}
.boletin-card-actions{margin:0}
.boletin-preview{display:block;max-width:min(100%,460px);height:auto;border:1px solid var(--line);border-radius:6px}

.boletin-file{min-width:0;display:grid;gap:2px;padding:12px 14px;border-radius:8px;background:var(--linen)}
.boletin-file strong{overflow-wrap:anywhere}
.boletin-file small{color:var(--stone);font-size:.8rem}
.boletin-columns{display:grid;gap:8px;min-width:0;margin:0;padding:0;border:0}
.boletin-columns-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px}
.boletin-columns legend{float:left;padding:0;font-size:.95rem;font-weight:650;color:var(--ink)}
.boletin-count{color:var(--stone);font-size:.8rem;font-weight:600}
.boletin-columns-tools{display:flex;gap:8px}
.boletin-columns-tools .button{min-height:2.25rem;padding:.35rem .8rem;font-size:.78rem}
.boletin-column{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) 10.5rem;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-left:4px solid var(--line);border-radius:8px;background:#fff;transition:border-color .15s,background .15s}
.boletin-column:has(input[type="checkbox"]:checked){border-left-color:var(--orange);background:#fffaf5}
.boletin-column-labels{padding:0 12px 0 16px;border:0;background:none;color:var(--stone);font-size:.72rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase}
.boletin-column-name{display:flex;align-items:center;gap:10px;min-height:40px;min-width:0;cursor:pointer;font-weight:600}
.boletin-column-name span{overflow-wrap:anywhere}
.boletin-column-name input{width:1.15rem;height:1.15rem;flex-shrink:0;accent-color:var(--orange);cursor:pointer}
.boletin-column input[type="text"],.boletin-column select{width:100%;min-height:40px;padding:.5rem .7rem;border:1px solid var(--line);border-radius:var(--radius);background:#fff;color:var(--ink);font:inherit;font-size:.9rem;outline:none}
.boletin-column input[type="text"]:focus,.boletin-column select:focus{border-color:var(--orange);box-shadow:0 0 0 3px rgba(255,102,0,.12)}
.boletin-column:not(:has(input[type="checkbox"]:checked)) :is(input[type="text"],select){color:var(--stone);background:var(--paper)}
.boletin-sample{min-width:0;border:1px solid var(--line);border-radius:8px;background:#fff}
.boletin-sample summary{padding:12px 14px;cursor:pointer;font-size:.88rem;font-weight:600}
.boletin-sample[open] summary{border-bottom:1px solid var(--line)}
.boletin-sample-table{max-height:260px;overflow:auto}
.boletin-sample table{width:100%;border-collapse:collapse;font-size:.8rem}
.boletin-sample td{padding:7px 10px;border-bottom:1px solid var(--linen);white-space:nowrap}
.boletin-sample tr:nth-child(even) td{background:var(--paper)}
@media (max-width:640px){
  #op-boletin{padding:16px}
  .boletin-column{grid-template-columns:minmax(0,1fr)}
  .boletin-column-labels{display:none}
}

.expense-report{margin-bottom:1.25rem;min-width:0}
.expense-report .list-head{display:flex;flex-direction:column;align-items:stretch;gap:.75rem}
.expense-report .table-shell{max-width:100%;overflow:auto}
.expense-total{font-weight:700;background:var(--linen)}
#invoice-edit-form{display:grid;gap:1rem}
#invoice-edit-form textarea{min-height:5rem}
#invoice-edit-form input,#invoice-edit-form textarea{min-width:0;width:100%}
@media(min-width:768px){.expense-report .list-head{flex-direction:row;align-items:center;justify-content:space-between}}

/* Casillas de los formularios: opción completa clicable, no un cuadro gigante. */
.field-group{display:grid;gap:.45rem;min-width:0;margin:0;padding:0;border:0}
.field-group legend{padding:0;margin-bottom:.45rem;color:var(--stone);font-size:.82rem;font-weight:700}
.operations-dialog .field-group legend{color:var(--ink);font-size:.875rem}
.field-check-row{display:grid;gap:.6rem;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr))}
.field-label.field-check,.modal .check-line{display:flex;align-items:center;gap:.7rem;min-height:3rem;padding:.65rem .9rem;border:1px solid var(--line);border-radius:var(--radius);background:#fff;color:var(--ink);font-size:.9rem;font-weight:600;cursor:pointer;transition:border-color .15s,background .15s}
.field-label.field-check:hover,.modal .check-line:hover{border-color:#c9c4b5}
.field-label.field-check:has(input:checked),.modal .check-line:has(input:checked){border-color:var(--orange);background:#fffaf5}
.field-label.field-check:has(input:focus-visible),.modal .check-line:has(input:focus-visible){box-shadow:0 0 0 3px rgba(255,102,0,.18)}
.field-label.field-check input,.modal .check-line input{width:1.15rem;height:1.15rem;min-height:0;margin:0;padding:0;flex-shrink:0;accent-color:var(--orange);cursor:pointer;box-shadow:none}
.modal fieldset:has(> .check-line){display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));gap:.6rem;min-width:0;margin:0;padding:0;border:0}
.modal fieldset:has(> .check-line) > legend{grid-column:1/-1;padding:0;margin-bottom:.45rem;color:var(--stone);font-size:.82rem;font-weight:700}
.contactos-embarque{grid-column:1/-1;border:1px solid var(--line);border-radius:var(--radius);padding:.7rem .9rem;margin:0;min-width:0}.contactos-embarque label{display:flex;align-items:center;gap:.5rem;font-weight:500;color:var(--ink);padding:.15rem 0}.contactos-embarque input[type="checkbox"]{width:1.1rem;height:1.1rem;min-height:0;margin:0;padding:0;flex:0 0 auto;accent-color:var(--orange);cursor:pointer;box-shadow:none}.contacto-baja{margin:.25rem 0;color:var(--danger);font-weight:600;font-size:.9rem}.contacto-nuevo{display:flex;gap:8px;flex-wrap:wrap}.contacto-nuevo input{flex:1 1 10rem;min-width:0}.sin-contacto{color:var(--danger);font-weight:700}.espera-naviera{color:var(--orange);font-weight:700}
.bandeja-item h4{margin:0 0 .25rem}.bandeja-motivos{margin:.25rem 0;padding-left:1.1rem;color:var(--orange)}.bandeja-enviado{display:flex;flex-wrap:wrap;gap:.5rem;align-items:baseline}.bandeja-enviado small{flex-basis:100%}
.mail-frame{display:block;width:min(720px,100%);height:70vh;border:1px solid #d8d3c7;background:#fff}
.mapa-filtros{display:flex;flex-wrap:wrap;gap:.75rem}.mapa-grid{display:grid;gap:1rem;grid-template-columns:minmax(0,1fr)}.mapa-lienzo{height:min(60vh,520px);min-height:300px;border-radius:12px;border:1px solid #d8d3c7}
@media(min-width:1024px){.mapa-grid{grid-template-columns:minmax(0,2fr) minmax(16rem,1fr)}}
.mapa-lista{list-style:none;margin:0;padding:0;display:grid;gap:.5rem}.mapa-lista>li{padding:.5rem;border-bottom:1px solid #ece8de;cursor:default}#mapa-buques>li{cursor:pointer}.mapa-motivo{color:var(--orange);font-weight:700}
.buque-marca{width:14px;height:14px;border-radius:50%;background:#ff6600;border:2px solid #fbfaf6;box-shadow:0 0 0 1px #3a3a40}
