/* =========================
   VetHC - style.css
   Mobile first
   ========================= */

:root {
  --bg: #F7F9FC;
  --surface: #FFFFFF;
  --surface-soft: #F1F5F9;
  --border: #D9E2EC;
  --text: #243447;
  --muted: #5B6B7A;

  --primary: #2F5D62;
  --primary-dark: #25494D;
  --primary-soft: rgba(47, 93, 98, 0.10);

  --success: #7BAE7F;
  --success-soft: rgba(123, 174, 127, 0.16);

  --warning: #D9A441;
  --warning-soft: rgba(217, 164, 65, 0.16);

  --danger: #C65A5A;
  --danger-soft: rgba(198, 90, 90, 0.16);

  --info: #7DA8C7;
  --info-soft: rgba(125, 168, 199, 0.16);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 10px;

  --shadow: 0 10px 30px rgba(36, 52, 71, 0.08);
  --shadow-sm: 0 4px 14px rgba(36, 52, 71, 0.06);

  --container-max: 920px;
  --topbar-height: 78px;
}

/* =========================
   Reset / base
   ========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Inter, Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* =========================
   Layout
   ========================= */

.app-shell {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

.page-wrap {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem;
}

.content-wrap {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem;
}

.stack-gap > * + * {
  margin-top: 14px;
}

.hidden {
  display: none !important;
}

/* =========================
   Topbar / header
   ========================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  backdrop-filter: blur(10px);
  background: rgba(247, 249, 252, 0.92);
  border-bottom: 1px solid rgba(217, 226, 236, 0.85);
}

.topbar-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.75rem 1rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.app-header__center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.app-clinic-line {
  font-size: 24px;
  font-weight: 600;
  color: #5f6f81;
  text-align: center;
  white-space: nowrap;
}

.user-small {
  font-size: 11px;
  line-height: 1.1;
  color: var(--muted);
  text-align: left;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* .logo-mobile {
  height: 50px;
  width: auto;
} */

.logo-desktop {
  height: 50px;
  width: auto;
  
}

.brand-block {
  min-width: 0;
}

.brand-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.2;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 10px rgba(36, 52, 71, 0.04);
  transition: 0.2s ease;
}

.icon-btn:hover {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.icon-btn i {
  font-size: 1rem;
}

/* =========================
   Footer
   ========================= */

.site-footer {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem;
  text-align: center;
}

.site-footer small {
  color: var(--muted);
}

/* =========================
   Login
   ========================= */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 1rem;
}

.auth-logo {
  width: 84px;
  height: auto;
}

.auth-logo-desktop {
  width: 220px;
  height: auto;
}

.auth-title {
  margin: 0;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.auth-subtitle {
  margin: 0.2rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-form .form-row + .form-row {
  margin-top: 12px;
}

.auth-form .btn {
  margin-top: 14px;
  width: 100%;
}

/* =========================
   Cards / sections
   ========================= */

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-card + .section-card {
  margin-top: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem 1rem 0.75rem;
}

.section-head-start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.section-body {
  padding: 0 1rem 1rem;
}

.soft-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
}

/* =========================
   Hero paciente
   ========================= */

   .alert-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff4f4;
  border: 1px solid #efcaca;
  color: #8a2d2d;
  font-weight: 500;
}

.pet-hero {
  background: linear-gradient(135deg, rgba(47, 93, 98, 1) 0%, rgba(74, 125, 128, 1) 100%);
  color: #fff;
  border-radius: 0 0 26px 26px;
  box-shadow: var(--shadow);
}

.pet-hero-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem;
}

.pet-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pet-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  /* border: 1px solid rgba(255, 255, 255, 0.22); */
  font-size: 2rem;
  flex: 0 0 auto;
}

.pet-hero-content {
  flex: 1 1 auto;
  min-width: 0;
}

.pet-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pet-name {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.1;
  font-weight: 800;
  color: #fff;
}

.hero-sub {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.94rem;
  margin-top: 0.25rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.85rem;
}

.chip-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.82rem;
}

/* =========================
   Summary grid / stats
   ========================= */

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mini-stat {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
}

.mini-label {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.mini-value {
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text);
}

/* =========================
   Badges
   ========================= */

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  font-weight: 600;
  font-size: 0.76rem;
  line-height: 1;
  white-space: nowrap;
}

.bg-soft-success {
  background: var(--success-soft);
  color: #2f6c37;
}

.bg-soft-warning {
  background: var(--warning-soft);
  color: #8a620d;
}

.bg-soft-danger {
  background: var(--danger-soft);
  color: #8f2f2f;
}

.bg-soft-info {
  background: var(--info-soft);
  color: #285a7a;
}
.table-vacunas tbody tr.fila-vacuna-amarillo td {
  background: rgba(255, 235, 120, 0.18);
}

.table-vacunas tbody tr.fila-vacuna-naranja td {
  background: rgba(255, 166, 77, 0.18);
}

.table-vacunas tbody tr.fila-vacuna-rojo td {
  background: rgba(198, 90, 90, 0.16);
}
/* =========================
   Lists
   ========================= */

