@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* =============================================================
   VETPRO DESIGN SYSTEM  v4.0 (SAP SuccessFactors Theme)
   Grid module : 44px  |  Base unit : 4px
   Font        : Inter
   ============================================================= */

:root {
  /* ── Grid ──────────────────────────────────────────────── */
  --g:   44px;   /* module */
  --g-h: 22px;   /* ½ module */
  --g-q: 11px;   /* ¼ module */

  /* ── Spacing (4 px base) ───────────────────────────────── */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-11: 44px;

  /* ── Typography ────────────────────────────────────────── */
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  --fs-10: 10px;   /* caption / label */
  --fs-12: 12px;
  --fs-13: 13px;   /* secondary text */
  --fs-14: 14px;   /* body */
  --fs-16: 16px;   /* sub-heading */
  --fs-20: 20px;   /* section title */
  --fs-24: 24px;   /* page title */
  --fs-32: 32px;   /* display */

  /* ── Colors ────────────────────────────────────────────── */
  --c-bg:           #f2f5f8;   /* SAP Main Body Background */
  --c-surface:      #FFFFFF;   /* SAP White card background */
  --c-surface-2:    #fafafa;   /* SAP Light gray card headers */
  --c-border:       #d9d9d9;   /* SAP Border Gray */
  --c-border-s:     #cccccc;

  --c-primary:      #0070f2;   /* SAP Blue */
  --c-primary-h:    #0059c1;   /* SAP Darker Blue/Hover */
  --c-primary-bg:   #eff6ff;   /* SAP active/light blue background */
  --c-primary-text: #0070f2;   /* SAP Blue text */

  --c-success:      #107e3e;   /* SAP Success Green */
  --c-success-bg:   #f4fdf8;   /* SAP Success Green Light BG */
  --c-warning:      #d97706;   /* SAP Warning Orange */
  --c-warning-bg:   #fffbeb;   /* SAP Warning Orange Light BG */
  --c-danger:       #bb0000;   /* SAP Danger Red */
  --c-danger-bg:    #fff5f5;   /* SAP Danger Red Light BG */
  --c-info:         #0070f2;
  --c-info-bg:      #eff6ff;
  --c-purple:       #bb0000;   /* Mapped to SAP Danger */
  --c-purple-bg:    #fff5f5;

  --c-text:         #32363a;   /* SAP Primary text color */
  --c-text-2:       #4a4e52;   /* SAP Secondary text color */
  --c-text-muted:   #6a6d70;   /* SAP Label/Muted text color */
  --c-text-ph:      #96999c;

  /* ── Shadows ───────────────────────────────────────────── */
  --sh-xs: 0 1px 2px rgba(0,0,0,.05);
  --sh-sm: 0 0.125rem 0.5rem 0 rgba(0,0,0,.05);
  --sh-md: 0 4px 12px rgba(0,0,0,.08);
  --sh-lg: 0 8px 24px rgba(0,0,0,.10);
  --sh-xl: 0 16px 48px rgba(0,0,0,.12);
  --sh-focus: 0 0 0 3px rgba(0,112,242,.18);

  /* ── Radii ─────────────────────────────────────────────── */
  --r-xs: 2px;                 /* SAP has sharper corners */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;

  /* ── Transitions ───────────────────────────────────────── */
  --t-fast:   100ms ease;
  --t-base:   150ms ease;
  --t-slow:   250ms ease;
  --t-spring: 300ms cubic-bezier(.34,1.56,.64,1);
  --t-smooth: 250ms cubic-bezier(.4,0,.2,1);

  /* ── Shell ─────────────────────────────────────────────── */
  --sidebar-w:    220px;
  --sidebar-mini: 56px;
  --topbar-h:     52px;

  /* ── Legacy aliases (keep templates working) ───────────── */
  --font-sans:           var(--font);
  --color-brand-primary: var(--c-primary);
  --color-wow-bg:        var(--c-bg);
  --color-wow-border:    var(--c-border);
  --color-wow-text-main: var(--c-text);
  --color-wow-text-muted:var(--c-text-muted);
  --shadow-wow:          var(--sh-sm);
  --shadow-wow-lg:       var(--sh-md);
}

/* ─── RESET ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
}

/* ─── SCROLLBAR ─────────────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar          { width: 4px; height: 4px; }
.custom-scrollbar::-webkit-scrollbar-track    { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb    { background: var(--c-border); border-radius: 99px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--c-border-s); }

/* ─── CARD ──────────────────────────────────────────────── */
.card-container {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--sh-sm);
  padding: var(--sp-6);
}

/* ─── LABELS / BADGES ───────────────────────────────────── */
.clinical-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  font-size: var(--fs-10);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid;
  white-space: nowrap;
}

.label-clinical {
  display: block;
  font-size: var(--fs-10);
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 3px;
}

.data-clinical {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--c-text);
}

/* ─── SIDEBAR NAV ───────────────────────────────────────── */
.sidebar-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 16px 6px;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid #f2f2f2;
  margin-bottom: 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  border-top: none;
  border-right: none;
  border-bottom: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.sidebar-item svg {
  flex-shrink: 0;
  opacity: 0.75;
  transition: all 0.2s ease;
}

.sidebar-item:hover {
  background-color: var(--c-bg);
  color: var(--c-text);
}

.sidebar-item:hover svg {
  opacity: 1;
  color: var(--c-text);
}

.sidebar-item.active {
  background-color: var(--c-primary-bg);
  color: var(--c-primary);
  border-left-color: var(--c-primary);
  font-weight: 600;
}

.sidebar-item.active svg {
  opacity: 1;
  color: var(--c-primary);
}

