/* ============================================================
   PetPro - Design System Premium
   Desenvolvido por SSoftwares Sistemas - by S.M.S.M
   ============================================================ */

/* ===== IMPORTAÇÕES ===== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&display=swap");

/* ===== VARIÁVEIS CSS ===== */
:root {
  /* Cores Primárias */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  /* Cores Secundárias - Violeta */
  --secondary-50: #f5f3ff;
  --secondary-100: #ede9fe;
  --secondary-200: #ddd6fe;
  --secondary-300: #c4b5fd;
  --secondary-400: #a78bfa;
  --secondary-500: #8b5cf6;
  --secondary-600: #7c3aed;
  --secondary-700: #6d28d9;

  /* Cores de Acento - Coral/Pêssego */
  --accent-50: #fff7ed;
  --accent-100: #ffedd5;
  --accent-200: #fed7aa;
  --accent-300: #fdba74;
  --accent-400: #fb923c;
  --accent-500: #f97316;
  --accent-600: #ea580c;

  /* Cores de Sucesso */
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-400: #4ade80;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;

  /* Cores de Perigo */
  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-400: #f87171;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;

  /* Cores de Aviso */
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-400: #fbbf24;
  --warning-500: #f59e0b;
  --warning-600: #d97706;

  /* Cores de Info */
  --info-50: #ecfeff;
  --info-100: #cffafe;
  --info-400: #22d3ee;
  --info-500: #06b6d4;
  --info-600: #0891b2;

  /* Cores Rosa */
  --pink-50: #fdf2f8;
  --pink-100: #fce7f3;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --pink-600: #db2777;

  /* Neutros */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #020617;

  /* Tema Claro */
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --shadow-color: rgba(0, 0, 0, 0.06);

  /* Layout */
  --sidebar-width: 280px;
  --sidebar-collapsed: 80px;
  --header-height: 70px;
  --border-radius: 14px;
  --border-radius-sm: 8px;
  --border-radius-lg: 20px;
  --border-radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  /* Sombras */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 50px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
}

/* ===== TEMA ESCURO ===== */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-sidebar: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: #334155;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ===== RESET E BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ===== TIPOGRAFIA ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Outfit", "Inter", sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.625rem;
}
h3 {
  font-size: 1.375rem;
}
h4 {
  font-size: 1.125rem;
}

a {
  color: var(--primary-500);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary-600);
}

/* ===== SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--gray-600);
}

/* ===== LAYOUT PRINCIPAL ===== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed);
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  z-index: 1000;
  transition: var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 80px;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.sidebar-brand h1 {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.sidebar-brand small {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .menu-label,
.sidebar.collapsed .menu-item span,
.sidebar.collapsed .menu-item .menu-arrow {
  display: none;
}

/* Menu */
.sidebar-menu {
  flex: 1;
  padding: 16px 12px;
}

.menu-label {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 16px 14px 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  color: rgba(255, 255, 255, 0.65);
  border-radius: var(--border-radius-sm);
  margin-bottom: 2px;
  transition: var(--transition-fast);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  gap: 12px;
  position: relative;
  text-decoration: none;
}

.menu-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(3px);
}

.menu-item.active {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
}

.sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 12px;
}

.menu-badge {
  margin-left: auto;
  background: var(--danger-500);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
}

/* ===== HEADER / TOPBAR ===== */
.topbar {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-toggle {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--gray-100);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  transition: var(--transition-fast);
  font-size: 1.1rem;
}

[data-theme="dark"] .topbar-toggle {
  background: var(--gray-700);
  color: var(--gray-300);
}

.topbar-toggle:hover {
  background: var(--primary-100);
  color: var(--primary-600);
}

.topbar-search {
  position: relative;
}

.topbar-search input {
  width: 320px;
  padding: 10px 16px 10px 42px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
  font-family: inherit;
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.topbar-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  position: relative;
  transition: var(--transition-fast);
  font-size: 1.15rem;
}

.topbar-btn:hover {
  background: var(--gray-100);
  color: var(--primary-500);
}

[data-theme="dark"] .topbar-btn:hover {
  background: var(--gray-700);
}

.topbar-btn .notif-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  background: var(--danger-500);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition-fast);
}

.topbar-user:hover {
  background: var(--gray-100);
}

[data-theme="dark"] .topbar-user:hover {
  background: var(--gray-700);
}

.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
}

.topbar-user-info {
  line-height: 1.3;
}

.topbar-user-info .name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-user-info .role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===== CONTEÚDO ===== */
.main-content {
  flex: 1;
  padding: 28px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header-left h2 {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header-left p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary-500);
}

.breadcrumb .separator {
  color: var(--gray-300);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--gray-50);
}

[data-theme="dark"] .card-footer {
  background: rgba(0, 0, 0, 0.15);
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 22px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
}