.list-clean {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item-soft {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
}

.list-item-soft-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
}

.list-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.list-title {
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.list-text {
  color: var(--muted);
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
}

.list-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--primary);
  flex: 0 0 auto;
}

.muted {
  color: var(--muted);
}

.bg-soft-yellow {
  background: rgba(255, 235, 120, 0.22);
  color: #7a6200;
}

.bg-soft-orange {
  background: rgba(255, 166, 77, 0.20);
  color: #8a4a00;
}
/* =========================
   Tabs nav
   ========================= */

.tabs-scroll {
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-scroll::-webkit-scrollbar {
  display: none;
}

.nav-pills-custom {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 0;
  margin: 0 0 0.8rem;
  list-style: none;
}

.nav-pills-custom .nav-link,
.tab-chip {
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.nav-pills-custom .nav-link.active,
.tab-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

.timeline-list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 11px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 34px;
  padding-bottom: 1rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--primary);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}

.timeline-title {
  font-weight: 700;
  color: var(--text);
}

.timeline-meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.1rem;
}

.timeline-text {
  margin-top: 0.35rem;
  color: var(--text);
}

/* =========================
   Forms
   ========================= */

.form-row + .form-row {
  margin-top: 12px;
}

.form-label {
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 0.92rem;
}

.form-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
}

.form-control,
.form-select,
.textarea-control {
  width: 100%;
  min-height: 48px;
  padding: 0.78rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: 0.2s ease;
  outline: none;
}

textarea.form-control,
.textarea-control {
  min-height: 110px;
  resize: vertical;
}

.form-control:focus,
.form-select:focus,
.textarea-control:focus {
  border-color: rgba(47, 93, 98, 0.45);
  box-shadow: 0 0 0 0.25rem rgba(47, 93, 98, 0.12);
}

.form-inline-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.form-inline-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* =========================
   Buttons
   ========================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  line-height: 1;
  transition: 0.2s ease;
}

.btn-sm {
  min-height: 38px;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  font-size: 0.88rem;
}

.btn-block,
.w-100 {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.btn-soft {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-soft:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.btn-danger-soft {
  background: var(--danger-soft);
  border-color: transparent;
  color: #8f2f2f;
}

.btn-linkish {
  background: transparent;
  border: none;
  color: var(--primary);
  padding: 0;
  min-height: auto;
}

/* =========================
   Search blocks
   ========================= */

.search-block .form-control {
  margin-bottom: 10px;
}

.search-result-empty {
  background: var(--surface-soft);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
}

/* =========================
   Data rows / key-value
   ========================= */

.data-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.data-item {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
}

.data-label {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.data-value {
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

/* =========================
   Tables
   ========================= */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table th,
.table td {
  padding: 0.85rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.table th {
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
}

.table tr:last-child td {
  border-bottom: none;
}

/* =========================
   Attachments / files
   ========================= */

.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
}

.file-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-info {
  flex: 1 1 auto;
  min-width: 0;
}

.file-title {
  font-weight: 700;
  margin: 0;
}

.file-meta {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 0.2rem;
}

.file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================
   Alerts
   ========================= */

.alert {
  border-radius: 14px;
  padding: 0.9rem 1rem;
  border: 1px solid transparent;
  font-size: 0.94rem;
}

.alert-info {
  background: var(--info-soft);
  color: #285a7a;
}

.alert-success {
  background: var(--success-soft);
  color: #2f6c37;
}

.alert-warning {
  background: var(--warning-soft);
  color: #8a620d;
}

.alert-danger {
  background: var(--danger-soft);
  color: #8f2f2f;
}

/* =========================
   Utility
   ========================= */

.text-center {
  text-align: center;
}

.text-end {
  text-align: right;
}

.fw-semibold {
  font-weight: 600;
}

.fw-bold {
  font-weight: 700;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 1rem;
}

.me-2 {
  margin-right: 0.5rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 1rem;
}

.d-flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.align-items-center {
  align-items: center;
}

.align-items-start {
  align-items: flex-start;
}

.justify-content-between {
  justify-content: space-between;
}

.justify-content-end {
  justify-content: flex-end;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-grow-1 {
  flex-grow: 1;
}

.min-w-0 {
  min-width: 0;
}

.tab-chip {
  cursor: pointer;
}

/* =========================
   Responsive
   ========================= */

@media (min-width: 768px) {
  .page-wrap,
  .content-wrap,
  .pet-hero-inner {
    padding: 1.25rem;
  }

  .logo-mobile {
    display: none;
  }

  .logo-desktop {
    display: block;
    height: 60px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .pet-hero {
    border-radius: 0 0 32px 32px;
  }

  .summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .data-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-inline-2 {
    grid-template-columns: 1fr 1fr;
  }

  .form-inline-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (min-width: 992px) {
  .topbar-inner {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .content-wrap,
  .page-wrap,
  .pet-hero-inner {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .auth-card {
    max-width: 460px;
    padding: 1.5rem;
  }
}