/* ============================================================
   StableOps Component Library
   Auth, Toasts, Skeletons, Badges, Shift Header, Forms
   ============================================================ */

/* ============================================================
   1. LOGIN SCREEN
   ============================================================ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 30%, rgba(179, 122, 69, 0.18), transparent 35%),
    linear-gradient(145deg, #29160c 0%, #21120b 50%, #180d08 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 251, 245, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  padding: 40px 36px 36px;
  box-shadow:
    0 0 0 1px rgba(179, 122, 69, 0.18),
    var(--shadow-xl);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.login-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.login-logo-text strong {
  font-family: "Cormorant Garamond", serif;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.login-logo-text span {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-heading {
  font-family: "Cormorant Garamond", serif;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.login-subheading {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0 0 28px;
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--window-top);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  outline: none;
  -webkit-appearance: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px var(--bronze-soft);
}

.form-field input.error,
.form-field select.error,
.form-field textarea.error {
  border-color: var(--status-danger);
  box-shadow: 0 0 0 3px var(--status-danger-soft);
}

.form-field .field-error {
  font-size: var(--text-xs);
  color: var(--status-danger);
  font-weight: 500;
  margin-top: 2px;
}

.login-forgot {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
}

.login-forgot button {
  background: none;
  border: none;
  color: var(--bronze);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--duration-fast);
}
.login-forgot button:hover { text-decoration-color: var(--bronze); }

.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--oxblood);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
  box-shadow: 0 4px 16px rgba(110, 52, 47, 0.35);
}
.login-btn:hover:not(:disabled) {
  background: #8a2a18;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(110, 52, 47, 0.45);
}
.login-btn:active:not(:disabled) {
  transform: translateY(0);
}
.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-btn.loading {
  position: relative;
  color: transparent;
}
.login-btn.loading::after {
  content: "";
  position: absolute;
  inset: 50% 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.login-error-banner {
  padding: 12px 14px;
  background: var(--status-danger-soft);
  border: 1px solid rgba(185, 50, 50, 0.25);
  border-radius: var(--radius-sm);
  color: var(--status-danger);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
  display: none;
}
.login-error-banner.visible { display: block; }

.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.6;
}

/* ============================================================
   2. TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - 48px);
}

.toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  box-shadow:
    0 0 0 1px var(--line),
    var(--shadow-lg);
  animation: toast-in var(--duration-base) var(--ease-out) forwards;
  overflow: hidden;
}

.toast.toast-exit {
  animation: toast-out var(--duration-base) var(--ease-out) forwards;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.toast.success .toast-icon { background: var(--status-ok-soft); color: var(--status-ok); }
.toast.error   .toast-icon { background: var(--status-danger-soft); color: var(--status-danger); }
.toast.warning .toast-icon { background: var(--status-warn-soft); color: var(--status-warn); }
.toast.info    .toast-icon { background: var(--status-info-soft); color: var(--status-info); }

.toast-body { flex: 1; min-width: 0; }
.toast-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px;
  line-height: 1.3;
}
.toast-message {
  font-size: var(--text-xs);
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity var(--duration-fast);
  margin-top: 2px;
}
.toast-close:hover { opacity: 1; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(6px) scale(0.97); }
}

/* ============================================================
   3. SKELETON LOADING STATES
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--line) 25%,
    rgba(243, 236, 226, 0.9) 50%,
    var(--line) 75%
  );
  background-size: 200% auto;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--panel);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.skeleton-line {
  height: 14px;
  border-radius: 99px;
}
.skeleton-line.short  { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long   { width: 90%; }
.skeleton-line.full   { width: 100%; }
.skeleton-line.title  { height: 20px; width: 55%; }

.skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-badge {
  height: 22px;
  width: 68px;
  border-radius: 99px;
}

/* ============================================================
   4. STATUS + COMPLIANCE BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
  line-height: 1;
}

.badge-ok,
.badge-ready,
.badge-current,
.badge-active,
.badge-paid,
.badge-approved,
.badge-open { background: var(--status-ok-soft); color: var(--status-ok); border: 1px solid rgba(42,110,79,0.2); }

.badge-warning,
.badge-due-soon,
.badge-partial,
.badge-pending,
.badge-queued { background: var(--status-warn-soft); color: var(--status-warn); border: 1px solid rgba(158,108,0,0.2); }

.badge-danger,
.badge-overdue,
.badge-expired,
.badge-blocked,
.badge-rejected { background: var(--status-danger-soft); color: var(--status-danger); border: 1px solid rgba(185,50,50,0.2); }

.badge-info,
.badge-due-today,
.badge-in-review { background: var(--status-info-soft); color: var(--status-info); border: 1px solid rgba(36,88,165,0.2); }

.badge-neutral,
.badge-inactive,
.badge-retired,
.badge-draft { background: var(--status-neutral-soft); color: var(--status-neutral); border: 1px solid rgba(90,90,90,0.2); }

/* Compliance status dot indicator */
.compliance-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.compliance-dot.ok      { background: var(--status-ok); }
.compliance-dot.warning { background: var(--status-warn); }
.compliance-dot.danger  { background: var(--status-danger); }
.compliance-dot.info    { background: var(--status-info); }
.compliance-dot.neutral { background: var(--status-neutral); }

/* ============================================================
   5. SHIFT PROGRESS HEADER
   ============================================================ */
.shift-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--panel);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.shift-header-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shift-header-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.shift-header-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.shift-progress-wrap {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shift-progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 500;
}

.shift-progress-bar {
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.shift-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--bronze), var(--status-ok));
  transition: width var(--duration-slow) var(--ease-out);
}

