:root {
  color-scheme: dark;
  --shop-bg: #101010;
  --shop-surface: #161616;
  --shop-surface-2: #1f1f1f;
  --shop-line: rgba(245, 245, 245, .12);
  --shop-line-strong: rgba(245, 245, 245, .22);
  --shop-fg: #f5f5f5;
  --shop-muted: rgba(245, 245, 245, .72);
  --shop-soft: rgba(245, 245, 245, .08);
  --primary: #02693a;
  --primary-dark: #014b2a;
  --primary-soft: rgba(2, 105, 58, .16);
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, .14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, .14);
  --success: #16a34a;
  --warning: #f59e0b;
  --bg: #101010;
  --surface: #161616;
  --surface-soft: #1f1f1f;
  --ink: #f5f5f5;
  --text: rgba(245, 245, 245, .9);
  --muted: rgba(245, 245, 245, .68);
  --border: rgba(245, 245, 245, .16);
  --line: rgba(245, 245, 245, .1);
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, .26);
  --radius: 8px;
  --radius-sm: 6px;
  --container: 1220px;
  font-family: "Work Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 15% 0%, rgba(2, 105, 58, .34), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(245, 158, 11, .14), transparent 24rem),
    linear-gradient(180deg, #101010 0%, #151515 44%, #0f0f0f 100%);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 72%);
}
a { color: #6ee7a8; text-decoration: none; }
a:hover { color: #a7f3d0; text-decoration: none; }
.skip-link { position: absolute; left: 12px; top: -80px; background: var(--shop-fg); color: #101010; padding: 10px 14px; border-radius: var(--radius); z-index: 20; font-weight: 800; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid #47d98b; outline-offset: 3px; }
.wrap { width: min(var(--container), calc(100% - 32px)); margin: 0 auto; position: relative; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(16, 16, 16, .82);
  border-bottom: 1px solid var(--shop-line);
  backdrop-filter: blur(18px);
}
.topbar .wrap { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { position: relative; display: grid; gap: 2px; padding-left: 54px; font-weight: 900; color: var(--shop-fg); letter-spacing: 0; }
.brand::before {
  content: "CARE";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), #0c8f51);
  color: #fff;
  font-size: 10px;
  letter-spacing: .08em;
  box-shadow: 0 10px 24px rgba(2, 105, 58, .32);
}
.brand small { display: block; color: var(--shop-muted); font-size: 13px; font-weight: 600; }
.userbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--shop-muted); font-size: 14px; }

.btn, button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  padding: 11px 16px;
  font: inherit;
  font-weight: 850;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(2, 105, 58, .24);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}
