:root {
  --black: #090909;
  --yellow: #f2ae00;
  --paper: #f1f2f4;
  --white: #fff;
  --line: #d4d7dc;
  --muted: #60656d;
  --danger: #a7271d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--black);
  background:
    linear-gradient(135deg, rgba(0,0,0,.025) 25%, transparent 25%) 0 0/14px 14px,
    var(--paper);
  font: 16px/1.45 Arial, Helvetica, sans-serif;
}
button, input, select { font: inherit; }
.admin-header {
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 15px clamp(18px, 4vw, 70px);
  color: var(--white);
  background: var(--black);
  border-bottom: 8px solid var(--yellow);
}
.admin-brand img { width: 76px; height: 76px; object-fit: contain; }
.admin-header p {
  margin: 0 0 2px;
  color: var(--yellow);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}
h1, h2 { margin: 0; text-transform: uppercase; font-weight: 900; }
h1 { font-size: clamp(1.45rem, 3vw, 2.5rem); line-height: 1; }
h2 { font-size: clamp(1.15rem, 2vw, 1.6rem); }
.header-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}
.header-link {
  color: var(--white);
  font-weight: 800;
  text-decoration-color: var(--yellow);
}
.admin-main { width: min(1320px, calc(100% - 32px)); margin: 34px auto 70px; }
.panel {
  margin-bottom: 24px;
  padding: clamp(20px, 3vw, 34px);
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-left: 7px solid var(--black);
  box-shadow: 8px 8px 0 rgba(0,0,0,.08);
}
.panel.compact { border-left-color: var(--yellow); }
.toolbar { display: flex; align-items: end; gap: 18px; }
.toolbar label { flex: 1; }
.version {
  padding: 10px 13px;
  background: var(--black);
  color: var(--yellow);
  font-weight: 800;
  white-space: nowrap;
}
.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--black);
}
.section-heading > div { display: flex; align-items: center; gap: 12px; }
.section-heading p { margin: 0; max-width: 520px; color: var(--muted); }
.number {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 38px;
  padding: 0 8px;
  color: var(--black);
  background: var(--yellow);
  font-weight: 900;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}
label { display: grid; gap: 7px; font-weight: 800; }
input, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--black);
  background: var(--white);
  border: 2px solid #b8bdc4;
  border-radius: 0;
}
input:focus, select:focus { outline: 3px solid rgba(242,174,0,.35); border-color: var(--black); }
.button {
  min-height: 46px;
  padding: 11px 18px;
  border: 2px solid var(--black);
  color: var(--black);
  background: var(--yellow);
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}
.button.secondary { color: var(--white); background: var(--black); }
.text-button { border: 0; background: none; font-weight: 800; cursor: pointer; text-decoration: underline; }
.form-action { justify-self: start; }
.wide-label { margin-bottom: 14px; }
.origin-note {
  margin: 8px 0 18px;
  padding: 12px 14px;
  color: #3e4248;
  background: #f8edca;
  border-left: 5px solid var(--yellow);
}
.promotion-warning {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 2px solid var(--black);
  border-left: 8px solid var(--yellow);
  background: #fff3c6;
  font-weight: 800;
  line-height: 1.45;
}
.promotion-table { min-width: 820px; }
.promotion-state {
  display: inline-block;
  padding: 5px 8px;
  border: 2px solid var(--black);
  background: var(--white);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}
