/* ==========================================================
   Ambuvet · Sistema de gestión
   ========================================================== */
:root {
  --teal: #034652;
  --teal-hover: #02343d;
  --teal-soft: #e7f0f1;
  --ink: #141414;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --band: #f6f6f6;
  --yellow: #f4d000;
  --yellow-hover: #e2c000;
  --avatar: #f3e6f2;
  --purple: #5b2a86;
  --pink: #e0336e;
  --danger: #b3261e;
  --footer: #0f0f0f;
  --badge-bg: #123d33;
  --badge-ink: #7fe3c3;
  --radius: 6px;
  --pad-x: clamp(13px, 2.56vw, 45px);
  --font-ui: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-form: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-ui); color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid #6fb3be; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 500; font-size: 13px; line-height: 1.2; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-hover); }
.btn-yellow { background: var(--yellow); color: var(--ink); font-weight: 600; }
.btn-yellow:hover { background: var(--yellow-hover); }
.btn-outline { background: #fff; border-color: #dcdcdc; color: var(--ink); }
.btn-outline:hover { border-color: #b9b9b9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1e18; }
.btn-lg { padding: 11px 29px; font-size: 16px; border-radius: 8px; }
.btn svg { width: 14px; height: 14px; flex: none; }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); font-size: 12px; }
.linkbtn:hover { color: var(--ink); }
.linkbtn.danger:hover { color: var(--danger); }

/* ==========================================================
   LOGIN (interno y clientes)
   ========================================================== */