.shift-signoff-btn {
  padding: 8px 18px;
  background: var(--pine);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast), transform var(--duration-fast);
}
.shift-signoff-btn:hover  { background: #21382e; transform: translateY(-1px); }
.shift-signoff-btn:active { transform: translateY(0); }
.shift-signoff-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   6. OFFLINE BANNER
   ============================================================ */
.offline-banner {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: var(--status-warn-soft);
  border: 1px solid rgba(158, 108, 0, 0.25);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--status-warn);
  font-weight: 500;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.offline-banner.visible { display: flex; }

.offline-banner-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.offline-banner-text {
  flex: 1;
}

.offline-badge-count {
  background: var(--status-warn);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
}

/* ============================================================
   7. HORSE PROFILE SECTIONS
   ============================================================ */
.horse-profile {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.horse-profile-hero {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  background: var(--panel);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
}

.horse-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bronze-soft);
  border: 2px solid var(--line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--bronze);
}

.horse-profile-info { flex: 1; min-width: 0; }
.horse-profile-name {
  font-family: "Cormorant Garamond", serif;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.horse-profile-breed {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0 0 10px;
}

.horse-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.horse-profile-priority-alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 20px;
  background: rgba(185, 50, 50, 0.05);
  border: 1px solid rgba(185, 50, 50, 0.15);
  border-top: none;
  border-bottom: none;
}

.priority-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--status-danger);
  font-weight: 500;
}

.priority-alert-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-danger);
  flex-shrink: 0;
}

.horse-profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.horse-profile-tabs::-webkit-scrollbar { display: none; }

.horse-tab {
  padding: 12px 18px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-fast), border-color var(--duration-fast);
  font-family: inherit;
}
.horse-tab:hover { color: var(--ink); }
.horse-tab.active { color: var(--oxblood); border-bottom-color: var(--oxblood); }

.horse-profile-body {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ============================================================
   8. HEALTH TIMELINE
   ============================================================ */
.health-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}

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

.timeline-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  width: 20px;
  padding-top: 2px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bronze);
  background: var(--window);
  flex-shrink: 0;
}

.timeline-dot.health { border-color: var(--status-ok); }
.timeline-dot.medication { border-color: var(--status-warn); }
.timeline-dot.surgery { border-color: var(--status-danger); }
.timeline-dot.farrier { border-color: var(--bronze); }
.timeline-dot.dental  { border-color: var(--pine); }
.timeline-dot.vaccination { border-color: var(--status-info); }

.timeline-line {
  flex: 1;
  width: 1px;
  background: var(--line);
  margin-top: 2px;
}

.timeline-body { flex: 1; min-width: 0; }

.timeline-date {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.timeline-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.timeline-detail {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.5;
}

/* ============================================================
   9. COMPLIANCE DASHBOARD
   ============================================================ */
.compliance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.compliance-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--panel);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  transition: box-shadow var(--duration-fast);
}

.compliance-card:hover { box-shadow: var(--shadow-md); }

.compliance-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compliance-horse-name {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compliance-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compliance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compliance-item-name {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 500;
}

.compliance-item-date {
  font-size: var(--text-xs);
  color: var(--ink);
  font-weight: 600;
}

/* ============================================================
   10. FORM VALIDATION FEEDBACK
   ============================================================ */
.form-error-summary {
  padding: 12px 14px;
  background: var(--status-danger-soft);
  border: 1px solid rgba(185, 50, 50, 0.2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--status-danger);
  font-weight: 500;
  line-height: 1.5;
}

.form-success-message {
  padding: 12px 14px;
  background: var(--status-ok-soft);
  border: 1px solid rgba(42, 110, 79, 0.2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--status-ok);
  font-weight: 500;
}

/* ============================================================
   11. MODAL OVERLAY
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(33, 18, 11, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  animation: fade-in var(--duration-base) var(--ease-out) forwards;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--panel-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--line);
  animation: slide-up var(--duration-base) var(--ease-out) forwards;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--panel-strong);
  z-index: 1;
}

.modal-title {
  font-family: "Cormorant Garamond", serif;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast);
}
.modal-close:hover { background: var(--line-strong); }

.modal-body { padding: 24px 28px; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 28px;
  border-top: 1px solid var(--line);
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   12. READINESS WIDGET
   ============================================================ */
.readiness-widget {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel);
}

.readiness-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.readiness-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.readiness-indicator.ready   { background: var(--status-ok); box-shadow: 0 0 0 3px var(--status-ok-soft); }
.readiness-indicator.advisory{ background: var(--status-warn); box-shadow: 0 0 0 3px var(--status-warn-soft); }
.readiness-indicator.blocked { background: var(--status-danger); box-shadow: 0 0 0 3px var(--status-danger-soft); }

.readiness-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink);
}

.readiness-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 24px;
}

.readiness-item {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.5;
}

.readiness-item.blocking { color: var(--status-danger); font-weight: 600; }
.readiness-item.advisory { color: var(--status-warn); font-weight: 600; }

/* ============================================================
   13. DATA TABLE
   ============================================================ */
.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.data-table thead tr {
  background: var(--content-bg);
}

.data-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  background: var(--panel);
  transition: background var(--duration-fast);
  cursor: pointer;
}

.data-table tbody tr:hover { background: var(--window-top); }

/* ============================================================
   14. PILL TABS (within a panel)
   ============================================================ */
.pill-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.pill-tab {
  padding: 5px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--line);
  background: transparent;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.pill-tab:hover { border-color: var(--bronze); color: var(--bronze); }
.pill-tab.active { background: var(--oxblood); border-color: var(--oxblood); color: #fff; }

/* ============================================================
   15. EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  gap: 12px;
}

.empty-state-icon {
  font-size: 40px;
  opacity: 0.35;
}

.empty-state-title {
  font-family: "Cormorant Garamond", serif;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.empty-state-body {
  font-size: var(--text-sm);
  color: var(--muted);
  max-width: 300px;
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   16. GLOBAL SPINNER
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--bronze);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ============================================================
   17. HORSE PROFILE — full tabbed detail view
   ============================================================ */
.horse-profile-photo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.horse-profile-photo-placeholder {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--muted);
  flex-shrink: 0;
}

.horse-profile-meta {
  flex: 1;
  min-width: 0;
}

.horse-profile-content {
  margin-top: 12px;
}

