/* =========================
   Badge base
========================= */
.badge{
  display:inline-flex;
  align-items:center;
  gap:.25rem;
  padding:.35em .6em;
  font-size:.75rem;
  font-weight:700;
  border-radius:.375rem;
  line-height:1;
  white-space:nowrap;
}

/* =========================
   TYPE badges
========================= */
.badge-type-quote{
  background:#e0f2fe;
  color:#075985;
  border:1px solid #bae6fd;
}

.badge-type-invoice{
  background:#fff7ed;
  color:#9a3412;
  border:1px solid #fed7aa;
}

/* =========================
   STATUS badges
========================= */
.badge-status-open{
  background:#eef2ff;
  color:#3730a3;
  border:1px solid #c7d2fe;
}

.badge-status-closed{
  background:#f1f5f9;
  color:#334155;
  border:1px solid #e2e8f0;
}

.badge-status-paid{
  background:#dcfce7;
  color:#166534;
  border:1px solid #bbf7d0;
}

/* =========================
   Tooltip (shared)
========================= */
/* =========================
   Tooltip (shared, modern)
========================= */
.tooltip{
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

/* Tooltip card */
.tooltip-content{
  position: absolute;
  bottom: calc(100% + 10px); /* sits above trigger */
  left: 50%;
  transform: translateX(-50%);

  min-width: 220px;
  max-width: 320px;

  background: #ffffff;
  color: #0f172a;

  padding: 10px 12px;
  border-radius: 10px;

  font-size: .8rem;
  line-height: 1.4;

  white-space: normal;

  border: 1px solid rgba(0,0,0,.12);
  box-shadow:
    0 4px 12px rgba(0,0,0,.08),
    0 16px 32px rgba(0,0,0,.12);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity .15s ease,
    transform .15s ease;

  z-index: 9999;
}

/* Hover state */
.tooltip:hover .tooltip-content{
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-2px);
}

/* Arrow (real triangle, not diamond) */
.tooltip-content::after{
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);

  width: 0;
  height: 0;

  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #ffffff;

  filter: drop-shadow(0 1px 0 rgba(0,0,0,.12));
}

/* Optional: subtle fade-in lift */
.tooltip:hover .tooltip-content{
  animation: tooltipFadeUp .15s ease-out;
}

@keyframes tooltipFadeUp{
  from{
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
  to{
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
  }
}

/* =========================================================
   Tooltip — Mobile reliability patch (NO style change)
   Keeps your current look; just makes it work on iPhone.
   Add BELOW your existing tooltip CSS.
========================================================= */

/* Make the tooltip trigger tappable */
.tooltip{
  -webkit-tap-highlight-color: transparent;
}

/* If your trigger is a span, it may not receive focus on iOS.
   This makes it possible to tap-and-hold / tap to show using :active.
   (If you can, best is to make tooltip-icon a <button>, but not required.) */
.tooltip .tooltip-icon{
  cursor: pointer;
}

/* Show on tap (active) — iOS/Android */
.tooltip:active .tooltip-content{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-2px);
}

/* Show when any child can be focused (works great if tooltip-icon is a <button> or <a>) */
.tooltip:focus-within .tooltip-content{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-2px);
}

/* If you ever wrap tooltips in labels, prevent weird selection on long-press */
.tooltip,
.tooltip *{
  -webkit-user-select: none;
  user-select: none;
}

/* Keep it on-screen on small devices */
@media (max-width: 767.98px){
  .tooltip-content.tooltip-wide{
    width: min(360px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }
}
