* { box-sizing: border-box }
:root { color-scheme: light; font-family: system-ui, sans-serif; color: #30242a; background: #f8f5f3; --wine:#401f2b; --accent:#79334b; --muted:#6d5e64; --border:#e5dcd9; --paper:#fff }
body { margin:0 }
button,input,select,textarea { font:inherit }
button { cursor:pointer }
button:disabled { opacity:.6; cursor:wait }
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:3px solid #aa657d; outline-offset:2px }
.layout { min-height:100vh; display:grid; grid-template-columns:248px minmax(0,1fr) }
.sidebar { background:var(--wine); color:#fff6f2; padding:30px 17px 22px; display:flex; flex-direction:column; gap:38px }
.wordmark { display:flex; gap:12px; align-items:center; font: 25px Georgia,serif; padding:0 8px; white-space:nowrap }
.wordmark small { display:block; font: 650 11px system-ui,sans-serif; letter-spacing:.25em; margin-top:5px }
.monogram { border:1px solid #b98995; width:43px; height:43px; border-radius:50%; display:grid; place-items:center; font-size:19px; flex:none }
nav { display:grid; gap:6px }
nav button { display:flex; align-items:center; text-align:left; gap:11px; color:#f4e5e7; background:none; border:1px solid transparent; padding:12px 9px; border-radius:9px; font-size:14px }
nav button span { width:23px; text-align:center; font-size:20px; line-height:1 }
nav button:hover, nav button.active { background:#633548; color:#fff; border-color:#875566 }
.account { margin-top:auto; border-top:1px solid #794c5a; padding:18px 9px 0; display:grid; gap:4px }
.account small { color:#eed7dd }
.logout { background:none; border:none; color:#f4dce4; padding:9px 0; text-align:left; text-decoration:underline }
.top { min-height:64px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px clamp(16px,3vw,42px); background:#fff; border-bottom:1px solid var(--border); color:var(--muted); font-size:14px }
.demo,.tag { border-radius:100px; padding:4px 10px; background:#f5ebef; color:#64334a; white-space:nowrap; font-size:13px; font-weight:650 }
.tag.good { background:#e8f3ea; color:#2f6042 }
.content { max-width:1560px; margin:auto; padding:30px clamp(16px,3vw,42px) 48px }
.heading,.section-heading,.actions { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap }
.heading { margin-bottom:24px }
h1,h2,p { margin:0 }
h1 { font: 500 clamp(32px,4vw,47px)/1.1 Georgia,serif; letter-spacing:-.03em; color:var(--wine) }
h2 { font-size:18px }
.heading p,.section-heading p,.muted { color:var(--muted); margin-top:7px }
.card { background:var(--paper); border:1px solid var(--border); border-radius:13px; padding:20px; margin-bottom:16px }
.card > .section-heading { margin-bottom:15px }
.card.flush { padding:0; overflow:hidden }
.flush > .section-heading { padding:17px 20px; margin:0; border-bottom:1px solid var(--border) }
.section-heading > span { color:var(--muted); font-size:14px }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(160px,100%),1fr)); gap:14px }
.filters { align-items:end }
.filters .plain { justify-self:start }
label { display:grid; align-content:start; gap:6px; font-size:14px; font-weight:620; min-width:0 }
.grid + label { margin-top:14px }
input,select,textarea { width:100%; min-width:0; color:#30242a; background:#fff; border:1px solid #cbbec3; border-radius:7px; padding:9px 10px; font-weight:400; min-height:40px }
select { appearance:none; padding-right:30px; background-image:linear-gradient(45deg,transparent 50%,#6b4c5b 50%),linear-gradient(135deg,#6b4c5b 50%,transparent 50%); background-position:calc(100% - 15px) 50%,calc(100% - 10px) 50%; background-size:5px 5px; background-repeat:no-repeat }
textarea { resize:vertical }
.primary,.secondary,.plain,.danger { border:1px solid transparent; border-radius:8px; padding:9px 13px; font-size:14px; font-weight:650; min-height:40px }
.primary { background:var(--accent); color:#fff }
.primary:hover { background:#62273c }
.secondary { border-color:#d9c8cf; color:var(--wine); background:#fff }
.secondary:hover,.plain:hover { background:#f6eef1 }
.plain,.link { color:#79334b; background:none }
.link { padding:0; border:0; font-weight:700; text-decoration:underline; text-underline-offset:3px; text-align:left; white-space:nowrap }
.danger { background:#982d42; color:#fff }
.actions { justify-content:flex-end; margin-top:15px }
.section-heading .actions { margin-top:0 }
.stack { display:grid; gap:12px }
.stack > .card { margin-bottom:0 }
.stack > .actions { margin-top:0 }
.metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(145px,100%),1fr)); gap:10px; margin:0 0 16px }
.metric { padding:15px; background:#fff; border:1px solid var(--border); border-radius:11px; display:grid; align-content:space-between; gap:10px }
.metric span { color:var(--muted); font-size:14px }
.metric strong { font:600 27px Georgia,serif; font-variant-numeric:tabular-nums; white-space:nowrap }
.metric small { font:600 13px system-ui,sans-serif }
.metric.highlight { background:#f4e6eb; border-color:#e0c3ce }
.table-wrap { overflow:auto }
table { width:100%; border-collapse:collapse; text-align:left; font-size:14px }
th,td { padding:12px 13px; vertical-align:top; border-bottom:1px solid #efe8e6 }
th { background:#fcf8f8; color:#654b56; font-size:13px; font-weight:650 }
td small { display:block; color:var(--muted); margin-top:4px }
td:first-child,th:first-child { padding-left:19px }
tr:last-child td { border-bottom:none }
.number { white-space:nowrap; font-variant-numeric:tabular-nums }
.emphasis { font-weight:750; color:#79334b }
.empty { padding:17px 20px; color:var(--muted) }
.alert { padding:12px 15px; border-radius:8px; background:#e9f4eb; color:#2e5c40; margin-bottom:16px }
.alert.error { background:#fbe9ec; color:#82263a }
.line-edit { padding:14px; margin:12px 0; border:1px solid var(--border); border-radius:8px; min-width:0 }
.line-edit legend { font-weight:700; padding:0 6px }
.allocation { display:grid; grid-template-columns:minmax(0,4fr) minmax(90px,1fr) auto; align-items:end; gap:10px; margin:12px 0 }
.totals { border-top:1px solid var(--border); padding-top:14px }
.tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px }
.facts { display:flex; flex-wrap:wrap; gap:20px }
.facts dt { font-weight:700; font-size:14px }
.facts dd { margin:3px 0 0; overflow-wrap:anywhere }
.login { width:min(440px,100%); padding:16px; margin:10vh auto }
.login .wordmark { color:var(--wine); margin-bottom:19px }
.login h1 { margin-bottom:19px; font-size:36px }
.login .muted { margin-top:14px }
@media (max-width:850px) {
  .layout { grid-template-columns:1fr }
  .sidebar { padding:13px 16px; gap:12px }
  nav { grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr)); gap:3px }
  nav button { padding:7px 5px }
  .account { display:flex; align-items:center; flex-wrap:wrap; gap:9px; padding:4px 3px 0 }
  .logout { margin-left:auto }
  .top { min-height:46px }
  .content { padding-top:20px }
}
@media (max-width:500px) {
  .allocation { grid-template-columns:1fr 1fr }
  .allocation > label:first-child { grid-column:1/-1 }
  .card { padding:14px }
}
@media print {
  .layout { display:block }
  .sidebar,.top,.no-print,.heading button,.alert { display:none !important }
  body,.card { background:#fff }
  .content { padding:0 }
  .table-wrap { overflow:visible }
  table { font-size:10px }
  th,td { padding:4px }
  th { font-size:10px }
  td:first-child,th:first-child { padding-left:4px }
  tr { break-inside:avoid }
}/* Pendientes y recepción documental */
:root { color:#202d32; background:#f4f7f8; --wine:#203E49; --accent:#203E49; --muted:#53646a; --border:#dce5e8; --paper:#fff; --received:#219653; --pending:#DC3545; --requested:#D99A22 }
.sidebar { color:#f4f9fb }
.monogram { border-color:#7a9aa5 }
nav button { color:#e1edf0 }
nav button:hover, nav button.active { background:#315563; border-color:#577583 }
.account { border-color:#52717c }
.account small,.logout { color:#d9e8ee }
.primary:hover { background:#295260 }
.link,.plain { color:#244f62 }
.secondary { border-color:#c8d9df }
.secondary:hover,.plain:hover { background:#edf4f6 }
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline-color:#527d8f }
.demo,.tag { background:#e9f2f4; color:#254b5a }
.tag.good { background:#e9f7ee; color:#136f39 }
.filter-actions { display:flex; justify-content:space-between; align-items:center; gap:.75rem; margin-top:.7rem }
.doc-review { display:flex; align-items:center; gap:.6rem; font-weight:550 }
.doc-review input { flex:none; width:1.05rem; min-height:auto; height:1.05rem; accent-color:#203E49 }
.purchase-summary,.article-card { background:#fff; border:1px solid #dbe5e8; border-radius:14px; margin:0 0 18px; overflow:hidden }
.purchase-summary { padding:18px 20px; border-top:3px solid #203E49 }
.purchase-summary h2 { margin-bottom:14px }
.purchase-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px }
.purchase-metric { min-width:0; display:grid; align-content:space-between; gap:6px; padding:12px 10px; border-radius:8px; background:#f3f6f7 }
.purchase-metric span { font-size:.875rem; color:#40525a }
.purchase-metric strong { font:600 clamp(1.2rem,2.45vw,1.85rem)/1.08 Georgia,serif; color:#202d32; white-space:nowrap; font-variant-numeric:tabular-nums }
.purchase-metric small { font:600 .8rem system-ui,sans-serif }
.purchase-metric.received { background:#ebf7ef; border-top:2px solid #219653 }
.purchase-metric.received strong { color:#17763f }
.purchase-metric.pending { background:#feeff1; border-top:2px solid #DC3545 }
.purchase-metric.pending strong { color:#b62433 }
.purchase-metric.open { background:#fff5e4; border-top:2px solid #D99A22 }
.purchase-metric.open strong { color:#805508 }
.pending-section { margin:21px 0 12px }
.article-card header { background:#203E49; color:#fff; padding:15px 20px }
.article-card header h2 { font-size:1.25rem }
.article-card header h2 span { font-weight:500; color:#d5e5ea }
.article-card header p { font-size:.875rem; color:#e1ebee; margin-top:4px }
.collection-row { padding:17px 20px; border-top:1px solid #e2e9ec }
.collection-title { display:flex; gap:12px; align-items:center; justify-content:space-between; margin-bottom:11px }
.collection-title span,.collection-order small { color:var(--muted); font-size:.875rem }
.collection-title h3 { margin:2px 0 0; color:#203E49; font-size:1.1rem }
.collection-order { text-align:right; display:grid; justify-items:end; gap:3px }
.purchase-progress { position:relative; overflow:hidden; height:9px; background:#e5eaed; border-radius:20px; margin-top:13px }
.purchase-progress progress { position:absolute; appearance:none; inset:0; width:100%; height:100%; border:0; background:transparent }
.purchase-progress progress::-webkit-progress-bar { background:transparent }
.progress-received::-webkit-progress-value { background:#219653 }
.progress-requested::-webkit-progress-value { background:#D99A22 }
.progress-received::-moz-progress-bar { background:#219653 }
.progress-requested::-moz-progress-bar { background:#D99A22 }
.file-choices { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr)); gap:12px; margin:15px 0 }
.doc-detail { margin-top:13px }
.doc-detail pre { white-space:pre-wrap; overflow-wrap:anywhere; background:#f3f6f7; padding:11px; max-height:18rem; overflow:auto }
.doc-groups { list-style:none; padding:0; margin:0; display:grid; gap:.5rem }
.doc-groups>li { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.5rem; background:#f3f6f7; padding:.7rem; border-radius:8px }
.doc-bulk { display:flex; align-items:end; flex-wrap:wrap; gap:.5rem; margin:1rem 0 }
.doc-bulk label { flex:1 1 12rem }
@media (max-width:1050px) and (min-width:851px) { .purchase-metrics { grid-template-columns:repeat(3,minmax(0,1fr)) } }
@media (max-width:630px) {
 .purchase-metrics { grid-template-columns:repeat(2,minmax(0,1fr)) }
 .purchase-metric strong { font-size:1.45rem }
 .purchase-summary,.article-card header,.collection-row { padding:13px }
 .filter-actions { flex-wrap:wrap }
}
@media (max-width:630px) {
 nav { grid-template-columns:repeat(2,minmax(0,1fr)) }
 .pending-filters .grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px }
 .account strong { flex:1 0 100% }
}

.document-download { display:inline-flex; align-items:center; text-decoration:none }
.supplier-preview { max-height: 28rem; overflow: auto; }
.choice-control { position:relative; min-width:0 }
.choice-list { position:absolute; z-index:5; inset-inline:0; top:100%; max-height:15rem; overflow:auto; background:#fff; border:1px solid #b6c7ce; border-radius:8px; box-shadow:0 4px 12px #17344124 }
.choice-list [role=option] { display:block; width:100%; padding:.65rem .75rem; background:#fff; color:#203e49; border:0; border-radius:0; text-align:left; white-space:normal; min-height:44px }
.choice-list [role=option]:hover,.choice-list .choice-highlight { background:#e6f0f3 }
.choice-list [aria-selected=true] { font-weight:700 }
.choice-list small { display:block; padding:.65rem .75rem }
.choice-list [hidden] { display:none }
.order-colors { display:grid; gap:.6rem; align-content:start; min-width:0 }
.supply-line { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.8rem; align-items:center; padding:.8rem 0; border-top:1px solid #dbe5e8 }
.supply-line small,.supply-line span strong { display:block }
.supply-line > div:first-child,.supply-line > .purchase-progress { grid-column:1/-1 }
.supply-line span strong { color:#111 }
.supply-line .supply-received strong { color:#17763f }
.supply-line .supply-pending strong { color:#b62433 }
.supply-line .supply-open strong { color:#9a5410 }
@media (max-width:650px) {
  .supply-line { grid-template-columns:repeat(2,minmax(0,1fr)) }
  .supply-line > div:first-child { grid-column:1/-1 }
}
