:root {
    --page-background: #f6f7f8;
    --surface: #ffffff;
    --brand-text: #171b1f;
    --brand-primary: #002b69;
    --brand-primary-hover: #001f4d;
    --brand-secondary: #1f6fe5;
    --brand-secondary-hover: #1858c7;
    --brand-soft: #e8eef6;
    --brand-accent: #122033;
    --border-color: #e3e7e9;
    --muted: #6f777d;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --ok: #087a5a;
    --ok-bg: #ecf8f4;
    --whatsapp: #25d366;
    --shadow: 0 1px 2px rgba(18, 32, 51, 0.06);
    --radius: 10px;
    --radius-sm: 8px;
    --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sidebar-width: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: var(--font);
    color: var(--brand-text);
    background: var(--page-background);
    line-height: 1.45;
}
a { color: var(--brand-primary); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}
.muted { color: var(--muted); font-size: 0.875rem; font-weight: 400; }
.crumb { margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--muted); }
.crumb a { text-decoration: none; color: var(--muted); }
.crumb a:hover { color: var(--brand-primary); }

.app-shell { display: flex; min-height: 100vh; }
.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--brand-accent);
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(18, 32, 51, 0.4);
    z-index: 20;
    border: 0;
    padding: 0;
    cursor: pointer;
}
body.nav-open .nav-scrim { display: block; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    color: var(--brand-text);
    border-right: 1px solid var(--border-color);
    padding: 1.25rem 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex-shrink: 0;
}
.brand {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--brand-accent);
    padding: 0.25rem 0.7rem;
    font-size: 1.05rem;
}
.sidebar nav { display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar a {
    color: var(--brand-text);
    text-decoration: none;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
    min-height: 40px;
}
.sidebar a svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); }
.sidebar a:hover { background: #f3f5f6; }
.sidebar a.active {
    background: var(--brand-soft);
    color: var(--brand-primary);
    border-left-color: var(--brand-primary);
    font-weight: 600;
}
.sidebar a.active svg { color: var(--brand-primary); }
.sidebar .logout { margin-top: auto; padding: 0 0.2rem; }
.sidebar button,
.sidebar .logout button {
    width: 100%;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    min-height: 40px;
}
.sidebar .logout button:hover { color: var(--brand-text); background: #f3f5f6; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    padding: 0.7rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    min-height: 56px;
}
.topbar-start { margin-right: auto; display: flex; align-items: center; gap: 0.6rem; }
.topbar-company { min-width: 0; flex: 1; max-width: 18rem; }
.company-switch label,
.current-company {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
    display: block;
}
.company-switch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    align-items: end;
}
.company-switch select {
    width: 100%;
    max-width: 100%;
    margin-top: 0.15rem;
}
.company-switch button {
    margin: 0;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}
