/*
 * Capa visual moderna y reversible para la portada.
 * No altera estructura, datos, eventos ni permisos. Para volver al diseño
 * anterior basta retirar su enlace de index.html.
 */
:root {
  --navy: #092b53;
  --blue: #1466d8;
  --blue-strong: #0f64d5;
  --gold: #e2b83d;
  --red: #c73545;
  --ink: #10233d;
  --muted: #64758b;
  --line: #dbe6f2;
  --surface: #ffffff;
  --soft: #eef5fc;
  --success: #16855d;
  --danger: #c73545;
  --modern-radius: 18px;
  --modern-shadow: 0 14px 38px rgba(16, 54, 94, 0.09);
}

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(20, 102, 216, 0.08), transparent 24rem),
    linear-gradient(180deg, #f6f9fd 0%, #eef4fa 100%);
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}

button,
a,
input,
textarea,
select {
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  padding: 10px max(22px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(199, 215, 232, 0.82);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 7px 26px rgba(15, 52, 92, 0.07);
  backdrop-filter: blur(16px);
}

.brand-lockup { gap: 12px; }
.brand-lockup strong { color: var(--navy); font-size: 18px; letter-spacing: -0.02em; }
.brand-lockup span { margin-top: 1px; color: var(--muted); font-size: 11px; }
.brand-mark {
  width: 46px;
  height: 46px;
  border: 2px solid #edce70;
  box-shadow: 0 7px 17px rgba(132, 94, 10, 0.13);
}

.account-actions { gap: 9px; }
.account-name { color: var(--ink); font-weight: 600; }
.snapshot-badge {
  min-height: 32px;
  border-color: #d8e4f1;
  background: #f3f7fc;
  padding: 6px 12px;
}

.icon-button,
.ghost-button,
.primary-button,
.download-button,
.mail-button {
  border-radius: 11px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-color: #d8e4f1;
  box-shadow: 0 4px 12px rgba(19, 55, 94, 0.05);
}

.ghost-button {
  min-height: 38px;
  padding: 7px 14px;
  border-color: #d3e0ef;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(19, 55, 94, 0.04);
}

.primary-button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #176bdc, #0d88b9);
  box-shadow: 0 9px 20px rgba(20, 102, 216, 0.2);
}

.primary-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #0e5ecb, #087da9);
  transform: translateY(-1px);
}

.shell {
  width: min(1240px, 100%);
  padding: 28px 22px 40px;
}

.auth-panel {
  min-height: 470px;
  border: 1px solid rgba(211, 224, 239, 0.9);
  border-top: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 30%, rgba(20, 184, 212, 0.08), transparent 18rem),
    #ffffff;
  box-shadow: var(--modern-shadow);
  overflow: hidden;
}

.auth-character { max-height: 360px; filter: drop-shadow(0 16px 20px rgba(10, 44, 82, 0.12)); }
.eyebrow { color: var(--blue); letter-spacing: 0.09em; }
.auth-copy h1 { color: var(--navy); font-size: 36px; letter-spacing: -0.035em; }
.auth-message { max-width: 410px; }

