:root { --paper:#f6f6f2; --ink:#202320; --muted:#62665e; --rule:#d3d6cd; --wine:#741c30; --shell:clamp(18px,4vw,68px); }
body { color:var(--ink); background:var(--paper); line-height:1.5; }
[hidden] { display:none!important; }
button,input,select { font:inherit; }
button,a,input,select { outline-offset:4px; }
:focus-visible { outline:2px solid var(--wine); }
button { border:1px solid var(--rule); color:inherit; background:transparent; }
button:disabled { cursor:default; color:#73766f; background:#eeefe9; }
button:not(:disabled):hover { border-color:var(--wine); }
.admin-header { min-height:86px; padding:16px var(--shell); display:flex; align-items:center; justify-content:space-between; gap:18px; border-bottom:1px solid var(--rule); }
.admin-header img { width:136px; height:auto; display:block; }
.admin-header nav { display:flex; align-items:center; gap:clamp(14px,2.5vw,40px); font-size:14px; }
.admin-header a { text-decoration:none; }
.admin-header nav a { padding-block:10px; }
.admin-header nav a span { padding-left:9px; }
.admin-header button { min-height:42px; padding:7px 13px; }
#admin-main { max-width:1600px; margin:auto; padding:clamp(32px,4vw,62px) var(--shell); min-height:calc(100vh - 156px); }
.admin-footer { border-top:1px solid var(--rule); padding:20px var(--shell); display:flex; justify-content:space-between; gap:16px; color:var(--muted); font-size:12px; }
.session-loading { padding:60px 0; color:var(--muted); }
.session-error { max-width:650px; padding:24px; border:1px solid #ae7582; background:#faf0f2; }
.session-error button { padding:9px 14px; }
.access { display:grid; grid-template-columns:1fr minmax(300px,.85fr); gap:clamp(34px,8vw,130px); align-items:center; min-height:62vh; max-width:1150px; margin:auto; }
.access-label { font-size:13px; font-weight:550; color:var(--wine); }
.access-intro h1 { font-size:clamp(56px,6.8vw,104px); font-weight:520; letter-spacing:-.065em; line-height:.98; margin:20px 0 24px; }
.access-intro h1 em { color:var(--wine); font:italic 400 1.1em/.95 "Instrument Serif",Georgia,serif; letter-spacing:-.04em; }
.access-intro p { color:var(--muted); max-width:31ch; font-size:18px; }
.access-form { border-top:3px solid var(--wine); padding:clamp(25px,3vw,45px); background:white; }
.access-form h2 { margin:0 0 14px; font-weight:550; font-size:clamp(25px,2.4vw,36px); letter-spacing:-.045em; line-height:1.1; }
.access-form p { color:var(--muted); font-size:14px; margin:0 0 25px; }
.access-form label { font-size:13px; font-weight:600; display:block; margin-bottom:7px; }
.password-field { display:flex; align-items:stretch; border:1px solid #949a8e; min-width:0; }
.password-field:focus-within { outline:2px solid var(--wine); outline-offset:2px; }
.password-field input { border:0; outline:none; min-width:0; width:100%; padding:12px; color:var(--ink); background:transparent; }
.password-field button { border:0; font-size:12px; padding:8px 12px; color:var(--wine); }
.access-form .form-help { margin:10px 0 0; font-size:12px; }
.primary-button { display:flex; justify-content:space-between; align-items:center; gap:20px; width:100%; background:var(--wine); color:white; border:1px solid var(--wine); min-height:48px; padding:10px 15px; margin-top:24px; }
.primary-button:not(:disabled):hover { background:#541323; }
.access-form .form-error { color:#861f33; margin:15px 0 0; }
.workspace-heading { display:flex; justify-content:space-between; align-items:center; gap:15px; margin-bottom:clamp(24px,3vw,40px); }
.workspace-heading h1 { font-size:clamp(45px,5.5vw,80px); line-height:1; font-weight:530; letter-spacing:-.065em; margin:0; }
.workspace-heading p { color:var(--muted); font-size:14px; margin:10px 0 0; }
.quiet-button { min-height:42px; padding:8px 14px; font-size:13px; }
.quiet-button span { font-size:17px; padding-left:10px; }
.status-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1px; background:var(--rule); border:1px solid var(--rule); }
.status-filters button { text-align:left; border:0; background:var(--paper); min-height:102px; padding:clamp(13px,1.5vw,23px); display:flex; flex-direction:column; gap:7px; }
.status-filters button > span { display:flex; align-items:center; gap:8px; font-size:13px; }
.status-filters strong { font-size:clamp(28px,2.9vw,42px); line-height:1; letter-spacing:-.045em; font-weight:500; font-variant-numeric:tabular-nums; }
.status-filters button[aria-pressed=true] { background:var(--wine); color:white; }
.status-filters button:focus-visible { outline-offset:-4px; outline-color:#b25f72; }
.status-dot { display:inline-block; width:6px; height:6px; border-radius:50%; background:currentColor; }
.status-dot.nueva { color:#b04860; }
.status-dot.en_curso { color:#9f6818; }
.status-dot.cerrada { color:#577866; }
[aria-pressed=true] .status-dot { color:inherit; }
.search-form { display:flex; align-items:center; flex-wrap:wrap; gap:10px 16px; padding:22px 0; }
.search-form label { font-size:13px; font-weight:600; }
.search-field { display:flex; width:min(100%,510px); border:1px solid #9a9e94; background:#fff; }
.search-field:focus-within { outline:2px solid var(--wine); outline-offset:2px; }
.search-field input { min-width:0; width:100%; color:var(--ink); border:0; outline:0; padding:11px 12px; font-size:14px; }
.search-field button { padding:8px 13px; border:0; border-left:1px solid var(--rule); color:var(--wine); font-size:13px; }
.list-tools { display:grid; grid-template-columns:minmax(0,1fr) minmax(190px,230px); gap:18px 28px; padding:24px 0 20px; }
.list-tools .search-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px 14px; padding:0; align-items:end; }
.list-tools .search-form > label { grid-column:1/-1; }
.list-tools .search-field { width:100%; min-height:44px; }
.list-tools #clear-search { min-height:44px; text-align:left; }
.order-field { min-width:0; }
.order-field label { display:block; font-size:13px; font-weight:600; margin-bottom:7px; }
.order-field select { display:block; width:100%; min-width:0; min-height:44px; padding:9px 28px 9px 11px; border:1px solid #9a9e94; border-radius:0; background:#fff; color:var(--ink); font-size:14px; }
.date-form { grid-column:1/-1; display:grid; grid-template-columns:minmax(190px,.9fr) minmax(280px,1.1fr) auto; align-items:end; gap:12px 24px; padding:18px 20px; border-block:1px solid var(--rule); background:#edf0e7; }
.date-intro { align-self:center; }
.date-intro h2 { font-size:14px; font-weight:650; margin:0 0 4px; }
.date-intro p { color:var(--muted); font-size:12px; line-height:1.4; margin:0; }
.date-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; min-width:0; }
.date-fields label { min-width:0; font-size:12px; font-weight:600; }
.date-fields input { display:block; width:100%; min-width:0; max-width:100%; min-height:44px; margin-top:5px; padding:9px 8px; border:1px solid #9a9e94; border-radius:0; background:#fff; color:var(--ink); font-size:14px; font-weight:450; }
.date-fields input[aria-invalid=true] { border-color:#9b3041; background:#fff5f5; }
.date-actions { display:flex; align-items:center; flex-wrap:wrap; gap:4px 16px; }
#apply-dates { min-height:44px; padding:9px 14px; font-size:13px; font-weight:600; border-color:#8e9987; background:#f9faf5; }
#apply-dates:hover { border-color:var(--wine); background:white; color:var(--wine); }
#clear-dates { min-height:44px; }
.date-error,.date-filter { grid-column:1/-1; margin:0; font-size:13px; line-height:1.45; }
.date-error { padding:9px 12px; border-left:2px solid var(--wine); background:#f9e9ec; color:#861f33; }
.date-filter { color:#43563c; border-top:1px solid #cdd4c4; padding-top:10px; }
.text-button { border:0; background:none; padding:8px 0; color:var(--wine); text-decoration:underline; text-underline-offset:3px; font-size:13px; }
.model-filter { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; margin:0 0 20px; padding:10px 14px; color:#354735; background:#e5eadd; border-left:3px solid #50694d; }
.model-filter > span { font-size:13px; }
#clear-model { display:inline-flex; align-items:center; justify-content:space-between; gap:12px; min-height:38px; max-width:100%; border-color:#9bab94; padding:4px 10px; background:#fafaf3; color:#344732; text-align:left; }
#clear-model strong { font-weight:600; font-size:14px; overflow-wrap:anywhere; }
#clear-model > span { font-size:19px; line-height:1; }
#clear-model:hover { border-color:#51674b; background:white; }
.workspace-error { margin:0 0 20px; padding:12px 15px; color:#861f33; background:#f7eaee; border-left:3px solid var(--wine); font-size:14px; }
.inbox { display:grid; grid-template-columns:minmax(280px,.8fr) minmax(0,1.2fr); border:1px solid var(--rule); background:#fff; min-height:530px; }
.inbox-list { min-width:0; border-right:1px solid var(--rule); }
.list-heading { display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding:16px 19px; border-bottom:1px solid var(--rule); background:#f0f2eb; }
.list-heading h2 { margin:0; font-size:14px; font-weight:650; }
.list-heading span { font-size:12px; color:var(--muted); }
#consultas { margin:0; padding:0; list-style:none; max-height:650px; overflow-y:auto; scrollbar-width:thin; }
.consulta-row { display:block; width:100%; border:0; border-bottom:1px solid #e0e3da; text-align:left; padding:17px 19px; }
.consulta-row[aria-pressed=true] { background:#f7eef0; box-shadow:inset 3px 0 var(--wine); }
.consulta-row:not([aria-pressed=true]):hover { background:#f7f8f3; }
.consulta-row:focus-visible { outline-offset:-3px; }
.row-top { display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-bottom:7px; }
.row-top strong { font-size:15px; font-weight:650; overflow-wrap:anywhere; line-height:1.3; }
.row-top time { font-size:11px; color:var(--muted); flex-shrink:0; }
.row-summary { display:block; font-size:13px; color:var(--muted); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; margin-bottom:10px; }
.row-models { display:flex; gap:7px; align-items:baseline; margin:-2px 0 11px; color:#41533d; font-size:12px; line-height:1.35; overflow-wrap:anywhere; }
.row-models small { flex:0 0 auto; font-size:11px; font-weight:600; white-space:nowrap; }
.row-bottom { display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:11px; }
.row-reference { color:var(--muted); overflow-wrap:anywhere; }
.status-label { display:inline-flex; align-items:center; gap:6px; font-size:11px; line-height:1.4; padding:3px 7px; white-space:nowrap; background:#eef0e9; color:#53604f; }
.status-label[data-state=nueva] { background:#f5e5e9; color:#84283e; }
.status-label[data-state=en_curso] { background:#f5ecdc; color:#795218; }
.status-label[data-state=cerrada] { background:#e8f0e9; color:#356044; }
.pagination { padding:13px 18px; display:flex; justify-content:space-between; gap:10px; align-items:center; border-top:1px solid var(--rule); }
.pagination button { min-width:36px; min-height:36px; }
.pagination span { font-size:12px; color:var(--muted); }
.list-feedback { padding:15px 19px; color:var(--muted); font-size:13px; }
.list-empty { padding:40px 22px; }
.list-empty h3 { font-size:20px; font-weight:550; letter-spacing:-.035em; margin:0 0 10px; }
.list-empty p { color:var(--muted); font-size:14px; margin:0; max-width:38ch; }
.detail { min-width:0; padding:clamp(23px,3vw,46px); }
.detail-empty { max-width:380px; margin:clamp(30px,7vw,100px) auto; }
.detail-line { display:block; width:38px; border-top:2px solid var(--wine); margin-bottom:22px; }
.detail-empty h2 { font-size:clamp(33px,3.5vw,52px); font-weight:520; letter-spacing:-.055em; line-height:1; margin:0; }
.detail-empty em { color:var(--wine); font:italic 400 1.12em/1 "Instrument Serif",Georgia,serif; }
.detail-empty p { font-size:14px; color:var(--muted); max-width:32ch; margin:20px 0 0; }
.detail-top { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:18px; }
#back-to-list { display:none; }
.detail-reference { display:flex; flex-wrap:wrap; gap:6px 16px; font-size:11px; color:var(--muted); margin-bottom:12px; overflow-wrap:anywhere; }
#customer-name { margin:0; font-size:clamp(28px,3vw,42px); font-weight:550; line-height:1.1; letter-spacing:-.05em; overflow-wrap:anywhere; }
#company { margin:8px 0; font-size:15px; color:var(--muted); overflow-wrap:anywhere; }
.email-link { display:inline-block; color:var(--wine); font-size:14px; text-underline-offset:3px; overflow-wrap:anywhere; margin-top:3px; }
.customer-contact { display:flex; flex-wrap:wrap; gap:14px 28px; margin-top:18px; }
.customer-contact > div { min-width:0; }
.customer-contact > div > span { display:block; color:var(--muted); font-size:11px; line-height:1.4; }
.message-block { margin-top:27px; padding-top:20px; border-top:1px solid var(--rule); }
.message-block h3,.references-block h3 { font-size:13px; font-weight:650; margin:0 0 10px; overflow-wrap:anywhere; }
.message-block p { white-space:pre-wrap; overflow-wrap:anywhere; font-size:15px; line-height:1.7; margin:0; }
.references-block { margin-top:22px; }
.references-block ul { padding:0; margin:0; list-style:none; border-block-start:1px solid var(--rule); }
.references-block h3 { margin-bottom:3px; }
.references-block p { margin:0 0 9px; font-size:13px; color:var(--muted); }
.references-block li { border-block-end:1px solid var(--rule); }
.model-chip { display:flex; align-items:center; gap:clamp(7px,1vw,14px); width:100%; min-height:48px; padding:7px 6px; border:0; background:transparent; color:var(--ink); text-align:left; }
.model-chip img { flex:none; width:48px; height:43px; object-fit:contain; background:white; }
.model-name { min-width:0; font-size:14px; font-weight:620; overflow-wrap:anywhere; }
.model-name small { display:block; color:var(--muted); font-size:12px; font-weight:450; }
.model-quantity { flex:none; margin-inline-start:auto; font-size:12px; font-variant-numeric:tabular-nums; color:#43583f; }
.model-chip:is(:hover,:focus-visible):enabled { background:#eff2e9; color:var(--wine); }
.detail-actions { border-top:1px solid var(--rule); margin-top:28px; padding-top:20px; }
#status-form label { display:block; font-size:12px; font-weight:650; margin-bottom:7px; }
#status-form > div { display:flex; flex-wrap:wrap; align-items:stretch; gap:8px; }
#status-form select { padding:8px 29px 8px 10px; border:1px solid #909789; border-radius:0; color:var(--ink); background:white; min-height:40px; font-size:13px; }
#save-status { padding:8px 13px; font-size:13px; }
#save-status:not(:disabled) { background:var(--wine); border-color:var(--wine); color:white; }
.reply-link { display:inline-flex; align-items:center; gap:14px; color:var(--wine); text-decoration:underline; text-underline-offset:4px; margin-top:22px; padding:5px 0; font-size:14px; }
.action-status { min-height:1.5em; margin:14px 0 0; font-size:13px; color:var(--wine); }
.detail-actions { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:14px 20px; }
.detail-notice { flex:0 0 100%; margin:0; padding:10px 12px; background:#f8f0e3; border-left:2px solid #8d672f; font-size:13px; color:#60491e; }
.detail-actions .reply-link { margin:0; min-height:40px; }
.detail-history { margin-top:26px; padding-top:22px; border-top:1px solid var(--rule); }
.detail-history h3 { font-size:17px; font-weight:550; letter-spacing:-.035em; margin:0 0 16px; }
.history-feedback { margin:0; font-size:13px; color:var(--muted); }
.history-list { margin:0; padding:0; list-style:none; }
.history-list li { position:relative; display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; column-gap:14px; row-gap:2px; padding:0 0 15px 21px; }
.history-list li:not(:last-child)::before { content:''; position:absolute; left:3px; top:8px; bottom:-8px; border-left:1px solid var(--rule); }
.history-list li::after { content:''; position:absolute; left:0; top:7px; width:7px; height:7px; border-radius:50%; background:#a8ada0; }
.history-list li:first-child::after { background:var(--wine); }
.history-list li:last-child { padding-bottom:0; }
.history-list strong { font-size:13px; font-weight:550; }
.history-list time { font-size:12px; color:var(--muted); }
.detail-notes { margin-top:26px; padding-top:22px; border-top:1px solid var(--rule); }
.notes-heading { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:5px 15px; }
.notes-heading h3 { margin:0; font-size:17px; font-weight:550; letter-spacing:-.035em; }
#notes-count,#notes-visibility,#note-length,#notes-list time { color:var(--muted); font-size:12px; }
#notes-visibility { margin:4px 0 16px; }
#note-form { background:#f5f6f1; padding:clamp(12px,1.4vw,19px); margin-bottom:16px; }
#note-form label { display:block; margin-bottom:6px; font-size:13px; font-weight:600; }
#note-text { display:block; width:100%; min-height:78px; padding:10px 12px; border:1px solid #9a9e94; border-radius:0; background:#fff; color:var(--ink); font:400 14px/1.5 "DM Sans",Arial,sans-serif; resize:vertical; }
#note-text:read-only { background:#f3f4ef; }
.note-toolbar { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:6px 12px; margin-top:8px; }
#note-save { min-height:40px; padding:7px 14px; font-size:13px; }
#note-save:not(:disabled) { color:white; background:var(--wine); border-color:var(--wine); }
.note-feedback { color:var(--wine); font-size:13px; margin:9px 0 0; }
#notes-list { padding:0; margin:0; list-style:none; max-height:26rem; overflow:auto; scrollbar-width:thin; }
#notes-list li { padding:11px 0; }
#notes-list li+li { border-top:1px solid var(--rule); }
#notes-list time { display:block; }
#notes-list p { margin:4px 0 0; font-size:14px; white-space:pre-wrap; overflow-wrap:anywhere; }
@media (max-width:800px) {
  .inbox { grid-template-columns:minmax(250px,.85fr) minmax(0,1.15fr); }
  .detail { padding:22px; }
  .search-form { gap:8px 12px; }
  .search-form label { flex-basis:100%; }
  .list-tools { column-gap:18px; }
  .date-form { grid-template-columns:minmax(0,1fr) auto; gap:14px 20px; }
  .date-intro { grid-column:1/-1; }
  .date-intro p { margin-top:3px; }
  .date-actions { flex-direction:column; align-items:start; gap:0; }
}
@media (max-width:650px) {
  .admin-header { min-height:70px; padding-block:12px; }
  .admin-header img { width:112px; }
  .admin-header nav { gap:12px; font-size:12px; }
  .admin-header nav a span { display:none; }
  .admin-header button { font-size:12px; min-height:38px; padding:6px 8px; }
  .access { grid-template-columns:minmax(0,1fr); gap:26px; min-height:0; }
  .access-intro h1 { margin:12px 0 15px; font-size:56px; }
  .access-intro p { font-size:15px; margin-bottom:0; max-width:40ch; }
  .access-form { padding:25px 20px; }
  .workspace-heading { align-items:flex-start; }
  .workspace-heading h1 { font-size:48px; }
  .workspace-heading p { max-width:22ch; }
  .quiet-button { font-size:12px; padding-inline:9px; }
  .quiet-button span { display:none; }
  .status-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .status-filters button { min-height:81px; padding:12px 15px; }
  .status-filters strong { font-size:28px; }
  .inbox { grid-template-columns:minmax(0,1fr); }
  .inbox-list { border-right:0; }
  #consultas { max-height:480px; }
  .detail { border-top:1px solid var(--rule); }
  .detail:has(#detail-card[hidden]) { display:none; }
  #back-to-list { display:block; }
  .detail-top { margin-bottom:13px; }
  .consulta-row { padding:15px; }
  .list-heading { padding:13px 15px; }
  .detail-reference { display:grid; }
  .list-tools { grid-template-columns:minmax(0,1fr); gap:16px; padding-block:20px; }
  .list-tools .search-form { grid-template-columns:minmax(0,1fr); gap:7px; }
  .list-tools #clear-search { justify-self:start; min-height:36px; padding-block:5px; }
  .order-field { display:flex; justify-content:space-between; align-items:center; gap:14px; }
  .order-field label { flex:0 1 auto; margin:0; }
  .order-field select { flex:0 1 205px; width:auto; }
  .date-form { grid-template-columns:minmax(0,1fr); padding:16px; gap:14px; }
  .date-actions { flex-direction:row; align-items:center; gap:4px 18px; }
}
@media (max-width:360px) {
  .admin-header { flex-wrap:wrap; gap:8px; }
  .admin-header nav { margin-left:auto; }
  .detail { padding:18px; }
  .search-field input { font-size:13px; }
  .date-fields { grid-template-columns:minmax(0,1fr); gap:10px; }
  .order-field { display:block; }
  .order-field label { margin-bottom:6px; }
  .order-field select { width:100%; }
}
#setup-credentials { margin-bottom: 16px; }
.admin-footer { flex-wrap: wrap; gap: 12px 24px; }
.admin-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.admin-footer nav a { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; text-underline-offset: .2em; }
