/* =========================================================
   Veterinaria "4 Patas" — Hoja de estilos
   Paleta: azul marino, azul y blanco
   ========================================================= */
:root {
  --navy: #0D3B66; --blue: #1565C0; --mid: #12488C; --pale: #E3F2FD; --pale2: #BBDEFB; --ink: #12263A;
  --muted: #5C7A94; --white: #fff; --line: #D5E3F0; --bg: #F5F9FD;
  --ok: #2E7D32; --okbg: #E8F5E9; --warn: #B26A00; --warnbg: #FFF4E0; --bad: #C62828; --badbg: #FDECEC;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
button { font: inherit; cursor: pointer; }
.paw { width: 22px; height: 22px; fill: currentColor; flex: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .center { text-align: center; }
.kicker { color: var(--blue); font-weight: 700; font-size: 12.5px; letter-spacing: 1.5px; text-transform: uppercase; }
.kicker.light { color: var(--pale2); }
h2 { font-size: 28px; color: var(--navy); margin: 4px 0 18px; }
.h2-small { font-size: 23px; }
h3 { color: var(--navy); font-size: 17px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

/* ---------- Botones y formularios ---------- */
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 700; background: var(--navy); color: #fff; text-align: center; }
.btn:hover { filter: brightness(1.12); }
.btn.blue { background: var(--blue); } .btn.alt { background: var(--pale); color: var(--navy); }
.btn.danger { background: var(--bad); } .full { width: 100%; }
.link { background: none; border: 0; color: var(--blue); font-weight: 600; padding: 0; }
.danger-text { color: var(--bad); }
.small-btn { font-size: 13px; font-weight: 700; background: var(--pale); color: var(--navy); padding: 5px 10px; border-radius: 8px; white-space: nowrap; }
label { display: block; font-size: 14px; font-weight: 600; color: var(--navy); margin: 12px 0 6px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 4px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.inline-label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.input, select { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; color: var(--ink); }
.input:focus, select:focus { outline: 2px solid var(--pale2); border-color: var(--blue); }
.input.slim { padding: 7px 10px; }
.toolbar .input:not(.slim) { min-width: 220px; flex: 1; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.readonly { padding: 10px 12px; background: var(--pale); border-radius: 10px; font-weight: 700; }
.form-card { max-width: 720px; } .form-card.narrow { max-width: 440px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.inline { display: inline; } .inline-edit { display: flex; gap: 8px; align-items: center; }
.danger-zone { max-width: 720px; margin-top: 16px; border-color: #F3C4C4; }
.danger-zone p { margin: 4px 0 10px; }

/* ---------- Mensajes ---------- */
.msg { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; font-size: 14.5px; }
.msg.ok { background: var(--okbg); color: var(--ok); } .msg.err { background: var(--badbg); color: var(--bad); }
.msg.warn { background: var(--warnbg); color: var(--warn); }

/* ---------- Tarjetas, grillas, etiquetas ---------- */
.grid { display: grid; gap: 16px; }
.g5 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.badge { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.b-rx { background: #EDE7F6; color: #4527A0; } .b-soft { background: var(--pale); color: var(--navy); font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.b-ok { background: var(--okbg); color: var(--ok); } .b-low { background: var(--warnbg); color: var(--warn); } .b-out { background: var(--badbg); color: var(--bad); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); font-weight: 600; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.empty { color: var(--muted); padding: 24px; text-align: center; }

/* ---------- Parte pública ---------- */
.pub-head { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.pub-head .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--navy); font-size: 19px; }
.brand .logo { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; }
.pub-nav { display: flex; gap: 4px; margin-left: auto; }
.pub-nav a { padding: 8px 12px; border-radius: 8px; font-size: 15px; color: var(--muted); font-weight: 600; }
.pub-nav a.on, .pub-nav a:hover { color: var(--navy); background: var(--pale); }
.pub-nav a.cta { background: var(--navy); color: #fff; }
.menu-btn { display: none; margin-left: auto; background: var(--pale); border: 0; border-radius: 8px; font-size: 20px; padding: 4px 12px; color: var(--navy); }
.hero { background: var(--navy); color: #fff; padding: 56px 0 64px; position: relative; overflow: hidden; }
.hero h1 { font-size: 38px; line-height: 1.15; max-width: 640px; margin-top: 6px; }
.hero p { color: var(--pale2); font-size: 18px; margin: 12px 0 26px; max-width: 580px; }
.hero .wrap { position: relative; z-index: 1; }
.hero .bgpaw { position: absolute; z-index: 0; right: -40px; bottom: -60px; width: 300px; height: 300px; fill: var(--mid); }
.search { display: flex; background: #fff; border-radius: 12px; overflow: hidden; max-width: 580px; position: relative; z-index: 1; }
.search input { flex: 1; border: 0; padding: 15px 16px; font-size: 16px; outline: none; color: var(--ink); min-width: 0; }
.search button { border: 0; background: var(--blue); color: #fff; padding: 0 22px; font-weight: 700; }
section.block { padding: 44px 0; } section.soft { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 30px 0; }
.cat-card { text-align: center; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(13, 59, 102, .10); }
.cat-card .ic { width: 58px; height: 58px; border-radius: 50%; background: var(--pale); display: grid; place-items: center; margin: 0 auto 10px; font-size: 27px; }
.cat-card b { display: block; color: var(--navy); } .cat-card span { color: var(--muted); font-size: 13.5px; }
.mini { display: flex; align-items: center; gap: 10px; background: var(--pale); border-radius: 12px; padding: 12px 16px; font-weight: 600; color: var(--navy); }
.mini span { font-size: 20px; }
.info b { color: var(--navy); display: block; margin-bottom: 4px; } .info span { color: var(--muted); }
.prod { display: flex; flex-direction: column; gap: 6px; }
.prod .cat { font-size: 12px; color: var(--blue); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.prod b { color: var(--navy); font-size: 16px; } .prod .desc { color: var(--muted); font-size: 13.5px; }
.prod .row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; gap: 8px; }
.prod .ask { font-size: 13px; font-weight: 600; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.price { font-weight: 700; }
.login { max-width: 400px; margin: 0 auto; }
.login h2 { text-align: center; }
.login-logo { width: 64px; height: 64px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; margin: 0 auto 6px; }
.login-logo .paw { width: 32px; height: 32px; }
.pub-foot { background: var(--navy); color: var(--pale2); padding: 24px 0; font-size: 14px; margin-top: 20px; }
.pub-foot b { color: #fff; } .pub-foot a { color: #fff; font-weight: 600; }
.foot-grid { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-right { text-align: right; } .foot-note { opacity: .7; font-size: 12.5px; }

/* ---------- Panel privado ---------- */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; }
.side .brand { color: #fff; margin-bottom: 22px; font-size: 17px; }
.side .brand .logo { background: var(--mid); }
.side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--pale2); font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.side a.on, .side a:hover { background: var(--mid); color: #fff; }
.side .sep { border-top: 1px solid #23517F; margin: 14px 0; }
.side .count { margin-left: auto; background: var(--bad); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; }
.side-user { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid #23517F; font-size: 14px; color: #fff; }
.side-user small { color: var(--pale2); }
.main { padding: 24px 28px 40px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.topbar h2 { margin: 2px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { color: var(--ink); } .stat .n { font-size: 34px; font-weight: 800; color: var(--navy); }
.stat .l { color: var(--muted); font-size: 14px; font-weight: 600; }
.stat.dark { background: var(--navy); border-color: var(--navy); } .stat.dark .n { color: #fff; } .stat.dark .l { color: var(--pale2); }
.stat.warn .n { color: var(--warn); } .stat.bad .n { color: var(--bad); }
.tbl { border: 1px solid var(--line); border-radius: 14px; overflow: auto; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: middle; }
th { background: var(--pale); color: var(--navy); font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.acciones { white-space: nowrap; } .acciones a, .acciones .link { margin-right: 10px; font-size: 14px; font-weight: 600; }
.tipo-e { color: var(--ok); font-weight: 700; } .tipo-s { color: var(--bad); font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.two.wide-right { grid-template-columns: 360px 1fr; }
.two > * { min-width: 0; }
.print-head { display: none; }

/* ---------- Celular ---------- */
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 12px; }
  .side .brand { width: 100%; margin-bottom: 6px; }
  .side nav { display: contents; }
  .side a { padding: 7px 10px; font-size: 14px; }
  .side .sep, .side-user { display: none; }
  .two, .two.wide-right, .frow { grid-template-columns: 1fr; }
  .main { padding: 18px 14px 30px; }
  .hero h1 { font-size: 29px; }
  .hero .bgpaw { width: 180px; height: 180px; opacity: .45; right: -50px; bottom: -40px; }
  .g5 { grid-template-columns: repeat(2, 1fr); }
  .cat-card { padding: 14px 10px; }
  .menu-btn { display: block; }
  .pub-nav { display: none; width: 100%; flex-direction: column; padding-bottom: 10px; }
  .pub-head .wrap { flex-wrap: wrap; }
  body.menu-abierto .pub-nav { display: flex; }
  .foot-right { text-align: left; }
}

/* ---------- Impresión de reportes ---------- */
@media print {
  .side, .actions, .no-print, .toolbar, .msg { display: none !important; }
  .admin { display: block; } .main { padding: 0; }
  .print-head { display: block; margin-bottom: 12px; }
  .tbl { border: 0; } th { background: #eee !important; }
  body { background: #fff; }
}

/* Logo de la veterinaria */
.logo-img { width: 46px; height: 46px; border-radius: 50%; flex: none; box-shadow: 0 1px 4px rgba(0,0,0,.18); background: #fff; }
.side .logo-img { width: 40px; height: 40px; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.login-logo-img { display: block; width: 110px; height: 110px; margin: 0 auto 10px; border-radius: 50%; box-shadow: 0 4px 14px rgba(13,59,102,.2); }
.foot-brand { display: flex; align-items: center; gap: 14px; }
.foot-brand img { width: 56px; height: 56px; border-radius: 50%; flex: none; background: #fff; }
.hero-logo { position: absolute; z-index: 1; right: 9%; top: 50%; transform: translateY(-50%); width: 220px; height: 220px; border-radius: 50%; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
@media (max-width: 900px) { .hero-logo { display: none; } }