.promotion-state.activa { background: var(--yellow); }
.promotion-state.programada { color: var(--white); background: var(--black); }
.promotion-state.finalizada,
.promotion-state.inactiva { color: var(--muted); border-color: var(--line); }
.catalog-search { display: flex; align-items: end; gap: 12px; margin-bottom: 12px; }
.catalog-search label { flex: 1; }
.quick-edit-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}
.quick-edit-toolbar label { flex: 1; }
.time-comparison {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(520px, 1.7fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}
.time-source-card {
  padding: 18px;
  border: 2px solid var(--black);
  background: var(--white);
}
.time-source-card h3 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 4px solid var(--yellow);
  font-size: 1rem;
  text-transform: uppercase;
}
.time-maia-values {
  display: grid;
  gap: 8px;
}
.time-maia-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.time-maia-row strong { white-space: nowrap; }
.quick-table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px;
  border: 2px solid var(--black);
  border-left: 8px solid var(--yellow);
  background: #fff8e5;
}
.quick-table-actions p { margin: 0; }
.quick-time-table {
  min-width: 1080px;
  table-layout: fixed;
}
.quick-time-table thead th { text-align: center; }
.quick-time-table th,
.quick-time-table td {
  padding: 11px 7px;
  vertical-align: middle;
}
.quick-time-table th { font-size: .72rem; }
.quick-time-table th:first-child,
.quick-time-table td:first-child {
  width: 190px;
  min-width: 190px;
}
.quick-time-table th:last-child,
.quick-time-table td:last-child { width: 82px; }
.time-name-cell strong,
.time-name-cell small {
  display: block;
  overflow-wrap: anywhere;
}
.time-name-cell strong {
  font-size: .72rem;
  line-height: 1.08;
}
.time-name-cell small {
  margin-top: 4px;
  font-size: .66rem;
  line-height: 1.12;
}
.time-value-stack {
  display: grid;
  gap: 7px;
}
.time-maia-value,
.time-mqf-value {
  display: grid;
  gap: 3px;
}
.time-maia-value {
  padding: 6px 7px;
  border: 1px solid var(--line);
  background: #f2f4f6;
}
.time-mqf-value {
  padding: 7px;
  border-left: 4px solid var(--yellow);
  background: #fff8e5;
}
.time-maia-value span,
.time-mqf-value > span {
  font-size: .62rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}
.time-maia-value strong {
  font-size: .83rem;
  white-space: nowrap;
}
.quick-time-table input {
  width: 100%;
  min-height: 38px;
  padding: 5px 6px;
}
.quick-time-table tr.changed,
.glass-table tr.changed { background: #fff2bf; }
.source-badge {
  display: inline-block;
  padding: 4px 7px;
  border: 1px solid var(--black);
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}
.source-badge.own { background: var(--yellow); }
.source-badge.inherited { color: var(--muted); border-color: var(--line); }
.maia-number {
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.glass-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}
.glass-toolbar label { flex: 1; }
.glass-form {
  margin: 18px 0 26px;
  padding: 20px;
  border: 3px solid var(--black);
  background: #fff8e5;
}
.glass-commercial-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.glass-value-stack {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--black);
  background: var(--white);
}
.glass-value-stack h3 {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 4px solid var(--yellow);
  font-size: 1rem;
  text-transform: uppercase;
}
.webshop-field {
  padding: 12px;
  border-left: 5px solid var(--yellow);
  background: #fff8e5;
}
.checkbox-label {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid #b8bdc4;
  background: var(--white);
}
.checkbox-label input,
.glass-visible-toggle {
  width: 22px;
  min-height: 22px;
  accent-color: var(--yellow);
}
.glass-help {
  margin: 0;
  color: var(--muted);
}
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.glass-table { min-width: 1040px; }
.glass-table-edit {
  min-width: 1050px;
  table-layout: fixed;
}
.glass-table-edit th,
.glass-table-edit td { padding: 9px 7px; }
.glass-table-edit th:nth-child(1) { width: 82px; }
.glass-table-edit th:nth-child(2) { width: 190px; }
.glass-table-edit th:nth-child(3) { width: 230px; }
.glass-table-edit th:nth-child(4),
.glass-table-edit th:nth-child(5) { width: 210px; }
.glass-table-edit th:nth-child(6) { width: 100px; }
.glass-identity strong,
.glass-identity small {
  display: block;
  overflow-wrap: anywhere;
}
.glass-identity strong { font-size: .84rem; }
.glass-identity small {
  margin-top: 4px;
  line-height: 1.2;
}
.technical-cell,
.table-value-stack {
  display: grid;
  gap: 8px;
}
.technical-cell label,
.table-value-stack label {
  display: grid;
  gap: 4px;
}
.technical-cell label > span,
.table-value-stack label > span {
  font-size: .67rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}
