@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;
  --g-h: 22px;
  --g-q: 11px;

  /* ── 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-10: 40px;
  --sp-11: 44px;

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

  --fs-10: 10px;
  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-32: 32px;

  /* ── Colors (SAP SuccessFactors Palette) ──────────────── */
  --c-bg:           #f5f7fa;
  --c-surface:      #ffffff;
  --c-surface-2:    #edeff2;
  --c-border:       #d9e0e8;
  --c-border-s:     #c0c8d2;

  --c-primary:      #0070f2;
  --c-primary-h:    #0057c2;
  --c-primary-bg:   #e6f2ff;
  --c-primary-text: #0070f2;

  --c-success:      #127e3e;
  --c-success-bg:   #edf5ef;
  --c-warning:      #d17e00;
  --c-warning-bg:   #fff8e6;
  --c-danger:       #bb0000;
  --c-danger-bg:    #fff0f0;
  --c-info:         #0070f2;
  --c-info-bg:      #e6f2ff;
  --c-purple:       #6a2c8f;
  --c-purple-bg:    #f3edf6;

  --c-text:         #1c232a;
  --c-text-2:       #38424f;
  --c-text-muted:   #6e7a89;
  --c-text-ph:      #9ba5b2;

  /* ── Shadows (SAP subtle) ──────────────────────────────── */
  --sh-xs: 0 1px 2px rgba(0,0,0,.04);
  --sh-sm: 0 1px 4px rgba(0,0,0,.06);
  --sh-md: 0 4px 12px rgba(0,0,0,.07);
  --sh-lg: 0 8px 24px rgba(0,0,0,.08);
  --sh-xl: 0 16px 40px rgba(0,0,0,.10);
  --sh-focus: 0 0 0 3px rgba(0,112,242,.2);

  /* ── Radii ─────────────────────────────────────────────── */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* ── 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 ────────────────────────────────────── */
  --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);
  transition: box-shadow var(--t-base), transform var(--t-base), border-color var(--t-base);
}

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

/* ─── 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 var(--c-surface-2);
  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(0,112,242,.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(0,112,242,.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: #fcc; }
.status-critico,
.status-mortal,
.status-parvovirus   { background: var(--c-purple-bg);  color: var(--c-purple);  border-color: #d9c3e6; }
.status-monitoreo,
.status-observacion  { background: var(--c-primary-bg); color: var(--c-primary); border-color: #b3d4ff; }
.status-estable,
.status-alta         { background: var(--c-success-bg); color: var(--c-success); border-color: #b8d9c5; }
.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-xl);
  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(0,112,242,.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(0,112,242,.35);
  transform: translateY(-1px);
}

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

.error-message {
  background: var(--c-danger-bg);
  border: 1px solid #fcc;
  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 #b3d4ff;
  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: #f5f7fa; }
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; }
}

/* ═══════════════════════════════════════════════════════════
   EFECTOS SUTILES — Micro-interactions & Animations
   ═══════════════════════════════════════════════════════════ */

/* ── 1. Entrada de página ──────────────────────────────── */
@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.main-content > * {
  animation: page-enter 280ms cubic-bezier(.4,0,.2,1) both;
}

/* ── 2. Aparición escalonada de tarjetas ───────────────── */
@keyframes card-enter {
  from { opacity: 0; transform: translateY(12px) scale(.99); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.card-container {
  animation: card-enter 300ms cubic-bezier(.4,0,.2,1) both;
  transition:
    box-shadow 200ms ease,
    transform  200ms ease,
    border-color 200ms ease;
}
.card-container:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-1px);
}

/* ── 3. Hover en filas de tabla ────────────────────────── */
tbody tr {
  transition: background 140ms ease, box-shadow 140ms ease;
}
tbody tr:hover {
  background: #e6f2ff !important;
  box-shadow: inset 3px 0 0 var(--c-primary);
}

/* ── 4. Botones — efecto ripple y lift ─────────────────── */
@keyframes ripple-out {
  from { transform: scale(0);   opacity: .35; }
  to   { transform: scale(2.8); opacity: 0; }
}
.btn-primary,
.btn-login,
.btn-quick {
  position: relative;
  overflow: hidden;
}
.btn-primary::after,
.btn-login::after,
.btn-quick::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 100%;
  aspect-ratio: 1;
  background: rgba(255,255,255,.35);
  border-radius: 50%;
  pointer-events: none;
  transform: scale(0);
  opacity: 0;
}
.btn-primary:active::after,
.btn-login:active::after,
.btn-quick:active::after {
  animation: ripple-out 480ms ease forwards;
}