.kv { display: grid; gap: 0.65rem; margin: 1rem 0; }
.kv div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.4rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
}
.status-badge.status-pending { background: #fff8e6; }
.status-badge.status-approved { background: var(--ok-bg); }
.status-badge.status-rejected,
.status-badge.status-suspended { background: var(--danger-bg); }
.status-badge.status-none { background: #f3f5f6; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--border-color); vertical-align: top; }
.admin-actions { display: grid; gap: 0.75rem; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.audit-list { padding-left: 1.1rem; }
.stack { display: grid; gap: 0.75rem; }
.stack label { display: grid; gap: 0.3rem; }
.danger-zone {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid #f5c2c0;
    background: var(--danger-bg);
    display: grid;
    gap: 0.75rem;
}
.danger-zone h3 {
    margin: 0;
    color: var(--danger);
    font-size: 1rem;
}
.profile-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    color: var(--muted);
    font-size: 0.875rem;
}
.profile-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}
.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand-primary);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex: 0 0 auto;
}
.content { padding: 1.5rem 1.5rem 2.5rem; max-width: 960px; width: 100%; }
h1, h2, h3 { margin-top: 0; letter-spacing: -0.02em; color: var(--brand-accent); }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: 0.95rem; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.page-header p { margin: 0.35rem 0 0; color: var(--muted); max-width: 36rem; }
.page-header h1 { margin: 0; }
.workflow-steps {
    list-style: none;
    margin: 0 0 1.2rem;
    padding: 0.85rem 1rem;
    display: grid;
    gap: 0.55rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.workflow-steps li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.92rem;
}
.workflow-steps li.is-current,
.workflow-steps li.is-done { color: var(--brand-text); }
.workflow-step-n {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef1f3;
    font-size: 0.78rem;
}
.workflow-steps li.is-done .workflow-step-n,
.workflow-steps li.is-current .workflow-step-n {
    background: var(--brand-primary);
    color: #fff;
}
.workflow-kicker {
    margin: 0 0 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.2rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.card > h2:first-child { margin-bottom: 0.35rem; }
.card-lede { margin: 0 0 1rem; }

.form-grid, .filter-form { display: grid; gap: 0.9rem; }
.form-grid.two-col {
    grid-template-columns: 1fr 1fr;
}
.public-wa-field { grid-column: 1 / -1; }
.signup-phone-row { display: grid; grid-template-columns: 11rem 1fr; gap: 0.75rem; }
.public-wa-field input[aria-invalid="true"] {
    border-color: var(--danger);
}
label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.875rem; color: var(--brand-text); }
input, select, button, textarea { font: inherit; }
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="date"],
select,
textarea {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--brand-text);
    min-height: 40px;
    width: 100%;
}
input[type="date"] {
    min-width: 0;
    color-scheme: light;
}
input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="number"]:hover,
input[type="password"]:hover,
input[type="search"]:hover,
input[type="url"]:hover,
input[type="date"]:hover,
select:hover {
    border-color: #c9d0d4;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(8, 122, 90, 0.15);
    outline: none;
}
input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="tel"]:disabled,
input[type="number"]:disabled,
input[type="password"]:disabled,
select:disabled,
textarea:disabled,
button:disabled {
    background: #f3f5f6;
    color: var(--muted);
    cursor: not-allowed;
}
input[type="radio"],
input[type="checkbox"] {
    appearance: auto;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    flex: 0 0 18px;
    accent-color: var(--brand-primary);
    cursor: pointer;
}
input[type="radio"]:disabled,
input[type="checkbox"]:disabled {
    cursor: not-allowed;
    background: transparent;
}
input[type="hidden"] {
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
}
.form-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }
.save-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    padding: 0.2rem 0 1.2rem;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--surface);
    border-radius: 8px;
    padding: 0 1.1rem;
    text-decoration: none;
    color: var(--brand-text);
    cursor: pointer;
    height: 40px;
    min-height: 40px;
    width: auto;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
}
.btn:hover { background: #f3f5f6; }
.btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}
.btn.primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}
.btn.primary:hover { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); }
.btn.danger {
    background: #fff;
    border-color: #f0c7c4;
    color: var(--danger);
}
.btn.danger:hover { background: var(--danger-bg); border-color: #e3a8a4; }
.btn:disabled,
.btn.primary:disabled,
.btn.danger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.btn.is-loading { opacity: 0.72; pointer-events: none; }
.alert {
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-size: 0.9rem;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f5c2c0; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: #b7e4d6; }
.verify-banner {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    margin: 0 0 1rem;
    border: 1px solid #d7e8e2;
    border-radius: var(--radius-sm);
    background: #f3faf7;
}
.verify-banner-copy { margin: 0; }
.verify-banner-copy strong { display: block; margin-bottom: 0.2rem; }
.verify-banner-copy p { margin: 0.25rem 0 0; font-size: 0.9rem; }
.verify-banner-ok { color: var(--ok); }
.verify-banner-error { color: var(--danger); }
.verify-banner .btn { white-space: nowrap; }
.verify-state { margin: 0 0 0.8rem; }
.verify-state.is-ok { color: var(--ok); font-weight: 650; }
.verify-state.is-warn { color: var(--danger); font-weight: 650; }
.meta { display: grid; gap: 0.65rem; margin: 0 0 0.8rem; }
.meta div { display: flex; gap: 0.8rem; }
.meta dt { width: 160px; color: var(--muted); font-size: 0.875rem; flex-shrink: 0; }
.meta dd { margin: 0; font-weight: 600; }
.catalog-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.catalog-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    background: #fbfcfc;
}
.pill {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: #eef1f3;
    color: var(--muted);
    margin-left: 0.4rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.filter-block {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    margin: 0;
}
#comercial .filter-block { margin: 0 0 1.15rem; }
.filter-block legend { font-weight: 650; font-size: 0.88rem; padding: 0 0.25rem; }
.choice-group {
    border: 0;
    padding: 0;
    margin: 0 0 1.15rem;
    min-width: 0;
}
.choice-group:last-of-type { margin-bottom: 1rem; }
.choice-group legend {
    float: none;
    width: 100%;
    padding: 0;
    margin: 0 0 0.6rem;
    font-weight: 650;
    font-size: 0.88rem;
    color: var(--brand-accent);
}
.choice-grid {
    display: grid;
    gap: 0.6rem;
}
.choice-grid-2 { grid-template-columns: repeat(2, minmax(12rem, 1fr)); }
.choice-grid-3 { grid-template-columns: repeat(3, minmax(11rem, 1fr)); }
label.check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
    font-weight: 500;
    margin: 0;
}
.check { font-weight: 500; display: flex; gap: 0.7rem; align-items: center; }
.choice-card {
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid #e2e7e8;
    border-radius: 8px;
    background: #fff;
    color: #263238;
    cursor: pointer;
    min-width: 0;
}
.choice-card:hover {
    border-color: #c9d0d4;
    background: var(--brand-soft);
}
.choice-card:has(input:checked) {
    border-color: var(--brand-primary);
    background: var(--brand-soft);
    font-weight: 600;
    color: var(--brand-accent);
}
.choice-card:has(input:disabled) {
    background: #f3f5f6;
    color: #8b9399;
    cursor: not-allowed;
    border-color: var(--border-color);
}
.choice-card:has(input:disabled):hover {
    background: #f3f5f6;
    border-color: var(--border-color);
}
.choice-card input[type="radio"],
.choice-card input[type="checkbox"] {
    margin-top: 1px;
}
.info-note {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0.7rem 0 0;
    padding: 0.7rem 0.85rem;
    background: #f3f6f8;
    border: 1px solid #e4eaee;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
}
.info-note svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin-top: 0.12rem;
    color: #4b6a86;
}
.payment-mode-fieldset {
    margin: 0 0 0.75rem;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: grid;
    gap: 0.45rem;
}
.payment-mode-fieldset legend {
    font-weight: 650;
    font-size: 0.88rem;
    color: var(--brand-accent);
}
.commercial-config-panel {
    margin: 0.75rem 0 0;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface);
    overflow: hidden;
}
.commercial-config-panel.is-hidden,
.commercial-field.is-hidden,
.commercial-custom.is-hidden,
.filter-block.is-hidden,
.is-hidden {
    display: none !important;
}
.commercial-config-title {
    margin: 0 0 10px;
    font-size: 0.88rem;
    font-weight: 650;
    color: var(--brand-accent);
}
.commercial-config-grid {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(160px, 220px) minmax(220px, 1fr);
    gap: 12px;
    align-items: end;
}
.commercial-field { min-width: 0; }
#comercial .commercial-field > label {
    display: block;
    margin: 0 0 6px;
    font-weight: 650;
    font-size: 0.8rem;
}
#comercial .commercial-field select,
#comercial .commercial-custom input[type="number"] {
    min-height: 42px;
    height: 42px;
}
.commercial-control-row {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}
.commercial-control-row > select {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}
.commercial-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}
#comercial .commercial-custom input[type="number"] {
    width: 5.75rem;
    min-width: 0;
}
.commercial-suffix {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 650;
    white-space: nowrap;
}
.commercial-preview {
    min-width: 0;
    padding: 8px 10px;
    background: #eef6f3;
    border: 1px solid #d7ebe3;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.35;
}
.commercial-preview p { margin: 0; }
.commercial-preview-kicker {
    margin: 0 0 4px !important;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
}
.commercial-preview-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.commercial-config-grid.commercial-config-grid-cuotas {
    grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr);
}
.cuotas-recargo-head {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr) 5.5rem minmax(0, 1fr);
    gap: 6px 16px;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.cuotas-plan-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    margin: 0 0 10px;
}
.cuotas-plan-row {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 6px 8px;
    align-items: center;
    min-width: 0;
}
.cuotas-plazo-label {
    font-size: 0.8rem;
    font-weight: 650;
    white-space: nowrap;
}
.cuotas-plan-row .field-error {
    grid-column: 1 / -1;
    margin: 0;
}
.cuotas-plan-row .commercial-control-row {
    min-width: 0;
}
.field-error {
    margin: 6px 0 0;
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 600;
}
.option-scroll {
    max-height: 180px;
    overflow: auto;
    display: grid;
    gap: 0.25rem;
}
.check { font-weight: 500; display: flex; gap: 0.45rem; align-items: center; }
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.9rem;
}
.product-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.7rem;
    background: var(--surface);
}
.product-card img, .img-fallback {
    width: 100%;
    height: 140px;
    object-fit: contain;
    border-radius: 8px;
    background: #f6f7f8;
}
.img-fallback { display: grid; place-items: center; color: var(--muted); }
.product-card h3 { font-size: 0.9rem; margin: 0.55rem 0 0.2rem; font-weight: 600; }
.price { font-weight: 700; }
.merch-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.7rem;
    margin: 0.8rem 0 1rem;
}
.merch-stats div {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.8rem;
    background: #fbfcfc;
}
.merch-stats span { display: block; color: var(--muted); font-size: 0.8rem; }
.merch-search, .merch-priority, .merch-mini, .merch-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: end; }
.merch-search label { display: grid; gap: 0.25rem; font-weight: 600; }
.merch-table { width: 100%; border-collapse: collapse; margin: 0.6rem 0 1.2rem; }
.merch-table-wrap { overflow-x: auto; }
.merch-table th, .merch-table td { border-bottom: 1px solid var(--border-color); text-align: left; padding: 0.55rem 0.35rem; vertical-align: top; }
.merch-table th { color: var(--muted); font-size: 0.78rem; font-weight: 650; }
.merch-priority input[type="number"] { width: 5.5rem; }
.supplier-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.supplier-form:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }

