/* ============================================================
   VetClinic — Minimal Design System v1.5
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg:        #F7F6F3;
  --surface:   #FFFFFF;
  --border:    #E4E2DC;
  --border-lt: #EEECE7;

  --text:      #1A1917;
  --muted:     #7A796F;
  --dim:       #AEADA5;

  --accent:    #3F6B3A;
  --accent-lt: #EFF5EE;

  --warn:      #7A5C1E;
  --warn-lt:   #FEF6E7;
  --danger:    #8B2E2E;
  --danger-lt: #FDF0F0;
  --info:      #1E4F6B;
  --info-lt:   #EEF5FA;

  --radius:    6px;
  --radius-lg: 10px;
  --font:      'DM Sans', system-ui, sans-serif;
  --mono:      'DM Mono', monospace;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
}

.vet-app *, .vet-login-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

/* ── App Shell ──────────────────────────────────────────────── */
.vet-app {
  display: flex;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.vet-sidebar {
  width: 196px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.vet-sidebar-brand {
  padding: 26px 20px 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--border-lt);
}
.vet-brand-icon { font-size: 16px; line-height: 1; }
.vet-brand-name {
  font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text);
}

.vet-nav { padding: 10px 0; flex: 1; }

.vet-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .1s;
}
.vet-nav-item:hover  { color: var(--text); }
.vet-nav-item.active {
  color: var(--accent);
  font-weight: 500;
  border-left-color: var(--accent);
  background: var(--accent-lt);
}
.vet-nav-icon { font-size: 15px; line-height: 1; flex-shrink: 0; }
.vet-nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vet-nav-indicator { display: none; }

.vet-sidebar-footer { padding: 12px 20px; border-top: 1px solid var(--border-lt); }
.vet-version { font-size: 11px; font-family: var(--mono); color: var(--dim); }

/* ── Main ───────────────────────────────────────────────────── */
.vet-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.vet-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 30px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 16px;
  position: sticky; top: 0; z-index: 10;
}
.vet-main-header-inner { display: flex; align-items: center; gap: 10px; }
.vet-main-title { font-size: 15px; font-weight: 500; letter-spacing: -.01em; }

.vet-content-card { flex: 1; padding: 26px 30px; max-width: 940px; }