.stat-card.blue::before {
  background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
}
.stat-card.purple::before {
  background: linear-gradient(
    90deg,
    var(--secondary-400),
    var(--secondary-600)
  );
}
.stat-card.green::before {
  background: linear-gradient(90deg, var(--success-400), var(--success-600));
}
.stat-card.orange::before {
  background: linear-gradient(90deg, var(--accent-400), var(--accent-600));
}
.stat-card.pink::before {
  background: linear-gradient(90deg, var(--pink-400), var(--pink-600));
}
.stat-card.cyan::before {
  background: linear-gradient(90deg, var(--info-400), var(--info-600));
}
.stat-card.red::before {
  background: linear-gradient(90deg, var(--danger-400), var(--danger-600));
}
.stat-card.yellow::before {
  background: linear-gradient(90deg, var(--warning-400), var(--warning-600));
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.blue {
  background: var(--primary-100);
  color: var(--primary-600);
}
.stat-icon.purple {
  background: var(--secondary-100);
  color: var(--secondary-600);
}
.stat-icon.green {
  background: var(--success-100);
  color: var(--success-600);
}
.stat-icon.orange {
  background: var(--accent-100);
  color: var(--accent-600);
}
.stat-icon.pink {
  background: var(--pink-100);
  color: var(--pink-600);
}
.stat-icon.cyan {
  background: var(--info-100);
  color: var(--info-600);
}
.stat-icon.red {
  background: var(--danger-100);
  color: var(--danger-600);
}
.stat-icon.yellow {
  background: var(--warning-100);
  color: var(--warning-600);
}

[data-theme="dark"] .stat-icon.blue {
  background: rgba(59, 130, 246, 0.15);
}
[data-theme="dark"] .stat-icon.purple {
  background: rgba(139, 92, 246, 0.15);
}
[data-theme="dark"] .stat-icon.green {
  background: rgba(34, 197, 94, 0.15);
}
[data-theme="dark"] .stat-icon.orange {
  background: rgba(249, 115, 22, 0.15);
}
[data-theme="dark"] .stat-icon.pink {
  background: rgba(236, 72, 153, 0.15);
}
[data-theme="dark"] .stat-icon.cyan {
  background: rgba(6, 182, 212, 0.15);
}
[data-theme="dark"] .stat-icon.red {
  background: rgba(239, 68, 68, 0.15);
}
[data-theme="dark"] .stat-icon.yellow {
  background: rgba(245, 158, 11, 0.15);
}

.stat-info h4 {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-info .number {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: "Outfit", sans-serif;
  line-height: 1;
}

.stat-info .trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 20px;
}

.trend.up {
  color: var(--success-600);
  background: var(--success-50);
}
.trend.down {
  color: var(--danger-600);
  background: var(--danger-50);
}

/* ===== GRID ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ===== BOTÕES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn i {
  font-size: 0.9rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: #fff;
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(59, 130, 246, 0.3);
  color: #fff;
}

.btn-secondary {
  background: linear-gradient(
    135deg,
    var(--secondary-500),
    var(--secondary-600)
  );
  color: #fff;
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.25);
}
.btn-secondary:hover {
  background: linear-gradient(
    135deg,
    var(--secondary-600),
    var(--secondary-700)
  );
  transform: translateY(-1px);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-500), var(--success-600));
  color: #fff;
  box-shadow: 0 3px 12px rgba(34, 197, 94, 0.25);
}
.btn-success:hover {
  background: linear-gradient(135deg, var(--success-600), var(--success-700));
  transform: translateY(-1px);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-500), var(--danger-600));
  color: #fff;
  box-shadow: 0 3px 12px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
  background: linear-gradient(135deg, var(--danger-600), var(--danger-700));
  transform: translateY(-1px);
  color: #fff;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
  color: #fff;
}

.btn-info {
  background: linear-gradient(135deg, var(--info-500), var(--info-600));
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--primary-500);
  color: var(--primary-500);
  background: var(--primary-50);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 0.95rem;
  border-radius: var(--border-radius);
}
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: var(--border-radius-sm);
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== FORMULÁRIOS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger-500);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 11px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.763L10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* ===== TABELAS ===== */
.table-container {
  overflow-x: auto;
  border-radius: var(--border-radius);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.table thead th {
  padding: 14px 16px;
  background: var(--gray-50);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

[data-theme="dark"] .table thead th {
  background: rgba(0, 0, 0, 0.2);
}

.table tbody tr {
  transition: var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--primary-50);
}

[data-theme="dark"] .table tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-primary {
  background: var(--primary-100);
  color: var(--primary-700);
}
.badge-secondary {
  background: var(--secondary-100);
  color: var(--secondary-700);
}
.badge-success {
  background: var(--success-100);
  color: var(--success-700);
}
.badge-danger {
  background: var(--danger-100);
  color: var(--danger-700);
}
.badge-warning {
  background: var(--warning-100);
  color: var(--warning-600);
}
.badge-info {
  background: var(--info-100);
  color: var(--info-600);
}

/* ===== ALERTAS ===== */
.alert {
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.875rem;
  animation: slideDown 0.3s ease;
}

.alert-success {
  background: var(--success-50);
  border-left: 4px solid var(--success-500);
  color: var(--success-700);
}
.alert-danger {
  background: var(--danger-50);
  border-left: 4px solid var(--danger-500);
  color: var(--danger-700);
}
.alert-warning {
  background: var(--warning-50);
  border-left: 4px solid var(--warning-500);
  color: var(--warning-600);
}
.alert-info {
  background: var(--info-50);
  border-left: 4px solid var(--info-500);
  color: var(--info-600);
}

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  font-size: 1.1rem;
}

/* ===== AVATAR ===== */
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.7rem;
  border-radius: 8px;
}
.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.2rem;
  border-radius: 16px;
}
.avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 1.8rem;
  border-radius: 20px;
}