.file-drop {
    position: relative;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    background: #fbfcfc;
    padding: 1rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
}
.file-drop.is-dragover { border-color: var(--brand-primary); background: var(--brand-soft); }
.file-drop-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
}
.file-drop-preview {
    width: 88px;
    height: 88px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
}
.file-drop-preview img, .logo-preview {
    max-width: 88px;
    max-height: 88px;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    border: 0;
    background: transparent;
}
.file-drop-copy { position: relative; z-index: 1; pointer-events: none; }
.file-drop-copy .btn { pointer-events: none; }
.file-drop-name { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.82rem; }
.file-drop-error {
    display: block;
    margin-top: 0.35rem;
    color: var(--danger);
    font-size: 0.82rem;
}
.file-drop-error[hidden] { display: none !important; }

.empty-state {
    text-align: center;
    padding: 1.6rem 1rem;
    color: var(--muted);
}
.empty-state strong { display: block; color: var(--brand-text); margin-bottom: 0.3rem; }

.is-login {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: var(--page-background);
}
.login-card {
    width: min(420px, 92vw);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.8rem 1.6rem;
    box-shadow: var(--shadow);
}
.login-card h1 { margin-bottom: 0.25rem; }
.login-card form { display: grid; gap: 0.9rem; }
.login-card .btn { width: 100%; }
.login-card form.signup-otp .btn { width: auto; }
.login-brand { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-primary); margin: 0 0 0.5rem; }
.login-brand a { color: inherit; text-decoration: none; }
.login-alt { margin: 1.1rem 0 0; text-align: center; }