/* ── Alerts ─────────────────────────────────────────────────── */
.vet-alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.vet-alert-success { background: var(--accent-lt); color: var(--accent);  border-color: #C8DEC6; }
.vet-alert-error   { background: var(--danger-lt); color: var(--danger);  border-color: #F0CCCC; }
.vet-alert-info    { background: var(--info-lt);   color: var(--info);    border-color: #C0D8E8; }
.vet-alert a       { color: inherit; font-weight: 500; }

/* ── Forms ──────────────────────────────────────────────────── */
.vet-form { display: flex; flex-direction: column; gap: 15px; }
.vet-field { display: flex; flex-direction: column; gap: 5px; }
.vet-field label {
  font-size: 11.5px; font-weight: 500;
  color: var(--muted); letter-spacing: .03em; text-transform: uppercase;
}
.vet-field .req { color: var(--accent); }

.vet-field input,
.vet-field select,
.vet-field textarea {
  width: 100%; padding: 8px 11px;
  font-family: var(--font); font-size: 13.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); outline: none; -webkit-appearance: none;
  transition: border-color .12s; line-height: 1.5;
}
.vet-field input:focus, .vet-field select:focus, .vet-field textarea:focus { border-color: var(--accent); }
.vet-field input::placeholder, .vet-field textarea::placeholder { color: var(--dim); }
.vet-field textarea { resize: vertical; min-height: 72px; }

.vet-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vet-form-actions {
  display: flex; gap: 10px; align-items: center;
  padding-top: 8px; border-top: 1px solid var(--border-lt); margin-top: 4px;
}
.vet-edit-meta { font-size: 12px; color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--border-lt); margin-bottom: 4px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.vet-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; font-family: var(--font); font-size: 13px; font-weight: 500;
  border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: all .1s; line-height: 1;
}
.vet-btn-primary        { background: var(--accent); color:#fff; border-color: var(--accent); }
.vet-btn-primary:hover  { background: #325930; }
.vet-btn-ghost          { background: transparent; color: var(--muted); }
.vet-btn-ghost:hover    { background: var(--bg); color: var(--text); }
.vet-btn-outline        { background: transparent; color: var(--text); border-color: var(--border); }
.vet-btn-outline:hover  { border-color: var(--text); }
.vet-btn-danger         { background: var(--danger); color:#fff; border-color: var(--danger); }
.vet-btn-danger:hover   { background: #721F1F; }
.vet-btn-danger-outline { background: transparent; color: var(--danger); border-color: #F0CCCC; }
.vet-btn-danger-outline:hover { background: var(--danger-lt); }
.vet-btn-sm   { padding: 6px 12px; font-size: 12px; }
.vet-btn-full { width: 100%; justify-content: center; }

.vet-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; cursor: pointer;
  color: var(--muted); transition: all .1s; line-height: 1; text-decoration: none;
}
.vet-icon-btn:hover { border-color: var(--text); color: var(--text); background: var(--bg); }
.vet-icon-btn-danger { border-color: #F0CCCC; color: var(--danger); }
.vet-icon-btn-danger:hover { background: var(--danger-lt); border-color: var(--danger); }

/* ── Toolbar / Search ───────────────────────────────────────── */
.vet-citas-toolbar, .vet-search-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 18px; flex-wrap: wrap;
}
.vet-filter-form { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.vet-search-form { margin-bottom: 18px; }

.vet-search-input {
  padding: 8px 11px; font-family: var(--font); font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); outline: none; min-width: 200px;
}
.vet-search-input:focus { border-color: var(--accent); }

.vet-filter-select, .vet-filter-date {
  padding: 7px 10px; font-family: var(--font); font-size: 12.5px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); outline: none; -webkit-appearance: none;
}
.vet-filter-select:focus, .vet-filter-date:focus { border-color: var(--accent); }

/* ── Status Badges ──────────────────────────────────────────── */
.vet-estado-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 500;
  white-space: nowrap;
}
.vet-estado-badge::before {
  content: ''; display: block; width: 5px; height: 5px;
  border-radius: 50%; background: currentColor; opacity: .7;
}
.vet-estado-pendiente  { color: var(--warn);   background: var(--warn-lt); }
.vet-estado-confirmada { color: var(--accent);  background: var(--accent-lt); }
.vet-estado-completada { color: #1B5E34;        background: #E8F5ED; }
.vet-estado-cancelada  { color: var(--danger);  background: var(--danger-lt); }
.vet-stock-ok      { color: var(--accent); background: var(--accent-lt); }
.vet-stock-bajo    { color: var(--warn);   background: var(--warn-lt); }
.vet-stock-agotado { color: var(--danger); background: var(--danger-lt); }
.vet-venc-vencido  { color: var(--danger); font-weight: 500; }
.vet-venc-proximo  { color: var(--warn);   font-weight: 500; }

/* ── Registros ──────────────────────────────────────────────── */
.vet-records-layout {
  display: grid; grid-template-columns: 256px 1fr;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface);
}
.vet-client-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 620px; }
.vet-list-header {
  padding: 10px 16px; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--dim); border-bottom: 1px solid var(--border-lt);
  background: var(--bg); position: sticky; top: 0;
}
.vet-client-card {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-lt);
  text-decoration: none; transition: background .08s;
}
.vet-client-card:hover    { background: var(--bg); }
.vet-client-card.selected { background: var(--accent-lt); }
.vet-client-avatar {
  width: 32px; height: 32px; border-radius: var(--radius);
  background: var(--border); color: var(--muted); font-size: 11.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.vet-client-card.selected .vet-client-avatar { background: var(--accent); color: #fff; }
.vet-client-info { flex: 1; min-width: 0; }
.vet-client-name  { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vet-client-meta  { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vet-client-badge { font-size: 11px; color: var(--dim); white-space: nowrap; padding-top: 1px; }

.vet-client-detail { padding: 22px; overflow-y: auto; max-height: 620px; }
.vet-detail-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 300px; gap: 10px; color: var(--dim);
}
.vet-detail-empty-icon { font-size: 28px; opacity: .35; }
.vet-detail-empty p { font-size: 13px; }

.vet-detail-section { margin-bottom: 26px; }
.vet-detail-section:last-child { margin-bottom: 0; }
.vet-detail-heading-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border-lt);
}
.vet-detail-heading { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); }
.vet-detail-actions { display: flex; gap: 6px; }
.vet-detail-grid { display: grid; grid-template-columns: 1fr 1fr; }
.vet-detail-field {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 0; border-bottom: 1px solid var(--border-lt);
}
.vet-detail-field:nth-child(odd) { padding-right: 18px; }
.vet-detail-full { grid-column: 1/-1; padding-right: 0; }
.vet-detail-label { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.vet-detail-value { font-size: 13.5px; color: var(--text); }
.vet-detail-value em { color: var(--dim); font-style: normal; }

.vet-pets-grid { display: flex; flex-direction: column; gap: 8px; }
.vet-pet-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.vet-pet-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.vet-pet-icon { font-size: 20px; flex-shrink: 0; }
.vet-pet-header-info { flex: 1; min-width: 0; }
.vet-pet-name    { font-size: 14px; font-weight: 500; }
.vet-pet-species { font-size: 12px; color: var(--muted); }
.vet-pet-card-actions { display: flex; gap: 5px; }
.vet-pet-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.vet-pet-tag {
  padding: 2px 8px; border-radius: 20px; font-size: 11.5px;
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
}
.vet-pet-notes { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ── Citas ──────────────────────────────────────────────────── */
.vet-citas-list { display: flex; flex-direction: column; gap: 6px; }
.vet-cita-row {
  display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; transition: box-shadow .1s;
}
.vet-cita-row:hover { box-shadow: var(--shadow-sm); }
.vet-cita-hoy { border-left: 3px solid var(--accent); }

.vet-cita-fecha-bloque {
  padding: 14px 16px; text-align: center; flex-shrink: 0;
  border-right: 1px solid var(--border-lt); background: var(--bg); min-width: 62px;
}
.vet-cita-dia  { font-size: 20px; font-weight: 600; line-height: 1; }
.vet-cita-mes  { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 2px; }
.vet-cita-hora { font-size: 11px; font-family: var(--mono); color: var(--accent); margin-top: 3px; }

.vet-cita-body { flex: 1; padding: 12px 16px; min-width: 0; }
.vet-cita-titulo { font-size: 13.5px; font-weight: 500; margin-bottom: 3px; }
.vet-cita-sep    { color: var(--dim); margin: 0 5px; }
.vet-cita-pet    { font-weight: 400; color: var(--muted); }
.vet-cita-motivo { font-size: 12.5px; color: var(--muted); }
.vet-cita-notas  { font-size: 12px; color: var(--dim); margin-top: 2px; }

.vet-cita-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  padding: 12px 14px; border-left: 1px solid var(--border-lt); flex-shrink: 0;
}
.vet-cita-btns { display: flex; gap: 4px; }

/* ── Inventario ─────────────────────────────────────────────── */
.vet-inv-summary { display: flex; gap: 10px; margin-bottom: 18px; }
.vet-inv-stat {
  flex: 1; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); display: flex; flex-direction: column; gap: 3px;
}
.vet-inv-stat-warn.active   { border-color: #E8D0A0; background: var(--warn-lt); }
.vet-inv-stat-danger.active { border-color: #E8B8B8; background: var(--danger-lt); }
.vet-inv-stat-num {
  font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1;
}
.vet-inv-stat-warn.active   .vet-inv-stat-num { color: var(--warn); }
.vet-inv-stat-danger.active .vet-inv-stat-num { color: var(--danger); }
.vet-inv-stat-lbl { font-size: 11.5px; color: var(--muted); }

.vet-inv-table-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.vet-inv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vet-inv-table th {
  padding: 9px 14px; text-align: left; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--dim);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.vet-inv-table td { padding: 11px 14px; border-bottom: 1px solid var(--border-lt); }
.vet-inv-table tbody tr:last-child td { border-bottom: none; }
.vet-inv-table tbody tr:hover { background: var(--bg); }
.vet-med-nombre    { font-weight: 500; }
.vet-med-proveedor { font-size: 11.5px; color: var(--dim); margin-top: 1px; }
.vet-stock-num     { font-family: var(--mono); }
.vet-stock-min     { font-size: 11px; color: var(--dim); }
.vet-cat-tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; background: var(--bg); border: 1px solid var(--border); color: var(--muted);
}

.vet-med-detalle-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.vet-med-detalle-icon   { font-size: 24px; }
.vet-med-detalle-nombre { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.vet-med-detalle-stock  { font-size: 12.5px; color: var(--muted); }

.vet-historial-panel { width: 230px; flex-shrink: 0; }
.vet-historial-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); margin-bottom: 12px; }
.vet-historial-list  { display: flex; flex-direction: column; gap: 8px; }
.vet-historial-row { display: flex; gap: 10px; align-items: flex-start; padding-bottom: 8px; border-bottom: 1px solid var(--border-lt); }
.vet-historial-row:last-child { border-bottom: none; padding-bottom: 0; }
.vet-mov-tipo { padding: 2px 7px; border-radius: 20px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; flex-shrink: 0; }
.vet-mov-tipo.entrada { background: var(--accent-lt); color: var(--accent); }
.vet-mov-tipo.salida  { background: var(--warn-lt);   color: var(--warn); }
.vet-mov-cantidad { font-size: 12.5px; font-family: var(--mono); }
.vet-mov-motivo   { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.vet-mov-fecha    { font-size: 11px;   color: var(--dim);   margin-top: 1px; }

/* ── Modal ──────────────────────────────────────────────────── */
.vet-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,25,23,.4);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 24px;
}
.vet-modal-box {
  background: var(--surface); border-radius: var(--radius-lg); padding: 28px;
  max-width: 380px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.14);
  border: 1px solid var(--border);
}
.vet-modal-icon  { font-size: 26px; margin-bottom: 12px; }
.vet-modal-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.vet-modal-text  { font-size: 13px; color: var(--muted); margin-bottom: 22px; line-height: 1.55; }
.vet-modal-text strong { color: var(--text); }
.vet-modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 18px; border-top: 1px solid var(--border-lt);
}