.btn:hover, button:hover { background: #058149; color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 16px 30px rgba(2, 105, 58, .3); }
.btn:active, button:active { transform: translateY(0); }
.btn.secondary { background: rgba(245, 245, 245, .07); color: var(--shop-fg); border-color: var(--shop-line-strong); box-shadow: none; }
.btn.secondary:hover { background: rgba(245, 245, 245, .12); border-color: rgba(245, 245, 245, .32); }
.btn.success { background: var(--success); }
.btn.danger { background: var(--danger); }

.layout { padding: 30px 0 46px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.panel, .card, .login-card {
  background: linear-gradient(180deg, rgba(31, 31, 31, .96), rgba(22, 22, 22, .96));
  border: 1px solid var(--shop-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.panel { padding: 22px; }
.panel > :last-child, .login-card > :last-child { margin-bottom: 0; }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(540px, 100%); padding: 32px; position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); }

h1, h2, h3 { color: var(--shop-fg); line-height: 1.12; margin: 0 0 12px; font-family: inherit; letter-spacing: 0; }
h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 900; }
h2 { font-size: 23px; font-weight: 850; }
h3 { font-size: 17px; font-weight: 820; }
p { margin: 0 0 12px; color: var(--muted); }
strong { color: var(--shop-fg); }
.meta { color: var(--muted); font-size: 13px; }
.section { margin-top: 20px; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.hero p { max-width: 760px; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 11px;
  background: rgba(245, 245, 245, .08);
  border: 1px solid var(--shop-line);
  color: rgba(245, 245, 245, .84);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.badge.success { background: var(--primary-soft); border-color: rgba(34, 197, 94, .28); color: #86efac; }
.badge.warn { background: var(--accent-soft); border-color: rgba(245, 158, 11, .32); color: #fbbf24; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
label { font-weight: 820; color: rgba(245, 245, 245, .84); font-size: 13px; }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--shop-line-strong);
  border-radius: var(--radius);
  padding: 11px 12px;
  font: inherit;
  color: var(--shop-fg);
  background: rgba(16, 16, 16, .78);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea { min-height: 112px; resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(245, 245, 245, .4); }
input:focus, select:focus, textarea:focus { border-color: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .16); background: rgba(16, 16, 16, .95); outline: 0; }
input[type="file"] { padding: 10px; }

.alert { border: 1px solid rgba(239, 68, 68, .35); background: var(--danger-soft); color: #fecaca; padding: 13px 15px; border-radius: var(--radius); margin-bottom: 16px; }
.alert.ok { border-color: rgba(34, 197, 94, .35); background: var(--primary-soft); color: #bbf7d0; }
.empty { border: 1px dashed rgba(245, 245, 245, .24); border-radius: var(--radius); padding: 20px; background: rgba(245, 245, 245, .04); color: var(--muted); }

.pet-list { display: grid; gap: 12px; }
.pet-link {
  display: block;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--shop-line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(2, 105, 58, .14), transparent 52%),
    rgba(245, 245, 245, .045);
  color: inherit;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.pet-link strong { display: block; color: var(--shop-fg); font-size: 20px; margin-bottom: 4px; }
.pet-link:hover { text-decoration: none; border-color: rgba(52, 211, 153, .55); transform: translateY(-2px); background: linear-gradient(135deg, rgba(2, 105, 58, .22), rgba(245, 245, 245, .06)); box-shadow: 0 18px 36px rgba(0,0,0,.28); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 0; }
.kpi { min-height: 104px; background: rgba(245, 245, 245, .055); border: 1px solid var(--shop-line); border-radius: var(--radius); padding: 15px; }
.kpi b { display: block; color: var(--shop-fg); font-size: clamp(20px, 2vw, 28px); line-height: 1.08; overflow-wrap: anywhere; }
.kpi span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.list { display: grid; gap: 10px; }
.item {
  border: 1px solid var(--shop-line);
  border-radius: var(--radius);
  padding: 13px;
  background: rgba(245, 245, 245, .045);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.item-main { min-width: 0; }
.item-main p { margin-top: 10px; }
.tabs { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; align-items: start; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-note { color: rgba(245, 245, 245, .52); padding: 0 0 36px; font-size: 13px; }
.print-only { display: none; }

aside.panel { position: sticky; top: 98px; }
aside.panel .item { background: rgba(2, 105, 58, .1); border-color: rgba(34, 197, 94, .2); }
aside.panel .item strong { font-size: 24px; }

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; }
  body::before, .topbar, .no-print, .btn, button { display: none !important; }
  .wrap { width: 100%; }
  .layout, .tabs, .grid-2, .grid-3, .kpis { display: block; }
  .panel, .card { box-shadow: none; border-color: #bbb; background: #fff; break-inside: avoid; margin-bottom: 16px; }
  h1, h2, h3, strong, .kpi b { color: #111; }
  p, .meta, .footer-note { color: #444; }
  .print-only { display: block; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 980px) {
  .layout, .tabs, .hero { grid-template-columns: 1fr; }
  aside.panel { position: static; }
  .kpis, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .wrap { width: min(100% - 24px, var(--container)); }
  .topbar .wrap { min-height: 0; flex-direction: column; align-items: flex-start; padding: 14px 0; }
  .userbar { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .brand { padding-left: 50px; }
  .layout { padding-top: 18px; }
  .panel, .login-card { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .btn, button { width: 100%; }
  .item { flex-direction: column; }
}