.inline-inputs {
  display: flex;
  align-items: center;
  gap: 5px;
}
.glass-table-edit input[type="number"],
.glass-table-edit input[type="text"] {
  width: 100%;
  min-height: 38px;
  padding: 5px 6px;
}
.glass-table-edit .compact-input { width: 78px; }
.table-value-stack .mqf-value {
  padding: 8px;
  border-left: 4px solid var(--yellow);
  background: #fff8e5;
}
.glass-table td { vertical-align: top; }
.glass-table small { display: block; color: var(--muted); }
.glass-table .price-cell { white-space: nowrap; }
.glass-table .inherited { color: var(--muted); font-style: italic; }
.glass-table .catalog-warning {
  display: inline-block;
  margin-top: 4px;
  color: var(--danger);
  font-size: .76rem;
  font-weight: 800;
}

.mosquito-table {
  min-width: 1040px;
}

.mosquito-table-edit {
  min-width: 1120px;
  table-layout: fixed;
}

.mosquito-table-edit th:nth-child(1) { width: 82px; }
.mosquito-table-edit th:nth-child(2) { width: 250px; }
.mosquito-table-edit th:nth-child(3) { width: 210px; }
.mosquito-table-edit th:nth-child(4) { width: 230px; }
.mosquito-table-edit th:nth-child(5) { width: 220px; }
.mosquito-table-edit th:nth-child(6) { width: 100px; }
.mosquito-table tr.changed { background: #fff2bf; }
.mosquito-table td > small { display: block; color: var(--muted); }

.mosquito-identity {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.mosquito-identity strong,
.mosquito-identity small {
  display: block;
  overflow-wrap: anywhere;
}

.admin-mosquito-swatch {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 0, 0, .35);
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}
.catalog-results {
  max-height: 300px;
  overflow: auto;
  margin-bottom: 18px;
  border: 2px solid var(--black);
  background: var(--white);
}
.catalog-item {
  display: grid;
  grid-template-columns: minmax(100px, .7fr) minmax(220px, 2fr) .7fr .7fr;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
}
.catalog-item:hover { background: #fff4d3; }
.catalog-item strong { font-family: Consolas, monospace; }
.span-2 { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }
.table-wrap { margin-top: 24px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 9px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--white); background: var(--black); text-transform: uppercase; font-size: .78rem; }
.row-actions { display: flex; gap: 8px; }
.row-button { border: 0; background: none; font-weight: 800; text-decoration: underline; cursor: pointer; }
.row-button.delete { color: var(--danger); }
.message {
  position: sticky;
  z-index: 5;
  top: 12px;
  margin-bottom: 18px;
  padding: 14px 18px;
  color: var(--white);
  background: #19713b;
  border: 3px solid var(--black);
  font-weight: 800;
}
.message.error { background: var(--danger); }
.access-panel { display: flex; gap: 18px; }
.access-panel p { margin: 8px 0 20px; }

@media (max-width: 800px) {
  .admin-header { align-items: flex-start; gap: 12px; }
  .admin-brand img { width: 55px; height: 55px; }
  .header-link { font-size: .82rem; }
  .admin-main { width: min(100% - 20px, 680px); margin-top: 18px; }
  .panel { padding: 18px; box-shadow: 4px 4px 0 rgba(0,0,0,.08); }
  .toolbar, .section-heading, .catalog-search, .glass-toolbar,
  .quick-edit-toolbar, .quick-table-actions { align-items: stretch; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2, .span-full { grid-column: auto; }
  .glass-commercial-comparison, .time-comparison { grid-template-columns: 1fr; }
  .catalog-item { grid-template-columns: 1fr; gap: 3px; }
}