/* ===== PAGINAÇÃO ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  justify-content: center;
  margin-top: 20px;
}

.page-item .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-fast);
  text-decoration: none;
}

.page-item .page-link:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-600);
}

.page-item.active .page-link {
  background: var(--primary-500);
  border-color: var(--primary-500);
  color: #fff;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlide 0.3s ease;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 24px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-500);
  border: 3px solid var(--bg-primary);
  z-index: 1;
}

.timeline-item.vacina::before {
  background: var(--success-500);
}
.timeline-item.consulta::before {
  background: var(--primary-500);
}
.timeline-item.servico::before {
  background: var(--accent-500);
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  margin-top: 6px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state i {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: 16px;
}

.empty-state h3 {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--border-radius-sm);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.4s ease;
}

.toast-success {
  background: var(--success-600);
}
.toast-error {
  background: var(--danger-600);
}
.toast-warning {
  background: var(--warning-600);
}
.toast-info {
  background: var(--info-600);
}

/* ===== PET CARD ===== */
.pet-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
}

.pet-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pet-card-image {
  height: 180px;
  background: linear-gradient(135deg, var(--primary-100), var(--secondary-100));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
}

.pet-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-card-body {
  padding: 16px;
}

.pet-card-body h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.pet-card-body .pet-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.pet-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 6px;
}

/* ===== CHARTS CONTAINER ===== */
.chart-container {
  position: relative;
  height: 300px;
  padding: 10px;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-200) 25%,
    var(--gray-100) 50%,
    var(--gray-200) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius-sm);
}

/* ===== FOOTER ===== */
.app-footer {
  padding: 16px 28px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.app-footer a {
  color: var(--primary-500);
  font-weight: 600;
}

/* ===== TAB SYSTEM ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 24px;
}

.tab-item {
  padding: 12px 20px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition-fast);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-item:hover {
  color: var(--primary-500);
}
.tab-item.active {
  color: var(--primary-600);
  border-color: var(--primary-600);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 2000;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .app-content {
    margin-left: 0 !important;
  }

  .main-content {
    padding: 16px;
  }

  .topbar-search {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar-user-info {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
  .stat-card {
    padding: 16px;
  }
  .card-body {
    padding: 16px;
  }
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent);
  top: -200px;
  right: -200px;
  border-radius: 50%;
}

.login-page::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent);
  bottom: -200px;
  left: -200px;
  border-radius: 50%;
}

.login-card {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-xl);
  padding: 48px;
  width: 420px;
  max-width: 95%;
  z-index: 1;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo .logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.login-logo h1 {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.login-logo p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin-top: 4px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form .form-label {
  color: rgba(255, 255, 255, 0.7);
}

.login-form .form-control {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 14px 16px;
}

.login-form .form-control:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.login-form .form-control::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.login-form .btn-login {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
  border-radius: var(--border-radius);
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.75rem;
}

/* ===== UTILITIES ===== */
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.text-muted {
  color: var(--text-muted);
}
.text-success {
  color: var(--success-500);
}
.text-danger {
  color: var(--danger-500);
}
.text-warning {
  color: var(--warning-500);
}
.text-primary {
  color: var(--primary-500);
}
.fw-bold {
  font-weight: 700;
}
.fw-semibold {
  font-weight: 600;
}
.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 16px;
}
.mt-4 {
  margin-top: 24px;
}
.mb-1 {
  margin-bottom: 4px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 16px;
}
.mb-4 {
  margin-bottom: 24px;
}
.p-3 {
  padding: 16px;
}
.p-4 {
  padding: 24px;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 16px;
}
.d-flex {
  display: flex;
}
.d-grid {
  display: grid;
}
.align-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.flex-wrap {
  flex-wrap: wrap;
}
.w-100 {
  width: 100%;
}
.rounded {
  border-radius: var(--border-radius);
}
.hidden {
  display: none !important;
}
.overflow-hidden {
  overflow: hidden;
}