/* ── Login ──────────────────────────────────────────────────── */
.vet-login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh; padding: 40px 24px; font-family: var(--font);
}
.vet-login-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px; width: 100%; max-width: 340px;
}
.vet-login-logo { font-size: 30px; margin-bottom: 16px; }
.vet-login-box h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.vet-login-box p  { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.vet-login-box .vet-field { margin-bottom: 14px; }
.vet-login-box .vet-btn-full { margin-top: 6px; padding: 10px; }

/* ── Diagnosticos ───────────────────────────────────────────── */
.vet-diag-list { display: flex; flex-direction: column; gap: 6px; }
.vet-diag-row {
  display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; transition: box-shadow .1s;
}
.vet-diag-row:hover { box-shadow: var(--shadow-sm); }

.vet-diag-fecha-bloque {
  padding: 14px 16px; text-align: center; flex-shrink: 0;
  border-right: 1px solid var(--border-lt); background: var(--bg); min-width: 62px;
}
.vet-diag-body { flex: 1; padding: 12px 16px; min-width: 0; }
.vet-diag-titulo { font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }
.vet-diag-texto  { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.vet-diag-vet    { font-size: 11.5px; color: var(--dim); margin-top: 3px; }

/* Ficha */
.vet-ficha-wrap { display: flex; flex-direction: column; }
.vet-ficha-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 22px; border: 1px solid var(--border); background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; gap: 16px;
}
.vet-ficha-header-left  { display: flex; flex-direction: column; gap: 3px; }
.vet-ficha-badge  { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .07em; }
.vet-ficha-fecha  { font-size: 15px; font-weight: 500; }
.vet-ficha-vet    { font-size: 12.5px; color: var(--muted); }
.vet-ficha-header-actions { display: flex; gap: 8px; align-items: flex-start; }

.vet-ficha-cols {
  display: grid; grid-template-columns: 210px 1fr;
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; background: var(--surface);
}
.vet-ficha-aside { border-right: 1px solid var(--border); display: flex; flex-direction: column; }

.vet-ficha-section { padding: 16px 16px; border-bottom: 1px solid var(--border-lt); }
.vet-ficha-section:last-child { border-bottom: none; }
.vet-ficha-section-title {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--dim); margin-bottom: 10px;
}
.vet-ficha-dato {
  display: flex; flex-direction: column; gap: 1px;
  padding: 5px 0; border-bottom: 1px solid var(--border-lt); font-size: 13px;
}
.vet-ficha-dato:last-child { border-bottom: none; }
.vet-ficha-dato span { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }

.vet-ficha-main { padding: 18px; display: flex; flex-direction: column; gap: 10px; }

.vet-ficha-block { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.vet-ficha-block-primary { border-color: #C8DEC6; }
.vet-ficha-block-primary .vet-ficha-block-title { background: var(--accent-lt); color: var(--accent); }

.vet-ficha-block-title {
  padding: 7px 13px; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--dim); background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.vet-ficha-block-title-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 13px; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--dim); background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.vet-ficha-block-text { padding: 12px 13px; font-size: 13.5px; line-height: 1.65; }
.vet-ficha-empty { padding: 13px; font-size: 13px; color: var(--dim); font-style: italic; }

/* Receta card */
.vet-receta-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 2px; }
.vet-receta-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 13px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.vet-receta-num   { font-size: 11.5px; font-weight: 600; color: var(--accent); font-family: var(--mono); }
.vet-receta-fecha { font-size: 12px; color: var(--muted); }
.vet-receta-vet   { font-size: 12px; color: var(--dim); font-style: italic; flex: 1; }

.vet-receta-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vet-receta-table th {
  padding: 7px 12px; text-align: left; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--dim);
  background: var(--bg); border-bottom: 1px solid var(--border-lt);
}
.vet-receta-table td { padding: 9px 12px; border-bottom: 1px solid var(--border-lt); }
.vet-receta-table tbody tr:last-child td { border-bottom: none; }
.vet-receta-nota-row td { background: var(--bg); font-size: 12px; color: var(--muted); padding: 5px 12px; }
.vet-receta-instrucciones {
  padding: 10px 13px; font-size: 12.5px; background: var(--warn-lt);
  border-top: 1px solid #E8D0A0; color: var(--warn); line-height: 1.5;
}