@media (max-width: 1024px) {
    .content { max-width: none; }
    .choice-grid-3 { grid-template-columns: repeat(2, minmax(11rem, 1fr)); }
    .commercial-config-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .commercial-preview { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .nav-toggle { display: inline-flex; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        transform: translateX(-105%);
        transition: transform 0.18s ease;
        box-shadow: 4px 0 24px rgba(18, 32, 51, 0.12);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    .form-grid.two-col { grid-template-columns: 1fr; }
    .signup-phone-row { grid-template-columns: 1fr; }
    .catalog-list li { flex-direction: column; align-items: stretch; }
    .file-drop { grid-template-columns: 1fr; justify-items: start; }
    .file-drop-preview { width: 88px; height: 88px; }
    .profile-chip span { max-width: 160px; }
    .content { padding: 1.1rem 1rem 2rem; }
    .topbar { padding: 0.6rem 0.9rem; }
    .meta div { flex-direction: column; gap: 0.15rem; }
    .meta dt { width: auto; }
    .choice-grid-2,
    .choice-grid-3,
    .signup-type-grid { grid-template-columns: 1fr; }
    .commercial-config-grid {
        grid-template-columns: 1fr;
    }
    .commercial-preview { grid-column: auto; }
    .cuotas-plan-list,
    .cuotas-recargo-head {
        grid-template-columns: 1fr;
    }
    .cuotas-plan-row {
        grid-template-columns: 5.5rem minmax(0, 1fr);
    }
    .cuotas-recargo-head { display: none; }
    #comercial .commercial-control-row > select,
    #comercial .commercial-field select {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .page-header { flex-direction: column; }
    h1 { font-size: 1.3rem; }
    .form-actions .btn { width: 100%; }
    .kv div { grid-template-columns: 1fr; }
    .topbar-company { max-width: 46vw; }
    .profile-chip span { display: none; }
    .company-switch { grid-template-columns: 1fr; }
    .table-wrap { overflow-x: visible; }
    .data-table, .data-table thead, .data-table tbody, .data-table tr, .data-table th, .data-table td {
        display: block;
        width: 100%;
    }
    .data-table thead { display: none; }
    .data-table td { border-bottom: 0; padding: 0.2rem 0; }
    .data-table tr { border-bottom: 1px solid var(--border-color); padding: 0.55rem 0; }
}

body.is-public {
    background: #f3f6f5;
    min-height: 100vh;
}
.land-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.land-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}
.land-brand {
    font-weight: 750;
    letter-spacing: -0.03em;
    color: var(--brand-accent);
    text-decoration: none;
    font-size: 1.15rem;
}
.land-header .nav-toggle { display: none; margin-left: auto; }
.land-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.35rem 1.1rem;
}
.land-nav a {
    color: var(--brand-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}
.land-nav a:hover { color: var(--brand-primary); }
.land-nav .land-nav-cta { color: #fff; }
.land-nav .land-nav-cta:hover { color: #fff; }
.land-main {
    width: min(1080px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.4rem 0 3.5rem;
    flex: 1;
}
.land-kicker {
    margin: 0 0 0.55rem;
    color: var(--brand-secondary);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.land-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.95fr);
    gap: 2.4rem;
    align-items: center;
    margin-bottom: 3.2rem;
}
.land-hero h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.12;
    margin: 0 0 0.85rem;
}
.land-lead {
    font-size: 1.12rem;
    color: var(--brand-text);
    max-width: 36rem;
    margin: 0 0 0.7rem;
}
.land-note {
    color: var(--muted);
    margin: 0 0 1.3rem;
    max-width: 34rem;
}
.land-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}
.land-hero-actions .btn { min-width: 9.5rem; }
.land-preview-label {
    margin: 0 0 0.65rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}
.land-preview-frame {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(18, 32, 51, 0.08);
    overflow: hidden;
}
.land-preview-chrome {
    display: flex;
    gap: 0.35rem;
    padding: 0.7rem 0.9rem;
    background: #eef2f1;
    border-bottom: 1px solid var(--border-color);
}
.land-preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c5ced0;
}
.land-preview-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.1rem 0.35rem;
}
.land-preview-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #12324a;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
}
.land-preview-brand span { display: block; color: var(--muted); font-size: 0.82rem; }
.land-preview-grid {
    list-style: none;
    margin: 0;
    padding: 0.8rem 1rem 1.1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}
