.ai-panel { min-width: 0; border: 1px solid #275353; border-radius: 12px; background: #081b1d; overflow: hidden; }
.ai-panel[hidden] { display: none !important; }
.ai-panel-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px; border-bottom: 1px solid #275353; }
.ai-panel-header h3, .ai-panel-header h4 { margin: 4px 0; color: #f3fffc; font-size: 22px; }
.ai-panel-header p { margin: 0; color: #a7c6c1; font-size: 13px; }
.ai-panel-header .eyebrow { color: #72e4d1; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.ai-panel-header .ai-label { border: 1px solid #37615c; border-radius: 7px; color: #7cebd8; padding: 7px 10px; white-space: nowrap; font-size: 11px; }
[data-amenidades-inventory] { padding: 18px 20px; color: #eefaf7; min-width: 0; font-size: 13px; }
[data-amenidades-inventory] * { box-sizing: border-box; }
.ai-sheet-picker { display: grid; grid-template-columns: minmax(260px,420px) minmax(0,1fr); align-items: end; gap: 12px 20px; padding: 14px; margin-bottom: 14px; border: 1px solid #37615c; border-radius: 8px; background: #0e2a29; }
.ai-sheet-picker label { display: grid; gap: 8px; color: #d9eae5; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.ai-sheet-picker select { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #75aa9f; border-radius: 6px; padding: 9px 12px; background: #fff3d2; color: #16382f; font: inherit; font-size: 14px; font-weight: 700; text-transform: none; }
.ai-sheet-picker select:disabled { opacity: .65; cursor: wait; }
.ai-sheet-picker p { margin: 0 0 2px; color: #b8d0c8; font-size: 12px; line-height: 1.6; }
.ai-source-line .ai-selected-sheet { font-size: 13px; }
.ai-source-line { display: flex; gap: 20px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ai-source-line p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0; color: #adc8c4; font-size: 11px; line-height: 1.6; }
.ai-source-line a { color: #78e6d4; font-weight: 700; }
.ai-refresh-help { margin: -4px 0 16px; max-width: 1050px; color: #adc8c4; font-size: 12px; line-height: 1.6; }
.ai-refresh { background: linear-gradient(120deg,#ffe365,#f4c423); color: #11211e; border: 1px solid #f7d447; border-radius: 7px; padding: 10px 14px; font: inherit; font-weight: 800; cursor: pointer; flex: 0 0 auto; }
.ai-refresh:disabled { opacity: .65; cursor: wait; }
.ai-notice { padding: 11px 13px; border: 1px solid #285a55; background: #10302c; border-radius: 7px; color: #d4eee5; font-size: 12px; line-height: 1.5; }
.ai-notice[data-tone="warning"] { border-color: #847134; background: #302d1b; color: #ffeb9e; }
.ai-notice[data-tone="error"] { border-color: #985956; background: #382425; color: #ffd5ce; }
.ai-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 15px 0; }
.ai-metric { padding: 12px 14px; border: 1px solid #254c49; border-radius: 8px; background: #0b2526; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.ai-metric span { font-size: 11px; color: #a8c8c2; }
.ai-metric strong { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; color: #fff5d1; }
.ai-metric-equal strong { color: #7edcc0; } .ai-metric-different strong, .ai-metric-pending strong { color: #ffda72; }
.ai-toolbar { display: grid; grid-template-columns: minmax(210px,1.6fr) minmax(170px,1fr) minmax(180px,1fr); gap: 12px; margin: 16px 0; }
.ai-toolbar label { display: grid; gap: 6px; color: #c5dad5; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.ai-toolbar input, .ai-toolbar select { width: 100%; min-width: 0; height: 39px; border-radius: 6px; border: 1px solid #3d6560; background: #102c2c; color: #f0faf6; padding: 9px 10px; font-size: 13px; font-family: inherit; }
.ai-toolbar input::placeholder { color: #92b2ac; }
.ai-toolbar select option { background: #102c2c; color: #f0faf6; }
[data-amenidades-inventory] :focus-visible { outline: 2px solid #ffe074; outline-offset: 3px; }
.ai-table-heading { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 8px; color: #a5c2bb; font-size: 11px; }
.ai-table-heading span:first-child { color: #e3efeb; font-weight: 700; }
.ai-table-wrap { max-height: 700px; overflow: auto; border: 1px solid #31524e; border-radius: 7px; scrollbar-color: #477771 #0c2223; }
.ai-grid { width: 100%; min-width: 2070px; border-spacing: 0; border-collapse: separate; font-size: 12px; table-layout: auto; margin: 0; }
.ai-grid th, .ai-grid td { padding: 10px 12px; border-right: 1px solid #234741; border-bottom: 1px solid #234741; vertical-align: middle; background: #0a2021; line-height: 1.4; }
.ai-grid thead th { background: #153632; color: #fce090; font-size: 10px; text-transform: uppercase; letter-spacing: .02em; text-align: center; position: sticky; top: 0; z-index: 3; min-width: 85px; }
.ai-grid thead th small { display: block; font-size: 10px; font-weight: 500; text-transform: none; color: #9ed8ca; }
.ai-grid tbody tr:nth-child(2n) td, .ai-grid tbody tr:nth-child(2n) .ai-name { background: #0e2728; }
.ai-grid .ai-name { position: sticky; left: 0; z-index: 2; min-width: 235px; width: 235px; max-width: 235px; text-align: left; font-weight: 600; box-shadow: 2px 0 0 #365953; overflow-wrap: anywhere; }
.ai-grid thead .ai-name { z-index: 4; }
.ai-grid .ai-code { min-width: 140px; color: #b7d5d0; white-space: nowrap; font-size: 11px; }
.ai-grid .ai-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 96px; }
.ai-grid .ai-physical { font-weight: 700; color: #fff; }
.ai-grid .ai-pack { text-align: center; color: #c5dad5; }
.ai-grid .ai-api { min-width: 155px; max-width: 195px; text-align: right; background: #102e2a; }
.ai-grid .ai-api strong { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.ai-grid .ai-api small { display: block; color: #bec9be; font-size: 10px; margin-top: 6px; text-align: left; line-height: 1.35; }
.ai-badge { display: inline-block; font-size: 10px; line-height: 1.3; border-radius: 4px; padding: 3px 5px; margin-top: 5px; background: #354536; color: #fbeac0; text-align: center; }
.ai-badge.ai-equal { background: #174c3b; color: #a6f4cf; }
.ai-badge.ai-different { background: #4d3919; color: #ffe191; }
.ai-badge.ai-unavailable { background: #55302c; color: #ffd3c9; }
.ai-grid .ai-group th { background: #173d36; color: #7de6ce; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; }
.ai-group th { position: relative; } .ai-grid .ai-empty { text-align: left; color: #a5c2bb; padding: 24px; }
.ai-footnote { margin: 11px 0 0; color: #97b5ad; font-size: 11px; line-height: 1.55; }
.ai-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
html:has(#inventarios.active), body:has(#inventarios.active) { min-width: 0 !important; }
body:has(#inventarios.active) .app-shell { grid-template-columns: 320px minmax(0,1fr); min-width: 0; }
body:has(#inventarios.active) .main-panel, #inventarios.active, #inventarios .inventory-report-stack { min-width: 0; }
html:has(#inventarioAmenidades.active), body:has(#inventarioAmenidades.active) { min-width: 0 !important; }
body:has(#inventarioAmenidades.active) .app-shell { grid-template-columns: 320px minmax(0,1fr); min-width: 0; }
body:has(#inventarioAmenidades.active) .main-panel { min-width: 0; }
@media(max-width: 1000px) { .ai-toolbar { grid-template-columns: 1fr 1fr; } .ai-toolbar .ai-search { grid-column: 1/-1; } .ai-source-line { flex-wrap: wrap; } }
@media(max-width: 700px) {
  .ai-sheet-picker { grid-template-columns: minmax(0,1fr); padding: 12px; }
  body:has(#inventarios.active) .app-shell { grid-template-columns: minmax(0,1fr); }
  .ai-panel-header { padding: 15px; flex-wrap: wrap; gap: 10px; } .ai-panel-header h3,.ai-panel-header h4 { font-size: 20px; }
  [data-amenidades-inventory] { padding: 12px; } .ai-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ai-toolbar { grid-template-columns: 1fr; } .ai-toolbar .ai-search { grid-column: auto; }
  .ai-table-heading { flex-direction: column; gap: 4px; } .ai-grid .ai-name { min-width: 145px; width: 145px; max-width: 145px; }
  .ai-refresh { width: 100%; } .ai-table-wrap { max-height: 65vh; }
  body:has(#inventarioAmenidades.active) .app-shell { display: block; }
  body:has(#inventarioAmenidades.active) .sidebar { position: relative; width: 100%; min-height: auto; height: auto; padding: 12px; }
  body:has(#inventarioAmenidades.active) .sidebar .brand, body:has(#inventarioAmenidades.active) .sidebar-footer { display: none; }
  body:has(#inventarioAmenidades.active) .nav-list { display: flex; overflow-x: auto; gap: 6px; }
  body:has(#inventarioAmenidades.active) .nav-item { flex: 0 0 auto; white-space: nowrap; width: auto; }
  body:has(#inventarioAmenidades.active) .main-panel { padding: 12px; }
}

/* Native disclosure keeps filters and loaded rows intact when closed. */
details.ai-panel > summary.ai-panel-header { list-style: none; cursor: pointer; }
details.ai-panel > summary.ai-panel-header::-webkit-details-marker { display: none; }
details.ai-panel > summary.ai-panel-header::marker { content: ''; }
details.ai-panel:not([open]) > summary.ai-panel-header { border-bottom: 0; }
details.ai-panel > summary.ai-panel-header:hover { background: #0d2828; }
details.ai-panel > summary.ai-panel-header:focus-visible { outline: 2px solid #ffe074; outline-offset: -4px; border-radius: 10px; }
.ai-collapse-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.ai-collapse-control { white-space: nowrap; }
.ai-collapse-close { display: none; }
details.ai-panel[open] .ai-collapse-control::before { content: '-'; }
details.ai-panel[open] .ai-collapse-open { display: none; }
details.ai-panel[open] .ai-collapse-close { display: inline; }
@media(max-width:700px) { .ai-collapse-actions { width: 100%; justify-content: space-between; } }