.horse-profile-tabs {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.detail-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.timeline-entry {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-entry:last-child { border-bottom: none; }

.timeline-date {
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
  margin-right: 6px;
}

.timeline-title {
  margin: 4px 0 0;
  font-size: var(--text-sm);
}

.doc-file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: var(--text-sm);
}

.reminder-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reminder-list li {
  font-size: var(--text-sm);
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.reminder-list li:last-child { border-bottom: none; }

.text-ok   { color: var(--status-ok); }
.text-warn { color: var(--status-warn); }
.text-danger { color: var(--status-danger); }

.detail-card.warn {
  border-color: var(--status-warn);
  background: color-mix(in srgb, var(--status-warn) 8%, var(--panel));
}

/* ============================================================
   18. RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 768px) {
  .login-card { padding: 28px 20px 24px; }
  .compliance-grid { grid-template-columns: 1fr; }
  .horse-profile-hero { flex-direction: column; }
  .horse-avatar { width: 64px; height: 64px; }
  .modal-card { max-height: 95vh; border-radius: var(--radius-md); }
  .modal-header,
  .modal-body,
  .modal-footer { padding-left: 20px; padding-right: 20px; }
  .toast-container { bottom: 16px; right: 12px; left: 12px; width: auto; }
}

@media (max-width: 480px) {
  .shift-header { flex-direction: column; align-items: flex-start; }
  .data-table { font-size: var(--text-xs); }
  .data-table th,
  .data-table td { padding: 9px 10px; }
}

/* ============================================================
   19. FIRST-RUN ONBOARDING WIZARD
   ============================================================ */

/* Full-screen overlay — sits above everything including the login screen */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 25% 20%, rgba(179, 122, 69, 0.22), transparent 40%),
    linear-gradient(155deg, #1e1108 0%, #2d1a0e 50%, #1a0d06 100%);
  padding: 16px;
  animation: ob-fade-in 0.35s var(--ease-out, cubic-bezier(0.21,1.02,0.73,1)) forwards;
}

@keyframes ob-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Centered card — mobile-first, expands on larger screens */
.onboarding-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(255, 251, 245, 0.97);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(179, 122, 69, 0.22),
    0 32px 80px rgba(0, 0, 0, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.22);
  animation: ob-slide-up 0.4s var(--ease-out, cubic-bezier(0.21,1.02,0.73,1)) forwards;
}

@keyframes ob-slide-up {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* Header strip inside modal */
.onboarding-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid rgba(179, 122, 69, 0.14);
  flex-shrink: 0;
}

.onboarding-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #c88820 0%, #9e6400 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboarding-header-text {
  flex: 1;
  min-width: 0;
}

.onboarding-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #2d1f0e;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

.onboarding-subtitle {
  font-size: 0.8125rem;
  color: #7a6048;
  margin: 3px 0 0;
  line-height: 1.4;
}

/* Step progress pill dots */
.onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px 0;
  flex-shrink: 0;
}

.onboarding-step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #7a6048;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 0 32px 14px;
  flex-shrink: 0;
}

.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: rgba(179, 122, 69, 0.25);
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ob-dot.active {
  width: 28px;
  background: #c88820;
}

.ob-dot.done {
  background: rgba(42, 110, 79, 0.55);
}

/* Scrollable step body */
.onboarding-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  /* clip the slide transitions */
}

.onboarding-steps-track {
  display: flex;
  width: 400%;  /* 4 steps */
  height: 100%;
  transition: transform 0.38s cubic-bezier(0.21, 1.02, 0.73, 1);
}

.onboarding-step {
  width: 25%;   /* each step = 1/4 of the track = 100% of modal width */
  overflow-y: auto;
  padding: 24px 32px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Step heading */
.onboarding-step-heading {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #2d1f0e;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.onboarding-step-copy {
  font-size: 0.8125rem;
  color: #7a6048;
  margin: 0 0 20px;
  line-height: 1.55;
}

/* Form groups within steps */
.onboarding-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.onboarding-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #4a3520;
  letter-spacing: 0.01em;
}

.onboarding-label .ob-optional {
  font-weight: 400;
  color: #9a7d5a;
  font-size: 0.75rem;
  margin-left: 5px;
}

.onboarding-input,
.onboarding-select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid rgba(179, 122, 69, 0.3);
  border-radius: 8px;
  background: #fffbf5;
  color: #2d1f0e;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.onboarding-input:focus,
.onboarding-select:focus {
  outline: none;
  border-color: #c88820;
  box-shadow: 0 0 0 3px rgba(200, 136, 32, 0.18);
}

.onboarding-input::placeholder {
  color: #b8a490;
}

.onboarding-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a7d5a' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.onboarding-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.onboarding-field-error {
  font-size: 0.75rem;
  color: #b93232;
  font-weight: 500;
  margin-top: 2px;
  display: none;
}

.onboarding-form-group.has-error .onboarding-input,
.onboarding-form-group.has-error .onboarding-select {
  border-color: #b93232;
  box-shadow: 0 0 0 3px rgba(185, 50, 50, 0.1);
}

.onboarding-form-group.has-error .onboarding-field-error {
  display: block;
}

/* Age / DOB toggle */
.ob-age-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ob-toggle-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9a7d5a;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.ob-toggle-btn:hover { color: #c88820; }

/* Step 3 optional note */
.ob-skip-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: -4px;
  margin-bottom: 10px;
}

.ob-skip-link {
  font-size: 0.8125rem;
  color: #9a7d5a;
  text-decoration: none;
  border-bottom: 1px dashed #c8a870;
  transition: color 0.15s;
}

.ob-skip-link:hover { color: #c88820; border-bottom-color: #c88820; }

/* Step 4 helper text */
.ob-helper {
  font-size: 0.8125rem;
  color: #7a6048;
  background: rgba(200, 149, 42, 0.08);
  border: 1px solid rgba(200, 149, 42, 0.18);
  border-radius: 8px;
  padding: 10px 13px;
  line-height: 1.55;
  margin-bottom: 14px;
}

/* Bottom navigation bar */
.onboarding-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px 24px;
  border-top: 1px solid rgba(179, 122, 69, 0.14);
  gap: 10px;
  flex-shrink: 0;
}