.land-preview-grid li {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.7rem;
    background: #fbfcfc;
}
.land-preview-grid strong,
.land-preview-grid span { display: block; }
.land-preview-grid span { color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }
.land-preview-swatch {
    display: block;
    height: 64px;
    border-radius: 8px;
    margin-bottom: 0.55rem;
}
.land-swatch-a { background: linear-gradient(135deg, #d7efe6, #8fbfae); }
.land-swatch-b { background: linear-gradient(135deg, #dce7f3, #7f9bb8); }
.land-swatch-c { background: linear-gradient(135deg, #f3e6d4, #c4a27a); }
.land-swatch-d { background: linear-gradient(135deg, #e8dcec, #9b7ea8); }
.land-section { margin: 0 0 2.8rem; }
.land-section h2,
.land-cta h2 { font-size: 1.55rem; margin-bottom: 1.1rem; }
.land-steps,
.land-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.9rem;
}
.land-steps { gap: 0.85rem; }
.land-steps li,
.land-benefits li {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.15rem 1.2rem;
}
.land-steps li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    align-items: start;
}
.land-step-n {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--brand-primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 750;
}
.land-steps h3,
.land-benefits h3 { margin: 0 0 0.3rem; }
.land-steps p,
.land-benefits p { margin: 0; color: var(--muted); }
.land-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.land-cta {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.8rem 1.5rem;
    text-align: center;
}
.land-cta p { color: var(--muted); margin: 0 0 1.1rem; }
.land-cta .land-hero-actions { justify-content: center; }
.land-avail {
    max-width: 40rem;
    margin: 2rem auto 3rem;
}
.land-avail h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); }
.land-avail p { color: var(--muted); }
.land-avail .land-kicker { color: var(--brand-secondary); }
.signup-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 1.2rem;
}
.signup-type-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.05rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    min-width: 0;
}
.signup-type-card:hover {
    border-color: var(--brand-secondary);
    background: var(--brand-soft);
}
.signup-type-card strong {
    color: var(--brand-primary);
    font-size: 1.05rem;
}
.signup-type-card span {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.35;
}
@media (max-width: 768px) {
    .signup-type-grid { grid-template-columns: 1fr; }
}
.signup-card form { display: grid; gap: 0.9rem; margin-top: 1.2rem; text-align: left; }
.signup-card .btn { width: 100%; }
.signup-card form.signup-otp,
.signup-card form.signup-resend {
    justify-items: start;
    width: 100%;
    max-width: 100%;
}
.signup-card form.signup-otp .btn,
.signup-card form.signup-resend .btn { width: auto; }
.signup-otp-field {
    display: grid;
    gap: 0.35rem;
    justify-items: start;
    max-width: 100%;
}
.signup-otp-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    max-width: 100%;
}
.signup-otp-input[type="text"] {
    width: 180px;
    max-width: 100%;
    height: 46px;
    min-height: 44px;
    max-height: 48px;
    box-sizing: border-box;
    padding: 0 0.55rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    font-variant-numeric: tabular-nums;
}
.signup-otp-submit {
    height: 46px;
    min-height: 46px;
}
.signup-card form.signup-resend {
    display: block;
    width: max-content;
    max-width: 100%;
    margin-top: 0.75rem;
}
.signup-card .land-lead { text-align: left; }
.signup-host { margin: 0; }
.signup-host strong { color: var(--brand-text); font-weight: 700; }
.signup-note { margin: 0.9rem 0 0; }
.signup-supplier {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    margin: 0;
}
.signup-supplier legend {
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0 0.25rem;
}
.signup-supplier-option {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    align-items: start;
    padding: 0.35rem 0 0;
}
.signup-supplier-option.is-selected {
    background: transparent;
}
.signup-supplier-option span { display: grid; gap: 0.15rem; }
.signup-supplier-option input { margin-top: 0.2rem; }
.land-footer {
    padding: 1.4rem 1.5rem 1.8rem;
    color: var(--muted);
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    background: var(--surface);
}
.land-footer p { margin: 0.15rem 0; }
.land-footer a { color: inherit; text-decoration: underline; }

@media (max-width: 860px) {
    .land-hero { grid-template-columns: 1fr; gap: 1.6rem; }
    .land-benefits { grid-template-columns: 1fr; }
    .land-header { flex-wrap: wrap; }
    .land-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin: 0;
        padding: 0.3rem 0 0.5rem;
        gap: 0.35rem;
    }
    body.nav-open .land-nav { display: flex; }
    .land-nav a { padding: 0.55rem 0.15rem; }
    .land-header .nav-toggle { display: inline-flex; }
    .land-hero-actions .btn { width: 100%; }
}

