/* =====================================================================
   Zenve BI — Veterinary Services Executive Control Center
   Sidebar: Veterinary Services Suite (9 Subdomains)
   Pure Light Executive Design System
   ===================================================================== */

#zvs-root {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 224px !important;
  width: calc(100vw - 224px) !important;
  max-width: calc(100vw - 224px) !important;
  height: 100vh !important;
  z-index: 60 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font-family: var(--font-sans, "Manrope", sans-serif);
  display: none;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}

#zvs-root.zpanel-open {
  display: block !important;
}

#zvs-root::-webkit-scrollbar {
  width: 6px;
}

#zvs-root::-webkit-scrollbar-track {
  background: #f8fafc;
}

#zvs-root::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}

#zvs-root::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

#zvs-root,
#zvs-root * {
  box-sizing: border-box !important;
}

/* ── Top Executive Header ─────────────────────────────────────────── */
.zvs-header {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 32px;
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02) !important;
}

.zvs-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.zvs-brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe) !important;
  border: 1px solid #bfdbfe !important;
  font-size: 19px;
  flex-shrink: 0;
}

.zvs-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.zvs-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zvs-main-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.25;
}

.zvs-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.zvs-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: zvsPulse 2s infinite;
}

@keyframes zvsPulse {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.25);
    opacity: 1;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

.zvs-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zvs-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.zvs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  font-family: inherit;
  line-height: 1.4;
}

.zvs-btn-secondary {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

.zvs-btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.zvs-btn-primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.zvs-btn-primary:hover {
  background: #1d4ed8;
}

.zvs-btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  margin-left: 6px;
}

.zvs-btn-close:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* ── Subcategory Chip Navigator ───────────────────────────────────── */
.zvs-nav-bar {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.zvs-nav-bar::-webkit-scrollbar {
  display: none;
}

.zvs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.zvs-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.zvs-chip.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
  font-weight: 600;
}

.zvs-chip-count {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
}

/* ── Main Content Body ────────────────────────────────────────────── */
.zvs-content,
#zvs-root main,
#zvs-root .zvs-content {
  padding: 24px 32px 64px 32px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  max-width: 1600px !important;
  margin: 0 auto !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* ── KPI Grid ─────────────────────────────────────────────────────── */
.zvs-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.zvs-kpi {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.zvs-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.zvs-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.zvs-kpi-icon {
  font-size: 16px;
  opacity: 0.85;
}

.zvs-kpi-val {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  margin-top: 2px;
}

.zvs-kpi-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.zvs-delta {
  font-size: 11px;
  font-weight: 700;
}

.zvs-delta.up {
  color: #16a34a;
}

.zvs-delta.down {
  color: #dc2626;
}

.zvs-delta.neutral {
  color: #64748b;
}

.zvs-subtext {
  font-size: 11px;
  color: #94a3b8;
}

/* ── Layout Cards & Grids ─────────────────────────────────────────── */
.zvs-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 18px;
}

.zvs-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0 !important;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.zvs-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 10px;
}

.zvs-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.zvs-card-sub {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
}

/* ── Interactive Tables ───────────────────────────────────────────── */
.zvs-table-wrap {
  overflow-x: auto;
}

.zvs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.zvs-table th {
  padding: 10px 14px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
}

.zvs-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.zvs-table tr:hover td {
  background: #f8fafc;
}

.zvs-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.zvs-tag.green {
  background: #dcfce7;
  color: #15803d;
}

.zvs-tag.blue {
  background: #eff6ff;
  color: #1d4ed8;
}

.zvs-tag.yellow {
  background: #fef9c3;
  color: #854d0e;
}

.zvs-tag.red {
  background: #fee2e2;
  color: #b91c1c;
}

.zvs-tag.purple {
  background: #f3e8ff;
  color: #7e22ce;
}

.zvs-tag.cyan {
  background: #ecfeff;
  color: #0891b2;
  border: 1px solid #a5f3fc;
}

/* ── Filters & Search ─────────────────────────────────────────────── */
.zvs-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.zvs-input {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  color: #0f172a;
  outline: none;
  font-family: inherit;
  background: #ffffff;
}

.zvs-input:focus,
.zvs-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.zvs-select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  color: #334155;
  background: #ffffff;
  outline: none;
  font-family: inherit;
}

/* ── Modals & Backdrop ────────────────────────────────────────────── */
.zvs-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.zvs-modal-box {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 500px;
  padding: 22px;
  border: 1px solid #e2e8f0;
  animation: zvsPop 0.15s ease-out;
}

@keyframes zvsPop {
  0% {
    transform: scale(0.96);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.zvs-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.zvs-modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.zvs-form-group {
  margin-bottom: 14px;
}

.zvs-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.zvs-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ── Toast Notification ───────────────────────────────────────────── */
.zvs-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: zvsSlideUp 0.2s ease-out;
}

@keyframes zvsSlideUp {
  0% {
    transform: translateY(12px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Sidebar Active Sync ──────────────────────────────────────────── */
.sidebar-scope li button.zvs-active {
  background: rgba(56, 189, 248, 0.16) !important;
  color: #38bdf8 !important;
  font-weight: 600 !important;
}