/* ── 5. Inputs — anillo de foco animado ────────────────── */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  transition:
    border-color 180ms ease,
    box-shadow   180ms ease;
}

/* ── 6. Sidebar items — deslizamiento suave del fondo ──── */
.sidebar-item {
  transition:
    background-color 160ms ease,
    color            160ms ease,
    border-left-color 160ms ease,
    transform        160ms ease;
}
.sidebar-item:hover {
  transform: translateX(2px);
}
.sidebar-item.active {
  transform: translateX(2px);
}
.sidebar-item svg {
  transition: transform 200ms cubic-bezier(.34,1.56,.64,1), opacity 160ms ease, color 160ms ease;
}
.sidebar-item:hover svg {
  transform: scale(1.15);
}

/* ── 7. Badges — pulso de color en estado activo ───────── */
@keyframes badge-glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(18,126,62,.25); }
  50%     { box-shadow: 0 0 0 4px rgba(18,126,62,.0); }
}
.status-estable,
.status-alta {
  animation: badge-glow 2.5s ease-in-out infinite;
}

/* ── 8. Imágenes de avatar — hover zoom ────────────────── */
.pet-avatar img,
img.rounded-full,
img.rounded-xl,
img.rounded-lg {
  transition: transform 250ms ease, filter 250ms ease;
}
.pet-avatar img:hover,
img.rounded-full:hover,
img.rounded-xl:hover,
img.rounded-lg:hover {
  transform: scale(1.06);
  filter: brightness(1.05);
}

/* ── 9. Modal — entrada más fluida ─────────────────────── */
.modal-overlay {
  animation: fade-in 160ms ease both;
}
.modal-content {
  animation: modal-in 240ms cubic-bezier(.34,1.56,.64,1) both;
}

/* ── 10. Toast / alertas — slide-in desde arriba ───────── */
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)      scale(1); }
}
.alert-banner,
[role="alert"] {
  animation: toast-in 220ms cubic-bezier(.4,0,.2,1) both;
}

/* ── 11. Skeleton loading ──────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--c-surface-2) 25%,
    #e2e8f0 50%,
    var(--c-surface-2) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
  color: transparent !important;
  pointer-events: none;
}

/* ── 12. Links — underline animado ────────────────────── */
a:not(.sidebar-item):not(.btn-primary):not(.btn-login):not(.btn-quick):not([class*="bg-"]) {
  transition: color 140ms ease, opacity 140ms ease;
}
a:not(.sidebar-item):not(.btn-primary):not(.btn-login):not(.btn-quick):not([class*="bg-"]):hover {
  opacity: .82;
}

/* ── 13. Dropdown / menús contextuales ─────────────────── */
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}
[data-dropdown-menu],
.dropdown-menu {
  animation: dropdown-in 180ms cubic-bezier(.4,0,.2,1) both;
  transform-origin: top center;
}

/* ── 14. Pet cards grid ─────────────────────────────────── */
.pets-grid .pet-card {
  transition:
    box-shadow 200ms ease,
    transform  200ms ease,
    border-color 200ms ease;
}
.pets-grid .pet-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  border-color: #b3d4ff;
}

/* ── 15. Smooth scroll global ───────────────────────────── */
html {
  scroll-behavior: smooth;
}

/* ── 16. Focus-visible — accesibilidad ─────────────────── */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ── 17. Transición de opacidad en imágenes al cargar ──── */
img {
  transition: opacity 300ms ease;
}
img[src=""] {
  opacity: 0;
}