.ob-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 9px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  border: none;
  min-width: 90px;
}

.ob-btn:active { transform: scale(0.97); }
.ob-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.ob-btn-back {
  background: transparent;
  color: #7a6048;
  border: 1.5px solid rgba(179, 122, 69, 0.3);
}

.ob-btn-back:hover:not(:disabled) {
  background: rgba(200, 136, 32, 0.06);
  border-color: rgba(200, 136, 32, 0.5);
  color: #4a3520;
}

.ob-btn-next {
  background: linear-gradient(135deg, #c88820 0%, #9e6400 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(200, 136, 32, 0.35);
  margin-left: auto;
}

.ob-btn-next:hover:not(:disabled) {
  box-shadow: 0 5px 16px rgba(200, 136, 32, 0.45);
  transform: translateY(-1px);
}

.ob-btn-finish {
  background: linear-gradient(135deg, #2a6e4f 0%, #1d5038 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(42, 110, 79, 0.35);
  margin-left: auto;
}

.ob-btn-finish:hover:not(:disabled) {
  box-shadow: 0 5px 16px rgba(42, 110, 79, 0.45);
  transform: translateY(-1px);
}

/* Loading spinner on finish button */
.ob-btn-finish.loading {
  pointer-events: none;
  opacity: 0.75;
}

/* Success screen */
.onboarding-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 36px 40px;
  gap: 16px;
}

.ob-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(42,110,79,0.12) 0%, rgba(42,110,79,0.06) 100%);
  border: 2px solid rgba(42, 110, 79, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ob-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ob-pop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1);   }
}

.ob-success-heading {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #2d1f0e;
  margin: 0;
  letter-spacing: -0.02em;
}

.ob-success-copy {
  font-size: 0.9375rem;
  color: #7a6048;
  line-height: 1.6;
  margin: 0;
  max-width: 380px;
}

.ob-btn-go {
  background: linear-gradient(135deg, #c88820 0%, #9e6400 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(200, 136, 32, 0.4);
  padding: 12px 28px;
  font-size: 1rem;
  margin-top: 8px;
}

.ob-btn-go:hover {
  box-shadow: 0 6px 20px rgba(200, 136, 32, 0.5);
  transform: translateY(-1px);
}

/* Mobile: full screen, no card rounding on smallest screens */
@media (max-width: 580px) {
  .onboarding-overlay { padding: 0; align-items: flex-end; }
  .onboarding-modal {
    max-width: 100%;
    max-height: 96dvh;
    border-radius: 20px 20px 0 0;
  }
  .onboarding-header { padding: 22px 20px 18px; }
  .onboarding-step   { padding: 20px 20px 8px; }
  .onboarding-nav    { padding: 14px 20px 24px; }
  .onboarding-progress,
  .onboarding-step-label { padding-left: 20px; padding-right: 20px; }
}

/* ============================================================
   20. VOICE CAPTURE — Stall-side dictation FAB + modal
   ============================================================ */

/* --- Floating action button --- */
.voice-fab {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 900;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(145deg, #d4971f 0%, #c8901a 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 14px rgba(200, 144, 26, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.voice-fab:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 20px rgba(200, 144, 26, 0.55),
    0 3px 8px rgba(0, 0, 0, 0.3);
}

.voice-fab:active {
  transform: scale(0.96);
}

.voice-fab[data-recording="true"] {
  background: linear-gradient(145deg, #e53e3e 0%, #c53030 100%);
  box-shadow:
    0 4px 14px rgba(229, 62, 62, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.25);
  animation: voice-fab-pulse 1.6s ease-in-out infinite;
}

@keyframes voice-fab-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(229, 62, 62, 0.5), 0 0 0 0 rgba(229, 62, 62, 0.4); }
  50%       { box-shadow: 0 4px 14px rgba(229, 62, 62, 0.5), 0 0 0 14px rgba(229, 62, 62, 0); }
}

.voice-fab-tooltip {
  position: fixed;
  bottom: 98px;
  right: 24px;
  z-index: 899;
  background: rgba(30, 20, 10, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
  letter-spacing: 0.01em;
}

/* --- Full-screen recording / confirmation modal (bottom sheet) --- */
.voice-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(10, 8, 4, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: voice-modal-in 0.22s ease;
}

@keyframes voice-modal-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.voice-modal-sheet {
  width: 100%;
  max-width: 680px;
  max-height: 96vh;
  background: #1c1208;
  border-radius: 24px 24px 0 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
  animation: voice-sheet-up 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes voice-sheet-up {
  from { transform: translateY(60px); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1; }
}

.voice-modal-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  margin: 14px auto 0;
}

.voice-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.voice-modal-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.voice-modal-horse-name {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  display: block;
  margin-top: 2px;
}

.voice-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s;
}
.voice-modal-close:hover { background: rgba(255, 255, 255, 0.15); }

.voice-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 220px;
}

/* --- Recording state --- */
.voice-recording-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 0 16px;
  text-align: center;
}

.voice-recording-orb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #ff6b6b, #c53030);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: voice-orb-breathe 1.5s ease-in-out infinite;
}

@keyframes voice-orb-breathe {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.5);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 18px rgba(229, 62, 62, 0);
  }
}

.voice-recording-label {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.voice-recording-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

/* --- Live transcript preview area --- */
.voice-transcript-preview {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  min-height: 80px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.35);
  font-style: italic;
  transition: border-color 0.2s, color 0.2s;
}

.voice-transcript-preview.has-text {
  color: rgba(255, 255, 255, 0.8);
  font-style: normal;
  border-color: rgba(200, 144, 26, 0.3);
}

.voice-transcript-preview.interim {
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
  border-color: rgba(200, 144, 26, 0.15);
}

/* --- Processing spinner --- */
.voice-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 0;
  text-align: center;
}

.voice-processing-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(200, 144, 26, 0.2);
  border-top-color: #c8901a;
  border-radius: 50%;
  animation: voice-spin 0.8s linear infinite;
}