.pedidos-page {
    padding: 1rem 1.1rem 1.15rem;
}
.pedidos-page .card-lede { margin-bottom: 0.7rem; }
.pedidos-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin: 0.55rem 0 0.8rem;
}
.pedidos-filters label { margin: 0; min-width: 0; }
.pedidos-filter-q {
    flex: 0 1 200px;
    width: 200px;
}
.pedidos-filter-status {
    flex: 0 1 170px;
    width: 170px;
}
.pedidos-filter-range {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    min-width: 0;
}
.pedidos-filter-dates {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 12px;
    min-width: 0;
}
.pedidos-filter-dates label {
    flex: 0 0 160px;
    width: 160px;
}
.pedidos-filters input,
.pedidos-filters select {
    width: 100%;
    height: 42px;
    min-height: 42px;
    max-width: 100%;
}
.pedidos-filters .btn {
    height: 42px;
    min-height: 42px;
    flex: 0 0 auto;
}
.pedidos-empty {
    padding: 1.1rem 0.2rem 0.4rem;
}
.pedidos-empty p { margin: 0.4rem 0 0; color: var(--muted); }
.pedido-status {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: #e8f6ef;
    color: var(--brand-primary);
    font-size: 0.78rem;
    font-weight: 700;
}
.pedido-status.is-en_atencion { background: #eaf2fb; color: #1c4d7c; }
.pedido-status.is-completado { background: #eceff1; color: #37474f; }
.pedido-status.is-cancelado { background: #fdecea; color: #8a2b2b; }
.pedidos-pager {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    margin-top: 0.9rem;
}
.pedido-kv {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1.2rem;
    margin: 0 0 1rem;
}
.pedido-kv div { margin: 0; }
.pedido-kv dt { color: var(--muted); font-size: 0.78rem; font-weight: 650; }
.pedido-kv dd { margin: 0.15rem 0 0; }
.pedido-status-form {
    display: flex;
    gap: 0.75rem;
    align-items: end;
    flex-wrap: wrap;
}
.pedido-totals { margin-top: 1rem; }
.pedido-totals div { display: flex; justify-content: space-between; gap: 1rem; margin: 0.35rem 0; }
.pedido-totals .is-total { font-weight: 750; color: var(--brand-accent); }
.pedido-history { list-style: none; padding: 0; margin: 0; }
.pedido-history li { display: flex; gap: 0.75rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border-color); }
.pedido-history span { color: var(--muted); min-width: 10rem; }
@media (max-width: 860px) {
    .pedidos-page { padding: 0.9rem 0.85rem 1rem; }
    .pedidos-filter-q,
    .pedidos-filter-status {
        flex: 1 1 calc(50% - 6px);
        width: auto;
        min-width: 0;
    }
    .pedidos-filter-range {
        flex: 1 1 100%;
        width: 100%;
    }
    .pedidos-filter-dates {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }
    .pedidos-filter-dates label {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: 170px;
    }
    .pedido-kv { grid-template-columns: 1fr; }
    .table-wrap:has(.pedidos-table) { overflow-x: visible; }
    .pedidos-table,
    .pedidos-table thead,
    .pedidos-table tbody,
    .pedidos-table tr,
    .pedidos-table th,
    .pedidos-table td {
        display: block;
        width: 100%;
    }
    .pedidos-table thead { display: none; }
    .pedidos-table td { border-bottom: 0; padding: 0.2rem 0; }
    .pedidos-table tr { border-bottom: 1px solid var(--border-color); padding: 0.55rem 0; }
    .pedidos-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 650;
    }
}
@media (max-width: 420px) {
    .pedidos-filter-dates {
        flex: 1 1 100%;
        width: 100%;
    }
    .pedidos-filter-dates label { max-width: none; }
}