/* Receta form */
.vet-receta-items-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.vet-receta-items-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 13px; background: var(--bg); border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 500;
}
.vet-receta-item { padding: 14px 13px 4px; }
.vet-receta-item-row { display: flex; gap: 12px; align-items: flex-start; }
.vet-item-divider { border: none; border-top: 1px solid var(--border-lt); margin: 10px 0 0; }
.vet-receta-item:last-child .vet-item-divider { display: none; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 780px) {
  .vet-sidebar       { width: 50px; }
  .vet-nav-label, .vet-brand-name, .vet-sidebar-footer { display: none; }
  .vet-nav-item      { justify-content: center; padding: 11px; border-left-width: 0; border-bottom: 2px solid transparent; }
  .vet-nav-item.active { border-bottom-color: var(--accent); background: var(--accent-lt); }
  .vet-nav-icon      { font-size: 17px; }
  .vet-sidebar-brand { justify-content: center; padding: 16px 10px; }
  .vet-content-card  { padding: 18px 16px; }
  .vet-main-header   { padding: 13px 16px; }
  .vet-records-layout { grid-template-columns: 1fr; }
  .vet-client-list   { max-height: 260px; border-right: none; border-bottom: 1px solid var(--border); }
  .vet-form-row      { grid-template-columns: 1fr; }
  .vet-ficha-cols    { grid-template-columns: 1fr; }
  .vet-ficha-aside   { border-right: none; border-bottom: 1px solid var(--border); }
  .vet-ficha-header  { flex-direction: column; }
  .vet-receta-item-row { flex-wrap: wrap; }
  .vet-inv-summary   { flex-direction: column; }
  .vet-detail-grid   { grid-template-columns: 1fr; }
}

/* ============================================================
   v2.0 — Estadísticas, Historial, Facturación
   ============================================================ */