@keyframes voice-spin {
  to { transform: rotate(360deg); }
}

.voice-processing-label {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

/* --- Raw transcript label (confirmation step) --- */
.voice-raw-transcript-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
  margin-bottom: 6px;
}

.voice-raw-transcript {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid rgba(200, 144, 26, 0.5);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.6;
  font-style: italic;
}

/* --- Structured data confirmation cards --- */
.voice-structured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.voice-structured-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.voice-structured-card.voice-card-full {
  grid-column: 1 / -1;
}

.voice-structured-card.voice-card-alert {
  border-color: rgba(229, 62, 62, 0.4);
  background: rgba(229, 62, 62, 0.06);
}

.voice-card-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 700;
}

.voice-card-value {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
  font-weight: 500;
}

.voice-card-value.muted {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 400;
  font-style: italic;
}

.voice-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  width: fit-content;
}

.voice-card-badge.badge-alert {
  background: rgba(229, 62, 62, 0.15);
  color: #fc8181;
  border: 1px solid rgba(229, 62, 62, 0.3);
}

.voice-card-badge.badge-ok {
  background: rgba(72, 187, 120, 0.12);
  color: #68d391;
  border: 1px solid rgba(72, 187, 120, 0.25);
}

.voice-card-badge.badge-category {
  background: rgba(200, 144, 26, 0.12);
  color: #e4ac3a;
  border: 1px solid rgba(200, 144, 26, 0.25);
}

.voice-med-list,
.voice-vital-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.voice-med-list li,
.voice-vital-list li {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.4;
}

.voice-med-list li:last-child,
.voice-vital-list li:last-child {
  border-bottom: none;
}

/* --- Action buttons --- */
.voice-modal-actions {
  display: flex;
  gap: 12px;
  padding: 4px 24px 24px;
  flex-wrap: wrap;
}

.voice-btn-primary {
  flex: 1;
  min-width: 140px;
  padding: 15px 20px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(145deg, #d4971f 0%, #c8901a 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 2px 8px rgba(200, 144, 26, 0.4);
  -webkit-tap-highlight-color: transparent;
}

.voice-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(200, 144, 26, 0.5);
}

.voice-btn-primary:active { transform: translateY(0); }

.voice-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.voice-btn-secondary {
  padding: 15px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.voice-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* --- Stop recording button --- */
.voice-stop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(229, 62, 62, 0.35);
  background: rgba(229, 62, 62, 0.08);
  color: #fc8181;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.voice-stop-btn:hover {
  background: rgba(229, 62, 62, 0.14);
  border-color: rgba(229, 62, 62, 0.5);
}

/* --- Mobile responsive --- */
@media (max-width: 480px) {
  .voice-fab { bottom: 20px; right: 16px; width: 56px; height: 56px; }
  .voice-structured-grid { grid-template-columns: 1fr; }
  .voice-structured-card.voice-card-full { grid-column: 1; }
  .voice-modal-body { padding: 16px; }
  .voice-modal-header { padding: 16px 16px 14px; }
  .voice-modal-actions { padding: 4px 16px 20px; }
}

/* ============================================================
   WELLNESS BASELINE & VITAL SIGN ANOMALY DETECTION
   ============================================================ */

/* --- Status badges --- */
.wellness-status-alert {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .03em;
  background: #fde8e8;
  color: #b91c1c;
  border: 1.5px solid #fca5a5;
}

.wellness-status-watch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .03em;
  background: #fff7ed;
  color: #c2410c;
  border: 1.5px solid #fdba74;
}

.wellness-status-normal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .03em;
  background: #f0fdf4;
  color: #15803d;
  border: 1.5px solid #86efac;
}

.wellness-status-insufficient_data {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
  border: 1.5px solid #cbd5e1;
}

/* --- Vitals entry form --- */
.wellness-vitals-form {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px 16px;
  margin-bottom: 20px;
}

.wellness-vitals-form h4 {
  margin: 0 0 14px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.wellness-vitals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px 16px;
  margin-bottom: 14px;
}

.wellness-vitals-grid .field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wellness-vitals-grid label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.wellness-vitals-grid input,
.wellness-vitals-grid select {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  background: var(--bg);
  color: var(--text-primary);
  transition: border-color .15s;
  width: 100%;
  box-sizing: border-box;
}

.wellness-vitals-grid input:focus,
.wellness-vitals-grid select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(179, 122, 69, .12);
}