.sidebar-item.danger:hover {
  background-color: var(--c-danger-bg);
  color: var(--c-danger);
  border-left-color: var(--c-danger);
}

.sidebar-item.danger:hover svg {
  color: var(--c-danger);
}

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 34px;
  padding: 0 var(--sp-4);
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(59,113,254,.25);
  transition:
    background var(--t-base),
    box-shadow var(--t-base),
    transform var(--t-fast);
}

.btn-primary:hover {
  background: var(--c-primary-h);
  box-shadow: 0 3px 10px rgba(59,113,254,.32);
}

.btn-primary:active { transform: scale(.97); }

/* ─── STATUS BADGES ─────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-xs);
  font-size: var(--fs-10);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid;
}

.status-grave,
.status-emergencia   { background: var(--c-danger-bg);  color: var(--c-danger);  border-color: #FECACA; }
.status-critico,
.status-mortal,
.status-parvovirus   { background: var(--c-purple-bg);  color: var(--c-purple);  border-color: #DDD6FE; }
.status-monitoreo,
.status-observacion  { background: var(--c-primary-bg); color: var(--c-primary); border-color: #BFDBFE; }
.status-estable,
.status-alta         { background: var(--c-success-bg); color: var(--c-success); border-color: #A7F3D0; }
.status-fallecido    { background: var(--c-surface-2);  color: var(--c-text-muted); border-color: var(--c-border); }

/* ─── SCROLLBAR (duplicate alias) ──────────────────────── */

/* ─── LOGIN ─────────────────────────────────────────────── */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  padding: var(--sp-6);
}

.login-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-11);
  box-shadow: var(--sh-lg);
  max-width: 440px;
  width: 100%;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo h1 {
  font-size: var(--fs-24);
  font-weight: 800;
  color: var(--c-primary);
  letter-spacing: -0.04em;
  margin-bottom: var(--sp-2);
}

.login-logo p {
  font-size: var(--fs-13);
  color: var(--c-text-muted);
  font-weight: 500;
}

.form-group {
  margin-bottom: var(--sp-5);
}

.form-group label {
  display: block;
  font-size: var(--fs-10);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.form-group input {
  width: 100%;
  height: 44px;
  padding: 0 var(--sp-4);
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--c-text);
  outline: none;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.form-group input:focus {
  border-color: var(--c-primary);
  box-shadow: var(--sh-focus);
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--fs-14);
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59,113,254,.25);
  transition:
    background var(--t-base),
    box-shadow var(--t-base),
    transform var(--t-fast);
}

.btn-login:hover {
  background: var(--c-primary-h);
  box-shadow: 0 4px 16px rgba(59,113,254,.35);
  transform: translateY(-1px);
}

.btn-login:active { transform: scale(.98); }

.error-message {
  background: var(--c-danger-bg);
  border: 1px solid #FECACA;
  color: var(--c-danger);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-13);
  font-weight: 600;
  margin-bottom: var(--sp-5);
}

/* ─── SHELL LAYOUT ──────────────────────────────────────── */
.app-container {
  display: flex;
  min-height: 100vh;
  background: var(--c-bg);
}

.sidebar {
  position: fixed;
  inset-y: 0;
  left: 0;
  width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--t-smooth), transform var(--t-smooth);
}

.sidebar-logo h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-text);
}

.sidebar-menu { padding: var(--sp-4); }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: var(--sp-6);
  min-height: 100vh;
  transition: margin-left var(--t-smooth);
}

/* ─── PET CARDS ─────────────────────────────────────────── */
.pets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-6);
  margin-top: var(--sp-6);
}

.pet-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--sh-sm);
  padding: var(--sp-6);
  text-decoration: none;
  color: inherit;
  display: block;
  transition:
    box-shadow var(--t-base),
    transform var(--t-base),
    border-color var(--t-base);
}

.pet-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: var(--c-border-s);
}

.pet-header {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.pet-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  background: var(--c-primary-bg);
  border: 1px solid #C7D7FC;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-primary);
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}

.pet-info h3 {
  font-size: var(--fs-16);
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}

.pet-info p {
  font-size: var(--fs-12);
  font-weight: 500;
  color: var(--c-text-muted);
}

.pet-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-label {
  font-size: var(--fs-10);
  font-weight: 700;
  color: var(--c-text-ph);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.detail-value {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--c-text);
}

/* ─── TABLES ────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }

thead tr {
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}

th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: var(--fs-10);
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

td {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-surface-2);
  vertical-align: middle;
}

tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: #F8FAFF; }
tbody tr:last-child td { border-bottom: none; }

/* ─── MODAL ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  overflow-y: auto;
  animation: fade-in var(--t-base) ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-content {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  width: 100%;
  overflow: hidden;
  animation: modal-in 220ms cubic-bezier(.34,1.56,.64,1);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ─── FORM INPUTS (global reset) ────────────────────────── */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
input[type="password"],
input[type="tel"],
input[type="search"],
select,
textarea {
  font-family: var(--font);
}

/* ─── ORIENTATION OVERLAY ───────────────────────────────── */
#orientation-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--c-text);
  color: #fff;
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-8);
}

@media (max-width: 1024px) and (orientation: portrait) {
  #orientation-overlay { display: flex; }
  body { overflow: hidden; }
}

.rotate-icon { animation: rotate-device 2.5s ease-in-out infinite; }

@keyframes rotate-device {
  0%,100% { transform: rotate(0deg); }
  40%,60%  { transform: rotate(90deg); }
}

/* ─── RESPONSIVE SIDEBAR ────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar     { transform: translateX(-100%); }
  .main-content { margin-left: 0 !important; }
}
  text-transform: uppercase;