/* ── KPI Cards ──────────────────────────────────────────────── */
.vet-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.vet-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vet-kpi-accent { border-color: #C8DEC6; background: var(--accent-lt); }
.vet-kpi-warn   { border-color: #E8D0A0; background: var(--warn-lt); }
.vet-kpi-icon { font-size: 18px; line-height: 1; margin-bottom: 2px; }
.vet-kpi-num  { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.vet-kpi-lbl  { font-size: 11.5px; color: var(--muted); }
.vet-kpi-accent .vet-kpi-num { color: var(--accent); }
.vet-kpi-warn   .vet-kpi-num { color: var(--warn); }

/* ── Stats layout ────────────────────────────────────────────── */
.vet-stats-cols     { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.vet-stats-col-main { display: flex; flex-direction: column; gap: 14px; }
.vet-stats-col-side { display: flex; flex-direction: column; gap: 14px; }

.vet-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.vet-stat-card-warn { border-color: #E8D0A0; background: var(--warn-lt); }

.vet-stat-card-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--dim); margin-bottom: 14px;
}
.vet-stat-card-title-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--dim); margin-bottom: 12px;
}
.vet-stat-more { font-size: 11px; color: var(--accent); text-decoration: none; font-weight: 400; text-transform: none; letter-spacing: 0; }
.vet-stat-more:hover { text-decoration: underline; }
.vet-stat-empty { font-size: 12.5px; color: var(--dim); font-style: italic; }

/* ── Bar Chart (citas por mes) ──────────────────────────────── */
.vet-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100px;
}
.vet-bar-col   { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 4px; height: 100%; justify-content: flex-end; }
.vet-bar-num   { font-size: 10px; color: var(--muted); min-height: 14px; }
.vet-bar-track { width: 100%; flex: 1; display: flex; align-items: flex-end; background: var(--bg); border-radius: 3px 3px 0 0; overflow: hidden; max-height: 72px; }
.vet-bar-fill  { width: 100%; background: var(--border); border-radius: 3px 3px 0 0; min-height: 3px; transition: height .3s; }
.vet-bar-fill.current { background: var(--accent); }
.vet-bar-label { font-size: 10px; color: var(--dim); white-space: nowrap; }

