:root {
  --navy: #10294f;
  --navy-2: #071b39;
  --green: #319844;
  --bg: #f3f6fa;
  --border: #d9e2ec;
  --text: #14213d;
  --muted: #61708a;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}
a { color: #1769aa; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.admin-top {
  align-items: center;
  background: var(--navy-2);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 54px);
}
.admin-brand { color: #fff; font-weight: 900; margin-right: auto; }
.admin-top nav { display: flex; flex-wrap: wrap; gap: 14px; }
.admin-top nav a { color: #dce7f7; font-size: .88rem; font-weight: 700; }
.admin-account { align-items: center; display: flex; gap: 10px; font-size: .75rem; }
.admin-account form { margin: 0; }
.admin-account button {
  background: transparent;
  border: 1px solid #627491;
  border-radius: 7px;
  color: #fff;
  padding: 6px 9px;
}
.admin-main { margin: 0 auto; max-width: 1280px; padding: 26px 20px 60px; }
.page-title { align-items: center; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 18px; }
h1 { font-size: 1.55rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 13px; }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: 0 8px 24px rgba(16, 41, 79, .06);
  margin-bottom: 16px;
  padding: 18px;
}
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { color: var(--muted); font-size: .72rem; font-weight: 800; }
input, select, textarea {
  background: #fff;
  border: 1px solid #cbd7e5;
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}
textarea { min-height: 58px; resize: vertical; }
.btn, button.primary {
  background: var(--navy);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-weight: 800;
  padding: 10px 14px;
}
.btn.green { background: var(--green); }
.btn.whatsapp { background: #16883b; }
.btn.light { background: #eaf0f7; color: var(--navy); }
.btn.danger, button.danger { background: var(--danger); color: #fff; }
.compact-form { display: inline-block; margin: 0; }
.confirm-delete { max-width: 620px; }
.confirm-code { font-family: Consolas, monospace; font-weight: 800; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; font-size: .82rem; width: 100%; }
th, td { border-bottom: 1px solid #e5ebf2; padding: 10px 9px; text-align: left; vertical-align: top; }
th { background: #edf3f8; color: #42516a; font-size: .7rem; text-transform: uppercase; }
.muted { color: var(--muted); }
.number { text-align: right; white-space: nowrap; }
.badge { border-radius: 999px; display: inline-block; font-size: .68rem; font-weight: 800; padding: 4px 8px; }
.badge.new { background: #e8f6ea; color: #246d31; }
.badge.contacted { background: #e8f1fb; color: #255f97; }
.badge.quoted { background: #fff2ce; color: #7c5b0e; }
.badge.closed { background: #e8ebef; color: #465261; }
.badge.approval-draft { background: #edf1f5; color: #526174; }
.badge.approval-pending { background: #fff2ce; color: #7c5b0e; }
.badge.approval-approved { background: #e8f6ea; color: #246d31; }
.badge.approval-rejected { background: #ffebea; color: var(--danger); }
.flash { border-radius: 9px; margin-bottom: 14px; padding: 11px 13px; }
.flash.success { background: #e9f7eb; color: #246d31; }
.flash.error { background: #ffebea; color: var(--danger); }
.summary { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary div { background: #f5f8fb; border-radius: 9px; padding: 11px; }
.summary span { color: var(--muted); display: block; font-size: .68rem; }
.summary strong { display: block; margin-top: 3px; }
.system-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; margin-top: 10px; padding: 13px; }
.system-card p { font-size: .8rem; margin: 5px 0; }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.login-card { max-width: 430px; width: 100%; }
.login-card .brand { color: var(--green); font-size: .78rem; font-weight: 900; text-transform: uppercase; }
.login-card h1 { margin: 6px 0 18px; }
.login-card button { margin-top: 12px; width: 100%; }
.inline-form { align-items: end; display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form .field { min-width: 150px; }
.catalog-filters .search-field { flex: 1 1 230px; }
.catalog-filters .supplier-field { flex: 1 1 240px; }
.catalog-filters select { max-width: 330px; }
.danger { color: var(--danger); }
.approval-summary { margin-bottom: 16px; }
.approval-panel .action-row, .action-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.action-row form { margin: 0; }
.approval-ok { background: #e9f7eb; border-radius: 9px; color: #246d31; padding: 11px 13px; }
.commercial-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.missing-price { background: #fff7f6; }
.missing-price td:first-child { color: var(--danger); font-weight: 800; }
.admin-profit {
  background: #071b39;
  border-radius: 10px;
  color: #fff;
  margin-top: 15px;
  padding: 13px;
}
.admin-profit span { color: #b9c8dc; display: block; font-size: .7rem; }
.admin-profit strong { display: block; margin-top: 4px; }
.secure-link {
  background: #f5f8fb;
  border-radius: 8px;
  font-size: .78rem;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
  padding: 10px;
}
.sales-recommendation {
  background: #eef7e9;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  margin-top: 14px;
  padding: 12px 14px;
}
.sales-recommendation p { margin: 5px 0 0; }
.commercial-fields { margin-bottom: 14px; }
.catalog-refresh-form {
  align-items: center;
  background: #f5f8fb;
  border: 1px solid #d7e1ec;
  border-radius: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px;
}
.catalog-refresh-form .muted { flex: 1 1 360px; font-size: .78rem; }
.catalog-add {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.catalog-add select { max-width: 470px; }
.catalog-add .muted { font-size: .78rem; }
.quote-lines input { min-width: 86px; }
.quote-lines select, .quote-lines textarea { margin-bottom: 5px; }
.quote-lines td:first-child { min-width: 280px; }
.quote-lines td:first-child input { margin-bottom: 5px; }
.quote-lines td:first-child input:last-child { margin-bottom: 0; }
.qty-control { align-items: center; display: flex; min-width: 138px; }
.qty-control input { border-radius: 0; min-width: 65px; text-align: center; }
.qty-control button {
  background: #eaf0f7;
  border: 1px solid #cbd7e5;
  color: var(--navy);
  cursor: pointer;
  font-weight: 900;
  min-height: 40px;
  min-width: 35px;
}
.qty-control button:first-child { border-radius: 8px 0 0 8px; }
.qty-control button:last-child { border-radius: 0 8px 8px 0; }
.tax-check { align-items: center; display: flex; gap: 6px; white-space: nowrap; }
.tax-check input { min-height: auto; min-width: auto; width: auto; }
.remove-line {
  background: #fff0ef;
  border: 1px solid #f0b5b0;
  border-radius: 7px;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.2rem;
  min-height: 38px;
  min-width: 38px;
}
.quote-totals {
  display: grid;
  gap: 7px;
  margin: 14px 0 14px auto;
  max-width: 430px;
}
.quote-totals div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 7px 10px;
}
.quote-totals .grand-total {
  background: var(--navy);
  border-radius: 8px;
  color: #fff;
  font-size: 1.05rem;
}
.price-rule {
  color: var(--muted);
  display: block;
  font-size: .65rem;
  margin-top: 4px;
  max-width: 155px;
}
.bulk-save-bar {
  align-items: center;
  background: #eef3f8;
  border-radius: 9px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 11px 13px;
}
.bulk-save-bar.bottom { margin: 14px 0 0; }
.bulk-save-bar span { color: var(--muted); display: block; font-size: .72rem; margin-top: 3px; }
.catalog-table textarea { min-width: 220px; }
.catalog-table input { min-width: 92px; }
.catalog-table td:first-child input { margin-top: 6px; }
button:disabled { cursor: not-allowed; opacity: .45; }
@media (max-width: 780px) {
  .grid, .grid.three, .summary, .commercial-summary { grid-template-columns: 1fr; }
  .admin-top { align-items: flex-start; flex-direction: column; }
  .admin-brand { margin-right: 0; }
}

/* Filtro de compatibilidad por plataforma */
.platform-filter { background: #f4f7fa; border: 1px solid #dbe3ec; border-radius: 9px; margin: 10px 0 14px; padding: 10px 12px; }
.platform-filter label { align-items: center; display: flex; font-weight: 600; gap: 8px; }
.platform-filter input[type="checkbox"] { height: 17px; margin: 0; min-height: auto; width: 17px; }
.platform-filter .muted { display: block; font-size: .85rem; margin-top: 4px; }
.platform-status { color: #10294f; font-size: .85rem; font-weight: 600; margin: 8px 0 0; }
.platform-tag { background: #eef6e8; border-radius: 5px; color: #246f2f; font-size: .75rem; font-weight: 700; padding: 2px 6px; }
