/* --- App CSS (works with Tailwind CDN) --- */
:root {
  --Surface: #171717;
  --Surface-2: #1C1C1C;
  --Surface-3: #212121;
  --Border: #1D1D1D;
}

/* Global dark fallback (Tailwind handles most) */
body { color: #e5e7eb; } /* text-slate-200 approx */

/* Helpers used across templates */
.navlink { display:flex; align-items:center; gap:8px; height:40px; padding:8px; border-radius:8px; color:#d1d5db; }
.navlink:hover { background:#1C1C1C; color:#fff; }

/* Scrollbar */
*::-webkit-scrollbar { height: 8px; width: 8px; }
*::-webkit-scrollbar-thumb { background-color: #333; border-radius: 8px; }
*::-webkit-scrollbar-track { background: #111; }

/* ---- helpers to match your React classes ---- */
.bg-surface    { background-color: var(--Surface, #171717); }
.bg-background { background-color: #121212; }  /* your exact dark */
.border-deep   { border-color: var(--Border, #1D1D1D); }

/* --- Shared UI helpers (toasts + confirm) --- */
.crm-toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
  z-index: 1200;
}
.crm-toast {
  pointer-events: auto;
  min-width: 220px;
  max-width: 360px;
  background: var(--Surface-2, #1C1C1C);
  color: #fff;
  border: 1px solid var(--Border, #1D1D1D);
  border-left: 4px solid #3b82f6;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 150ms ease, transform 150ms ease;
}
.crm-toast-show { opacity: 1; transform: translateY(0); }
.crm-toast-hide { opacity: 0; transform: translateY(6px); }
.crm-toast-content { display: flex; flex-direction: column; gap: 4px; }
.crm-toast-title { font-weight: 600; font-size: 13px; letter-spacing: 0.01em; }
.crm-toast-message { font-size: 13px; line-height: 1.4; color: #e5e7eb; }
.crm-toast-meta { font-size: 11px; color: #9ca3af; }
.crm-toast-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  height: 24px;
  width: 24px;
  border-radius: 6px;
}
.crm-toast-close:hover { color: #fff; background: #2a2a2a; }
.crm-toast[data-type="success"] { border-left-color: #22c55e; }
.crm-toast[data-type="error"]   { border-left-color: #ef4444; }
.crm-toast[data-type="warning"] { border-left-color: #f59e0b; }
.crm-toast[data-type="info"]    { border-left-color: #3b82f6; }

.crm-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1400;
}
.crm-confirm-dialog {
  width: min(460px, 100%);
  background: var(--Surface, #171717);
  color: #fff;
  border: 1px solid var(--Border, #1D1D1D);
  border-radius: 10px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  padding: 18px 18px 16px;
}
.crm-confirm-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.crm-confirm-body  { font-size: 14px; color: #d1d5db; line-height: 1.5; }
.crm-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.crm-confirm-button {
  background: #1f2937;
  color: #fff;
  border: 1px solid #303642;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.crm-confirm-button.primary { background: #2563eb; border-color: #2563eb; }
.crm-confirm-button.danger  { background: #b91c1c; border-color: #b91c1c; }
.crm-confirm-button:hover { filter: brightness(1.05); }
.crm-confirm-button:focus { outline: 2px solid #60a5fa; outline-offset: 1px; }

/* --- Ticketing UI polish --- */
.ticket-hero {
  position: relative;
  border: 1px solid var(--Border, #1D1D1D);
  background:
    radial-gradient(1200px 220px at 10% -20%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(900px 200px at 90% -30%, rgba(250, 204, 21, 0.14), transparent 55%),
    var(--Surface, #171717);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
  overflow: visible;
}
.ticket-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  pointer-events: none;
  border-radius: inherit;
}
.ticket-panel {
  border: 1px solid var(--Border, #1D1D1D);
  background: var(--Surface, #171717);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}
.ticket-metric {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--Surface-2, #1C1C1C);
  border-radius: 12px;
  padding: 12px 14px;
}
.ticket-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--ticket-pill-bg, #1C1C1C);
  color: var(--ticket-pill-color, #BBB);
  border: 1px solid var(--ticket-pill-border, #2B2B2B);
}
@keyframes ticket-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.ticket-animate { animation: ticket-rise 240ms ease-out both; }
.ticket-animate-delay-1 { animation-delay: 60ms; }
.ticket-animate-delay-2 { animation-delay: 120ms; }
.ticket-animate-delay-3 { animation-delay: 180ms; }
@media (prefers-reduced-motion: reduce) {
  .ticket-animate,
  .ticket-animate-delay-1,
  .ticket-animate-delay-2,
  .ticket-animate-delay-3 { animation: none; }
}
