/* ===== Tipografía: Nunito Sans (self-hosted) ===== */
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/static/fonts/nunito-sans-300.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/nunito-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/nunito-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/nunito-sans-700.woff2") format("woff2");
}

/* ===== Paleta derivada del logo ===== */
:root {
  --brand-blue: #00ace9;
  --brand-pink: #fa1e56;
  --brand-amber: #ffba00;

  --blue-soft: #e6f7fe;
  --pink-soft: #fdeaef;
  --amber-soft: #fff5df;

  --ink: #14161a;
  --ink-2: #3c4149;
  --muted: #7b828c;
  --line: #e7e9ee;
  --line-soft: #f0f1f5;
  --bg: #f5f6f8;
  --panel: #ffffff;

  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 6px 20px rgba(20, 22, 26, .05);

  --sidebar-w: 244px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--ink); font-weight: 600; margin: 0; }
h1 { font-size: 26px; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 18px; letter-spacing: -.012em; margin: 22px 0 10px; }
h3 { font-size: 15px; letter-spacing: -.008em; }

.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.mt { margin-top: 14px; }

/* ===== Estructura: sidebar + main ===== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px 14px;
}

.brand { display: block; padding: 4px 8px 18px; }
.brand img { display: block; width: 138px; height: auto; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 400;
  font-size: 14.5px;
  transition: background .14s ease, color .14s ease;
}
.nav-item:hover { background: var(--line-soft); text-decoration: none; color: var(--ink); }
.nav-item.active { background: var(--blue-soft); color: #0679a3; font-weight: 600; }
.nav-item svg { width: 19px; height: 19px; flex: 0 0 19px; opacity: .85; }
.nav-item.active svg { opacity: 1; }

.main { display: flex; flex-direction: column; min-width: 0; }

/* Ancho de trabajo compartido por header y contenido: usa toda la
   pantalla hasta un tope amplio y queda centrado en monitores grandes. */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1560px; margin: 0 auto; padding: 0 34px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 62px;
}
.page-title { font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: -.015em; line-height: 1.2; }
.page-title small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

/* Menú del usuario */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 11px 5px 5px; border: 1px solid var(--line);
  background: #fff; border-radius: 999px; cursor: pointer; font: inherit;
  transition: background .14s ease, border-color .14s ease;
}
.user-btn:hover { background: var(--line-soft); }
.user-btn .avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-pink));
  color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.user-btn .u-name { font-size: 14.5px; color: var(--ink); font-weight: 600; }
.user-btn .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .16s ease; }
.user-menu.open .user-btn .chev { transform: rotate(180deg); }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 208px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 14px 36px rgba(20, 22, 26, .14);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 40;
}
.user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border-radius: 8px; border: none; background: none;
  color: var(--ink-2); font: inherit; font-size: 14.5px; font-weight: 400;
  cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--line-soft); text-decoration: none; color: var(--ink); }
