:root {
  --red: #dc2400;
  --red-deep: #a81b00;
  --red-link: #c42000;
  --red-tint: #fff1ed;
  --paper: #f6f6f6;
  --card: #fff;
  --line: #dcdcdc;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--text); font: 400 16px/1.55 var(--sans); }
a { color: var(--red-link); }
h1, h2 { line-height: 1.15; letter-spacing: -0.01em; }
h1 { margin: 0 0 18px; font-size: 30px; font-weight: 800; }
h2 { margin: 28px 0 12px; font-size: 21px; font-weight: 700; }
.card h1, .card h2 { margin-top: 0; }
:focus-visible { outline: 3px solid #2b2b2b; outline-offset: 2px; }

.top { background: var(--card); border-bottom: 4px solid var(--red); }
.top-bar { display: flex; align-items: center; gap: 16px; min-height: 72px; padding: 6px 24px; }
.logo { display: block; flex: none; }
.logo-svg { display: block; width: auto; height: 56px; }
.portal-name { padding-left: 16px; border-left: 2px solid var(--line); color: var(--red); font-size: 20px; font-weight: 700; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 15px; color: var(--muted); }
.who.back { color: var(--red-link); }
.who form { margin: 0; }
.link-btn { padding: 0; border: 0; background: none; color: var(--red-link); font: 600 15px/1.2 var(--sans); text-decoration: underline; cursor: pointer; }

.shell { flex: 1; display: grid; grid-template-columns: 250px minmax(0, 1fr); width: 100%; }
.shell-public { display: block; max-width: 1000px; margin: 0 auto; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 16px 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 11px 20px; border-left: 4px solid transparent; color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none; }
.side a:hover { background: var(--red-tint); }
.side a.on { border-left-color: var(--red); background: var(--red-tint); color: var(--red-link); }
.content { padding: 28px 32px 48px; min-width: 0; }
.foot { padding: 16px 24px; background: var(--red-deep); color: #fff; font-size: 14px; }

.banner { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; padding: 30px 32px; border-radius: 6px; background: var(--red-deep); color: #fff; }
.banner strong { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; }
.login-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: start; }

.card { margin-bottom: 20px; padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.narrow { max-width: 520px; margin-inline: auto; }
.content > .narrow { margin-inline: 0; }
.shell-public .narrow { margin-inline: auto; }
.narrow-form { max-width: 520px; }
.reply { border-top: 4px solid var(--red); }
.lead { color: var(--muted); margin-top: 0; }
.empty { padding: 18px; background: var(--card); border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack > * { min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
label { display: block; font-size: 14px; font-weight: 600; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 10px 11px; background: #fff; color: var(--text); border: 1px solid #a6a6a6; border-radius: 3px; font: 400 16px/1.4 var(--sans); }
input, select { min-height: 45px; }
input[type="file"] { padding: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { flex: none; width: 18px; height: 18px; min-height: 0; margin-top: 2px; }
.trap { position: absolute; left: -9999px; }
.btn { display: inline-block; align-self: flex-start; padding: 12px 20px; border: 1px solid var(--red); border-radius: 4px; background: var(--red); color: #fff; font: 700 15px/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn-ghost { background: var(--card); color: var(--red-link); }
.btn-ghost:hover { background: var(--red-tint); border-color: var(--red); }
.btn-small { padding: 7px 12px; font-size: 14px; }

.flash { margin: 0 0 18px; padding: 12px 15px; border-radius: 4px; border-left: 4px solid; font-weight: 500; }
.flash-ok { background: #e9f6ef; border-color: #1c7a49; }
.flash-err { background: var(--red-tint); border-color: var(--red); }
.flash-info { background: #f0f0f0; border-color: #8c8c8c; }
.flash code { display: block; margin-top: 6px; word-break: break-all; font-size: 13px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 4px; color: var(--text); text-decoration: none; }
.tile:hover { background: var(--red-tint); }
.tile span { color: var(--muted); font-size: 14px; }
.tile .big { color: var(--red-link); font-size: 32px; line-height: 1; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--paper); font-size: 13px; font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td form { margin: 0; }
small { color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; background: #ececec; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge-approved, .badge-completed, .badge-accepted { background: #e0f2e8; color: #14613a; }
.badge-submitted, .badge-pending, .badge-in_progress { background: #fdf0d0; color: #6e4c00; }
.badge-declined, .badge-rejected, .badge-suspended { background: #fde1da; color: #8f1700; }

.facts { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 6px 16px; margin: 0 0 8px; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.table-wrap + .facts { margin-top: 16px; }
.card form.row { margin-top: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.kyc-review { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kyc-review input { flex: 1 1 130px; width: auto; margin: 0; padding: 6px 8px; font-size: 14px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; color: var(--text); text-decoration: none; }
.product-card:hover { border-color: var(--red); }
.product-card strong { font-size: 17px; line-height: 1.25; }
.product-card span { color: var(--muted); font-size: 14px; }
.code { color: var(--muted); font-size: 14px; }
.product-page .code { margin: 0 0 8px; }
.product-thumb { display: block; width: 100%; height: 170px; margin-bottom: 8px; object-fit: contain; background: #fff; }
.product-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: start; }
.product-page h1 { margin: 4px 0 8px; }
.product-photo { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.no-picture { display: flex; align-items: center; justify-content: center; min-height: 80px; background: var(--paper); color: var(--muted); font-size: 14px; }
.product-photo.no-picture { height: 260px; }
.table-thumb { display: block; width: 72px; height: 54px; object-fit: contain; font-size: 11px; text-align: center; }
.table-thumb.no-picture { min-height: 54px; }
.current-file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: -6px; }
.filters a.on { color: var(--text); font-weight: 700; text-decoration: none; }
.empty p { margin: 0 0 12px; }

.menu-brand { margin: 0; }
.menu-title { scroll-margin-top: 16px; }
.menu-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.menu-row input[name="name"] { flex: 1 1 220px; width: auto; min-height: 38px; margin: 0; padding: 7px 9px; font-size: 15px; }
.menu-head { padding-top: 0; border-bottom: 2px solid var(--line); }
.menu-head input[name="name"] { font-weight: 700; font-size: 17px; }
.menu-row.is-off input[name="name"], .menu-title.is-off .menu-head input[name="name"] { color: var(--muted); text-decoration: line-through; }
.menu-count { min-width: 74px; font-size: 14px; text-align: center; }
.menu-add { display: flex; gap: 8px; margin-top: 12px; }
.menu-add input[name="name"] { flex: 1; min-width: 0; margin: 0; min-height: 38px; padding: 7px 9px; }
.option-pick { max-width: 320px; }
.option-pick .required { color: var(--red); }
.option-note { margin: 6px 0 0; color: #b3361b; font-size: 14px; font-weight: 600; }
.product-tabs { padding: 0; overflow: hidden; }
.tab-list { display: flex; flex-wrap: wrap; background: var(--paper); border-bottom: 1px solid var(--line); }
.tab-list button { padding: 14px 22px; border: 0; border-bottom: 3px solid transparent; border-right: 1px solid var(--line); background: none; color: var(--text); font: 600 16px/1.2 var(--sans); cursor: pointer; }
.tab-list button:hover { color: var(--red-link); }
.tab-list button[aria-selected="true"] { background: var(--card); border-bottom-color: var(--red); color: var(--red-link); }
.tab-panel { padding: 24px 26px; }
.tab-panel[hidden] { display: none; }
.tab-panel > p { margin: 0; }
.rich p { margin-top: 0; margin-bottom: 10px; }
.rich ul, .rich ol { margin: 0 0 10px; padding-left: 28px; }
.rich > :last-child { margin-bottom: 0; }
.rich li { margin-bottom: 4px; }
.rich li::marker { color: var(--red); }
.rich ul.rt-list-dot { list-style-type: disc; }
.rich ul.rt-list-arrow { list-style-type: '\27A4\00A0\00A0'; }
.rich ul.rt-list-tick { list-style-type: '\2713\00A0\00A0'; }
.rich ul.rt-list-square { list-style-type: square; }
.rt-c-default { color: var(--text); } .rt-c-red { color: #c42000; } .rt-c-blue { color: #1d4fbf; } .rt-c-green { color: #14703f; } .rt-c-orange { color: #b85a00; } .rt-c-purple { color: #6b2fa0; } .rt-c-gray { color: #666; }
.rt-bg-none { background: none; } .rt-bg-yellow { background: #fff27a; } .rt-bg-green { background: #bff0c4; } .rt-bg-cyan { background: #b5ecf5; } .rt-bg-pink { background: #ffc9de; }
.rt-s-normal { font-size: 16px; } .rt-s-small { font-size: 13px; } .rt-s-large { font-size: 20px; } .rt-s-huge { font-size: 28px; line-height: 1.25; }
.rt-f-default { font-family: var(--sans); } .rt-f-arial { font-family: Arial, Helvetica, sans-serif; } .rt-f-times { font-family: 'Times New Roman', Times, serif; } .rt-f-courier { font-family: 'Courier New', Courier, monospace; } .rt-f-verdana { font-family: Verdana, Geneva, sans-serif; }
.rt-left { text-align: left; } .rt-center { text-align: center; } .rt-right { text-align: right; } .rt-justify { text-align: justify; }
.rt-indent-1 { margin-left: 28px; } .rt-indent-2 { margin-left: 56px; } .rt-indent-3 { margin-left: 84px; } .rt-indent-4 { margin-left: 112px; } .rt-indent-5 { margin-left: 140px; } .rt-indent-6 { margin-left: 168px; }
#detailsBox[hidden] { display: none; }
.rt-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; padding: 6px; background: var(--paper); border: 1px solid #a6a6a6; border-bottom: 0; border-radius: 3px 3px 0 0; }
.rt-bar button { min-width: 34px; min-height: 34px; padding: 0 7px; border: 1px solid transparent; border-radius: 3px; background: none; color: var(--text); font: 600 15px/1 var(--sans); cursor: pointer; }
.rt-bar button:hover { background: #fff; border-color: var(--line); }
.rt-bar button svg { display: block; margin: auto; }
.rt-bar select { width: auto; min-height: 34px; margin: 0; padding: 4px 6px; font-size: 14px; }
.rt-sep { width: 1px; margin: 3px 4px; background: var(--line); }
.rt-editor { min-height: 220px; max-height: 480px; overflow-y: auto; padding: 12px; background: #fff; border: 1px solid #a6a6a6; border-radius: 0 0 3px 3px; font-size: 16px; font-weight: 400; }
.rt-editor:focus { outline: 2px solid var(--red); outline-offset: -2px; }
.items { display: flex; flex-direction: column; gap: 10px; }
.item-row { display: grid; grid-template-columns: 150px 1fr 90px auto; gap: 10px; align-items: end; }
.item-row .remove { padding: 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); color: var(--red-link); font: 700 14px/1.2 var(--sans); cursor: pointer; }
.search-form { display: flex; gap: 12px; align-items: flex-end; }
.search-form label { flex: 1; }
.hint { display: block; margin-top: 2px; font-weight: 400; }
.field-title { font-size: 14px; font-weight: 600; }
.format { gap: 6px; }
.format textarea { margin-top: 0; }
.search-form select { min-width: 150px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side ul { display: flex; gap: 4px; overflow-x: auto; }
  .side a { padding: 8px 12px; border-left: 0; border-radius: 3px; white-space: nowrap; }
  .content { padding: 20px 16px 36px; }
  .login-grid, .two, .product-page { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: 1fr; gap: 0 0; }
  .facts dd { margin-bottom: 10px; }
  .top-bar { flex-wrap: wrap; padding: 6px 16px; gap: 6px 12px; }
  .logo-svg { height: 46px; }
  .portal-name { font-size: 17px; padding-left: 12px; }
  .who { width: 100%; margin-left: 0; justify-content: space-between; font-size: 14px; }
  .who.back { width: auto; margin-left: auto; }
  .banner { padding: 22px 18px; }
  .banner strong, h1 { font-size: 26px; }
  .card { padding: 18px; }
  .item-row { grid-template-columns: 1fr 80px; }
  .item-row label:nth-child(1) { grid-column: 1 / -1; }
  .search-form { flex-direction: column; align-items: stretch; }
  .btn { text-align: center; }
}
