@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  --ink: #16181d;
  --text: #16181d;
  --muted: #5f6570;
  --line: #e4e6eb;
  --line-strong: #d0d4dc;
  --bg: #f3f4f7;
  --panel: #ffffff;
  --side: #14161c;
  --side-2: #1c1f27;
  --side-hover: rgba(255, 255, 255, 0.08);
  --accent: #e85d04;
  --accent-2: #d14f00;
  --accent-soft: #fff1e6;
  --cta: #e85d04;
  --cta-hover: #d14f00;
  --ok: #0b7a4b;
  --ok-bg: #e7f6ef;
  --warn: #b45309;
  --warn-bg: #fff7ed;
  --bad: #c0392b;
  --bad-bg: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 18, 24, 0.04), 0 8px 24px rgba(16, 18, 24, 0.04);
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }

.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

.side {
  background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%);
  color: #ece8e1;
  padding: 20px 12px 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.brand--logo {
  align-items: center;
  justify-content: center;
  padding: 12px 8px 18px;
}
.brand-logo {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 56px;
  height: auto;
  object-fit: contain;
}
.brand-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: -0.02em;
}
.logo-upload {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.logo-preview {
  width: 120px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.logo-preview--empty {
  color: var(--muted);
  font-size: 0.78rem;
  background: #fafbfc;
}
.brand-text strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}
.brand-text small {
  display: block;
  margin-top: 4px;
  color: rgba(238, 245, 255, 0.78);
  font-size: 0.76rem;
  font-weight: 500;
}

.side-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 8px 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}
.mode-dot.demo { background: #cbd5e1; }
.mode-dot.beta { background: #fbbf24; }
.mode-dot.prod, .mode-dot.production { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25); }

.nav {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-section {
  margin: 14px 10px 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav a {
  color: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}
.nav a:hover {
  background: var(--side-hover);
  color: #fff;
  text-decoration: none;
}
.nav a.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.nav a.nav-logout {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.84rem;
  font-weight: 500;
}

.main {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 24px 28px 48px;
  background: var(--bg);
}

.page-head,
.hero-strip {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--line);
  background: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  color: inherit;
}
.page-head h1,
.hero-strip h1,
h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.page-head .muted,
.hero-strip .muted,
.muted { color: var(--muted); }
.hero-strip::after { display: none; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; gap: 16px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.mail-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.mail-tpl-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.mail-tpl-wrap .ql-toolbar.ql-snow {
  border: none;
  border-bottom: 1px solid var(--line);
}
.mail-tpl-wrap .ql-container.ql-snow {
  border: none;
  height: 200px;
}
.mail-tpl-wrap .ql-editor {
  min-height: 160px;
  max-height: 200px;
  overflow-y: auto;
}
.mail-tpl-preview-block {
  margin-top: 18px;
  clear: both;
  position: relative;
  z-index: 0;
}
.mail-tpl-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  min-height: 120px;
  overflow: auto;
}
.filters-card {
  margin-bottom: 14px;
}
.filters-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.filters-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
@media (max-width: 1100px) {
  .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .filters-grid { grid-template-columns: 1fr 1fr; }
}
.card h2 {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card {
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  min-height: 108px;
}
.stat-card:nth-child(2) { border-top-color: #15803d; }
.stat-card:nth-child(3) { border-top-color: #0369a1; }
.stat-card:nth-child(4) { border-top-color: #7c3aed; }
.stat-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  margin-top: 10px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #e8eef8;
  color: #1e3a5f;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fafbfc;
}
tbody tr:hover { background: #f7f8fa; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  background: var(--accent-2);
  text-decoration: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(232, 93, 4, 0.28);
}
.btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.btn.secondary:hover { background: #fafbfc; color: var(--ink); }
.btn.success {
  background: var(--accent);
  color: #fff;
}
.btn.success:hover { background: var(--accent-2); color: #fff; }
.btn.danger {
  background: #fff;
  color: var(--bad);
  border: 1px solid #fecaca;
}
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 6px 11px; font-size: 0.8rem; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
input, select, textarea {
  width: 100%;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.22);
}
.items-table input { padding: 8px 10px; }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: opacity .32s ease, transform .32s ease;
  box-shadow: 0 1px 2px rgba(16, 18, 24, 0.04);
}
.alert.ok { background: var(--ok-bg); border: 1px solid #bbf7d0; color: var(--ok); }
.alert.err { background: var(--bad-bg); border: 1px solid #fecaca; color: var(--bad); }
.alert.warn {
  background: #fff8e6;
  border: 1px solid #f5d78e;
  color: #8a6d1d;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.attach-box {
  border: 1px dashed rgba(232, 93, 4, 0.35);
  border-radius: 10px;
  padding: 10px;
  background: var(--accent-soft);
}
.alert.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 500;
}
.alert.is-gone { opacity: 0; transform: translateY(-6px); pointer-events: none; margin: 0; padding: 0; border: 0; }
.unclic-flash-hidden { display: none !important; }

/* —— Toasts Unclic —— */
.unclic-toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}
.unclic-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 0;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(16, 18, 24, 0.12), 0 2px 6px rgba(16, 18, 24, 0.06);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity .28s ease, transform .28s ease;
}
.unclic-toast.is-in { opacity: 1; transform: none; }
.unclic-toast.is-out { opacity: 0; transform: translateY(8px) scale(0.98); }
.unclic-toast-bar { background: var(--accent); }
.unclic-toast.is-ok .unclic-toast-bar { background: var(--ok); }
.unclic-toast.is-err .unclic-toast-bar { background: var(--bad); }
.unclic-toast.is-warn .unclic-toast-bar { background: var(--warn); }
.unclic-toast.is-info .unclic-toast-bar { background: #2563eb; }
.unclic-toast-body { padding: 12px 6px 12px 14px; min-width: 0; }
.unclic-toast-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.unclic-toast-msg {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  word-break: break-word;
}
.unclic-toast-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  padding: 10px 12px;
  cursor: pointer;
  align-self: start;
}
.unclic-toast-x:hover { color: var(--ink); }

/* —— Confirmación Unclic —— */
.unclic-confirm {
  border: 0;
  padding: 0;
  margin: auto;
  background: transparent;
  max-width: 26rem;
  width: calc(100% - 2rem);
}
.unclic-confirm::backdrop {
  background: rgba(16, 18, 24, 0.52);
  backdrop-filter: blur(2px);
}
.unclic-confirm-card {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.2rem 1.2rem;
  box-shadow: 0 18px 50px rgba(16, 18, 24, 0.18);
  animation: unclicPop .22s ease;
}
@keyframes unclicPop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.unclic-confirm-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.unclic-confirm-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
}
.unclic-confirm-brand-text {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.unclic-confirm-title {
  margin: 0 0 8px;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.unclic-confirm-msg {
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #3d4450;
  font-weight: 500;
}
.unclic-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.unclic-confirm.is-danger #unclic-confirm-ok {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.unclic-confirm.is-danger #unclic-confirm-ok:hover {
  filter: brightness(0.92);
}
@media (max-width: 640px) {
  .unclic-toasts { right: 12px; left: 12px; width: auto; bottom: 12px; }
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 10% -10%, #f15a2233, transparent 50%),
    radial-gradient(800px 400px at 110% 110%, #14161c22, transparent 45%),
    #eceef2;
}
.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.login-card:before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #f4a261);
}
.login-card .login-kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.login-card h1 { font-size: 1.4rem; letter-spacing: -0.03em; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel-note {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.86em;
  background: var(--accent-soft);
  color: var(--accent-2);
  padding: 2px 6px;
  border-radius: 4px;
}

/* —— Emitir CPE (estilo ordenado tipo proveedor) —— */
.emit-form { margin: 0; }
.emit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}
.emit-main.card { padding: 18px 20px 16px; }
.emit-side.card {
  padding: 16px;
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.emit-brand-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.emit-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}
.emit-brand strong {
  display: block;
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.3;
}
.emit-logo {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}
.emit-logo-img {
  flex: 0 0 auto;
  height: 44px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}
.emit-dates {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.emit-dates > div { width: 148px; }
.emit-dates input { padding: 8px 10px; }

.emit-meta {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1.1fr 0.8fr 0.9fr;
  gap: 10px;
  margin-bottom: 16px;
}
.emit-meta label { margin-bottom: 4px; }
.emit-meta input,
.emit-meta select { padding: 8px 10px; font-size: 0.9rem; }
.emit-tc { display: flex; gap: 6px; align-items: center; }
.emit-tc input { flex: 1; }
#wrapTipoCambio.is-disabled { opacity: 0.55; }

.emit-nota-box {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f0f7ff;
}
.emit-nota-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.emit-nota-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 1fr;
  gap: 10px;
}
@media (max-width: 1100px) {
  .emit-nota-grid { grid-template-columns: 1fr 1fr; }
}

.emit-cliente {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfe;
}
.emit-cliente-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.emit-cliente-head label {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}
.emit-cliente-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
}
.emit-cliente-grid .full { grid-column: 1 / -1; }
.emit-doc-wrap { display: flex; gap: 8px; }
.emit-doc-wrap input { flex: 1; }
.field-hint {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 1em;
}

.emit-items-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}
.emit-catalog { display: flex; gap: 8px; align-items: center; }
.emit-catalog select { min-width: 200px; max-width: 320px; padding: 7px 10px; }

.emit-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.emit-items { margin: 0; font-size: 0.86rem; }
.emit-items th {
  background: #f3f7fc;
  padding: 8px 6px;
  white-space: nowrap;
}
.emit-items td {
  padding: 6px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.emit-items tbody tr:hover { background: #f7f8fa; }
.emit-items input {
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 0.86rem;
}
.emit-items .c { text-align: center; }
.emit-items-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.btn-add-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-add-item .icon-plus-circle {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.emit-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.emit-side-toggles {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.toggle-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}
.toggle-row input { width: auto; margin-top: 2px; }
.emit-extra {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fafcfe;
}
.emit-extra summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
}
.emit-extra summary::-webkit-details-marker { display: none; }
.emit-extra-body { padding: 0 12px 12px; }
.emit-extra-body textarea { resize: vertical; min-height: 72px; }
.emit-submit { width: 100%; }
.emit-side-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

@media (max-width: 1100px) {
  .grid.stats { grid-template-columns: 1fr 1fr; }
  .emit-meta { grid-template-columns: 1fr 1fr; }
  .emit-layout { grid-template-columns: 1fr; }
  .emit-side.card { position: static; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
  .grid.two { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .main { padding: 18px 14px 40px; }
  .page-head, .hero-strip { flex-direction: column; align-items: flex-start; }
  .emit-brand-row { flex-direction: column; }
  .emit-dates { width: 100%; }
  .emit-dates > div { flex: 1; width: auto; }
  .emit-cliente-grid { grid-template-columns: 1fr; }
}
