/* ============================================================
   BAITARI — Design System v2
   assets/css/baitari.css
   Include in every page: <link rel="stylesheet" href="/assets/css/baitari.css">
   ============================================================ */

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

/* ── TOKENS ── */
:root {
  /* Brand greens */
  --g1:#f0fdf4; --g2:#dcfce7; --g3:#86efac;
  --g4:#34d399; --g5:#10b981; --g6:#059669;
  --g7:#047857; --g8:#065f46; --g9:#064e3b;

  /* Accent */
  --gold:#c9a84c; --gold2:#f0c96e;
  --red:#ef4444;  --red2:#dc2626;
  --blue:#3b82f6; --amber:#f59e0b;

  /* Surfaces */
  --bg:#f0f7f3;
  --surface:#ffffff;
  --surface2:#f6faf8;
  --surface3:#eef5f1;
  --inp:#edf4f0;

  /* Borders */
  --br:rgba(6,95,70,.10);
  --br2:rgba(6,95,70,.20);
  --br3:rgba(6,95,70,.35);

  /* Text */
  --tp:#052e1c;   /* primary */
  --ts:#2d6a4f;   /* secondary */
  --tm:#74a98a;   /* muted */

  /* Shadows */
  --sh1:0 1px 2px rgba(0,0,0,.04),0 2px 8px rgba(0,0,0,.05);
  --sh2:0 2px 8px rgba(0,0,0,.06),0 8px 28px rgba(0,0,0,.09);
  --sh3:0 4px 16px rgba(0,0,0,.08),0 20px 56px rgba(0,0,0,.12);

  /* Radii */
  --r1:8px; --r2:14px; --r3:20px; --r4:28px;

  /* Nav */
  --nav-h:64px;
  --bot-h:68px;

  /* Transition */
  --tr:.2s cubic-bezier(.4,0,.2,1);
}

/* Dark mode */
[data-theme=dark] {
  --bg:#050f09;
  --surface:#0b1a10;
  --surface2:#0f2016;
  --surface3:#0d1c13;
  --inp:#0d1c13;
  --br:rgba(110,231,183,.07);
  --br2:rgba(110,231,183,.14);
  --br3:rgba(110,231,183,.25);
  --tp:#d1fae5;
  --ts:#6ee7b7;
  --tm:#347860;
}