/* ── 18. TOAST / NOTIFICATIONS ────────────────────────── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  font-size: var(--fs-13);
  font-weight: 600;
  color: #fff;
  min-width: 280px;
  max-width: 420px;
  animation: toast-slide-in 300ms cubic-bezier(.34,1.56,.64,1) both;
  position: relative;
  overflow: hidden;
}

.toast.toast-exit {
  animation: toast-slide-out 250ms ease both;
}

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(100%) scale(.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-slide-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(100%) scale(.9); }
}

.toast-success { background: #127e3e; }
.toast-error   { background: #bb0000; }
.toast-warning { background: #d17e00; }
.toast-info    { background: #0070f2; }

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-message { flex: 1; }

.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255,255,255,.15);
  border-radius: var(--r-sm);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--t-fast);
}
.toast-close:hover { background: rgba(255,255,255,.3); }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255,255,255,.3);
  animation: toast-progress 4s linear forwards;
}

@keyframes toast-progress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ── 19. CONFIRM DIALOG ───────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  animation: fade-in 150ms ease both;
}

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

.confirm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 0;
}

.confirm-header-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.confirm-header-icon.danger {
  background: var(--c-danger-bg);
  color: var(--c-danger);
}

.confirm-header-icon.warning {
  background: var(--c-warning-bg);
  color: var(--c-warning);
}

.confirm-header-icon.info {
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

.confirm-title {
  font-size: var(--fs-16);
  font-weight: 700;
  color: var(--c-text);
}

.confirm-body {
  padding: 8px 24px 20px;
  font-size: var(--fs-13);
  color: var(--c-text-2);
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
}

.confirm-btn {
  flex: 1;
  height: 38px;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--fs-12);
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: all var(--t-base);
}

.confirm-btn-cancel {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  color: var(--c-text);
}

.confirm-btn-cancel:hover {
  background: var(--c-surface-2);
  border-color: var(--c-border-s);
}

.confirm-btn-danger {
  background: var(--c-danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(187,0,0,.2);
}

.confirm-btn-danger:hover {
  background: #880000;
  box-shadow: 0 4px 12px rgba(187,0,0,.25);
}

.confirm-btn-primary {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,112,242,.2);
}

.confirm-btn-primary:hover {
  background: var(--c-primary-h);
}

/* ── 20. LOADING SPINNER ──────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(0,0,0,.1);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }

.btn-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn-loading::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

/* ── 21. SKELETON VARIANTS ────────────────────────────── */
.skeleton-text {
  height: 12px;
  margin-bottom: 8px;
  border-radius: var(--r-sm);
}

.skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-card {
  height: 180px;
  border-radius: var(--r-lg);
}

/* ── 22. BREADCRUMBS ──────────────────────────────────── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.breadcrumb-item {
  font-weight: 500;
  color: var(--c-text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}

.breadcrumb-item:hover {
  color: var(--c-primary);
}

.breadcrumb-item.active {
  color: var(--c-text);
  font-weight: 600;
}

.breadcrumb-sep {
  color: var(--c-border);
  font-size: 10px;
}

/* ── 23. SEARCH AUTOCOMPLETE ──────────────────────────── */
.search-wrapper {
  position: relative;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  max-height: 360px;
  overflow-y: auto;
  z-index: 999;
  animation: dropdown-in 180ms cubic-bezier(.4,0,.2,1) both;
  transform-origin: top center;
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-surface-2);
  transition: background var(--t-fast);
  cursor: pointer;
}

.search-dropdown-item:hover,
.search-dropdown-item.highlighted {
  background: var(--c-primary-bg);
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-dropdown-item .search-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--c-text-muted);
}

.search-dropdown-item .search-item-info {
  flex: 1;
  min-width: 0;
}

.search-dropdown-item .search-item-name {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dropdown-item .search-item-sub {
  font-size: var(--fs-10);
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-empty-state {
  padding: 20px;
  text-align: center;
  font-size: var(--fs-12);
  color: var(--c-text-muted);
}

/* ── 24. ACCESSIBILITY ────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

[aria-current="page"] {
  font-weight: 700 !important;
}

[role="button"],
button,
a[href] {
  -webkit-tap-highlight-color: transparent;
}

/* ── 25. BADGE / COUNTER PULSE ────────────────────────── */
.badge-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.badge-counter-danger {
  background: var(--c-danger);
  color: #fff;
}

.badge-counter-warning {
  background: var(--c-warning);
  color: #fff;
}

/* ── 26. RIPPLE EFFECT (advanced) ─────────────────────── */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ripple:active::after {
  animation: ripple-effect 500ms ease-out forwards;
}

@keyframes ripple-effect {
  from {
    width: 0;
    height: 0;
    opacity: .4;
  }
  to {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

/* ── 27. PAGE TRANSITIONS ─────────────────────────────── */
@keyframes page-enter-old {
  from { opacity: 1; }
  to { opacity: 0; }
}

.page-transitioning {
  animation: page-enter 300ms cubic-bezier(.4,0,.2,1) both;
}

/* ── 28. SIDEBAR SUBMENU ──────────────────────────────── */
.sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms cubic-bezier(.4,0,.2,1);
}

.sidebar-submenu.open {
  max-height: 500px;
}

.sidebar-submenu .sidebar-item {
  padding-left: 48px;
  font-size: 12px;
}

.sidebar-chevron {
  transition: transform 200ms ease;
  margin-left: auto;
}

.sidebar-chevron.open {
  transform: rotate(90deg);
}

/* ── 29. FOCUS TRAP INDICATOR ─────────────────────────── */
.focus-trap-indicator {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
