:root {
  --ink: #1b1d1b;
  --ink-2: #505650;
  --paper: #f3eee5;
  --surface: #fffdf8;
  --surface-2: #ebe5da;
  --line: #d8d0c3;
  --line-dark: #aaa093;
  --olive: #5d6753;
  --olive-dark: #3e4838;
  --rust: #9a6045;
  --danger: #963f37;
  --success: #3d724a;
  --sidebar: 244px;
  --shadow: 0 24px 70px rgba(23, 25, 22, .14);
  --display: "Newsreader", "Lora", Georgia, serif;
  --sans: "DM Sans", "Aptos", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--paper); font: 15px/1.5 var(--sans); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: #d4cebb; }
:focus-visible { outline: 3px solid rgba(93, 103, 83, .38); outline-offset: 3px; }
.skip-link { position: fixed; left: 12px; top: 12px; z-index: 500; transform: translateY(-150%); padding: 10px 14px; background: var(--ink); color: white; text-decoration: none; }
.skip-link:focus { transform: none; }
.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; }
.overline { display: block; color: var(--olive); font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }

.auth-view { min-height: 100vh; display: grid; grid-template-columns: minmax(350px, .9fr) minmax(430px, 1.1fr); background: var(--surface); }
.auth-visual { position: relative; isolation: isolate; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(38px, 6vw, 84px); color: var(--paper); background: radial-gradient(135% 95% at 82% 12%, color-mix(in srgb, var(--rust) 22%, transparent), transparent 55%), radial-gradient(120% 95% at 8% 92%, color-mix(in srgb, var(--olive) 32%, transparent), transparent 60%), repeating-linear-gradient(135deg, color-mix(in srgb, var(--paper) 5%, transparent) 0 1px, transparent 1px 24px), linear-gradient(155deg, var(--olive-dark), var(--ink) 58%, var(--olive-dark)); }
.auth-visual::before { content: ""; position: absolute; inset: 28px; z-index: -1; border: 1px solid rgba(255,255,255,.2); }
.auth-visual .overline { color: #d8d3c5; }
.auth-visual strong { margin: auto 0; font: 600 clamp(4.4rem, 8vw, 8rem)/.74 var(--display); letter-spacing: -.065em; }
.auth-visual p { max-width: 430px; color: rgba(255,255,255,.72); }
.auth-card { width: min(510px, calc(100% - 48px)); margin: auto; padding: clamp(28px, 5vw, 64px); }
.auth-card__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-card__back { flex: none; min-height: 36px; gap: 8px; padding: 7px 14px; font-size: .7rem; }
.auth-card__back:hover { border-color: var(--ink); }
.brand, .sidebar__brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand__mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid currentColor; font: 600 1.05rem var(--display); }
.brand b, .sidebar__brand b { display: block; font-size: .78rem; letter-spacing: .09em; }
.brand small, .sidebar__brand small { display: block; color: var(--ink-2); font-size: .66rem; }
.auth-card__heading { margin: clamp(52px, 9vh, 100px) 0 32px; }
.auth-card h1, .topbar h1, .page-heading h2, .data-card h3, .dialog-heading h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.025em; }
.auth-card h1 { margin: 7px 0; font-size: clamp(2.8rem, 5vw, 4.2rem); line-height: .92; }
.auth-card__heading p, .page-heading p, .dialog-heading p { color: var(--ink-2); }
.auth-card__note { margin-top: 16px; color: var(--ink-2); font-size: .7rem; }
.auth-card__forgot { margin: -6px 0 0; text-align: right; }
.auth-card__forgot .text-button { color: var(--ink-2); font-weight: 600; }
.auth-security-note { display: grid; gap: 4px; margin-top: 18px; padding: 13px 14px; border-left: 3px solid var(--olive); color: var(--ink); background: #f0ece2; }
.auth-security-note strong { font-size: .7rem; }
.auth-security-note span { color: var(--ink-2); font-size: .64rem; line-height: 1.55; }

.form-stack { display: grid; gap: 17px; }
.form-grid { display: grid; gap: 13px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { min-width: 0; display: grid; gap: 6px; }
.field > span:first-child, .field-group legend { font-size: .73rem; font-weight: 700; }
.field b { color: var(--rust); }
.field em { color: var(--ink-2); font-style: normal; font-weight: 400; }
input, select, textarea { width: 100%; min-height: 43px; border: 1px solid var(--line); border-radius: 2px; padding: 9px 11px; color: var(--ink); background: white; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 98px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--line-dark); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(93,103,83,.11); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.password-control, .money-control, .color-control { position: relative; display: flex; align-items: center; gap: 8px; }
.password-control input { padding-right: 78px; }
.password-control button { position: absolute; right: 6px; border: 0; padding: 6px 7px; color: var(--olive-dark); background: transparent; font-size: .68rem; font-weight: 700; cursor: pointer; }
.money-control i { position: absolute; left: 12px; color: var(--ink-2); font-style: normal; }
.money-control input { padding-left: 27px; }
.color-control input[type="color"] { flex: 0 0 48px; width: 48px; padding: 4px; cursor: pointer; }
.message { min-height: 1.2em; margin: 0; color: var(--danger); font-size: .75rem; font-weight: 600; }
.message.is-success { color: var(--success); }
.button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 2px; padding: 9px 16px; font-size: .75rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .15s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .56; cursor: wait; transform: none; }
.button--dark { color: white; background: var(--ink); }
.button--dark:hover { background: var(--olive-dark); }
.button--outline { border-color: var(--ink); background: transparent; }
.button--outline:hover { background: var(--surface-2); }
.button--plain { border-color: var(--line); background: transparent; }
.button--wide { width: 100%; justify-content: space-between; }
.button--google { width: 100%; color: var(--ink); background: var(--surface); border-color: var(--line); }
.button--google:hover { background: var(--surface-2); border-color: var(--ink); }
.button--google svg { flex: none; width: 18px; height: 18px; }

/* Separador "o" entre el ingreso por password y el ingreso con Google. */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 2px 0; color: var(--ink-2); font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }

/* Estados de la callback de Google (auth-callback.html). Reusa los tokens del panel. */
.oauth-state { display: grid; gap: 16px; margin-top: 8px; }
.oauth-state > p { color: var(--ink-2); }
.oauth-state .message { margin: 0; }
.oauth-spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: oauth-spin .8s linear infinite; }
@keyframes oauth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .oauth-spinner { animation: none; } }
.text-button { border: 0; padding: 4px 0; background: transparent; font-size: .7rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.danger-text { color: var(--danger); }

.app-view { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 40; height: 100vh; display: flex; flex-direction: column; padding: 27px 19px 21px; color: #f4f0e8; background: var(--ink); }
.sidebar__brand { padding: 0 8px 34px; }
.sidebar__brand small { color: rgba(255,255,255,.5); }
.sidebar__nav { display: grid; gap: 6px; }
.nav-link { min-height: 48px; display: flex; align-items: center; gap: 12px; border: 1px solid transparent; padding: 10px 12px; color: rgba(255,255,255,.65); background: transparent; text-align: left; cursor: pointer; }
.nav-link i { color: #aaa69b; font: 600 .88rem var(--display); font-style: normal; }
.nav-link:hover { color: white; border-color: rgba(255,255,255,.12); }
.nav-link.is-active { color: white; border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.08); }
.sidebar__footer { margin-top: auto; display: grid; gap: 7px; padding: 18px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar__footer a, .sidebar__footer button { border: 0; padding: 6px 0; color: rgba(255,255,255,.7); background: transparent; font-size: .7rem; text-align: left; text-decoration: none; cursor: pointer; }
.sidebar__footer a:hover, .sidebar__footer button:hover { color: white; }
.workspace { min-width: 0; }
.topbar { min-height: 90px; display: flex; align-items: center; gap: 22px; padding: 17px clamp(22px, 4vw, 55px); border-bottom: 1px solid var(--line); background: rgba(243,238,229,.94); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 1.6rem; }
.session-status { margin-left: auto; display: flex; align-items: center; gap: 9px; min-height: 43px; padding: 7px 11px; border: 1px solid var(--line); background: rgba(255,253,248,.7); }
.session-status > i { width: 7px; height: 7px; border-radius: 50%; background: #62a36e; box-shadow: 0 0 0 4px rgba(98,163,110,.13); }
.session-status span { display: grid; }
.session-status small { color: var(--ink-2); font-size: .56rem; }
.session-status b { font: 700 .67rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.session-status.is-expiring > i { background: #b47b33; box-shadow: 0 0 0 4px rgba(180,123,51,.13); }
.session-status.is-expiring b { color: #8a5723; }
.user-badge { display: flex; align-items: center; gap: 10px; }
.user-badge > i { width: 8px; height: 8px; border-radius: 50%; background: #62a36e; box-shadow: 0 0 0 4px rgba(98,163,110,.13); }
.user-badge span { display: grid; }
.user-badge b { font-size: .72rem; }
.user-badge small { max-width: 210px; overflow: hidden; color: var(--ink-2); font-size: .63rem; text-overflow: ellipsis; }
.menu-button { display: none; }
.content { padding: clamp(28px, 4vw, 55px); }
.page-section { display: none; }
.page-section.is-active { display: block; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h2 { margin: 5px 0; font-size: clamp(2.25rem, 4vw, 3.6rem); line-height: .94; }
.page-heading p { max-width: 720px; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 20px; }
.stats article { min-height: 120px; padding: 17px; border: 1px solid var(--line); background: rgba(255,253,248,.65); }
.stats span, .stats small { display: block; color: var(--ink-2); font-size: .66rem; }
.stats strong { display: block; margin: 6px 0 1px; font: 600 2.7rem/1 var(--display); }
.data-card, .form-card { border: 1px solid var(--line); background: var(--surface); box-shadow: 0 10px 35px rgba(28,30,27,.035); }
.data-card__head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 23px 24px 16px; }
.data-card h3 { margin: 3px 0 0; font-size: 1.8rem; line-height: 1; }
.search-control input { width: min(320px, 34vw); }
.filter-row { display: flex; gap: 6px; padding: 0 24px 16px; border-bottom: 1px solid var(--line); }
.filter-chip { border: 1px solid var(--line); padding: 6px 10px; color: var(--ink-2); background: transparent; font-size: .65rem; cursor: pointer; }
.filter-chip.is-active { border-color: var(--ink); color: white; background: var(--ink); }
.table-scroll { overflow-x: auto; }
.catalog-table { width: 100%; border-collapse: collapse; min-width: 930px; }
.catalog-table th { padding: 11px 13px; color: var(--ink-2); background: #f6f2ea; font-size: .61rem; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.catalog-table td { padding: 12px 13px; border-top: 1px solid var(--line); vertical-align: middle; font-size: .72rem; }
.product-cell { min-width: 230px; display: grid; grid-template-columns: 53px minmax(0,1fr); gap: 10px; align-items: center; }
.product-thumb { width: 53px; aspect-ratio: 4/5; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface-2); font-size: .55rem; text-align: center; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-cell b, .product-cell small { display: block; }
.product-cell b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.product-cell small { color: var(--ink-2); }
.catalog-table--slim { min-width: 560px; }
.category-name-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.category-name-cell span { min-width: 0; display: grid; }
.category-name-cell b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.category-name-cell small { color: var(--ink-2); font-size: .58rem; }
.category-branch { flex: 0 0 auto; color: var(--ink-2); font-size: .8rem; line-height: 1; }
.category-row--child td:first-child { padding-left: 28px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); padding: 3px 6px; color: var(--ink-2); font-size: .58rem; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #978e82; }
.status-pill.is-live::before { background: #4d8c5a; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-actions button { border: 1px solid var(--line); padding: 6px 8px; background: transparent; font-size: .63rem; cursor: pointer; }
.row-actions button:hover { border-color: var(--ink); }
.empty-state { padding: 50px 24px; color: var(--ink-2); text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.fabric-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.fabric-card { min-height: 180px; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); background: var(--surface); }
.fabric-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fabric-card h3 { margin: 4px 0; font: 600 1.8rem/1 var(--display); }
.fabric-card p { color: var(--ink-2); font-size: .68rem; }
.fabric-card__footer { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.fabric-card__footer strong, .fabric-card__footer small { display: block; }
.fabric-card__footer strong { font: 600 1.35rem var(--display); }
.fabric-card__footer small { color: var(--ink-2); font-size: .58rem; }
.fabric-card button { border: 1px solid var(--line); padding: 7px 10px; background: transparent; font-size: .65rem; cursor: pointer; }
.form-card { padding: clamp(20px, 3vw, 34px); }
.form-card--settings { max-width: 900px; }
.settings-group { display: grid; gap: 18px; margin-top: 4px; padding-top: 22px; border-top: 1px solid var(--line); }
.settings-group__heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.settings-group__heading h3 { margin: 4px 0 0; font: 600 2rem/1 var(--display); }
.settings-group__heading p { max-width: 430px; margin: 0; color: var(--ink-2); font-size: .67rem; line-height: 1.55; }
.hero-settings { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(0, 1.28fr); gap: 22px; align-items: start; }
.hero-settings__preview { --hero-preview-shade: .76; position: relative; aspect-ratio: 4 / 5; min-height: 330px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.hero-settings__preview img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 48%; }
.hero-settings__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,18,15,.02) 35%, rgba(20,18,15,var(--hero-preview-shade)) 100%); pointer-events: none; }
.hero-settings__preview > span { position: absolute; z-index: 2; left: 14px; bottom: 13px; padding: 5px 7px; color: white; background: rgba(20,18,15,.68); font-size: .56rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hero-settings__controls { display: grid; gap: 15px; }
.hero-settings__upload { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 13px; }
.hero-settings__upload small { flex: 1 1 230px; color: var(--ink-2); font-size: .61rem; line-height: 1.5; }
.hero-settings__actions { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.range-grid { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); background: #f8f4ec; }
.range-field { display: grid; gap: 7px; }
.range-field > span { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .68rem; font-weight: 700; }
.range-field output { color: var(--olive-dark); font: 700 .63rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.range-field input[type="range"] { min-height: auto; height: 20px; border: 0; padding: 0; background: transparent; box-shadow: none; accent-color: var(--olive); cursor: pointer; }
.security-summary { max-width: 900px; display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 18px; }
.security-summary div { min-height: 105px; padding: 14px; border: 1px solid var(--line); background: rgba(255,253,248,.62); }
.security-summary strong, .security-summary small { display: block; }
.security-summary strong { margin: 8px 0 3px; }
.security-summary small { color: var(--ink-2); font-size: .63rem; }

.editor-dialog { width: min(850px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; border: 1px solid var(--line); padding: clamp(22px, 4vw, 40px); color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.editor-dialog::backdrop { background: rgba(20,22,20,.7); backdrop-filter: blur(3px); }
.editor-dialog--small { width: min(620px, calc(100vw - 28px)); }
.dialog-close-form { position: sticky; top: 0; z-index: 3; height: 0; display: flex; justify-content: flex-end; }
.dialog-close-form button { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); font-size: 1.3rem; cursor: pointer; }
.dialog-heading { padding-right: 44px; margin-bottom: 24px; }
.dialog-heading h2 { margin: 4px 0; font-size: 2.6rem; line-height: .95; }
.dialog-heading p { margin: 0; }
.image-editor { display: grid; grid-template-columns: 120px 1fr; gap: 17px; padding: 13px; border: 1px dashed var(--line-dark); background: #f8f4ec; }
.image-preview { aspect-ratio: 4/5; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface-2); font-size: .65rem; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-editor > div:last-child { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.image-editor p { margin: 8px 0; color: var(--ink-2); font-size: .68rem; }
.upload-button { display: inline-flex; min-height: 39px; align-items: center; border: 1px solid var(--ink); padding: 8px 12px; font-size: .7rem; font-weight: 700; cursor: pointer; }
.name-preview { padding: 13px 15px; border-left: 3px solid var(--rust); background: #f2ece2; }
.name-preview span { display: block; color: var(--ink-2); font-size: .61rem; letter-spacing: .08em; text-transform: uppercase; }
.name-preview strong { display: block; margin-top: 3px; font: 600 1.22rem var(--display); }
.field-group { margin: 0; border: 1px solid var(--line); padding: 14px; }
.field-group legend { padding: 0 6px; }
.dimensions { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr 78px; gap: 8px; align-items: end; }
.dimensions > i { padding-bottom: 11px; color: var(--ink-2); font-style: normal; }
.switch-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.switch-row { min-height: 61px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); padding: 9px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; flex: 0 0 35px; height: 20px; border-radius: 20px; background: #c6c1b8; transition: background .16s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: white; transition: transform .16s; }
.switch-row input:checked + .switch { background: var(--olive); }
.switch-row input:checked + .switch::after { transform: translateX(15px); }
.switch-row input:focus-visible + .switch { outline: 3px solid rgba(93,103,83,.35); outline-offset: 3px; }
.switch-row b, .switch-row small { display: block; }
.switch-row b { font-size: .67rem; }
.switch-row small { color: var(--ink-2); font-size: .58rem; }
.switch-row--compact { align-self: end; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { display: flex; justify-content: space-between; gap: 15px; padding-top: 15px; border-top: 1px solid var(--line); }

.field-hint { display: block; color: var(--ink-2); font-size: .62rem; line-height: 1.45; }
.password-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; margin: 2px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: .61rem; }
.password-rules li { position: relative; padding-left: 15px; line-height: 1.4; }
.password-rules li::before { content: "○"; position: absolute; left: 0; color: var(--ink-2); }
.password-rules li.is-valid { color: var(--success); }
.password-rules li.is-valid::before { content: "✓"; color: var(--success); font-weight: 800; }
.password-rules li.is-invalid { color: var(--danger); }
.password-rules li.is-invalid::before { content: "×"; color: var(--danger); font-weight: 800; }
.field-hint.is-success { color: var(--success); }
.field-hint.is-error { color: var(--danger); }
.form-grid--color { align-items: end; }
.selected-color { min-height: 72px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); padding: 11px 13px; background: #f8f4ec; }
.selected-color > i { flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid rgba(27,29,27,.22); box-shadow: inset 0 0 0 3px rgba(255,255,255,.42); }
.selected-color span { min-width: 0; display: grid; }
.selected-color small { color: var(--ink-2); font-size: .58rem; }
.selected-color b { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.selected-color code { color: var(--ink-2); font: 600 .61rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.selected-color.is-empty { opacity: .68; }

.fabric-card__palette { min-height: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 13px 0 17px; }
.fabric-card__palette > i { width: 25px; height: 25px; border: 1px solid rgba(27,29,27,.19); box-shadow: inset 0 0 0 2px rgba(255,255,255,.45); }
.fabric-card__palette > small { color: var(--ink-2); font-size: .62rem; }
.fabric-card__meta { text-align: right; }
.fabric-card__meta b, .fabric-card__meta small { display: block; }
.fabric-card__meta b { font-size: .66rem; }

.editor-dialog--material { width: min(920px, calc(100vw - 28px)); }
.color-manager { margin-top: 28px; padding-top: 27px; border-top: 1px solid var(--line); }
.color-manager__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.color-manager__head h3 { margin: 3px 0; font: 600 2rem/1 var(--display); }
.color-manager__head p { max-width: 560px; margin: 0; color: var(--ink-2); font-size: .7rem; }
.color-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.color-list__item { min-width: 0; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); padding: 9px; color: var(--ink); background: white; text-align: left; cursor: pointer; }
.color-list__item:hover { border-color: var(--ink); }
.color-list__item > i { flex: 0 0 35px; width: 35px; height: 35px; border: 1px solid rgba(27,29,27,.2); box-shadow: inset 0 0 0 2px rgba(255,255,255,.45); }
.color-list__item span { min-width: 0; display: grid; }
.color-list__item strong { overflow: hidden; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.color-list__item small { color: var(--ink-2); font-size: .56rem; }
.color-list__item.is-inactive { opacity: .58; background: var(--surface-2); }
.color-list__empty { margin: 0; padding: 22px; border: 1px dashed var(--line-dark); color: var(--ink-2); text-align: center; font-size: .69rem; }
.color-editor { display: grid; gap: 15px; margin-top: 17px; padding: 18px; border: 1px solid var(--line); background: #f8f4ec; }
.color-editor__heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.color-editor__heading strong { font: 600 1.4rem var(--display); }

/* ===== Slice C · atributos y especificaciones genéricos ===== */
.attribute-card__flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 13px 0 15px; }
.attribute-flag { padding: 3px 8px; border: 1px solid var(--line); font-size: .55rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.attribute-flag.is-on { color: var(--olive-dark); border-color: var(--olive); background: rgba(93,103,83,.09); }
.attribute-empty { margin: 13px 0 0; padding: 30px; border: 1px dashed var(--line-dark); color: var(--ink-2); text-align: center; font-size: .72rem; }
.axis-control { display: flex; align-items: center; gap: 10px; }
.axis-control > select { flex: 1; min-width: 0; }
.axis-control > i { flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid rgba(27,29,27,.22); box-shadow: inset 0 0 0 2px rgba(255,255,255,.42); }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; align-items: end; }
#spec-fields-card { margin-top: 22px; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 200; max-width: min(380px, calc(100vw - 40px)); padding: 12px 15px; transform: translateY(140%); opacity: 0; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: .72rem; transition: transform .18s, opacity .18s; }
.toast.is-visible { transform: none; opacity: 1; }
.toast.is-error { background: var(--danger); }
.busy { position: fixed; inset: 0; z-index: 300; display: grid; place-content: center; justify-items: center; gap: 11px; color: white; background: rgba(20,22,20,.72); backdrop-filter: blur(3px); }
.busy > span { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.25); border-top-color: white; border-radius: 50%; animation: spin .75s linear infinite; }
.busy b { font-size: .72rem; }
@keyframes spin { to { transform: rotate(1turn); } }
.noscript { padding: 18px; color: white; background: var(--danger); text-align: center; }

@media (max-width: 1120px) {
  .stats { grid-template-columns: repeat(2,1fr); }
  .fabric-grid { grid-template-columns: repeat(2,1fr); }
  .color-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  :root { --sidebar: min(82vw, 290px); }
  .auth-view { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .app-view { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); transition: transform .18s; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: none; }
  .menu-button { display: inline-flex; border: 1px solid var(--line); padding: 7px 9px; background: transparent; font-size: .68rem; cursor: pointer; }
  .topbar { min-height: 75px; padding: 13px 17px; }
  .topbar .overline { display: none; }
  .topbar h1 { font-size: 1.3rem; }
  .session-status { margin-left: auto; }
  .session-status small { display: none; }
  .user-badge b { display: none; }
  .user-badge small { max-width: 110px; }
  .content { padding: 26px 17px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .color-manager__head { align-items: flex-start; flex-direction: column; }
  .color-manager__head .button { width: 100%; }
  .settings-group__heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .hero-settings { grid-template-columns: minmax(190px, .7fr) minmax(0, 1.3fr); }
  .security-summary { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 620px) {
  .auth-card { width: min(100% - 28px, 510px); padding: 25px 9px; }
  .auth-card__heading { margin-top: 58px; }
  .session-status { padding-inline: 9px; }
  .user-badge { display: none; }
  .stats, .fabric-grid, .form-grid--2, .switch-grid, .security-summary, .color-list, .hero-settings { grid-template-columns: 1fr; }
  .stats article { min-height: 103px; }
  .data-card__head { align-items: flex-start; flex-direction: column; }
  .search-control, .search-control input { width: 100%; }
  .filter-row { overflow-x: auto; }
  .editor-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); padding: 20px 15px; }
  .image-editor { grid-template-columns: 96px 1fr; }
  .hero-settings__preview { min-height: 360px; }
  .dimensions { grid-template-columns: 1fr auto 1fr; }
  .dimensions .field:nth-of-type(3), .dimensions .field--unit { grid-column: 1 / -1; }
  .dimensions > i:nth-of-type(2) { display: none; }
  .dialog-actions .button { width: 100%; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

html.is-busy {
  overflow: hidden;
}

.clipboard-helper {
  position: fixed;
  inset: 0 auto auto -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ===== Selector de apariencia (presets de tema de color + tipografía) — Grupo 10 C/D ===== */
.appearance-field { display: grid; gap: .6rem; margin-top: .2rem; }
.appearance-field .field-label { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.theme-swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .6rem; }
.theme-swatch { display: grid; gap: .5rem; padding: .5rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); cursor: pointer; text-align: left; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.theme-swatch:hover { border-color: var(--line-dark); transform: translateY(-1px); }
.theme-swatch:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
.theme-swatch[aria-checked="true"] { border-color: var(--olive-dark); box-shadow: 0 0 0 2px var(--olive-dark); }
.theme-swatch__palette { display: flex; height: 2.1rem; border-radius: .45rem; overflow: hidden; border: 1px solid rgba(0,0,0,.06); }
.theme-swatch__palette span { flex: 1; }
.theme-swatch__name { font-size: .68rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-preset-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: .6rem; }
.type-preset { display: grid; gap: .3rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); cursor: pointer; text-align: left; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.type-preset:hover { border-color: var(--line-dark); transform: translateY(-1px); }
.type-preset:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
.type-preset[aria-checked="true"] { border-color: var(--olive-dark); box-shadow: 0 0 0 2px var(--olive-dark); }
.type-preset__preview { font-size: 1.55rem; line-height: 1.05; color: var(--ink); }
.type-preset__sample { font-size: .74rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-preset__name { font-size: .6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }

/* Presets fuera de cupo del plan (locks proactivos de apariencia — Slice B): candado + badge del tier mínimo. */
.theme-swatch.is-locked, .type-preset.is-locked { position: relative; opacity: .5; cursor: not-allowed; }
.theme-swatch.is-locked:hover, .type-preset.is-locked:hover { transform: none; border-color: var(--line); }
.preset-lock { position: absolute; top: .35rem; right: .35rem; display: inline-flex; align-items: center; gap: .22rem; padding: .12rem .36rem; border-radius: .5rem; background: var(--ink); color: #fff; font-size: .54rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.5; pointer-events: none; }
.preset-lock::before { content: "\1F512"; font-size: .62rem; }

/* ===== Multi-tenant: catálogo activo, selector y switcher — Grupo 8.2a ===== */
.tenant-badge { display: flex; align-items: center; gap: 12px; }
.tenant-badge span { display: grid; }
.tenant-badge small { color: var(--ink-2); font-size: .55rem; letter-spacing: .1em; text-transform: uppercase; }
.tenant-badge b { font: 600 1.05rem var(--display); line-height: 1.1; color: var(--ink); }
.tenant-badge .text-button { color: var(--olive-dark); font-size: .64rem; }

.tenant-options { display: grid; gap: 9px; margin-bottom: 6px; }
.tenant-option { display: grid; gap: 3px; border: 1px solid var(--line); padding: 14px 16px; color: var(--ink); background: var(--surface); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.tenant-option:hover { border-color: var(--ink); background: var(--surface-2); transform: translateY(-1px); }
.tenant-option:focus-visible { outline: 3px solid rgba(93,103,83,.38); outline-offset: 2px; }
.tenant-option b { font: 600 1.2rem var(--display); line-height: 1.05; }
.tenant-option small { color: var(--olive); font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.reauth-target { color: var(--ink); font-weight: 700; }

@media (max-width: 850px) {
  .tenant-badge small { display: none; }
  .tenant-badge b { font-size: .92rem; }
  .tenant-badge .text-button { font-size: .6rem; }
}
@media (max-width: 620px) {
  .tenant-badge b { display: none; }
}

/* ===== Estado de suscripción + cupos de plan — Grupo 8.2b ===== */
/* Banner no intrusivo bajo la topbar. Reusa el idioma de caja tintada con borde-acento
   (.name-preview / .auth-security-note). rust = pendiente de pago; danger = suspendida. */
.subscription-banner { display: flex; align-items: center; gap: 11px; padding: 12px clamp(22px, 4vw, 55px); border-bottom: 1px solid var(--line); border-left: 3px solid var(--rust); color: var(--ink); background: #f4e9de; }
.subscription-banner[data-status="suspended"] { border-left-color: var(--danger); background: #f6e6e2; }
.subscription-banner__icon { flex: 0 0 21px; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--rust); font-size: .8rem; font-weight: 700; }
.subscription-banner[data-status="suspended"] .subscription-banner__icon { background: var(--danger); }
.subscription-banner__text { margin: 0; font-size: .72rem; font-weight: 600; line-height: 1.4; }

.quota-note { display: inline-flex; align-items: center; margin: 12px 0 0; padding: 4px 9px; border: 1px solid var(--line); border-radius: 2px; color: var(--ink-2); background: rgba(255,253,248,.7); font: 700 .63rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .03em; }
.quota-note.is-full { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: #f8ece9; }

/* ===== Sección Plan y facturación (Slice B · pagos MercadoPago) ===== */
/* Reusa el idioma visual del panel: cajas con borde --line sobre --surface, acento --olive, tipografía display. */
.plan-status { display: grid; gap: 4px; margin-bottom: 20px; padding: 16px 18px; border: 1px solid var(--line); border-left: 3px solid var(--olive); background: rgba(255,253,248,.7); }
.plan-status b { font: 600 1.05rem/1.2 var(--display); }
.plan-status span { color: var(--ink-2); font-size: .72rem; line-height: 1.5; }
.plan-status[data-status="past_due"] { border-left-color: var(--rust); background: #f4e9de; }
.plan-status[data-status="pending"] { border-left-color: var(--olive-dark); }
.plan-status[data-status="active"] { border-left-color: #62a36e; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; min-height: 210px; padding: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 10px 35px rgba(28,30,27,.035); }
.plan-card.is-current { border-color: var(--olive-dark); box-shadow: 0 0 0 2px var(--olive-dark), 0 10px 35px rgba(28,30,27,.05); }
.plan-card h3 { margin: 0; font: 600 1.35rem/1 var(--display); letter-spacing: -.02em; }
.plan-card__price { margin: 0; color: var(--olive-dark); font-size: .95rem; font-weight: 700; }
.plan-card__limits { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.plan-card__limits li { color: var(--ink-2); font-size: .68rem; }
.plan-card__note { margin: auto 0 0; color: var(--olive); font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.plan-card .button { margin-top: auto; }

/* ===== Centro de ayuda ===== */
.support-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr); gap: 18px; align-items: start; }
.support-form { display: grid; gap: 16px; padding: 0 24px 24px; }
.support-form .data-card__head { margin: 0 -24px; }
.support-form .button { justify-self: start; }
.support-history-card { min-height: 360px; }
.support-history-card > .section-status { margin: 0; padding: 10px 24px 18px; color: var(--ink-2); font-size: .72rem; }
.support-history { display: grid; gap: 0; border-top: 1px solid var(--line); }
.support-entry { display: grid; gap: 10px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.support-entry:last-child { border-bottom: 0; }
.support-entry__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.support-entry__head b { font: 600 1.05rem/1.2 var(--display); }
.support-entry__head small { color: var(--ink-2); font-size: .62rem; }
.support-entry__status { display: inline-flex; align-items: center; padding: 4px 8px; border: 1px solid var(--line); color: var(--ink-2); font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.support-entry__status[data-status="open"] { color: var(--rust); border-color: rgba(148,73,50,.35); background: #f4e9de; }
.support-entry__status[data-status="responded"] { color: var(--olive-dark); border-color: rgba(93,103,83,.35); background: #eef1e9; }
.support-entry__message, .support-entry__response { margin: 0; color: var(--ink-2); font-size: .72rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-entry__response { padding: 12px 14px; border-left: 3px solid var(--olive); color: var(--ink); background: var(--surface-2); }
.support-entry__response b { display: block; margin-bottom: 4px; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 900px) {
  .support-layout { grid-template-columns: 1fr; }
}

/* ===== Mi cuenta ===== */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.account-card { min-height: 280px; }
.account-details { margin: 0; padding: 0 24px 24px; }
.account-details div { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.account-details dt { color: var(--ink-2); font-size: .65rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.account-details dd { margin: 0; color: var(--ink); font-size: .74rem; overflow-wrap: anywhere; }
.account-actions { display: grid; justify-items: start; gap: 13px; padding: 0 24px 24px; }
.account-actions > p:first-child { margin: 0 0 4px; color: var(--ink-2); font-size: .72rem; line-height: 1.55; }
.account-profile { display: grid; align-content: start; gap: 18px; padding-bottom: 24px; }
.account-profile > :not(.data-card__head) { margin-inline: 24px; }
.profile-avatar-editor { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 18px; }
.profile-avatar-editor > div:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.profile-avatar-editor small { flex-basis: 100%; color: var(--ink-2); font-size: .66rem; line-height: 1.45; }
.profile-avatar { display: grid; place-items: center; width: 92px; height: 92px; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; color: var(--paper); background: var(--olive-dark); box-shadow: 0 0 0 5px var(--paper-deep); font-family: var(--display); font-size: 1.65rem; font-weight: 700; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; outline: 1px solid rgba(0, 0, 0, .1); }
.account-profile .button[type="submit"] { justify-self: start; }
@media (max-width: 800px) {
  .account-grid { grid-template-columns: 1fr; }
  .account-details div { grid-template-columns: 1fr; gap: 5px; }
  .profile-avatar-editor { grid-template-columns: 72px minmax(0, 1fr); }
  .profile-avatar { width: 72px; height: 72px; }
}