/* ── Estado bars ────────────────────────────────────────────── */
.vet-estado-bars        { display: flex; flex-direction: column; gap: 8px; }
.vet-estado-bar-row     { display: flex; align-items: center; gap: 10px; }
.vet-estado-bar-lbl     { font-size: 12px; color: var(--muted); width: 80px; flex-shrink: 0; }
.vet-estado-bar-track   { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.vet-estado-bar-fill    { height: 100%; border-radius: 3px; min-width: 4px; }
.vet-estado-bar-fill.vet-estado-pendiente  { background: var(--warn); }
.vet-estado-bar-fill.vet-estado-confirmada { background: var(--accent); }
.vet-estado-bar-fill.vet-estado-completada { background: #1B5E34; }
.vet-estado-bar-fill.vet-estado-cancelada  { background: var(--danger); }
.vet-estado-bar-num     { font-size: 11.5px; font-family: var(--mono); color: var(--text); width: 24px; text-align: right; }

/* ── Mini list (diags + facturas recientes) ──────────────────── */
.vet-mini-list { display: flex; flex-direction: column; }
.vet-mini-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border-lt);
  text-decoration: none; color: var(--text); transition: background .08s;
}
.vet-mini-row:last-child { border-bottom: none; }
.vet-mini-row:hover { background: var(--bg); margin: 0 -18px; padding: 8px 18px; }
.vet-mini-date   { font-size: 11px; font-family: var(--mono); color: var(--dim); width: 40px; flex-shrink: 0; text-align: center; }
.vet-mini-body   { flex: 1; min-width: 0; }
.vet-mini-title  { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vet-mini-sub    { font-weight: 400; color: var(--muted); }
.vet-mini-text   { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.vet-mini-amount { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--accent); flex-shrink: 0; }
.vet-mini-badge  { display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.vet-mini-badge-success { background: var(--accent-lt); color: var(--accent); }
.vet-mini-badge-info    { background: var(--info-lt);   color: var(--info); }
.vet-mini-badge-dim     { background: var(--bg);        color: var(--dim); border: 1px solid var(--border); }
.vet-mini-badge-danger  { background: var(--danger-lt); color: var(--danger); }

/* ── Próximas citas ──────────────────────────────────────────── */
.vet-proximas-list { display: flex; flex-direction: column; gap: 6px; }
.vet-proxima-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  border: 1px solid var(--border-lt); background: var(--surface);
}
.vet-proxima-row.hoy { border-color: #C8DEC6; background: var(--accent-lt); }
.vet-proxima-fecha { flex-shrink: 0; text-align: center; min-width: 34px; }
.vet-proxima-dia   { font-size: 17px; font-weight: 600; line-height: 1; }
.vet-proxima-mes   { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.vet-proxima-info  { flex: 1; min-width: 0; }
.vet-proxima-pet   { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vet-proxima-owner { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.vet-proxima-motivo{ font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.vet-proxima-hora  { font-size: 11px; color: var(--dim); margin-top: 3px; }

/* ── Stock alerts ───────────────────────────────────────────── */
.vet-stock-alerts { display: flex; flex-direction: column; gap: 8px; }
.vet-stock-alert-row  { display: flex; flex-direction: column; gap: 5px; }
.vet-stock-alert-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vet-stock-alert-nombre { font-size: 12.5px; font-weight: 500; }
.vet-stock-alert-nums   { display: flex; align-items: center; gap: 8px; }
.vet-stock-alert-min    { font-size: 11px; color: var(--dim); }
.vet-stock-alert-bar    { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.vet-stock-alert-fill   { height: 100%; border-radius: 2px; min-width: 4px; }
.vet-stock-fill-bajo    { background: var(--warn); }
.vet-stock-fill-agotado { background: var(--danger); }

/* ── Historial — Selector de mascotas ───────────────────────── */
.vet-pets-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.vet-pet-selector-card {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; color: var(--text);
  transition: border-color .1s, box-shadow .1s;
}
.vet-pet-selector-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.vet-pet-sel-icon  { font-size: 24px; flex-shrink: 0; }
.vet-pet-sel-name  { font-size: 13.5px; font-weight: 500; }
.vet-pet-sel-sub   { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.vet-pet-sel-owner { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* ── Historial — Header de mascota ──────────────────────────── */
.vet-hist-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--surface);
  margin-bottom: 22px;
}
.vet-hist-pet-icon { font-size: 36px; flex-shrink: 0; }
.vet-hist-pet-info { flex: 1; min-width: 0; }
.vet-hist-pet-name { font-size: 18px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 3px; }
.vet-hist-pet-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.vet-hist-owner    { font-size: 12px; color: var(--dim); }
.vet-hist-stats    { display: flex; gap: 18px; flex-shrink: 0; }
.vet-hist-stat     { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vet-hist-stat-num { font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.vet-hist-stat-lbl { font-size: 10.5px; color: var(--dim); text-align: center; }

/* ── Timeline ────────────────────────────────────────────────── */
.vet-timeline { position: relative; }
.vet-timeline-year-group { margin-bottom: 24px; }
.vet-timeline-year-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; color: var(--dim); margin-bottom: 14px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border-lt);
}

.vet-tl-item {
  display: flex; gap: 14px; margin-bottom: 10px;
  padding-left: 8px; position: relative;
}
.vet-tl-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: -10px;
  width: 1px; background: var(--border);
}
.vet-tl-item:last-child::before { bottom: 50%; }

.vet-tl-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface);
  flex-shrink: 0; margin-top: 12px; position: relative; z-index: 1;
}
.vet-tl-diagnostico .vet-tl-dot { border-color: var(--accent); background: var(--accent); }
.vet-tl-cita        .vet-tl-dot { border-color: var(--info);   background: var(--info-lt); }
.vet-tl-receta      .vet-tl-dot { border-color: var(--warn);   background: var(--warn-lt); }

.vet-tl-card {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.vet-tl-diagnostico .vet-tl-card { border-left: 3px solid var(--accent); }
.vet-tl-cita        .vet-tl-card { border-left: 3px solid var(--info); }
.vet-tl-receta      .vet-tl-card { border-left: 3px solid var(--warn); }

.vet-tl-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--border-lt);
}
.vet-tl-card-body { padding: 10px 12px; }

.vet-tl-tipo-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500;
}
.vet-tl-tipo-diagnostico { color: var(--accent); }
.vet-tl-tipo-cita        { color: var(--info); }
.vet-tl-tipo-receta      { color: var(--warn); }

.vet-tl-fecha   { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.vet-tl-actions { margin-left: auto; display: flex; gap: 4px; }
.vet-tl-main-text { font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.vet-tl-sub-text  { font-size: 12px; color: var(--muted); line-height: 1.4; }
.vet-tl-vitals    { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.vet-tl-vital     { font-size: 11.5px; color: var(--muted); }
.vet-tl-vet       { font-size: 11.5px; color: var(--dim); margin-top: 5px; font-style: italic; }
.vet-tl-link      { font-size: 11.5px; color: var(--accent); text-decoration: none; }
.vet-tl-link:hover { text-decoration: underline; }

/* ── Facturación — estado badges ────────────────────────────── */
.vet-factura-success { color: #1B5E34; background: #E8F5ED; }
.vet-factura-info    { color: var(--info);   background: var(--info-lt); }
.vet-factura-dim     { color: var(--muted);  background: var(--bg); border: 1px solid var(--border); }
.vet-factura-danger  { color: var(--danger); background: var(--danger-lt); }

/* ── Factura form items ─────────────────────────────────────── */
.vet-fac-item { padding: 12px 13px 4px; }
.vet-fac-item-row { display: flex; gap: 12px; align-items: flex-start; }

/* ── Responsive v2 ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .vet-stats-cols { grid-template-columns: 1fr; }
  .vet-kpi-grid   { grid-template-columns: repeat(2, 1fr); }
  .vet-hist-header { flex-wrap: wrap; }
  .vet-hist-stats  { width: 100%; justify-content: space-around; }
  .vet-fac-item-row { flex-wrap: wrap; }
}
@media (max-width: 780px) {
  .vet-pets-selector-grid { grid-template-columns: 1fr 1fr; }
  .vet-kpi-grid           { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Historial / Timeline
   ============================================================ */

/* ── Intro + selector ──────────────────────────────────────── */
.vet-hist-intro {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.vet-hist-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.vet-hist-sel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color .1s, box-shadow .1s;
}
.vet-hist-sel-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.vet-hist-sel-icon  { font-size: 24px; flex-shrink: 0; line-height: 1; }
.vet-hist-sel-name  { font-size: 13.5px; font-weight: 500; }
.vet-hist-sel-sub   { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.vet-hist-sel-owner { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* ── Header de mascota ──────────────────────────────────────── */
.vet-hist-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.vet-hist-pet-icon {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}

.vet-hist-pet-info  { flex: 1; min-width: 180px; }
.vet-hist-pet-name  { font-size: 17px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 3px; }
.vet-hist-pet-meta  { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.vet-hist-owner     { font-size: 12px; color: var(--dim); }

.vet-hist-kpis {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}
.vet-hist-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.vet-hist-kpi-num { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.vet-hist-kpi-lbl { font-size: 10.5px; color: var(--dim); }

/* ── Timeline ───────────────────────────────────────────────── */
.vet-timeline { position: relative; }

.vet-tl-year-group { margin-bottom: 28px; }

.vet-tl-year-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--dim);
  padding-bottom: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-lt);
}

.vet-tl-item {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  padding-left: 6px;
  position: relative;
}

/* Línea vertical continua */
.vet-tl-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 20px;
  bottom: -10px;
  width: 1px;
  background: var(--border);
  z-index: 0;
}
.vet-tl-item:last-child::before { display: none; }

.vet-tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}
.vet-tl-diagnostico .vet-tl-dot { border-color: var(--accent); background: var(--accent); }
.vet-tl-cita        .vet-tl-dot { border-color: #1E4F6B; background: var(--info-lt); }
.vet-tl-receta      .vet-tl-dot { border-color: var(--warn); background: var(--warn-lt); }

/* Cards */
.vet-tl-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.vet-tl-diagnostico .vet-tl-card { border-left: 3px solid var(--accent); }
.vet-tl-cita        .vet-tl-card { border-left: 3px solid #1E4F6B; }
.vet-tl-receta      .vet-tl-card { border-left: 3px solid var(--warn); }

.vet-tl-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-lt);
}

.vet-tl-tipo {
  font-size: 11.5px;
  font-weight: 500;
  flex: 1;
}
.vet-tl-tipo-diagnostico { color: var(--accent); }
.vet-tl-tipo-cita        { color: #1E4F6B; }
.vet-tl-tipo-receta      { color: var(--warn); }

.vet-tl-fecha  { font-size: 11.5px; color: var(--muted); font-family: var(--mono); flex-shrink: 0; }
.vet-tl-action { flex-shrink: 0; }

.vet-tl-card-body { padding: 10px 12px; }

.vet-tl-main { font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.vet-tl-sub  { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 3px; }

.vet-tl-vitals {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.vet-tl-vital { font-size: 11.5px; color: var(--muted); }
.vet-tl-vet   { font-size: 11.5px; color: var(--dim); margin-top: 5px; font-style: italic; }
.vet-tl-link  { font-size: 11.5px; color: var(--accent); text-decoration: none; }
.vet-tl-link:hover { text-decoration: underline; }

@media (max-width: 780px) {
  .vet-hist-selector-grid { grid-template-columns: 1fr 1fr; }
  .vet-hist-header { gap: 12px; }
  .vet-hist-kpis   { width: 100%; justify-content: space-around; }
}