.workspace {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.creation-launcher,
.sellout-launcher,
.sellin-upload-launcher,
.query-band,
.result-panel {
  border: 1px solid rgba(210, 224, 239, 0.95);
  border-radius: var(--modern-radius);
  box-shadow: var(--modern-shadow);
}

.creation-launcher {
  grid-column: span 6;
  min-height: 116px;
  padding: 19px 20px;
  border-left: 1px solid rgba(210, 224, 239, 0.95);
  background: linear-gradient(145deg, #ffffff 0%, #f2f7fd 100%);
}

.creation-launcher:hover {
  border-color: #aac6e6;
  box-shadow: 0 18px 42px rgba(16, 70, 128, 0.14);
  transform: translateY(-2px);
}

.creation-launcher-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #0b315e, #1466d8);
  box-shadow: 0 9px 20px rgba(9, 57, 111, 0.18);
}

.kam-launcher {
  border-left: 1px solid rgba(210, 224, 239, 0.95);
  background: linear-gradient(145deg, #ffffff 0%, #edfbfd 100%);
}

.kam-launcher-icon { background: linear-gradient(145deg, #087d96, #14b8d4); }
.creation-launcher strong { color: var(--navy); font-size: 17px; letter-spacing: -0.01em; }
.creation-launcher small { margin-top: 5px; }
.creation-launcher-action {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  background: #edf4fd;
  color: var(--blue);
  font-size: 13px;
}

@supports selector(.workspace:has(.kam-launcher:not([hidden]))) {
  .workspace:not(:has(.kam-launcher:not([hidden]))) #creationLauncher { grid-column: 1 / -1; }
}

.sellout-launcher,
.sellin-upload-launcher,
.query-band,
.status-line,
.result-panel {
  grid-column: 1 / -1;
}

.sellout-launcher {
  min-height: 104px;
  padding: 18px 20px;
  border-left: 1px solid rgba(210, 224, 239, 0.95);
  background: #ffffff;
}

.sellout-launcher-icon {
  width: 48px;
  background: linear-gradient(145deg, #155fc8, #0d8fbd);
}
.peru-launcher { border-color: rgba(217, 16, 35, .32); }
.peru-launcher-icon { background: linear-gradient(135deg, #d91023 0 50%, #fff 50% 100%); color: #082f5f; }

.sellout-launcher input,
.example-picker select,
textarea,
.mail-dialog input,
.filtro-dialog input[type="search"],
.filtro-dialog input[type="email"],
.filtro-dialog select {
  border-color: #c7d7e8;
  border-radius: 11px;
  background: #fbfdff;
}

.sellout-launcher input:hover,
.example-picker select:hover,
textarea:hover {
  border-color: #9ebbd9;
}

.sellout-launcher input:focus,
.example-picker select:focus,
textarea:focus {
  outline: 4px solid rgba(20, 102, 216, 0.11);
  border-color: #4c8cd9;
}

.sellin-upload-launcher {
  padding: 18px 20px;
  border-left: 1px solid rgba(210, 224, 239, 0.95);
  background: linear-gradient(145deg, #ffffff, #f0fbf6);
}

.sellin-upload-icon { background: linear-gradient(145deg, #157951, #21a873); }

.query-band {
  padding: 22px;
  border-top: 1px solid rgba(210, 224, 239, 0.95);
  background: #ffffff;
}

.query-band > form > label {
  margin-bottom: 10px;
  font-size: 14px;
}

.query-row { gap: 12px; }
textarea { min-height: 66px; padding: 13px 14px; }
.submit-button { min-width: 126px; }

.suggestions { gap: 7px; margin-top: 13px; }
.suggestions button {
  border-color: #d5e2ef;
  border-radius: 999px;
  background: #f4f8fc;
  padding: 7px 12px;
  color: #264d78;
}
.suggestions button:hover { border-color: #9fbee0; background: #eaf3fd; }

.example-picker {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e4edf6;
}

.status-line { padding: 0 6px; }

.result-panel {
  min-height: 420px;
  overflow: hidden;
  background: #ffffff;
}

.result-heading {
  min-height: 62px;
  padding: 13px 18px;
  background: linear-gradient(115deg, #092b53 0%, #0b386b 68%, #0c4773 100%);
}

.result-heading h2 { font-size: 18px; font-weight: 700; }
.result-actions { gap: 7px; }

.download-button,
.mail-button {
  min-height: 37px;
  padding: 7px 11px;
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: none;
}

.catalogo-button { border-color: #e6a8ae; color: #a91927; }
.catalogo-margen { border-color: #b8cbe0; }
.mail-button { border-color: #e3c65e; background: #e5c654; }

.empty-state { min-height: 350px; }
.empty-state img { filter: drop-shadow(0 11px 16px rgba(9, 53, 99, 0.11)); }

.markdown-body { padding: 22px; }
.markdown-body h1 { color: var(--navy); letter-spacing: -0.025em; }
.markdown-body h2 { border-left-color: var(--blue); border-radius: 10px; }

.executive-summary {
  border-color: #c6daed;
  border-left: 0;
  border-radius: 16px;
  background: linear-gradient(120deg, #ffffff, #edf6ff);
  box-shadow: 0 10px 30px rgba(21, 72, 126, 0.08);
}

.executive-summary ul:first-of-type li {
  border-color: #d7e4f1;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(16, 54, 94, 0.05);
}

.table-wrap { border-color: #d7e3ef; border-radius: 12px; }
.markdown-body th { background: #0a2e57; }

.mail-dialog {
  border: 1px solid #d4e1ef;
  border-top: 0;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(7, 30, 59, 0.3);
}

.mail-dialog::backdrop { background: rgba(4, 22, 43, 0.64); backdrop-filter: blur(4px); }
.filtro-dialog textarea,
.filtro-marcas-lista { border-radius: 11px; border-color: #cfdeed; }

footer {
  width: min(1240px, 100%);
  padding: 0 22px 26px;
}

@media (max-width: 820px) {
  .creation-launcher { grid-column: 1 / -1; }
  .sellout-launcher { grid-template-columns: auto minmax(210px, 1fr) auto; }
  .sellout-brand-label,
  .sellout-launcher input,
  .sellout-launcher button { grid-column: auto; }
  .sellout-brand-label { display: none; }
}

@media (max-width: 720px) {
  .topbar { min-height: 66px; padding: 8px 13px; }
  .shell { padding: 16px 10px 28px; }
  .workspace { gap: 12px; }
  .auth-panel { border-radius: 18px; padding: 24px 18px; }
  .auth-copy h1 { font-size: 27px; }
  .creation-launcher,
  .sellout-launcher,
  .sellin-upload-launcher,
  .query-band,
  .result-panel { border-radius: 15px; }
  .creation-launcher { min-height: 0; }
  .sellout-launcher { grid-template-columns: auto minmax(0, 1fr); }
  .sellout-brand-label,
  .sellout-launcher input,
  .sellout-launcher button { grid-column: 1 / -1; }
  .sellout-brand-label { display: block; }
  .query-band { padding: 16px; }
  .result-heading { min-height: 0; }
  .result-actions { gap: 7px; }
  .markdown-body { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  button,
  a,
  input,
  textarea,
  select { transition: none; }
}