.menu-item svg { width: 18px; height: 18px; opacity: .85; }
.menu-item.danger { color: var(--brand-pink); }
.menu-item.danger:hover { background: var(--pink-soft); color: #c81043; }
.menu-sep { height: 1px; background: var(--line-soft); margin: 5px 6px; }

.content { max-width: 1560px; margin: 0 auto; width: 100%; padding: 30px 34px 64px; }
.subtitle { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

/* ===== Tarjetas ===== */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 940px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

/* ===== KPIs ===== */
.stat { position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 29px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; margin-top: 8px; }
.stat .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 0; }
.stat.blue::before { background: var(--brand-blue); }
.stat.amber::before { background: var(--brand-amber); }
.stat.pink::before { background: var(--brand-pink); }
.stat.blue .value { color: #0679a3; }
.stat.amber .value { color: #a67500; }
.stat.pink .value { color: #c81043; }

/* ===== Tablas ===== */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== Formularios ===== */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; letter-spacing: .01em; }
input, select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font: inherit; font-size: 14.5px; background: #fff; color: var(--ink);
  transition: border-color .14s ease, box-shadow .14s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
textarea { resize: vertical; min-height: 90px; }
input[type="checkbox"] { width: auto; }

.row-inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row-inline > * { flex: 1; min-width: 130px; }
.row-inline .shrink { flex: 0 0 auto; min-width: 0; }

/* Teléfono con prefijo fijo */
.phone-field {
  display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff;
  padding-left: 11px; transition: border-color .14s ease, box-shadow .14s ease;
}
.phone-field:focus-within { border-color: var(--brand-blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.phone-prefix { color: var(--muted); font-weight: 600; padding-right: 6px; }
.phone-field input {
  border: none; box-shadow: none; background: transparent; padding-left: 0;
  border-radius: 0 8px 8px 0;
}
.phone-field input:focus { outline: none; box-shadow: none; }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.btn:hover { background: var(--line-soft); text-decoration: none; }
.btn.primary { background: var(--brand-blue); border-color: var(--brand-blue); color: #ffffff; }
.btn.primary:hover { background: #0098cf; border-color: #0098cf; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-soft); }
.btn.danger { color: var(--brand-pink); border-color: var(--pink-soft); background: #fff; }
.btn.danger:hover { background: var(--pink-soft); }
.btn.wa { background: #25d366; border-color: #25d366; color: #05310f; }
.btn.wa:hover { background: #1ebe5a; border-color: #1ebe5a; }
.btn.sm { padding: 5px 10px; font-size: 13px; font-weight: 600; }

/* ===== Badges ===== */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; }
.badge.ok { background: var(--blue-soft); color: #0679a3; }
.badge.warn { background: var(--amber-soft); color: #a67500; }
.badge.danger { background: var(--pink-soft); color: #c81043; }
.badge.muted { background: var(--line-soft); color: var(--muted); }

/* ===== Alertas ===== */
.alert { padding: 12px 15px; border-radius: var(--r-sm); margin-bottom: 18px; border: 1px solid; font-size: 14px; font-weight: 400; }
.alert.ok { background: var(--blue-soft); border-color: #bfeafa; color: #066c92; }
.alert.err { background: var(--pink-soft); border-color: #f7c9d6; color: #b30e3f; }
.alert.warn { background: var(--amber-soft); border-color: #f6e2ad; color: #8a6400; }

.actions { display: flex; gap: 9px; flex-wrap: wrap; }
.form-actions { margin: 0 0 18px; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

/* Barra de pago: [monto] [Registrar adelanto] [Pagar saldo/total] */
.pago-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.pago-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.pago-monto { max-width: 140px; }

.item-cell .item-name { margin-bottom: 6px; }
.item-comentario { font-size: 13px; }
.item-puntos-wrap { margin-top: 8px; }
.item-puntos-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.item-puntos { max-width: 150px; }

.check-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check-item input { width: auto; }

.chart-wrap { position: relative; width: 100%; height: 260px; }

/* ===== WhatsApp ===== */
.wa-preview {
  white-space: pre-wrap; background: #e7ffdb; border: 1px solid #c9edbb;
  border-radius: 4px 14px 14px 14px; padding: 13px 15px;
  font-size: 14px; line-height: 1.55; max-width: 520px; color: #1b2a12;
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-sm);
  opacity: 0; transition: all .25s ease; z-index: 100; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Toolbar (mini header) ===== */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar-left .subtitle { margin: 0; }
.toolbar-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.empty { color: var(--muted); text-align: center; padding: 26px 10px; }

.actions-cell { white-space: nowrap; }
.actions-cell .btn { min-width: 90px; }

.mov-group { border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.mov-group:last-child { margin-bottom: 0; }
.mov-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.mov-head .right { margin-left: auto; }
.hide-costo .col-costo { display: none; }

.badge.ingreso { background: var(--blue-soft); color: #0679a3; }
.badge.egreso { background: var(--pink-soft); color: #c81043; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; padding: 20px;
  background: rgba(20, 22, 26, .45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .16s ease, visibility .16s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 540px;
  max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(20, 22, 26, .28);
  transform: translateY(8px) scale(.985); transition: transform .16s ease;
}
.modal-overlay.open .modal { transform: none; }
.modal.modal-sm { max-width: 400px; }
.modal-head { padding: 20px 22px 0; }
.modal-head h3 { font-size: 17px; }
.modal-head p { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.modal-body { padding: 16px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 9px; }

/* ===== Selector (picker) ===== */
.search-box { position: relative; margin-bottom: 12px; }
.picker-list { display: flex; flex-direction: column; gap: 2px; max-height: 52vh; overflow: auto; }
.picker-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 12px; border-radius: 8px; border: none; background: none;
  cursor: pointer; font: inherit; font-size: 14.5px; color: var(--ink); text-align: left;
}
.picker-item:hover { background: var(--blue-soft); }
.picker-item .meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.picker-item[disabled] { opacity: .5; cursor: not-allowed; }

/* ===== Receta (filas de insumos) ===== */
.receta-qty { max-width: 130px; }
.icon-remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; border: none; background: none;
  color: var(--muted); cursor: pointer;
}
.icon-remove:hover { background: var(--pink-soft); color: var(--brand-pink); }
.icon-remove svg { width: 17px; height: 17px; }

/* ===== Dropdown personalizado (bselect) ===== */
.bselect { position: relative; }
.bselect-native { display: none !important; }
.bselect-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; color: var(--ink); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.bselect-btn:hover { border-color: #cfd4dc; }
.bselect.open .bselect-btn { border-color: var(--brand-blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.bselect-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bselect-label.is-placeholder { color: var(--muted); }
.bselect-chev { width: 17px; height: 17px; color: var(--muted); flex: 0 0 17px; transition: transform .16s ease; }
.bselect.open .bselect-chev { transform: rotate(180deg); }
.bselect-pop {
  position: absolute; z-index: 60; left: 0; right: 0; margin-top: 6px; min-width: 200px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 16px 40px rgba(20, 22, 26, .16); max-height: 330px; overflow: auto;
}
.bselect-search { width: 100%; margin-bottom: 6px; padding: 8px 10px; font-size: 14px; }
.bselect-list { display: flex; flex-direction: column; gap: 1px; }
.bselect-item {
  display: block; width: 100%; text-align: left; padding: 9px 11px; border-radius: 8px;
  border: none; background: none; font: inherit; font-size: 14.5px; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bselect-item:hover { background: var(--line-soft); color: var(--ink); }
.bselect-item.is-selected { background: var(--blue-soft); color: #0679a3; font-weight: 600; }
.bselect-create {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--brand-blue); font-weight: 600;
}
.bselect-create:hover { background: var(--blue-soft); }
.bselect-plus { font-weight: 700; }
.bselect-empty { color: var(--muted); padding: 10px; font-size: 14px; text-align: center; margin: 0; }

/* ===== Documento imprimible (PDF) ===== */
.doc {
  position: relative; max-width: 840px; margin: 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 46px 50px 34px; box-shadow: var(--shadow); overflow: hidden;
}
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.doc-logo { width: 158px; height: auto; display: block; }
.doc-head-right { text-align: right; }
.doc-kind { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-blue); }
.doc-number { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; margin-top: 2px; }
.doc-date { color: var(--ink); font-size: 13px; margin-top: 2px; }

.doc-meta { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px;
  margin: 30px 0 32px; padding: 18px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.doc-meta-block { text-align: left; }
.doc-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink); font-weight: 700; margin-bottom: 4px; }
.doc-value { font-size: 15px; color: var(--ink); font-weight: 500; }
.doc-sub { font-size: 13px; color: var(--ink); margin-top: 2px; }

.doc-items { width: 100%; border-collapse: separate; border-spacing: 0; }
.doc-items thead th {
  background: var(--brand-blue); color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 12px 15px; text-align: left;
}
.doc-items thead th:first-child { border-radius: 8px 0 0 8px; }
.doc-items thead th:last-child { border-radius: 0 8px 8px 0; }
.doc-items tbody td { padding: 13px 15px; border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--ink); }
.doc-item-comment { font-size: 12.5px; color: var(--ink); opacity: .78; margin-top: 3px; }
.doc-items .num { text-align: right; }

.doc-items tfoot td { padding: 11px 15px; font-size: 14px; color: var(--ink); }
.doc-items tfoot .trow:first-child td { border-top: 1px solid var(--line); }
.doc-items tfoot .trow td:first-child { text-align: right; }
.doc-items tfoot .grand td { border-top: 1px solid var(--line); font-size: 16px; }
.doc-items tfoot .grand td.num strong { color: var(--brand-pink); }

.doc-foot-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 26px; }
.doc-notes { flex: 1; }
.doc-stamp { display: inline-block; padding: 9px 20px; border: 2px solid var(--brand-pink);
  color: var(--brand-pink); border-radius: 8px; font-weight: 700; letter-spacing: .16em; font-size: 13px;
  transform: rotate(-6deg); }

.doc-footer { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.doc-footer-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.doc-footer-contact { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink); font-size: 12.5px; margin-top: 4px; }
.doc-footer-thanks { color: var(--ink); font-size: 12.5px; }

/* ===== Login ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 372px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 34px 30px 30px;
  box-shadow: 0 20px 60px rgba(20, 22, 26, .08);
}
.login-card .logo { display: block; width: 176px; margin: 0 auto 22px; }
.login-card h1 { font-size: 20px; text-align: center; }
.login-card .subtitle { text-align: center; margin-top: 4px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; align-items: center;
    gap: 10px; padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .brand { padding: 0 14px 0 0; }
  .brand img { width: 118px; }
  .side-nav { flex-direction: row; gap: 4px; }
  .topbar-inner { padding: 0 18px; min-height: 56px; gap: 12px; }
  .page-title { font-size: 18px; letter-spacing: -.012em; }
  .user-btn .u-name { display: none; }
  .content { padding: 20px 18px 48px; }
}

@media (max-width: 520px) {
  .page-title { font-size: 16px; }
  .page-title small { display: none; }
}

/* ===== Impresión ===== */
@page { margin: 14mm; }

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .content { padding: 0; max-width: 100%; }
  .card { border: none; box-shadow: none; padding: 0; }
  .doc { border: none; box-shadow: none; border-radius: 0; padding: 0; max-width: 100%; }
  .doc-stamp, .doc-items thead th, .doc-items tfoot .grand td.num strong {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}