.wellness-vitals-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.wellness-log-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.wellness-log-btn:hover  { background: var(--accent-dark, #9a6a38); }
.wellness-log-btn:active { transform: scale(.97); }
.wellness-log-btn:disabled { opacity: .6; cursor: not-allowed; }

/* --- Report card --- */
.wellness-report-card {
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
}

.wellness-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.wellness-report-header h4 {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}

.wellness-report-header.alert-header  { background: #fff1f2; border-bottom-color: #fca5a5; }
.wellness-report-header.watch-header  { background: #fff7ed; border-bottom-color: #fdba74; }
.wellness-report-header.normal-header { background: #f0fdf4; border-bottom-color: #86efac; }

.wellness-baseline-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.wellness-baseline-meta span { white-space: nowrap; }

/* --- Finding rows --- */
.wellness-findings-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wellness-finding {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: start;
  gap: 10px 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light, #f1ece5);
  transition: background .1s;
}

.wellness-finding:last-child { border-bottom: none; }
.wellness-finding:hover { background: var(--surface-hover, rgba(0,0,0,.025)); }

.wellness-finding-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-top: 2px;
}

.wellness-finding-message {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.45;
}

.wellness-finding.status-ALERT  { background: #fff8f8; }
.wellness-finding.status-WATCH  { background: #fffbf5; }
.wellness-finding.status-NORMAL { background: transparent; }

.wellness-finding.status-ALERT .wellness-finding-message  { color: #991b1b; }
.wellness-finding.status-WATCH .wellness-finding-message  { color: #92400e; }

/* --- Recommendation block --- */
.wellness-recommendation {
  padding: 14px 18px;
  font-size: var(--text-sm);
  line-height: 1.55;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.wellness-recommendation.rec-alert {
  background: #fff1f2;
  color: #991b1b;
  font-weight: 600;
  border-top-color: #fca5a5;
}

.wellness-recommendation.rec-watch {
  background: #fff7ed;
  color: #92400e;
  border-top-color: #fdba74;
}

/* --- Sparkline container --- */
.wellness-sparkline-section {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
}

.wellness-sparkline-section h4 {
  margin: 0 0 12px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-secondary);
}

.wellness-sparkline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.wellness-sparkline {
  position: relative;
}

.wellness-sparkline-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.wellness-sparkline svg {
  display: block;
  width: 100%;
  height: 52px;
  overflow: visible;
}

.wellness-sparkline-value {
  position: absolute;
  top: 0;
  right: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .wellness-vitals-grid  { grid-template-columns: 1fr 1fr; }
  .wellness-finding      { grid-template-columns: 90px 1fr; }
  .wellness-finding > *:last-child { grid-column: 2; }
  .wellness-sparkline-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   WALLBOARD — Enterprise Command Center
   ============================================================ */

/* Semantic color helpers */
.wbd-ok       { color: #3ecf8e; }
.wbd-advisory { color: #f5a623; }
.wbd-blocked  { color: #ff4d4f; }
.wbd-warning  { color: #faad14; }

/* Wallboard container — takes over the .main area */
.wallboard-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #0d0e12;
  color: #e8eaf0;
  font-family: 'Inter', 'SF Pro Display', system-ui, sans-serif;
}

/* Top header bar */
.wallboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 12px;
  background: #13141a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.wallboard-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wallboard-header-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f5a623;
}

.wallboard-header-title {
  font-size: 20px;
  font-weight: 700;
  color: #f0f2f8;
  margin: 0;
  letter-spacing: -0.02em;
}

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

.wallboard-refresh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ecf8e;
  flex-shrink: 0;
  transition: background 0.2s;
}

.wallboard-refresh-dot.wbd-refreshing {
  background: #f5a623;
  animation: wbd-pulse 0.8s ease infinite;
}

@keyframes wbd-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.wallboard-updated {
  font-size: 12px;
  color: #6e7280;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.wallboard-refresh-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #b0b4c0;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.wallboard-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f0f2f8;
}

/* 2×2 grid */
.wallboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  flex: 1;
  min-height: 0;
  background: rgba(255, 255, 255, 0.06);
}

.wallboard-panel {
  display: flex;
  flex-direction: column;
  background: #13141a;
  min-height: 0;
  overflow: hidden;
}

.wallboard-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 9px;
  background: #0d0e12;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9499a8;
  flex-shrink: 0;
}

.wallboard-panel-header-sub {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-size: 11px;
  color: #5a5e6e;
}

.wallboard-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* Location cards */
.wallboard-location-card {
  background: #1a1c24;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 14px 16px 12px;
  margin-bottom: 12px;
  border-left: 3px solid transparent;
  transition: border-color 0.2s;
}

.wallboard-location-card.wbd-ok      { border-left-color: #3ecf8e; }
.wallboard-location-card.wbd-advisory { border-left-color: #f5a623; }
.wallboard-location-card.wbd-blocked  { border-left-color: #ff4d4f; }

.wallboard-location-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.wallboard-location-name {
  font-size: 15px;
  font-weight: 700;
  color: #f0f2f8;
  letter-spacing: -0.01em;
}

.wallboard-compliance-pct {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* Status bar */
.wallboard-status-bar-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.wallboard-status-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s var(--ease-out, ease-out);
}

.wallboard-status-bar.wbd-ok      { background: #3ecf8e; }
.wallboard-status-bar.wbd-advisory { background: #f5a623; }
.wallboard-status-bar.wbd-blocked  { background: #ff4d4f; }

/* Location meta row */
.wallboard-location-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 8px;
}

.wallboard-metric-row {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 13px;
  color: #c0c4d0;
}

.wbd-label {
  font-size: 11px;
  color: #5a5e6e;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wallboard-location-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wallboard-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}

.wallboard-badge.wbd-ok      { background: rgba(62, 207, 142, 0.15); color: #3ecf8e; border: 1px solid rgba(62,207,142,0.3); }
.wallboard-badge.wbd-advisory { background: rgba(245, 166, 35, 0.15); color: #f5a623; border: 1px solid rgba(245,166,35,0.3); }
.wallboard-badge.wbd-blocked  { background: rgba(255, 77, 79, 0.15); color: #ff4d4f;  border: 1px solid rgba(255,77,79,0.3); }

/* Alert rows */
.wallboard-alert-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wallboard-alert-row:last-child { border-bottom: none; }

.wallboard-alert-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.wallboard-alert-dot.wbd-blocked  { background: #ff4d4f; box-shadow: 0 0 6px rgba(255,77,79,0.5); }
.wallboard-alert-dot.wbd-advisory { background: #f5a623; box-shadow: 0 0 6px rgba(245,166,35,0.4); }
.wallboard-alert-dot.wbd-warning  { background: #faad14; }

.wallboard-alert-content {
  flex: 1;
  min-width: 0;
}

.wallboard-alert-primary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.wallboard-alert-primary strong {
  font-size: 13px;
  font-weight: 700;
  color: #f0f2f8;
}

.wallboard-alert-barn {
  font-size: 11px;
  color: #5a5e6e;
  font-weight: 500;
}

.wallboard-alert-message {
  font-size: 12px;
  color: #8a8f9e;
  line-height: 1.4;
}

.wallboard-alert-action {
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #9499a8;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.wallboard-alert-action:hover {
  background: rgba(255,255,255,0.12);
  color: #f0f2f8;
}

/* Big number display */
.wallboard-big-number {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.wallboard-big-unit {
  font-size: 28px;
  font-weight: 700;
  vertical-align: super;
  letter-spacing: 0;
}

.wallboard-big-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a5e6e;
  margin-bottom: 12px;
}

/* Metric grid (2 cols) */
.wallboard-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wallboard-metric-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 10px 12px;
}

.wallboard-metric-cell strong {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f0f2f8;
}

/* Empty / loading states in wallboard */
.wallboard-empty {
  font-size: 13px;
  color: #5a5e6e;
  padding: 24px 0;
  text-align: center;
}

@media (max-width: 900px) {
  .wallboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
}

/* ============================================================
   GLOBAL SEARCH PALETTE (Cmd+K)
   ============================================================ */

.search-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 300);
  background: rgba(8, 9, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.search-palette-backdrop--visible {
  opacity: 1;
  pointer-events: auto;
}

.search-palette {
  width: 100%;
  max-width: 640px;
  background: #1a1c24;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 32px 80px rgba(0,0,0,0.65),
    0 8px 24px rgba(0,0,0,0.4);
  overflow: hidden;
  transform: translateY(-8px);
  transition: transform 0.15s var(--ease-out, ease-out);
}

.search-palette-backdrop--visible .search-palette {
  transform: translateY(0);
}

/* Input row */
.search-palette-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.search-palette-icon {
  color: #5a5e6e;
  flex-shrink: 0;
  display: flex;
}

.search-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 17px;
  font-weight: 500;
  color: #f0f2f8;
  caret-color: #f5a623;
  min-width: 0;
}

.search-palette-input::placeholder {
  color: #3e4252;
  font-weight: 400;
}

.search-palette-input::-webkit-search-cancel-button { display: none; }

.search-palette-kbd {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #3e4252;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}

/* Results container */
.search-results {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

/* Group header */
.search-result-group {
  padding: 6px 0 2px;
}

.search-result-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3e4252;
  padding: 8px 18px 4px;
}

/* Individual result row */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 0;
}

.search-result-item:hover,
.search-result-item.highlighted {
  background: rgba(245, 166, 35, 0.08);
}

.search-result-item.highlighted .search-result-primary {
  color: #f5a623;
}

.search-result-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  filter: grayscale(20%);
}

.search-result-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.search-result-primary {
  font-size: 14px;
  font-weight: 600;
  color: #e8eaf0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.1s;
}

.search-result-secondary {
  font-size: 12px;
  color: #5a5e6e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* See-all hint */
.search-result-see-all {
  font-size: 11px;
  color: #3e4252;
  padding: 4px 18px 8px;
  font-style: italic;
}

/* Empty / loading / error states */
.search-empty,
.search-loading,
.search-error {
  padding: 28px 24px;
  text-align: center;
  font-size: 14px;
  color: #3e4252;
}

.search-error {
  color: #ff4d4f;
}

.search-loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(245,166,35,0.3);
  border-top-color: #f5a623;
  border-radius: 50%;
  margin-left: 8px;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   PART 1: KEYBOARD SHORTCUT REFERENCE MODAL
   ============================================================ */
.shortcut-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in var(--duration-base) var(--ease-out);
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.shortcut-modal {
  background: var(--panel, #fffbf5);
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-xl, 0 42px 120px rgba(0,0,0,0.25));
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
  animation: slide-up var(--duration-base) var(--ease-out);
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.shortcut-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.shortcut-modal-title {
  font-family: "Cormorant Garamond", serif;
  font-size: var(--text-lg, 1.25rem);
  font-weight: 700;
  color: var(--ink, #1a0e05);
  margin: 0;
  letter-spacing: -0.02em;
}

.shortcut-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--muted, #8a7060);
  border-radius: 4px;
  line-height: 1;
  transition: color var(--duration-fast);
}
.shortcut-modal-close:hover { color: var(--ink, #1a0e05); }

.shortcut-group {
  margin-bottom: 20px;
}

.shortcut-group-label {
  font-size: var(--text-xs, 0.6875rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #8a7060);
  margin: 0 0 8px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.06));
  gap: 12px;
}
.shortcut-row:last-child { border-bottom: none; }

.shortcut-desc {
  font-size: var(--text-sm, 0.8125rem);
  color: var(--ink, #1a0e05);
  flex: 1;
}

.shortcut-keys {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "ui-monospace", "SF Mono", "Consolas", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink, #1a0e05);
  background: var(--window-top, #fff);
  border: 1px solid var(--line-strong, rgba(0,0,0,0.15));
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 6px;
  min-width: 22px;
  line-height: 1.4;
  box-shadow: 0 1px 0 var(--line-strong, rgba(0,0,0,0.12));
}

/* ============================================================
   PART 2: BULK OPERATIONS
   ============================================================ */
.item-card-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  accent-color: var(--bronze, #b37a45);
  cursor: pointer;
  border-radius: 3px;
}

.item-card.bulk-selected {
  border-color: var(--bronze, #b37a45) !important;
  background: var(--bronze-soft, rgba(179,122,69,0.08)) !important;
  box-shadow: 0 0 0 2px rgba(179, 122, 69, 0.2);
}

.bulk-action-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky, 100);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ink, #1a0e05);
  border-top: 1px solid rgba(255,255,255,0.1);
  transform: translateY(100%);
  animation: bulk-bar-in 220ms var(--ease-out, cubic-bezier(0.21,1.02,0.73,1)) forwards;
}

@keyframes bulk-bar-in {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.bulk-count-badge {
  font-size: var(--text-sm, 0.8125rem);
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  margin-right: 4px;
}

.bulk-action-bar .btn-bulk {
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: var(--text-sm, 0.8125rem);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast);
  white-space: nowrap;
}
.bulk-action-bar .btn-bulk:hover {
  background: rgba(255,255,255,0.2);
}
.bulk-action-bar .btn-bulk-cancel {
  margin-left: auto;
  background: none;
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
}
.bulk-action-bar .btn-bulk-cancel:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.toolbar-bulk-toggle {
  margin-left: auto;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong, rgba(0,0,0,0.15));
  background: none;
  color: var(--muted, #8a7060);
  font-size: var(--text-sm, 0.8125rem);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.toolbar-bulk-toggle:hover,
.toolbar-bulk-toggle.active {
  border-color: var(--bronze, #b37a45);
  color: var(--bronze, #b37a45);
  background: var(--bronze-soft, rgba(179,122,69,0.08));
}

/* ============================================================
   PART 4: FILTER BAR
   ============================================================ */
.filter-bar {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 320ms var(--ease-out, cubic-bezier(0.21,1.02,0.73,1)),
              opacity 220ms ease;
  background: var(--window-top, #fdf8f2);
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.07));
  padding: 0 16px;
}
.filter-bar.expanded {
  max-height: 320px;
  opacity: 1;
  padding: 14px 16px 16px;
}

.filter-bar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.filter-group-label {
  font-size: var(--text-xs, 0.6875rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #8a7060);
}

.filter-select,
.filter-input {
  padding: 7px 10px;
  border: 1.5px solid var(--line-strong, rgba(0,0,0,0.14));
  border-radius: 6px;
  font-family: inherit;
  font-size: var(--text-sm, 0.8125rem);
  color: var(--ink, #1a0e05);
  background: var(--window, #fffbf5);
  transition: border-color var(--duration-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.filter-select:focus,
.filter-input:focus {
  border-color: var(--bronze, #b37a45);
  box-shadow: 0 0 0 3px var(--bronze-soft, rgba(179,122,69,0.15));
}

.filter-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-date-range .filter-to-label {
  font-size: var(--text-xs, 0.6875rem);
  color: var(--muted, #8a7060);
  flex-shrink: 0;
}

.filter-bar-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
}

.filter-bar-actions .btn-filter {
  padding: 7px 14px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong, rgba(0,0,0,0.14));
  background: none;
  font-size: var(--text-sm, 0.8125rem);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
  color: var(--ink, #1a0e05);
}
.filter-bar-actions .btn-filter-apply {
  background: var(--bronze, #b37a45);
  border-color: var(--bronze, #b37a45);
  color: #fff;
}
.filter-bar-actions .btn-filter-apply:hover {
  background: #a06830;
}
.filter-bar-actions .btn-filter-clear:hover,
.filter-bar-actions .btn-filter-save:hover {
  border-color: var(--bronze, #b37a45);
  color: var(--bronze, #b37a45);
}

.saved-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.07));
}

.saved-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 10px;
  border-radius: 99px;
  background: var(--bronze-soft, rgba(179,122,69,0.1));
  border: 1px solid rgba(179,122,69,0.25);
  color: var(--bronze, #b37a45);
  font-size: var(--text-xs, 0.6875rem);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.saved-filter-chip:hover { background: rgba(179,122,69,0.18); }

.saved-filter-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 0 0 0 2px;
  opacity: 0.7;
  transition: opacity var(--duration-fast);
}
.saved-filter-chip-remove:hover { opacity: 1; }

.toolbar-filter-toggle {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong, rgba(0,0,0,0.15));
  background: none;
  color: var(--muted, #8a7060);
  font-size: var(--text-sm, 0.8125rem);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.toolbar-filter-toggle:hover,
.toolbar-filter-toggle.active {
  border-color: var(--bronze, #b37a45);
  color: var(--bronze, #b37a45);
  background: var(--bronze-soft, rgba(179,122,69,0.08));
}

/* ============================================================
   PART 5: DARK MODE TOGGLE BUTTON
   ============================================================ */
.dark-mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--line-strong, rgba(0,0,0,0.12));
  background: none;
  cursor: pointer;
  color: var(--muted, #8a7060);
  transition: all var(--duration-fast);
  margin-left: auto;
  flex-shrink: 0;
}
.dark-mode-toggle:hover {
  color: var(--bronze, #b37a45);
  border-color: var(--bronze, #b37a45);
  background: var(--bronze-soft, rgba(179,122,69,0.08));
}
.dark-mode-toggle svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Dark mode session card adjustments */
[data-theme="dark"] .dark-mode-toggle {
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
}
[data-theme="dark"] .dark-mode-toggle:hover {
  color: var(--bronze, #c88820);
  border-color: var(--bronze, #c88820);
  background: rgba(200,136,32,0.12);
}

/* ============================================================
   PART 6: PAGINATION / INFINITE SCROLL
   ============================================================ */
.scroll-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
  visibility: hidden;
}

.load-more-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 8px;
  color: var(--muted, #8a7060);
  font-size: var(--text-sm, 0.8125rem);
}
.load-more-spinner::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong, rgba(0,0,0,0.12));
  border-top-color: var(--bronze, #b37a45);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ============================================================
   PART 8: INLINE ERROR RECOVERY
   ============================================================ */
.load-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  border: 1.5px dashed var(--status-danger-soft, rgba(185,50,50,0.25));
  border-radius: var(--radius-md, 10px);
  background: var(--status-danger-soft, rgba(185,50,50,0.04));
  margin: 16px;
  text-align: center;
}

.load-error p {
  font-size: var(--text-sm, 0.8125rem);
  color: var(--status-danger, #b93232);
  margin: 0;
  font-weight: 500;
}

.load-error .btn-retry {
  padding: 7px 18px;
  border-radius: 6px;
  border: 1.5px solid var(--status-danger, #b93232);
  background: var(--status-danger-soft, rgba(185,50,50,0.08));
  color: var(--status-danger, #b93232);
  font-size: var(--text-sm, 0.8125rem);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.load-error .btn-retry:hover {
  background: var(--status-danger, #b93232);
  color: #fff;
}

/* Search palette legacy selectors — kept for backward compat */
.search-palette-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px 0;
}

.search-palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--duration-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.search-palette-item:hover,
.search-palette-item.focused {
  background: var(--bronze-soft, rgba(179,122,69,0.08));
}

.search-palette-item-name {
  font-size: var(--text-sm, 0.8125rem);
  font-weight: 600;
  color: var(--ink, #1a0e05);
  flex: 1;
}
.search-palette-item-meta {
  font-size: var(--text-xs, 0.6875rem);
  color: var(--muted, #8a7060);
}

.search-palette-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: var(--text-sm, 0.8125rem);
  color: var(--muted, #8a7060);
}