.login-page { font-family: var(--font-form); --panel: clamp(480px, 50vw, 760px); }
.login { position: relative; min-height: 100vh; min-height: 100dvh; background: #2b2b2a; }
.login-admin .login-photo { background-image: url('/assets/img/login-admin.jpg'); background-position: 36% center; }
.login-photo { position: absolute; top: 0; right: 0; bottom: 0; left: calc(var(--panel) - 64px); background: url('/assets/img/login-bg.jpg') center 30% / cover no-repeat; }
.login-panel {
  position: relative; z-index: 1; width: var(--panel); min-height: 100vh; min-height: 100dvh; box-sizing: border-box;
  background: #fff; border-radius: 0 56px 0 0; padding: 44px clamp(32px, 7vw, 112px) 32px;
  display: flex; flex-direction: column;
}
.back { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .05em; color: #4b5d61; text-decoration: none; align-self: flex-start; padding: 6px 0; }
.back svg { width: 16px; height: 16px; }
.back:hover { color: var(--teal); }
.login-box { width: 100%; max-width: 460px; margin: auto; padding: 32px 0; }
.login-logo { display: flex; justify-content: center; }
.login-title { font-size: clamp(20px, 1.8vw, 26px); font-weight: 500; text-align: center; color: var(--teal); margin: 28px 0 34px; }
.login-form { display: flex; flex-direction: column; gap: 24px; }
.fl { position: relative; }
.fl label { position: absolute; top: -9px; left: 14px; padding: 0 6px; background: #fff; font-size: 12px; font-weight: 500; color: #4b5d61; line-height: 18px; z-index: 1; }
.fl input {
  width: 100%; height: 54px; border: 1px solid #8fa6ab; border-radius: 10px; padding: 0 18px; font-size: 16px; font-weight: 500; color: var(--ink); background: #fff;
}
.fl input:hover { border-color: #5f7d84; }
.fl input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(3, 70, 82, .14); }
.fl:focus-within label { color: var(--teal); }
.fl.pw input { padding-right: 60px; }
.pw-toggle { position: absolute; right: 6px; top: 5px; width: 44px; height: 44px; border: 0; background: none; color: var(--teal); display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.pw-toggle:hover { background: var(--teal-soft); }
.pw-toggle svg { width: 22px; height: 22px; }
.captcha { display: flex; align-items: center; gap: 10px; }
.captcha-img { width: 150px; height: 54px; border-radius: 10px; background: var(--teal-soft); overflow: hidden; flex: none; }
.captcha-img svg { display: block; width: 100%; height: 100%; }
.captcha-refresh { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #c9d8db; background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--teal); flex: none; }
.captcha-refresh:hover { background: var(--teal-soft); }
.captcha-refresh svg { width: 18px; height: 18px; }
.captcha .fl { flex: 1; min-width: 0; }
.captcha .fl input { text-transform: uppercase; letter-spacing: .2em; font-weight: 600; }
.form-error { color: var(--danger); font-size: 14px; margin: -6px 0 0; }
.form-error:empty { display: none; }
.btn-pill { height: 54px; border: 0; border-radius: 999px; background: var(--teal); color: #fff; font: 600 15px var(--font-form); letter-spacing: .06em; cursor: pointer; transition: background-color .15s; }
.btn-pill:hover { background: var(--teal-hover); }
.btn-pill:disabled { opacity: .7; cursor: progress; }
.login-help { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: #4b5d61; margin: 0; }
.login-help svg { width: 18px; height: 18px; color: #7d9095; }
.login-help button { background: none; border: 0; padding: 0; font: 600 14px var(--font-form); color: var(--teal); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.help-box { background: var(--teal-soft); border-radius: 10px; padding: 12px 16px; font-size: 13px; line-height: 1.6; color: #24474e; margin: -8px 0 0; }
.login-alt { background: #f2f6f7; border-radius: 16px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.login-alt strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.login-alt span { font-size: 13px; color: #4b5d61; }
.login-alt a { display: inline-flex; align-items: center; height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--teal); color: var(--teal); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.login-alt a:hover { background: var(--teal); color: #fff; }

/* Carrusel sobre la foto */
.promo { position: absolute; z-index: 1; right: clamp(32px, 5vw, 88px); bottom: clamp(32px, 6vh, 80px); width: min(400px, calc(100vw - var(--panel) - 64px)); box-sizing: border-box; border-radius: 26px; padding: 12px; color: #fff; background: rgba(12, 32, 36, .6); border: 1px solid rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.promo-slide { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 150px; }
.promo-tag { align-self: flex-start; font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.promo-text { margin: 0; font-size: 22px; font-weight: 500; line-height: 1.3; }
.promo-link { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; letter-spacing: .03em; margin-top: auto; }
.promo-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.promo-link svg { width: 14px; height: 14px; }
.promo-ctrl { background: rgba(0, 0, 0, .3); border-radius: 16px; padding: 8px 10px 8px 16px; display: flex; align-items: center; gap: 8px; }
.promo-dots { display: flex; gap: 8px; flex: 1; }
.promo-dots button { width: 30px; height: 20px; border: 0; padding: 8px 0; background: none; cursor: pointer; }
.promo-dots button::before { content: ''; display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .4); }
.promo-dots button[aria-current="true"]::before { background: #6fd3df; }
.promo-ctrl .round { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .45); background: none; color: #fff; display: grid; place-items: center; cursor: pointer; }
.promo-ctrl .round:hover { border-color: #fff; }
.promo-ctrl .plain { width: 40px; height: 40px; border: 0; background: none; color: #fff; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.promo-ctrl .plain:hover { background: rgba(255, 255, 255, .12); }
.promo-ctrl svg { width: 16px; height: 16px; }
.promo-anim { animation: promoIn .35s ease-out; }
@keyframes promoIn { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 900px) {
  .login-page { --panel: 100%; }
  .login { background: #fff; }
  .login-photo { position: relative; left: 0; height: 28vh; background-position: center 35%; }
  .login-admin .login-photo { background-position: 42% 30%; }
  .login-panel { width: 100%; min-height: 0; border-radius: 24px 24px 0 0; margin-top: -24px; padding: 22px 22px 28px; }
  .login-box { padding: 20px 0 28px; }
  .promo { display: none; }
}
@media (max-width: 420px) {
  .captcha { flex-wrap: wrap; }
  .captcha .fl { flex-basis: 100%; }
}

/* ==========================================================
   APP (administrador y portal)
   ========================================================== */
.app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.app main { flex: 1; }

.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 26px var(--pad-x); border-bottom: 1px solid var(--line); background: #fff;
}
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); justify-self: start; }
.logo-mark { width: 40px; height: 40px; border-radius: 11px; background: var(--teal); color: #fff; display: grid; place-items: center; flex: none; }
.logo-mark svg { width: 21px; height: 21px; }
.logo-text { display: flex; flex-direction: column; font-family: var(--font-form); }
.logo-name { font-size: 24px; font-weight: 600; line-height: 1.1; letter-spacing: .01em; }
.logo-sub { font-size: 11px; font-weight: 500; color: #237e8a; }
.logo.lg .logo-mark { width: 50px; height: 50px; border-radius: 14px; }
.logo.lg .logo-mark svg { width: 27px; height: 27px; }
.logo.lg .logo-name { font-size: 30px; }
.logo.lg .logo-sub { font-size: 12px; }
.logo.on-dark { color: #fff; margin-bottom: 12px; }
.logo.on-dark .logo-mark { background: #0b6b78; }
.logo.on-dark .logo-sub { color: #7fcfd9; }
.mainnav { display: flex; gap: clamp(16px, 2.4vw, 45px); }
.mainnav a { font-size: clamp(14px, 1.12vw, 17px); text-decoration: none; padding: 3px 0 6px; border-bottom: 2px solid transparent; }
.mainnav a:hover { border-color: #cfdfe2; }
.mainnav a.active { font-weight: 600; border-color: var(--teal); }
.userbox { justify-self: end; display: flex; align-items: center; gap: clamp(11px, 1.6vw, 29px); font-size: 12px; color: var(--muted); }
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; row-gap: 14px; padding-top: 16px; padding-bottom: 0; }
  .mainnav { grid-column: 1 / -1; grid-row: 2; }
  .userbox { flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; }
  .userbox .linkbtn { font-size: 13px; }
}

.band { background: var(--band); padding: 0 var(--pad-x); }
.wrap { padding: 0 var(--pad-x); }

/* Búsqueda de clientes */
.searchband { display: flex; align-items: center; gap: 14px; height: 74px; }
.searchband svg { width: 22px; height: 22px; flex: none; }
.searchband input { flex: 1; border: 0; background: transparent; font-size: clamp(13px, 1.12vw, 16px); height: 100%; min-width: 0; }
.searchband input:focus { outline: none; }
.searchband:focus-within { box-shadow: inset 0 -2px 0 var(--teal); }

.list-head { display: flex; align-items: center; gap: 22px; padding: 27px 0 21px; flex-wrap: wrap; }
.list-head h1 { font-size: clamp(16px, 1.28vw, 19px); font-weight: 600; margin: 0; }
.list-head .spacer { flex: 1; }
.dl-link { display: inline-flex; gap: 5px; align-items: center; font-size: 14px; color: var(--ink); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.dl-link:hover { color: var(--teal); }

/* Tabla de clientes */
.ctable { width: 100%; border-collapse: collapse; }
.ctable th { text-align: left; font-weight: 500; font-size: 15px; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
.ctable th:first-child, .ctable td:first-child { padding-left: 22px; }
.ctable th .ico { display: inline-flex; align-items: center; gap: 8px; }
.ctable th svg { width: 18px; height: 18px; }
.ctable td { padding: 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ctable td a { display: block; padding: 19px 10px 19px 0; text-decoration: none; }
.ctable td:first-child a { padding-left: 0; }
.ctable tbody tr { cursor: pointer; }
.ctable tbody tr:hover { background: #fafafa; }
.ctable .col-name { width: 34%; }
.ctable .col-pac { width: 22%; }
.ctable .col-mail { width: 26%; }
.tag-portal { display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 500; color: var(--teal); background: var(--teal-soft); border-radius: 16px; padding: 2px 8px; vertical-align: 2px; }
.more { display: flex; justify-content: center; padding: 22px 0 38px; }
.empty { text-align: center; color: var(--muted); padding: 45px 13px; font-size: 14px; line-height: 1.6; }
@media (max-width: 760px) {
  .ctable thead { display: none; }
  .ctable, .ctable tbody, .ctable tr, .ctable td { display: block; width: 100% !important; }
  .ctable tr { border-bottom: 1px solid var(--line); padding: 14px 0; }
  .ctable td { border: 0; font-size: 15px; }
  .ctable td:first-child { padding-left: 0; font-size: 17px; font-weight: 500; }
  .ctable td a { padding: 2px 0; }
  .ctable td.c-pac a::before { content: 'Paciente: '; color: var(--muted); }
  .ctable td.c-mail a::before { content: 'Email: '; color: var(--muted); }
  .ctable td.c-tel a::before { content: 'Teléfono: '; color: var(--muted); }
}

/* Breadcrumb */
.crumbs { display: flex; align-items: center; gap: 14px; height: 67px; font-size: 14px; }
.crumbs a { color: var(--muted); text-underline-offset: 3px; }
.crumbs strong { font-weight: 600; }
.crumbs svg { width: 8px; height: 11px; color: var(--muted); }

/* Perfil de cliente */
.profile { display: flex; align-items: center; gap: 29px; padding: 51px 0 32px; flex-wrap: wrap; }
.avatar { width: 102px; height: 102px; border-radius: 50%; background: var(--avatar); color: var(--teal); display: grid; place-items: center; font-size: 34px; font-weight: 600; flex: none; }
.profile-info { flex: 1; min-width: 176px; }
.profile-info h1 { font-size: clamp(21px, 1.76vw, 26px); font-weight: 600; margin: 0 0 6px; }
.profile-info p { margin: 3px 0; font-size: clamp(14px, 1.12vw, 17px); font-weight: 500; }
.profile-info p a { text-decoration: none; }
.profile-info p a:hover { text-decoration: underline; }
.profile-info .pet { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; font-weight: 400; font-size: 15px; }
.profile-info .pet strong { font-weight: 600; }
.pet-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: none; }
.pet-ico svg { width: 16px; height: 16px; }
.pet-sp { display: inline-block; margin-left: 10px; font-size: 12px; font-weight: 500; color: var(--teal); background: var(--teal-soft); border-radius: 20px; padding: 2px 10px; vertical-align: 1px; }
.profile-info .pet-empty { color: var(--muted); font-size: 14px; }
.profile-info .pnote { font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 10px; max-width: 70ch; white-space: pre-wrap; }
.profile-actions { display: flex; gap: 14px; }
.profile-actions .btn { padding: 11px 29px; font-size: 14px; }

/* Acceso al Sitio Privado */
.access { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; margin-bottom: 38px; }
.access-dot { width: 10px; height: 10px; border-radius: 50%; background: #c4c4c4; flex: none; }
.access.on .access-dot { background: #2e9e6a; }
.access-text { flex: 1; min-width: 176px; }
.access-text strong { display: block; font-weight: 600; font-size: 14px; }
.access-text span { color: var(--muted); font-size: 12px; }
.access-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Notas */
.notes-head { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin-bottom: 24px; }
.notes-head h2 { font-size: clamp(19px, 1.6vw, 24px); font-weight: 600; margin: 0; }
.notes-head .btn { padding: 12px 32px; font-size: 14px; }
.note { background: var(--band); border-radius: 8px; padding: 26px 34px 21px; margin-bottom: 21px; }
.note-grid { display: grid; grid-template-columns: minmax(144px, 240px) 1fr; gap: 13px 32px; padding-bottom: 21px; border-bottom: 1px solid #e2e2e2; }
.note h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.note-date { font-size: 14px; line-height: 1.5; }
.note-body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 80ch; }
.note-foot { display: flex; align-items: center; gap: 21px; padding-top: 14px; flex-wrap: wrap; }
.note-meta { margin-left: auto; font-size: 11px; color: var(--muted); }
.tag-private { font-size: 10px; font-weight: 500; color: #7a4a00; background: #fff1c2; border-radius: 16px; padding: 3px 8px; }
@media (max-width: 760px) {
  .profile { gap: 20px; padding-top: 36px; }
  .avatar { width: 84px; height: 84px; font-size: 28px; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1; padding: 12px; font-size: 16px; }
  .note { padding: 22px 20px; }
  .note-grid { grid-template-columns: 1fr; }
  .note-meta { margin-left: 0; width: 100%; }
  .notes-head .btn { padding: 12px 20px; font-size: 16px; }
}

/* Inventario */
.inv { display: grid; grid-template-columns: 240px 1fr; flex: 1; }
.filters { border-right: 1px solid var(--line); padding: 32px 22px 32px var(--pad-x); }
.filters h2 { font-size: 17px; font-weight: 600; margin: 0 0 29px; }
.filters h3 { font-size: 14px; font-weight: 600; margin: 0 0 14px; }
.fgroup { margin-bottom: 32px; }
.flist { max-height: 240px; overflow-y: auto; padding-right: 8px; }
.flist label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; padding: 7px 0; cursor: pointer; }
.flist input { width: 16px; height: 16px; accent-color: var(--teal); flex: none; }
.inv-main { padding: 22px var(--pad-x) 45px 37px; min-width: 0; }
.inv-tools { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; margin-bottom: 24px; }
.inv-search { flex: 3 1 288px; min-width: 176px; max-width: 608px; display: flex; align-items: center; gap: 10px; background: var(--band); border: 1px solid var(--line); border-radius: 6px; padding: 0 14px; height: 45px; }
.inv-search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.inv-search input { flex: 1; border: 0; background: transparent; font-size: 14px; height: 100%; min-width: 0; }
.inv-search input:focus { outline: none; }
.inv-search:focus-within { border-color: var(--teal); }
.inv-tools .spacer { flex: 1; }
.inv-tools .btn { height: 45px; padding: 0 21px; font-size: 14px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.itable { width: 100%; border-collapse: collapse; min-width: 608px; }
.itable th { background: var(--band); text-align: left; font-weight: 500; font-size: 14px; padding: 24px 16px; white-space: nowrap; }
.itable td { padding: 21px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.itable th:first-child, .itable td:first-child { padding-left: 29px; }
.itable td.stock { font-weight: 700; }
.itable td.stock.low { color: var(--danger); }
.itable td.actions { white-space: nowrap; text-align: right; padding-right: 29px; }
.itable td.actions .linkbtn + .linkbtn { margin-left: 21px; }
@media (max-width: 960px) {
  .inv { grid-template-columns: 1fr; }
  .filters { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px var(--pad-x); display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .filters h2 { grid-column: 1 / -1; margin-bottom: 18px; }
  .fgroup { margin-bottom: 8px; }
  .flist { max-height: 170px; }
  .inv-main { padding: 24px var(--pad-x) 40px; }
  .inv-tools .spacer { display: none; }
  .inv-tools .btn { flex: 1 1 auto; padding: 0 16px; }
}

/* Gestión */
.gwrap { width: 100%; max-width: 1360px; margin: 0 auto; box-sizing: border-box; padding: 28px var(--pad-x) 48px; display: flex; flex-direction: column; gap: 20px; }
.g-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.g-head h1 { margin: 0; font-size: 24px; font-weight: 700; }
.g-head p { margin: 4px 0 0; font-size: 14px; color: #5f5f5f; }
.g-head .btn { height: 42px; font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kpi { border: 1px solid #e3e3e3; border-radius: 12px; padding: 16px 20px; }
.kpi-l { font-size: 12px; font-weight: 600; color: #5f5f5f; }
.kpi-v { font-size: 26px; font-weight: 700; margin-top: 2px; }
.kpi-m { font-size: 13px; color: #5f5f5f; }
.kpi-dark { background: var(--teal); border-color: var(--teal); color: #fff; }
.kpi-dark .kpi-l { color: #bfe3e8; }
.kpi-dark .kpi-m { color: #d6eef1; }
.gcard { border: 1px solid #e3e3e3; border-radius: 12px; padding: 18px 20px; }
.cal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.cal-head h2 { margin: 0; font-size: 18px; font-weight: 700; min-width: 150px; text-align: center; }
.cal-head .spacer { flex: 1; }
.icon-btn { width: 36px; height: 36px; border: 1px solid #dcdcdc; border-radius: 8px; background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.icon-btn:hover { border-color: #b9b9b9; }
.icon-btn svg { width: 14px; height: 14px; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { margin-bottom: 6px; }
.cal-wd span { text-align: center; font-size: 12px; font-weight: 600; color: #5f5f5f; padding: 4px 0; }
.cday { min-height: 70px; border: 1px solid #e3e3e3; border-radius: 8px; background: #fff; padding: 7px 9px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; cursor: pointer; font-family: inherit; color: inherit; min-width: 0; }
.cday:hover { border-color: #9fbcc1; }
.cday.sun { background: #f6f6f6; }
.cday.sel { border: 2px solid var(--teal); background: var(--teal-soft); padding: 6px 8px; }
.cday-n { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.cday.today .cday-n { color: #fff; background: var(--ink); border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: 12px; }
.cday-t { font-size: 13px; font-weight: 700; color: var(--teal); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cday-c { font-size: 11px; color: #5f5f5f; }
.cblank { min-height: 70px; }
.day-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.day-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.day-head span { font-size: 14px; color: #5f5f5f; }
.addbar { background: #f5f7f7; border-radius: 10px; padding: 14px; }
.addrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.af { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.af label { font-size: 12px; font-weight: 600; color: #3f3f3f; }
.af input, .af select { box-sizing: border-box; width: 100%; height: 40px; border: 1px solid #c9c9c9; border-radius: 6px; padding: 0 12px; font-size: 14px; background: #fff; }
.af input:focus, .af select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(3, 70, 82, .14); }
.af-cli { flex: 2 1 230px; } .af-pac { flex: 1 1 150px; } .af-at { flex: 3 1 260px; } .af-pr { flex: 1 1 120px; } .af-pago { flex: 1 1 140px; }
.af-btn { height: 40px; padding: 0 20px; font-size: 14px; font-weight: 600; flex: 0 0 auto; }
.money { position: relative; }
.money span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #7a7a7a; font-size: 14px; }
.money input { padding-left: 26px; }
.ac { position: relative; }
.ac-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #7a7a7a; display: grid; }
.ac-ico svg { width: 15px; height: 15px; }
.ac input { padding-left: 34px; }
.ac-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #dcdcdc; border-radius: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, .12); max-height: 280px; overflow-y: auto; }
.ac-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.ac-list li[aria-selected="true"], .ac-list li:hover { background: var(--teal-soft); }
.ac-list li small { display: block; font-size: 12px; color: #5f5f5f; }
.ac-list li.ac-empty { cursor: default; color: #5f5f5f; font-size: 13px; }
.ac-list li.ac-empty:hover { background: none; }
.addbar .check { margin-top: 10px; }
.addbar .check.off { opacity: .5; }
.table-scroll.flat { border: 0; border-radius: 0; margin-top: 6px; }
.gtable { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
.gtable th { text-align: left; font-size: 12px; font-weight: 600; color: #5f5f5f; padding: 14px 8px; border-bottom: 1px solid #e6e6e6; }
.gtable td { padding: 12px 8px; border-bottom: 1px solid #ececec; vertical-align: top; }
.gtable .num { text-align: right; white-space: nowrap; }
.gtable td.hora, .gtable td.pago { color: #5f5f5f; white-space: nowrap; }
.gtable td.cli { font-weight: 600; }
.gtable td.cli a { color: var(--ink); text-decoration: none; }
.gtable td.cli a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gtable td.act { text-align: right; white-space: nowrap; }
.gtable td.act .linkbtn { font-size: 13px; }
.gtable td.act .linkbtn + .linkbtn { margin-left: 14px; }
.gtable tfoot td { border: 0; padding: 16px 8px; font-weight: 700; }
.gtable tfoot td.num { font-size: 16px; color: var(--teal); }
.gtable .empty-row td { text-align: center; color: #5f5f5f; padding: 32px 8px; }
.sp-tag { margin-left: 6px; font-size: 11px; font-weight: 500; color: var(--teal); background: var(--teal-soft); border-radius: 20px; padding: 2px 8px; white-space: nowrap; }
.nota-ico { display: inline-block; margin-left: 6px; font-size: 11px; color: #5f5f5f; }
@media (max-width: 760px) {
  .kpis { grid-template-columns: 1fr; }
  .cal-grid { gap: 4px; }
  .cday, .cblank { min-height: 52px; }
  .cday { padding: 5px 6px; }
  .cday.sel { padding: 4px 5px; }
  .cday-t { font-size: 0; }
  .cday-t::before { content: ''; display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); margin-top: 2px; }
  .cday-c { display: none; }
  .af-btn { flex: 1 1 100%; justify-content: center; }
  .af input, .af select { font-size: 16px; height: 44px; }
}

/* Footer */
.footer { background: var(--footer); color: #fff; }
.footer-in { display: flex; justify-content: space-between; align-items: center; gap: 19px; padding: 32px var(--pad-x) 29px; border-bottom: 1px solid #262626; flex-wrap: wrap; }

.f-sub { font-size: 12px; color: #cfcfcf; display: flex; align-items: center; gap: 6px; }
.badge { background: var(--badge-bg); color: var(--badge-ink); font-weight: 600; border-radius: 16px; padding: 2px 10px; font-size: 11px; }
.f-social { display: flex; align-items: center; gap: 18px; color: #cfcfcf; font-size: 13px; }
.soc { width: 46px; height: 46px; border-radius: 50%; border: 1px solid #3a3a3a; display: grid; place-items: center; color: #fff; }
.soc:hover { border-color: #7a7a7a; }
.soc svg { width: 19px; height: 19px; }
.f-copy { padding: 18px var(--pad-x); font-size: 11px; color: #9a9a9a; }

/* ==========================================================
   Modales
   ========================================================== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 25, 28, .5); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fadeIn .15s ease-out; }
.modal { background: #fff; width: 100%; max-width: 580px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 12px; padding: 26px 30px 24px; position: relative; font-family: var(--font-form); box-shadow: 0 20px 50px rgba(0, 0, 0, .18); animation: rise .18s ease-out; }
.modal.sm { max-width: 400px; }
.modal-title { font-size: 18px; font-weight: 600; margin: 0 40px 20px 0; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; background: none; cursor: pointer; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.modal-close:hover { background: var(--band); color: var(--ink); }
.modal-close svg { width: 18px; height: 18px; }
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.mgrid .full { grid-column: 1 / -1; }
.mf label, .mf .mf-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.mf input, .mf textarea {
  width: 100%; border: 1px solid #bdbdbd; border-radius: 6px; padding: 9px 12px; font-size: 14px; background: #fff;
}
.mf input:hover, .mf textarea:hover { border-color: #8f8f8f; }
.mf input { height: 40px; }
.mf textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.mf input:focus, .mf textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(3, 70, 82, .15); }
.mf .help { font-size: 12px; color: var(--muted); margin: 5px 0 0; }
.mf-row { display: flex; gap: 8px; }
.mf-row input { flex: 1; min-width: 0; }
.mf-row .btn { height: 40px; padding: 0 14px; font-size: 13px; white-space: nowrap; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin-top: 12px; }
.check input { width: 16px; height: 16px; accent-color: var(--teal); }
.modal-error { color: var(--danger); font-size: 13px; min-height: 0; margin: 12px 0 0; }
.modal-error:empty { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal-actions .btn { min-width: 120px; height: 40px; padding: 0 20px; font-size: 14px; font-weight: 500; border-radius: 8px; }
.modal p.lead { font-size: 14px; line-height: 1.6; margin: 0; color: #3a3a3a; }
.stock-preview { font-size: 14px; margin: 8px 0 0; }
.stock-preview strong { font-size: 18px; }
.cred { background: var(--teal-soft); border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.7; margin: 14px 0 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal, .modal.sm { max-width: none; border-radius: 16px 16px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92dvh; }
  .mgrid { grid-template-columns: 1fr; gap: 14px; }
  .mf input, .mf textarea { font-size: 16px; }
  .mf input, .mf-row .btn { height: 44px; }
  .modal-actions .btn { flex: 1; height: 44px; font-size: 15px; }
}

/* Toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 12px; z-index: 60; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); animation: rise .2s ease-out; max-width: calc(80vw - 26px); }
.toast.error { background: var(--danger); }

/* Portal cliente */
.portal-intro { padding: 38px 0 6px; }
.portal-intro h1 { font-size: clamp(21px, 1.92vw, 27px); font-weight: 600; margin: 0 0 5px; }
.portal-intro p { color: var(--muted); margin: 0; font-size: 14px; }

/* Público */
.public { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 26px; font-family: var(--font-form); background: linear-gradient(rgba(3, 70, 82, .78), rgba(3, 70, 82, .78)), #2a3338 url('/assets/img/login-bg.jpg') center / cover; color: #fff; }
.public h1 { font-size: clamp(35px, 5.6vw, 67px); font-weight: 400; margin: 0; }
.public p { font-size: clamp(14px, 1.6vw, 19px); margin: 6px 0 29px; }
.public .btn { background: #fff; color: var(--teal); }
.public .btn:hover { background: #e9f1f2; }

.loading { color: var(--muted); padding: 38px 0; text-align: center; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.toast { animation-name: toastIn; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Login interno (panel) */
.login-logo + .cms-badge { margin-top: 26px; }
.login-box { display: flex; flex-direction: column; }
.cms-badge { align-self: center; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--teal); background: var(--teal-soft); border-radius: 999px; padding: 6px 14px; letter-spacing: .02em; }
.cms-badge svg { width: 14px; height: 14px; }
.login-title.cms { margin: 14px 0 4px; }
.cms-sub { text-align: center; font-size: 14px; color: #5b6e72; margin: 0 0 32px; }
.cms-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid #e6eced; padding-top: 16px; font-size: 12px; color: #7d8d90; }
.cms-foot .badge { font-size: 11px; margin-left: 4px; }

/* ===== Perfil ===== */
.um { position: relative; }
.um-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid transparent; border-radius: 999px; padding: 4px 10px 4px 4px; font: inherit; font-size: 13px; color: #555; cursor: pointer; }
.um-btn:hover, .um-btn[aria-expanded="true"] { border-color: #dcdcdc; background: #fafafa; color: var(--ink); }
.um-av { width: 28px; height: 28px; border-radius: 50%; background: var(--avatar); color: var(--teal); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.um-chev { width: 14px; height: 14px; }
.um-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 250px; background: #fff; border: 1px solid #e3e3e3; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.12); padding: 6px; display: flex; flex-direction: column; }
.um-head { padding: 10px 12px 12px; border-bottom: 1px solid #eee; margin-bottom: 4px; }
.um-head strong { display: block; font-size: 14px; color: var(--ink); }
.um-head span { font-size: 12px; color: #6b6b6b; }
.um-menu a, .um-menu button { text-align: left; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--ink); text-decoration: none; background: none; border: 0; font-family: inherit; cursor: pointer; }
.um-menu a:hover, .um-menu button:hover { background: var(--teal-soft); }
.um-menu .um-out { border-top: 1px solid #eee; border-radius: 0 0 8px 8px; margin-top: 4px; color: var(--danger); }
.pf { max-width: 1360px; margin: 0 auto; padding-bottom: 56px; }
.pf-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin: 24px 0 26px; overflow-x: auto; }
.pf-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 0 12px; font: 500 15px var(--font-ui); color: #5f5f5f; cursor: pointer; white-space: nowrap; }
.pf-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-color: var(--teal); }
.pf-count { font-size: 11px; background: var(--band); border-radius: 20px; padding: 1px 8px; margin-left: 4px; }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.pf-card { border: 1px solid #e3e3e3; border-radius: 12px; padding: 24px; }
.pf-card h3 { margin: 0 0 18px; font-size: 17px; }
.pf-me { display: flex; align-items: center; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.pf-me h2 { margin: 0; font-size: 22px; }
.pf-me p { margin: 2px 0 8px; color: #5f5f5f; font-size: 14px; }
.avatar.sm { width: 72px; height: 72px; font-size: 24px; }
.avatar.xs { width: 30px; height: 30px; font-size: 11px; display: inline-grid; vertical-align: middle; margin-right: 8px; }
.pf-dl { margin: 18px 0 0; display: grid; gap: 12px; }
.pf-dl div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.pf-dl dt { color: #5f5f5f; } .pf-dl dd { margin: 0; font-weight: 500; text-align: right; }
.mgrid.one { grid-template-columns: 1fr; }
.role { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.role-admin { background: var(--teal); color: #fff; }
.role-ed { background: #e9e3f5; color: #4b2a86; }
.pf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pf-head h2 { margin: 0; font-size: 20px; }
.pf-head p { margin: 4px 0 0; color: #5f5f5f; font-size: 14px; }
.pf-head .btn { height: 42px; font-size: 14px; }
.ptable { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 14px; }
.ptable th { text-align: left; font-size: 12px; font-weight: 600; color: #5f5f5f; background: var(--band); padding: 14px 16px; }
.ptable td { padding: 12px 16px; border-top: 1px solid #ececec; vertical-align: middle; }
.ptable tr.off td { color: #9a9a9a; }
.ptable td.act { text-align: right; white-space: nowrap; }
.ptable td.act .linkbtn { font-size: 13px; } .ptable td.act .linkbtn + .linkbtn { margin-left: 14px; }
.ptable td.ip { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: #5f5f5f; }
.you { font-size: 11px; color: var(--teal); background: var(--teal-soft); border-radius: 20px; padding: 1px 8px; margin-left: 6px; }
.unk { font-size: 11px; color: #9a3412; background: #ffedd5; border-radius: 20px; padding: 1px 7px; margin-left: 4px; }
.st { font-size: 12px; font-weight: 500; color: #6b6b6b; display: inline-flex; align-items: center; gap: 6px; }
.st::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #bdbdbd; }
.st.on { color: #1f7a4f; } .st.on::before { background: #2e9e6a; }
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.role-card { background: #f5f7f7; border-radius: 12px; padding: 16px 18px; }
.role-card p { margin: 10px 0 0; font-size: 13px; line-height: 1.6; color: #3f3f3f; }
.ev { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.ev.ok { background: #dcf3e6; color: #17603d; } .ev.bad { background: #fde2e1; color: #9b1c15; }
.ev.warn { background: #fff1c2; color: #7a4a00; } .ev.out { background: #ececec; color: #4a4a4a; }
.ev.block { background: #2b2b2b; color: #fff; }
.pf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-v.warn { color: var(--danger); }
.pf-filters { display: flex; gap: 12px; flex-wrap: wrap; background: #f5f7f7; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.pf-filters .af { flex: 1 1 160px; }
.pf-pager { display: flex; justify-content: space-between; align-items: center; padding: 16px 4px; font-size: 13px; color: #5f5f5f; }
.rolepick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mf .rp, .rp { display: flex; margin: 0; gap: 10px; align-items: flex-start; border: 1px solid #d5d5d5; border-radius: 10px; padding: 12px; cursor: pointer; }
.rp:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.mf .rp input { width: 16px; height: 16px; padding: 0; flex: none; accent-color: var(--teal); margin: 3px 0 0; }
.rp b { display: block; font-size: 14px; } .rp small { font-size: 12px; color: #5f5f5f; line-height: 1.5; }
@media (max-width: 760px) {
  .pf-grid, .roles, .pf-stats, .rolepick { grid-template-columns: 1fr; }
}

.atable td { vertical-align: top; }
.atable td.nowrap { white-space: nowrap; color: #5f5f5f; }
.atable td.det { max-width: 420px; }
.ac { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.ac-new { background: #dcf3e6; color: #17603d; } .ac-edit { background: #e1eefb; color: #1d4f8a; }
.ac-del { background: #fde2e1; color: #9b1c15; } .ac-in { background: #e7f0f1; color: var(--teal); }
.ac-out { background: #ececec; color: #4a4a4a; } .ac-fail { background: #fff1c2; color: #7a4a00; }
.ac-xls { background: #fff6cc; color: #6b5800; } .ac-acc { background: #e9e3f5; color: #4b2a86; }
.sec { font-size: 13px; color: #3f3f3f; }
tr.diff td { border-top: 0; padding-top: 0; }
.dline { display: grid; grid-template-columns: 130px minmax(0, max-content) auto minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13px; background: #f7f9fa; border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.dk { font-weight: 600; color: #3f3f3f; }
.dold { color: #9b1c15; text-decoration: line-through; text-decoration-color: rgba(155,28,21,.45); }
.dnew { color: #17603d; font-weight: 500; }
.darr { color: #9a9a9a; }
@media (max-width: 760px) { .dline { grid-template-columns: 1fr; gap: 2px; } .darr { display: none; } }

/* Etiquetas: Montserrat dibuja mejor las tildes en tamaños pequeños */
.ac, .ev, .role, .st, .sp-tag, .tag-portal, .tag-private, .pet-sp, .you, .unk, .badge, .pf-count, .cms-badge, .promo-tag {
  font-family: var(--font-form);
}

.ini-prev { width: 40px; height: 40px; border-radius: 50%; background: var(--avatar); color: var(--teal); font: 700 13px var(--font-form); display: grid; place-items: center; flex: none; }

/* ===== Menú hamburguesa (celular) ===== */
.hb { display: none; width: 44px; height: 44px; border: 1px solid #e3e3e3; border-radius: 12px; background: #fff; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; justify-self: end; }
.hb span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.hb.x span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hb.x span:nth-child(2) { opacity: 0; }
.hb.x span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mnav-back { position: fixed; inset: 0; background: rgba(15, 25, 28, .45); z-index: 40; }
.mnav { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); background: #fff; box-shadow: -12px 0 40px rgba(0,0,0,.15); padding: 24px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; overflow-y: auto; animation: slideIn .2s ease-out; }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } }
.mnav-user { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; border-bottom: 1px solid #eee; margin-bottom: 8px; }
.mnav-user strong { display: block; font-size: 16px; }
.mnav-user span:not(.um-av) { font-size: 13px; color: #6b6b6b; }
.um-av.lg { width: 44px; height: 44px; font-size: 14px; }
.mnav-sec { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid #eee; }
.mnav-sec a { padding: 13px 12px; border-radius: 10px; font-size: 17px; font-weight: 500; text-decoration: none; color: var(--ink); }
.mnav-sec a.on { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.mnav-sec.small a { font-size: 15px; font-weight: 400; padding: 11px 12px; }
.mnav-out { margin-top: auto; text-align: left; padding: 13px 12px; border: 0; background: none; font: 500 15px var(--font-ui); color: var(--danger); cursor: pointer; border-radius: 10px; }
.mnav a:hover, .mnav-out:hover { background: var(--band); }
@media (max-width: 760px) {
  .topbar.has-hb { grid-template-columns: 1fr auto; padding: 14px var(--pad-x); row-gap: 0; }
  .topbar.has-hb .mainnav, .topbar.has-hb .userbox { display: none; }
  .hb { display: flex; }
}

/* ===== Filtros del inventario como acordeón ===== */
.facc summary { list-style: none; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.facc summary::-webkit-details-marker { display: none; }
.facc-val, .facc-chev { display: none; }
@media (min-width: 961px) { .facc summary { pointer-events: none; } }
@media (max-width: 960px) {
  .filters { display: block; padding: 14px var(--pad-x); }
  .filters h2 { font-size: 15px; margin-bottom: 10px; }
  .facc { border: 1px solid #e3e3e3; border-radius: 10px; margin-bottom: 10px; background: #fff; }
  .facc summary { margin: 0; padding: 14px 16px; cursor: pointer; min-height: 24px; }
  .facc-val { display: inline; margin-left: auto; font-size: 13px; font-weight: 500; color: #6b6b6b; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .facc-val.set { color: var(--teal); background: var(--teal-soft); border-radius: 999px; padding: 2px 10px; font-family: var(--font-form); font-weight: 600; }
  .facc-chev { display: block; width: 18px; height: 18px; color: #6b6b6b; transition: transform .2s; flex: none; }
  .facc[open] .facc-chev { transform: rotate(180deg); }
  .facc[open] summary { border-bottom: 1px solid #eee; }
  .facc .flist { max-height: 260px; padding: 6px 16px 10px; }
}

/* ===== Historial de inventario ===== */
.inv-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin: 0 0 22px; }
.inv-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 0 12px; font: 500 15px var(--font-ui); color: #5f5f5f; cursor: pointer; }
.inv-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-color: var(--teal); }
.hist-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.hist-head p { margin: 0; font-size: 14px; color: #5f5f5f; }
.hist-head .btn { height: 42px; font-size: 14px; }
.htable { min-width: 900px; }
.htable td { vertical-align: middle; }
.htable td.num, .htable th.num { text-align: right; white-space: nowrap; }
.htable .pos, .tl .pos { color: #17603d; font-weight: 600; }
.htable .neg, .tl .neg { color: #9b1c15; font-weight: 600; }
.det2 { display: block; font-size: 12px; color: #6b6b6b; }
.sold { color: #9a9a9a; }
.muted { color: #b5b5b5; }
.htable td.nota { color: #4a4a4a; font-size: 13px; max-width: 260px; }
.ac-sal { background: #fde2e1; color: #9b1c15; } .ac-ent { background: #dcf3e6; color: #17603d; } .ac-aj { background: #fff1c2; color: #7a4a00; }
.tl { display: flex; flex-direction: column; gap: 0; border-left: 2px solid #e6eced; margin-left: 6px; }
.tl-i { position: relative; display: flex; gap: 14px; padding: 0 0 18px 18px; }
.tl-dot { position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #bdbdbd; border: 2px solid #fff; }
.tl-sal { background: #c0392b; } .tl-ent, .tl-new { background: #2e9e6a; } .tl-aj { background: #d4a106; }
.tl-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.tl-st { font-size: 13px; color: #3f3f3f; }
.tl-meta { font-size: 12px; color: #6b6b6b; margin-top: 4px; }
@media (max-width: 760px) { .inv-tabs { gap: 20px; } .htable { min-width: 760px; } }

.inv.hist-mode { grid-template-columns: 1fr; }
.inv.hist-mode .filters { display: none; }
.inv.hist-mode .inv-main { padding-left: var(--pad-x); }

/* Permisos: lo que el rol Editor no ve */
body[data-rol="editor"] .admin-only { display: none !important; }
.inv-search-row { display: contents; }
.mf select { width: 100%; height: 40px; border: 1px solid #bdbdbd; border-radius: 6px; padding: 0 10px; font: 14px var(--font-form); background: #fff; }
.pf-empty { text-align: center; color: #6b6b6b; padding: 36px 12px; }
.lock-note { background: #f5f7f7; border-radius: 10px; padding: 14px 16px; font-size: 14px; color: #3f3f3f; }
.pos { color: #17603d; font-weight: 600; }
.neg { color: #9b1c15; font-weight: 600; }
.ac-acc, .ac-in { white-space: nowrap; }
.pf-count:empty { display: none; }