/* ── RESET ── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; }
body {
  font-family:'Tajawal',sans-serif;
  background:var(--bg);
  color:var(--tp);
  min-height:100dvh;
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
  overflow-x:hidden;
}
img  { display:block; max-width:100%; }
a    { text-decoration:none; color:inherit; }
button { cursor:pointer; font-family:'Tajawal',sans-serif; border:none; background:none; }
input, select, textarea { font-family:'Tajawal',sans-serif; outline:none; }

/* ── SHELL ── */
.shell {
  max-width:480px;
  margin:0 auto;
  min-height:100dvh;
  background:var(--bg);
  position:relative;
}
@media(min-width:640px) {
  body { background:radial-gradient(ellipse at 20% 50%,rgba(6,95,70,.12),transparent 60%),#040d07; }
  .shell { box-shadow:0 0 0 1px var(--br2), var(--sh3); }
}

/* ── TOP NAV ── */
.topnav {
  position:sticky; top:0; z-index:200;
  height:var(--nav-h);
  background:var(--surface);
  border-bottom:1px solid var(--br);
  display:flex; align-items:center; padding:0 18px; gap:12px;
  box-shadow:var(--sh1);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.nav-logo { display:flex; align-items:center; gap:9px; }
.nav-mark {
  width:36px; height:36px; border-radius:11px;
  background:linear-gradient(135deg,var(--g8),var(--g5));
  display:flex; align-items:center; justify-content:center;
  font-size:18px; flex-shrink:0;
  box-shadow:0 2px 10px rgba(4,120,87,.3);
}
.nav-title { font-size:18px; font-weight:900; color:var(--tp); }
.nav-right { margin-right:auto; display:flex; gap:8px; align-items:center; }
[dir=ltr] .nav-right { margin-right:0; margin-left:auto; }
.nav-btn {
  width:38px; height:38px; border-radius:11px;
  background:var(--inp); border:1px solid var(--br2);
  display:flex; align-items:center; justify-content:center;
  font-size:18px; cursor:pointer; transition:var(--tr);
  position:relative;
}
.nav-btn:hover { background:var(--surface2); }
.nav-badge {
  position:absolute; top:-4px; right:-4px;
  background:var(--red); color:#fff;
  border-radius:20px; font-size:10px; font-weight:800;
  padding:1px 5px; min-width:16px; text-align:center;
  border:2px solid var(--surface);
}

/* ── BOTTOM NAV ── */
.botnav {
  position:fixed; bottom:0; left:50%; transform:translateX(-50%);
  width:100%; max-width:480px;
  height:var(--bot-h);
  background:var(--surface);
  border-top:1px solid var(--br);
  display:flex; align-items:center; justify-content:space-around;
  padding:0 4px;
  padding-bottom:env(safe-area-inset-bottom,0);
  z-index:200;
  box-shadow:0 -4px 24px rgba(0,0,0,.07);
}
.bn {
  flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:6px 4px; cursor:pointer; color:var(--tm);
  transition:color var(--tr); position:relative;
}
.bn.on { color:var(--g6); }
.bn::before {
  content:''; position:absolute; top:0; left:50%; transform:translateX(-50%);
  width:0; height:3px; background:var(--g6); border-radius:0 0 3px 3px;
  transition:width var(--tr);
}
.bn.on::before { width:24px; }
.bn-icon { font-size:22px; line-height:1; transition:transform var(--tr); }
.bn.on .bn-icon { transform:translateY(-2px); }
.bn-emg .bn-icon-wrap {
  width:52px; height:52px; border-radius:50%;
  background:linear-gradient(135deg,var(--red2),var(--red));
  display:flex; align-items:center; justify-content:center;
  font-size:24px; margin-top:-18px;
  box-shadow:0 4px 18px rgba(239,68,68,.4),0 0 0 4px var(--surface);
  animation:emg-pulse 2.5s ease infinite;
}
@keyframes emg-pulse {
  0%,100% { box-shadow:0 4px 18px rgba(239,68,68,.4),0 0 0 4px var(--surface); }
  50% { box-shadow:0 4px 26px rgba(239,68,68,.6),0 0 0 6px var(--surface); }
}
.bn-label { font-size:10px; font-weight:700; white-space:nowrap; }

/* ── PAGE WRAPPER ── */
.page-wrap {
  padding-bottom:calc(var(--bot-h) + 16px);
}

/* ── SECTION ── */
.sec { padding:0 16px; margin-top:22px; }
.sec-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.sec-title { font-size:17px; font-weight:800; }
.sec-link { font-size:13px; color:var(--g5); font-weight:700; cursor:pointer; transition:var(--tr); }
.sec-link:hover { color:var(--g7); }

/* ── CARDS ── */
.card {
  background:var(--surface);
  border-radius:var(--r3);
  border:1px solid var(--br);
  box-shadow:var(--sh1);
  overflow:hidden;
  transition:var(--tr);
}
.card:hover { box-shadow:var(--sh2); }
.card-pad { padding:16px 18px; }

/* ── VET CARD ── */
.vet-card {
  background:var(--surface);
  border-radius:var(--r3);
  border:1px solid var(--br);
  padding:16px;
  margin-bottom:12px;
  box-shadow:var(--sh1);
  transition:var(--tr);
  cursor:pointer;
}
.vet-card:hover { box-shadow:var(--sh2); transform:translateY(-2px); border-color:var(--br2); }
.vet-card-top { display:flex; gap:14px; align-items:flex-start; }
.vet-avatar {
  width:58px; height:58px; border-radius:18px; flex-shrink:0;
  background:linear-gradient(135deg,var(--g7),var(--g4));
  display:flex; align-items:center; justify-content:center;
  font-size:28px; color:#fff; font-weight:800;
}
.vet-info { flex:1; min-width:0; }
.vet-name { font-size:16px; font-weight:800; }
.vet-spec { font-size:12px; color:var(--g5); font-weight:700; margin-top:2px; }
.vet-meta { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:6px; }
.vet-meta-item { font-size:12px; color:var(--ts); display:flex; align-items:center; gap:3px; }
.vet-actions { display:flex; gap:8px; margin-top:14px; }

/* ── PET CARD ── */
.pet-card {
  flex:0 0 106px;
  background:var(--surface);
  border-radius:var(--r3);
  border:1px solid var(--br);
  padding:14px 10px;
  text-align:center;
  cursor:pointer;
  transition:var(--tr);
  position:relative;
}
.pet-card:hover { transform:translateY(-3px); box-shadow:var(--sh2); border-color:var(--br2); }
.pet-avatar {
  width:54px; height:54px; border-radius:50%;
  background:var(--g1);
  border:2px solid var(--g2);
  display:flex; align-items:center; justify-content:center;
  font-size:26px; margin:0 auto 8px;
}
.pet-name { font-size:13px; font-weight:800; }
.pet-breed { font-size:11px; color:var(--tm); margin-top:2px; }
.pet-status-dot {
  position:absolute; top:9px; right:9px;
  width:9px; height:9px; border-radius:50%;
  border:2px solid var(--surface);
}
.pet-status-dot.ok { background:#4ade80; }
.pet-status-dot.warn { background:var(--amber); }

/* ── APPOINTMENT CARD ── */
.appt-card {
  background:var(--surface);
  border-radius:var(--r3);
  border:1px solid var(--br);
  padding:14px 16px;
  margin-bottom:10px;
  display:flex; gap:14px; align-items:flex-start;
  box-shadow:var(--sh1);
  transition:var(--tr);
}
.appt-card:hover { box-shadow:var(--sh2); }
.appt-date {
  text-align:center; flex-shrink:0;
  background:var(--g1); border:1px solid var(--g2);
  border-radius:12px; padding:8px 10px; min-width:48px;
}
.appt-day { font-size:22px; font-weight:900; color:var(--g7); line-height:1; }
.appt-mon { font-size:10px; color:var(--g5); font-weight:700; }
.appt-info { flex:1; }
.appt-vet  { font-size:15px; font-weight:800; }
.appt-time { font-size:12px; color:var(--ts); margin-top:2px; }
.appt-pet  { font-size:12px; color:var(--tm); margin-top:2px; }

/* ── STATUS PILLS ── */
.pill {
  display:inline-flex; align-items:center; gap:4px;
  padding:3px 10px; border-radius:20px;
  font-size:11px; font-weight:800; white-space:nowrap;
}
.pill-green   { background:var(--g1);              color:var(--g7); }
.pill-amber   { background:#fef3c7;                color:#92400e; }
.pill-red     { background:#fee2e2;                color:#991b1b; }
.pill-blue    { background:#dbeafe;                color:#1e40af; }
.pill-gray    { background:var(--surface3);        color:var(--ts); }

/* ── AVAILABILITY BADGE ── */
.avail-badge {
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 10px; border-radius:20px;
  font-size:11px; font-weight:800;
}
.avail-badge .dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.avail-on  { background:var(--g1); color:var(--g7); }
.avail-on  .dot { background:#4ade80; box-shadow:0 0 0 2px rgba(74,222,128,.3); }
.avail-off { background:var(--surface3); color:var(--tm); }
.avail-off .dot { background:var(--tm); }

/* ── BUTTONS ── */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border-radius:var(--r2); padding:12px 20px;
  font-size:15px; font-weight:800; cursor:pointer;
  transition:var(--tr); font-family:'Tajawal',sans-serif;
  border:none; position:relative; overflow:hidden;
}
.btn-primary {
  background:var(--g7); color:#fff;
  box-shadow:0 4px 16px rgba(4,120,87,.3);
}
.btn-primary::after {
  content:''; position:absolute; inset:0;
  background:linear-gradient(135deg,rgba(255,255,255,.12),transparent);
  opacity:0; transition:opacity var(--tr);
}
.btn-primary:hover { background:var(--g6); transform:translateY(-1px); box-shadow:0 8px 24px rgba(4,120,87,.35); }
.btn-primary:hover::after { opacity:1; }
.btn-primary:active { transform:translateY(0); }
.btn-primary:disabled { opacity:.5; pointer-events:none; }

.btn-outline {
  background:none; color:var(--g6);
  border:1.5px solid var(--br3);
}
.btn-outline:hover { background:var(--g1); border-color:var(--g4); }

.btn-ghost {
  background:var(--inp); color:var(--ts);
  border:1.5px solid var(--br2);
}
.btn-ghost:hover { background:var(--surface2); }

.btn-danger {
  background:var(--red); color:#fff;
  box-shadow:0 4px 14px rgba(239,68,68,.3);
}
.btn-danger:hover { background:var(--red2); transform:translateY(-1px); }

.btn-full { width:100%; }

.btn-sm { padding:8px 14px; font-size:13px; border-radius:var(--r1); }
.btn-lg { padding:15px 28px; font-size:17px; border-radius:var(--r2); }

/* ── FORM ELEMENTS ── */
.fld { margin-bottom:16px; }
.lbl {
  font-size:11px; font-weight:800; color:var(--tm);
  margin-bottom:7px; display:flex; align-items:center; gap:5px;
  letter-spacing:.06em; text-transform:uppercase;
}
.lbl-req { color:var(--g5); font-size:14px; line-height:1; }
.igrp {
  position:relative;
  background:var(--inp);
  border-radius:var(--r2);
  border:1.5px solid transparent;
  transition:border-color var(--tr),background var(--tr),box-shadow var(--tr);
}
.igrp:focus-within {
  border-color:var(--g5); background:var(--surface);
  box-shadow:0 0 0 4px rgba(16,185,129,.1);
}
.igrp.err { border-color:var(--red); box-shadow:0 0 0 3px rgba(239,68,68,.1); }
.finp {
  width:100%; background:none; border:none;
  padding:13px 46px 13px 16px;
  font-size:15px; color:var(--tp);
  -webkit-appearance:none;
}
[dir=ltr] .finp { padding:13px 16px 13px 46px; }
.finp::placeholder { color:var(--tm); }
.fsel {
  width:100%; background:none; border:none;
  padding:13px 16px; font-size:15px; color:var(--tp);
  -webkit-appearance:none; cursor:pointer;
}
.fta {
  width:100%; background:none; border:none;
  padding:13px 16px; font-size:14px; color:var(--tp);
  font-family:'Tajawal',sans-serif;
  resize:none; min-height:90px;
}
.igrp-ico {
  position:absolute; right:14px; top:50%; transform:translateY(-50%);
  font-size:18px; opacity:.4; pointer-events:none; transition:opacity var(--tr);
}
[dir=ltr] .igrp-ico { right:auto; left:14px; }
.igrp:focus-within .igrp-ico { opacity:.65; }
.igrp-eye {
  position:absolute; left:14px; top:50%; transform:translateY(-50%);
  font-size:17px; opacity:.35; cursor:pointer; transition:opacity var(--tr);
}
[dir=ltr] .igrp-eye { left:auto; right:14px; }
.igrp-eye:hover { opacity:.8; }
.em { font-size:12px; color:var(--red); font-weight:700; margin-top:5px; display:none; }
.em.on { display:block; }

/* ── TOGGLE ── */
.toggle {
  width:46px; height:26px; border-radius:13px;
  background:var(--br3); position:relative;
  cursor:pointer; transition:background var(--tr); flex-shrink:0; border:none;
}
.toggle.on { background:var(--g5); }
.toggle::after {
  content:''; position:absolute; top:3px; right:3px;
  width:20px; height:20px; background:#fff;
  border-radius:50%; transition:right var(--tr);
  box-shadow:0 1px 4px rgba(0,0,0,.2);
}
[dir=ltr] .toggle::after { right:auto; left:3px; }
.toggle.on::after { right:23px; }
[dir=ltr] .toggle.on::after { right:auto; left:23px; }

/* ── MODAL ── */
.modal-ov {
  position:fixed; inset:0;
  background:rgba(0,0,0,.55);
  z-index:500;
  display:none; align-items:flex-end; justify-content:center;
  backdrop-filter:blur(4px);
}
.modal-ov.open { display:flex; }
.modal-sheet {
  width:100%; max-width:480px;
  background:var(--surface);
  border-radius:28px 28px 0 0;
  padding:0 0 40px;
  max-height:92dvh; overflow-y:auto;
  animation:slideUp .32s cubic-bezier(.22,1,.36,1) both;
}
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
.modal-handle {
  width:36px; height:4px; background:var(--br2);
  border-radius:2px; margin:12px auto 0;
}
.modal-header {
  display:flex; align-items:center; gap:12px;
  padding:16px 20px; border-bottom:1px solid var(--br);
}
.modal-title { font-size:18px; font-weight:800; flex:1; }
.modal-close {
  width:34px; height:34px; border-radius:10px;
  background:var(--inp); display:flex; align-items:center;
  justify-content:center; font-size:16px; cursor:pointer;
  transition:var(--tr); flex-shrink:0;
}
.modal-close:hover { background:var(--br2); }
.modal-body { padding:20px; }

/* ── TOAST ── */
.toast {
  position:fixed; bottom:calc(var(--bot-h) + 16px); left:50%;
  transform:translateX(-50%) translateY(10px);
  background:var(--surface); border:1px solid var(--br2);
  border-radius:var(--r2); padding:13px 20px;
  display:flex; align-items:center; gap:10px;
  font-size:13px; font-weight:700; color:var(--tp);
  box-shadow:var(--sh3); z-index:9999;
  opacity:0; pointer-events:none;
  transition:opacity .28s,transform .28s cubic-bezier(.22,1,.36,1);
  width:90%; max-width:380px;
}
.toast.on { opacity:1; transform:translateX(-50%) translateY(0); pointer-events:auto; }

/* ── EMPTY STATE ── */
.empty-state { text-align:center; padding:52px 24px; color:var(--tm); }
.empty-state-icon { font-size:52px; margin-bottom:12px; opacity:.55; }
.empty-state p { font-size:14px; line-height:1.6; }

/* ── LOADER ── */
.loader { display:flex; align-items:center; justify-content:center; padding:40px; }
.spinner {
  width:32px; height:32px;
  border:3px solid var(--br2);
  border-top-color:var(--g5);
  border-radius:50%;
  animation:spin .7s linear infinite;
}
@keyframes spin { to{transform:rotate(360deg)} }

/* ── SKELETON ── */
.skel {
  background:linear-gradient(90deg,var(--br) 25%,var(--surface2) 50%,var(--br) 75%);
  background-size:200% 100%;
  animation:shimmer 1.4s ease infinite;
  border-radius:var(--r1);
}
@keyframes shimmer { from{background-position:200% 0} to{background-position:-200% 0} }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width:4px; height:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--br2); border-radius:2px; }

/* ── UTILITIES ── */
.flex { display:flex; }
.flex-col { flex-direction:column; }
.items-center { align-items:center; }
.justify-between { justify-content:space-between; }
.gap-2 { gap:8px; }
.gap-3 { gap:12px; }
.gap-4 { gap:16px; }
.mt-4  { margin-top:16px; }
.mt-6  { margin-top:24px; }
.w-full { width:100%; }
.text-muted { color:var(--tm); }
.text-sm { font-size:13px; }
.font-bold { font-weight:800; }
.overflow-x-auto { overflow-x:auto; scrollbar-width:none; }
.overflow-x-auto::-webkit-scrollbar { display:none; }

/* ── HORIZONTAL SCROLL ROW ── */
.h-scroll { display:flex; gap:12px; overflow-x:auto; scrollbar-width:none; padding:2px 4px 6px; }
.h-scroll::-webkit-scrollbar { display:none; }
