/* ==========================================================================
   WACRM — WhatsApp CRM Application Stylesheet
   Design System: shadcn/ui New York style (Tailwind CSS 4 equivalent)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET & BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background-color: var(--background);
  color: var(--foreground);
}

/* --------------------------------------------------------------------------
   2. CSS CUSTOM PROPERTIES — LIGHT THEME (default)
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --background: #ffffff;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --card-foreground: #0a0a0a;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --ring: #7c3aed;

  /* Accent */
  --primary: #7c3aed;
  --primary-foreground: #ffffff;
  --primary-hover: #6d28d9;

  /* Destructive */
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;

  /* Secondary / Outline */
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --accent: #f4f4f5;
  --accent-foreground: #18181b;

  /* Scrollbar */
  --scrollbar-thumb: #a1a1aa;
  --scrollbar-track: transparent;

  /* Dialog overlay */
  --overlay: rgba(0, 0, 0, 0.5);

  /* Focus ring */
  --ring-offset: #ffffff;

  /* Sidebar */
  --sidebar: #fafafa;
  --sidebar-foreground: #0a0a0a;

  /* Radius */
  --radius: 0.5rem;
}

/* --------------------------------------------------------------------------
   3. CSS CUSTOM PROPERTIES — DARK THEME
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #0a0a0f;
  --card-foreground: #fafafa;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --border: #27272a;
  --ring: #7c3aed;

  --primary: #7c3aed;
  --primary-foreground: #ffffff;
  --primary-hover: #8b5cf6;

  --destructive: #ef4444;
  --destructive-foreground: #ffffff;

  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --accent: #27272a;
  --accent-foreground: #fafafa;

  --scrollbar-thumb: #3f3f46;
  --scrollbar-track: transparent;

  --overlay: rgba(0, 0, 0, 0.7);

  --ring-offset: #09090b;

  --sidebar: #0a0a0a;
  --sidebar-foreground: #fafafa;
}

/* --------------------------------------------------------------------------
   4. TYPOGRAPHY UTILITIES
   -------------------------------------------------------------------------- */
.text-xs   { font-size: 0.75rem; line-height: 1rem; }
.text-sm   { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg   { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl  { font-size: 1.5rem; line-height: 2rem; }

.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.capitalize  { text-transform: capitalize; }

/* --------------------------------------------------------------------------
   5. LAYOUT & SPACING UTILITIES
   -------------------------------------------------------------------------- */
/* Padding */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* Margin */
.m-0  { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.ml-1 { margin-left: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }

/* Gap */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* Stacked vertical spacing (uses child selectors) */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* Flexbox */
.flex       { display: flex; }
.flex-1     { flex: 1 1 0%; }
.flex-col   { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }

/* Grid */
.grid        { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Sizing */
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.h-8     { height: 2rem; }
.h-9     { height: 2.25rem; }
.h-10    { height: 2.5rem; }
.w-8     { width: 2rem; }
.w-10    { width: 2.5rem; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }

/* Border & Radius */
.rounded-lg   { border-radius: var(--radius); }
.rounded-xl   { border-radius: 0.75rem; }
.rounded-md   { border-radius: 0.375rem; }
.rounded-full { border-radius: 9999px; }

/* Overflow */
.overflow-hidden  { overflow: hidden; }
.overflow-auto    { overflow: auto; }
.overflow-y-auto  { overflow-y: auto; }

/* Max-width */
.max-w-sm  { max-width: 24rem; }
.max-w-md  { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto   { margin-left: auto; margin-right: auto; }

/* Visibility & Effects */
.hidden      { display: none !important; }
.sr-only     { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.opacity-10  { opacity: 0.1; }
.opacity-20  { opacity: 0.2; }
.cursor-pointer { cursor: pointer; }

/* Transitions */
.transition-colors  { transition-property: color, background-color, border-color; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.transition-shadow  { transition-property: box-shadow; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* Backgrounds */
.bg-background { background-color: var(--background); }
.bg-card      { background-color: var(--card); }
.bg-muted     { background-color: var(--muted); }
.bg-muted\/50 { background-color: color-mix(in srgb, var(--muted) 50%, transparent); }
[data-theme="dark"] .bg-muted\/50 { background-color: rgba(39, 39, 42, 0.5); }

/* Solid color backgrounds */
.bg-violet-600  { background-color: #7c3aed; }
.bg-violet-700  { background-color: #6d28d9; }
.bg-violet-500  { background-color: #8b5cf6; }
.bg-violet-400  { background-color: #a78bfa; }
.bg-emerald-600 { background-color: #059669; }
.bg-emerald-500 { background-color: #10b981; }
.bg-sky-600     { background-color: #0284c7; }
.bg-sky-500     { background-color: #0ea5e9; }
.bg-amber-600   { background-color: #d97706; }
.bg-amber-500   { background-color: #f59e0b; }
.bg-rose-500    { background-color: #f43f5e; }
.bg-red-500     { background-color: #ef4444; }
.bg-red-600     { background-color: #dc2626; }
.bg-black       { background-color: #000000; }
.bg-destructive { background-color: var(--destructive); }

/* Semi-transparent backgrounds */
.bg-black\/50       { background-color: rgba(0, 0, 0, 0.5); }
.bg-violet-600\/10  { background-color: rgba(124, 58, 237, 0.1); }
.bg-violet-600\/15  { background-color: rgba(124, 58, 237, 0.15); }
.bg-violet-600\/20  { background-color: rgba(124, 58, 237, 0.2); }
.bg-violet-500\/10  { background-color: rgba(139, 92, 246, 0.1); }
.bg-violet-500\/5   { background-color: rgba(139, 92, 246, 0.05); }
.bg-violet-500\/20  { background-color: rgba(139, 92, 246, 0.2); }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.2); }
.bg-sky-500\/10     { background-color: rgba(14, 165, 233, 0.1); }
.bg-amber-500\/10   { background-color: rgba(245, 158, 11, 0.1); }
.bg-red-500\/10     { background-color: rgba(239, 68, 68, 0.1); }
.bg-destructive\/10 { background-color: rgba(239, 68, 68, 0.1); }
.bg-destructive\/90 { background-color: rgba(239, 68, 68, 0.9); }

/* Text colors */
.text-foreground       { color: var(--foreground); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-violet-500       { color: #8b5cf6; }
.text-violet-400       { color: #a78bfa; }
.text-violet-600       { color: #7c3aed; }
.text-emerald-500      { color: #10b981; }
.text-emerald-600      { color: #059669; }
.text-sky-500          { color: #0ea5e9; }
.text-sky-600          { color: #0284c7; }
.text-amber-500        { color: #f59e0b; }
.text-amber-600        { color: #d97706; }
.text-red-500          { color: #ef4444; }
.text-red-600          { color: #dc2626; }
.text-destructive      { color: var(--destructive); }
.text-destructive-foreground { color: var(--destructive-foreground); }
.text-white            { color: #ffffff; }
.text-white\/70        { color: rgba(255, 255, 255, 0.7); }
.text-white\/60        { color: rgba(255, 255, 255, 0.6); }

/* Z-index */
.z-40  { z-index: 40; }
.z-50  { z-index: 50; }
.z-\[60\]  { z-index: 60; }
.z-\[70\]  { z-index: 70; }
.z-\[100\] { z-index: 100; }

/* Arbitrary sizing */
.max-h-\[85vh\] { max-height: 85vh; }
.max-w-\[75\%\]  { max-width: 75%; }
.text-\[10px\]   { font-size: 10px; }
.text-\[11px\]   { font-size: 11px; }
.text-violet-200  { color: #ddd6fe; }

/* Ring utility */
.ring-2               { box-shadow: 0 0 0 2px var(--ring); }
.ring-transparent      { box-shadow: 0 0 0 2px transparent; }
.ring-violet-500      { box-shadow: 0 0 0 2px #8b5cf6; }
.ring-offset-2        { --tw-ring-offset: 2px; box-shadow: 0 0 0 2px var(--ring), 0 0 0 var(--tw-ring-offset, 2px) var(--ring-offset, var(--background)); }
.ring-offset-background { --ring-offset: var(--background); }

/* Focus rings */
.focus\:ring-1:focus  { box-shadow: 0 0 0 1px var(--ring); }
.focus\:ring-ring:focus { --ring: #7c3aed; }

/* Hover states */
.hover\:bg-muted:hover { background-color: var(--muted); }
.hover\:bg-muted\/50:hover { background-color: color-mix(in srgb, var(--muted) 50%, transparent); }
[data-theme="dark"] .hover\:bg-muted\/50:hover { background-color: rgba(39, 39, 42, 0.5); }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
[data-theme="dark"] .hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3); }
.hover\:text-foreground:hover { color: var(--foreground); }
.hover\:bg-destructive\/90:hover { background-color: rgba(239, 68, 68, 0.9); }
.hover\:bg-red-500\/10:hover { background-color: rgba(239, 68, 68, 0.1); }
.hover\:text-red-600:hover { color: #dc2626; }
.hover\:border-violet-400:hover { border-color: #a78bfa; }

/* Responsive — sm: */
@media (min-width: 640px) {
  .sm\:flex-row    { flex-direction: row; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:max-w-md    { max-width: 28rem; }
  .sm\:items-center { align-items: center; }
}

/* Responsive — md: */
@media (min-width: 768px) {
  .md\:hidden       { display: none; }
  .md\:flex         { display: flex; }
  .md\:relative     { position: relative; }
  .md\:translate-x-0 { transform: translateX(0); }
  .md\:grid-cols-2  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3  { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:p-6          { padding: 1.5rem; }
}

/* --------------------------------------------------------------------------
   6. COMPONENT — Button
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 150ms, background-color 150ms, border-color 150ms, box-shadow 150ms;
  white-space: nowrap;
  user-select: none;
  outline: none;
  text-decoration: none;
}
.btn:focus-visible {
  box-shadow: 0 0 0 2px var(--ring-offset), 0 0 0 4px var(--ring);
}
.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Variants */
.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-outline {
  background-color: transparent;
  color: var(--foreground);
  border-color: var(--border);
}
.btn-outline:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
  border-color: transparent;
}
.btn-ghost:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-destructive {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  border-color: var(--destructive);
}
.btn-destructive:hover { background-color: #dc2626; }

/* Sizes */
.btn-sm {
  height: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
}

/* --------------------------------------------------------------------------
   7. COMPONENT — Input / Textarea / Select
   -------------------------------------------------------------------------- */
.input,
.textarea,
.select {
  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--foreground);
  background-color: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--muted-foreground);
}
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 20%, transparent);
}

.textarea {
  height: auto;
  min-height: 80px;
  resize: vertical;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

/* --------------------------------------------------------------------------
   8. COMPONENT — Checkbox
   -------------------------------------------------------------------------- */
.checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   9. COMPONENT — Switch (Toggle)
   -------------------------------------------------------------------------- */
.switch {
  position: relative;
  display: inline-flex;
  width: 2.75rem;
  height: 1.5rem;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background-color: var(--input, var(--muted));
  transition: background-color 200ms, border-color 200ms;
  vertical-align: middle;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  background-color: var(--foreground);
  transition: transform 200ms;
  pointer-events: none;
}
.switch[aria-checked="true"],
.switch.is-active {
  background-color: var(--primary);
  border-color: var(--primary);
}
.switch[aria-checked="true"]::after,
.switch.is-active::after {
  transform: translateX(1.25rem);
  background-color: var(--primary-foreground);
}

/* --------------------------------------------------------------------------
   10. COMPONENT — Card
   -------------------------------------------------------------------------- */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--card-foreground);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.5rem 1.5rem 0.75rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--card-foreground);
}

.card-content {
  padding: 0.75rem 1.5rem 1.5rem;
}

/* --------------------------------------------------------------------------
   11. COMPONENT — Badge
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25rem;
  border-radius: 9999px;
  white-space: nowrap;
  transition: color 150ms, background-color 150ms;
}

.badge-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-outline {
  background-color: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}

.badge-violet {
  background-color: #7c3aed;
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   12. COMPONENT — Table
   -------------------------------------------------------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  caption-side: bottom;
  font-size: 0.875rem;
}
.table-header {
  background-color: var(--muted);
}
.table-header .table-head {
  color: var(--muted-foreground);
  font-weight: 500;
  text-align: left;
  padding: 0.5rem 1rem;
  white-space: nowrap;
}
.table-body .table-row {
  border-bottom: 1px solid var(--border);
  transition: background-color 150ms;
}
.table-body .table-row:last-child {
  border-bottom: none;
}
.table-body .table-row:hover {
  background-color: var(--muted) !important;
}
.table-cell {
  padding: 0.75rem 1rem;
  vertical-align: middle;
}
.table-head {
  padding: 0.5rem 1rem;
  text-align: left;
  font-weight: 500;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   13. COMPONENT — Tabs
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  flex-direction: column;
}

.tabs-list {
  display: inline-flex;
  height: 2.5rem;
  items-center: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: var(--radius);
  background-color: var(--muted);
  padding: 0.25rem;
  width: fit-content;
}

.tabs-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border-radius: calc(var(--radius) - 2px);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 150ms, background-color 150ms, box-shadow 150ms;
  white-space: nowrap;
}
.tabs-trigger:hover {
  color: var(--foreground);
}
.tabs-trigger[aria-selected="true"],
.tabs-trigger.is-active {
  background-color: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tabs-content {
  margin-top: 1rem;
}

/* --------------------------------------------------------------------------
   14. COMPONENT — Dialog (overlay + panel)
   -------------------------------------------------------------------------- */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 28rem;
  background-color: var(--card);
  color: var(--card-foreground);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.dialog-header {
  margin-bottom: 1rem;
}

.dialog-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
}

.dialog-content {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   15. COMPONENT — Dropdown
   -------------------------------------------------------------------------- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 40;
  min-width: 8rem;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--foreground);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  padding: 0.25rem;
  animation: dropdown-in 150ms ease-out;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: var(--foreground);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background-color 150ms;
  border: none;
  background: none;
  text-align: left;
}
.dropdown-item:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

/* --------------------------------------------------------------------------
   16. COMPONENT — Skeleton (loading)
   -------------------------------------------------------------------------- */
.skeleton {
  background-color: var(--muted);
  border-radius: var(--radius);
  animation: skeleton-pulse 2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   17. COMPONENT — Spinner
   -------------------------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 9999px;
  animation: spin 0.6s linear infinite;
}

/* --------------------------------------------------------------------------
   18. COMPONENT — Separator
   -------------------------------------------------------------------------- */
.separator {
  height: 1px;
  width: 100%;
  background-color: var(--border);
  border: none;
}

/* --------------------------------------------------------------------------
   19. COMPONENT — Progress
   -------------------------------------------------------------------------- */
.progress {
  height: 0.5rem;
  width: 100%;
  background-color: var(--muted);
  border-radius: 9999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background-color: var(--primary);
  border-radius: 9999px;
  transition: width 300ms ease;
}

/* --------------------------------------------------------------------------
   20. COMPONENT — Toast (container)
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 24rem;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background-color: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  animation: toast-in 300ms ease-out;
}

/* --------------------------------------------------------------------------
   21. COMPONENT — Scroll Area & Custom Scrollbar
   -------------------------------------------------------------------------- */
.scroll-area {
  overflow-y: auto;
  overflow-x: hidden;
}
.scroll-area::-webkit-scrollbar {
  width: 6px;
}
.scroll-area::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
.scroll-area::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 9999px;
}
.scroll-area::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}

/* Limited height scroll variants */
.max-h-96 { max-height: 24rem; }
.max-h-64 { max-height: 16rem; }

/* Global thin scrollbar on any overflow-y-auto (fallback) */
.overflow-y-auto::-webkit-scrollbar {
  width: 6px;
}
.overflow-y-auto::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
.overflow-y-auto::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 9999px;
}

/* --------------------------------------------------------------------------
   22. ANIMATION — animate-in (dialogs / toasts)
   -------------------------------------------------------------------------- */
@keyframes animate-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.animate-in {
  animation: animate-in 200ms ease-out;
}

/* --------------------------------------------------------------------------
   23. PAGE — Inbox (split-pane layout)
   -------------------------------------------------------------------------- */
.inbox-layout {
  display: flex;
  height: calc(100vh - 3.5rem);
  overflow: hidden;
}

.inbox-sidebar {
  width: 100%;
  max-width: 380px;
  min-width: 280px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background-color: var(--card);
  flex-shrink: 0;
}

.inbox-conversations {
  flex: 1;
  overflow-y: auto;
}

.inbox-conversation-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background-color 150ms;
}
.inbox-conversation-item:hover,
.inbox-conversation-item.is-active {
  background-color: var(--muted);
}

.inbox-conversation-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background-color: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.inbox-conversation-meta {
  flex: 1;
  min-width: 0;
}

.inbox-conversation-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--foreground);
}

.inbox-conversation-preview {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  min-width: 0;
}

.inbox-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.inbox-message {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  max-width: 70%;
}

.inbox-message--sent {
  margin-left: auto;
  flex-direction: row-reverse;
}

.inbox-message-bubble {
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
}
.inbox-message--received .inbox-message-bubble {
  background-color: var(--muted);
  color: var(--foreground);
  border-bottom-left-radius: 0.25rem;
}
.inbox-message--sent .inbox-message-bubble {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-bottom-right-radius: 0.25rem;
}

.inbox-message-time {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
  text-align: right;
}

.inbox-input-area {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.inbox-input-area .input {
  flex: 1;
  min-width: 0;
}

/* Mobile: stack inbox panels */
@media (max-width: 767px) {
  .inbox-layout { flex-direction: column; }
  .inbox-sidebar { max-width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 45vh; }
}

/* --------------------------------------------------------------------------
   24. PAGE — Contacts (table with horizontal scroll)
   -------------------------------------------------------------------------- */
.contacts-page {
  padding: 1.5rem;
}

.contacts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.contacts-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
}

/* --------------------------------------------------------------------------
   25. PAGE — Groups (card grid)
   -------------------------------------------------------------------------- */
.groups-page {
  padding: 1.5rem;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 640px) {
  .groups-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .groups-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.group-card {
  transition: box-shadow 150ms, border-color 150ms;
}
.group-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  border-color: var(--muted-foreground);
}

.group-card-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background-color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.group-card-info {
  flex: 1;
  min-width: 0;
}

.group-card-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--foreground);
}

.group-card-desc {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   26. PAGE — Templates (table with status badges)
   -------------------------------------------------------------------------- */
.templates-page {
  padding: 1.5rem;
}

.template-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.template-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  flex-shrink: 0;
}
.template-status-dot--approved  { background-color: #22c55e; }
.template-status-dot--pending   { background-color: #f59e0b; }
.template-status-dot--rejected  { background-color: #ef4444; }

/* --------------------------------------------------------------------------
   27. APP SHELL (sidebar + header + main)
   -------------------------------------------------------------------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 16rem;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background-color: var(--sidebar);
  color: var(--sidebar-foreground);
  display: flex;
  flex-direction: column;
  padding-top: 0.5rem;
  transition: transform 200ms ease;
  z-index: 30;
}

.app-sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin: 0.125rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms, background-color 150ms;
  border: none;
  background: none;
  width: calc(100% - 1rem);
  text-align: left;
}
.app-sidebar-nav-item:hover {
  color: var(--foreground);
  background-color: var(--accent);
}
.app-sidebar-nav-item.is-active {
  color: var(--foreground);
  background-color: var(--accent);
  font-weight: 500;
}

.app-sidebar-nav-item svg,
.app-sidebar-nav-item .icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-header {
  height: 3.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 0.75rem;
  background-color: var(--background);
  flex-shrink: 0;
}

.app-content {
  flex: 1;
  overflow: hidden;
}

/* Mobile sidebar: off-canvas */
@media (max-width: 767px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .app-sidebar.is-open {
    transform: translateX(0);
  }
}

/* --------------------------------------------------------------------------
   28. WHATSAPP GREEN ACCENT (brand colour for CRM identity)
   -------------------------------------------------------------------------- */
:root {
  --whatsapp: #25d366;
  --whatsapp-dark: #128c7e;
}

.whatsapp-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: var(--whatsapp);
  display: inline-block;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   29. MISC HELPERS
   -------------------------------------------------------------------------- */

/* Staggered alternating rows (used inside tables) */
.table-body .table-row:nth-child(even) {
  background-color: transparent;
}

/* Focus ring utility — apply to any interactive element */
.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ring-offset), 0 0 0 4px var(--ring);
}

/* Remove default list styles */
.list-unstyled {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Image/avatar circle */
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm {
  width: 2rem;
  height: 2rem;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted-foreground);
}
.empty-state svg,
.empty-state .icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* ==========================================================================
   30. TAILWIND-STYLE UTILITY CLASSES
   ========================================================================== */

/* --------------------------------------------------------------------------
   30a. Display & Flexbox
   -------------------------------------------------------------------------- */
.hidden { display: none; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }
.self-center { align-self: center; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.space-y-0 > * + * { margin-top: 0; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* --------------------------------------------------------------------------
   30b. Sizing — Width
   -------------------------------------------------------------------------- */
.w-full { width: 100%; }
.w-4 { width: 1rem; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-60 { width: 15rem; }
.w-64 { width: 16rem; }
.min-w-0 { min-width: 0; }
.min-w-5 { min-width: 1.25rem; }
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-\[75\%\] { max-width: 75%; }

/* --------------------------------------------------------------------------
   30c. Sizing — Height
   -------------------------------------------------------------------------- */
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.h-auto { height: auto; }
.min-h-screen { min-height: 100vh; }
.max-h-64 { max-height: 16rem; }
.max-h-96 { max-height: 24rem; }
.max-h-\[85vh\] { max-height: 85vh; }

/* --------------------------------------------------------------------------
   30d. Spacing — Padding
   -------------------------------------------------------------------------- */
.p-0 { padding: 0; }
.p-0\.5 { padding: 0.125rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-2 { padding-top: 0.5rem; }
.pr-2 { padding-right: 0.5rem; }
.pr-10 { padding-right: 2.5rem; }
.pl-9 { padding-left: 2.25rem; }

/* --------------------------------------------------------------------------
   30e. Spacing — Margin
   -------------------------------------------------------------------------- */
.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-auto { margin-top: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-auto { margin-left: auto; }
.mr-1 { margin-right: 0.25rem; }
.mr-1\.5 { margin-right: 0.375rem; }
.mr-2 { margin-right: 0.5rem; }
.-ml-2\.5 { margin-left: -0.625rem; }

/* --------------------------------------------------------------------------
   30f. Typography
   -------------------------------------------------------------------------- */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.break-words { overflow-wrap: break-word; }
.break-all { word-break: break-all; }
.select-all { user-select: all; }
.capitalize { text-transform: capitalize; }
.tracking-tight { letter-spacing: -0.025em; }
.leading-none { line-height: 1; }
.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }

/* --------------------------------------------------------------------------
   30g. Colors — Background
   -------------------------------------------------------------------------- */
.bg-background { background-color: var(--background); }
.bg-card { background-color: var(--card); }
.bg-muted { background-color: var(--muted); }
.bg-foreground { background-color: var(--foreground); }
.bg-white { background-color: #ffffff; }
.bg-black\/50 { background-color: rgba(0, 0, 0, 0.5); }

/* Violet backgrounds */
.bg-violet-50 { background-color: #f5f3ff; }
.bg-violet-100 { background-color: #ede9fe; }
.bg-violet-200 { background-color: #ddd6fe; }
.bg-violet-300 { background-color: #c4b5fd; }
.bg-violet-400 { background-color: #a78bfa; }
.bg-violet-500 { background-color: #8b5cf6; }
.bg-violet-600 { background-color: #7c3aed; }
.bg-violet-500\/5 { background-color: rgba(139, 92, 246, 0.05); }
.bg-violet-500\/10 { background-color: rgba(139, 92, 246, 0.1); }
.bg-violet-500\/20 { background-color: rgba(139, 92, 246, 0.2); }
.bg-violet-600\/10 { background-color: rgba(124, 58, 237, 0.1); }
.bg-violet-600\/20 { background-color: rgba(124, 58, 237, 0.2); }

/* Emerald backgrounds */
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-emerald-600 { background-color: #059669; }

/* Sky backgrounds */
.bg-sky-500\/10 { background-color: rgba(14, 165, 233, 0.1); }
.bg-sky-500 { background-color: #0ea5e9; }

/* Amber backgrounds */
.bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.1); }
.bg-amber-500 { background-color: #f59e0b; }

/* Red backgrounds */
.bg-red-500 { background-color: #ef4444; }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.1); }
.bg-red-500\/20 { background-color: rgba(239, 68, 68, 0.2); }

/* Rose backgrounds */
.bg-rose-500 { background-color: #f43f5e; }

/* Destructive background */
.bg-destructive\/10 { background-color: color-mix(in srgb, var(--destructive) 10%, transparent); }

/* Gray */
.bg-gray-400 { background-color: #9ca3af; }

/* --------------------------------------------------------------------------
   30h. Colors — Text
   -------------------------------------------------------------------------- */
.text-foreground { color: var(--foreground); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-white { color: #ffffff; }
.text-white\/30 { color: rgba(255, 255, 255, 0.3); }
.text-white\/70 { color: rgba(255, 255, 255, 0.7); }
.text-primary-foreground { color: var(--primary-foreground); }

/* Violet text */
.text-violet-400 { color: #a78bfa; }
.text-violet-500 { color: #8b5cf6; }
.text-violet-600 { color: #7c3aed; }

/* Red text */
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }

/* Emerald text */
.text-emerald-500 { color: #10b981; }
.text-emerald-600 { color: #059669; }

/* Amber text */
.text-amber-500 { color: #f59e0b; }
.text-amber-600 { color: #d97706; }

/* Sky text */
.text-sky-500 { color: #0ea5e9; }
.text-sky-600 { color: #0284c7; }

/* Rose text */
.text-rose-500 { color: #f43f5e; }

/* Gray text */
.text-gray-400 { color: #9ca3af; }

/* Destructive text */
.text-destructive { color: var(--destructive); }

/* Font family */
.font-mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; }

/* White space */
.whitespace-nowrap { white-space: nowrap; }

/* --------------------------------------------------------------------------
   30i. Colors — Border
   -------------------------------------------------------------------------- */
.border-border { border-color: var(--border); }
.border-input { border-color: var(--input); }
.border-violet-400 { border-color: #a78bfa; }
.border-violet-500 { border-color: #8b5cf6; }
.border-transparent { border-color: transparent; }
.border-red-500 { border-color: #ef4444; }
.border-red-500\/20 { border-color: rgba(239, 68, 68, 0.2); }
.border-emerald-500\/20 { border-color: rgba(16, 185, 129, 0.2); }
.border-violet-500\/20 { border-color: rgba(139, 92, 246, 0.2); }
.border-violet-500\/30 { border-color: rgba(139, 92, 246, 0.3); }

/* --------------------------------------------------------------------------
   30j. Borders
   -------------------------------------------------------------------------- */
.border {
  border-width: 1px;
  border-style: solid;
  border-color: var(--border);
}
.border-b { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: var(--border); }
.border-b-2 { border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: currentColor; }
.border-r { border-right-width: 1px; border-right-style: solid; border-right-color: var(--border); }
.border-t { border-top-width: 1px; border-top-style: solid; border-top-color: var(--border); }
.border-l { border-left-width: 1px; border-left-style: solid; border-left-color: var(--border); }
.border-2 { border-width: 2px; }
.border-dashed { border-style: dashed; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* --------------------------------------------------------------------------
   30k. Positioning
   -------------------------------------------------------------------------- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.static { position: static; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-1\/2 { top: 50%; }
.top-full { top: 100%; }
.right-0 { right: 0; }
.right-3 { right: 0.75rem; }
.bottom-0 { bottom: 0; }
.bottom-4 { bottom: 1rem; }
.left-0 { left: 0; }
.left-3 { left: 0.75rem; }

/* --------------------------------------------------------------------------
   30l. Transforms
   -------------------------------------------------------------------------- */
.-translate-y-1\/2 { transform: translateY(-50%); }
.-translate-x-full { transform: translateX(-100%); }
.translate-x-0 { transform: translateX(0); }

/* --------------------------------------------------------------------------
   30m. Z-index
   -------------------------------------------------------------------------- */
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-\[60\] { z-index: 60; }
.z-\[70\] { z-index: 70; }
.z-\[100\] { z-index: 100; }

/* --------------------------------------------------------------------------
   30n. Overflow
   -------------------------------------------------------------------------- */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }

/* --------------------------------------------------------------------------
   30o. Opacity
   -------------------------------------------------------------------------- */
.opacity-0 { opacity: 0; }
.opacity-20 { opacity: 0.2; }
.opacity-30 { opacity: 0.3; }
.opacity-40 { opacity: 0.4; }
.opacity-50 { opacity: 0.5; }
.opacity-60 { opacity: 0.6; }
.opacity-70 { opacity: 0.7; }
.opacity-80 { opacity: 0.8; }
.opacity-100 { opacity: 1; }

/* --------------------------------------------------------------------------
   30p. Cursor
   -------------------------------------------------------------------------- */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-default { cursor: default; }

/* --------------------------------------------------------------------------
   30q. Transitions
   -------------------------------------------------------------------------- */
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.transition-shadow { transition-property: box-shadow; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.transition-all { transition-property: all; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.transition-opacity { transition-property: opacity; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.transition-transform { transition-property: transform; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* --------------------------------------------------------------------------
   30r. Hover States
   -------------------------------------------------------------------------- */
.hover\:bg-muted:hover { background-color: var(--muted); }
.hover\:bg-muted\/50:hover { background-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.hover\:text-foreground:hover { color: var(--foreground); }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.hover\:bg-violet-400:hover { background-color: #a78bfa; }
.hover\:text-red-600:hover { color: #dc2626; }
.hover\:bg-red-500\/10:hover { background-color: rgba(239, 68, 68, 0.1); }
.hover\:border-violet-400:hover { border-color: #a78bfa; }
.hover\:text-violet-600:hover { color: #7c3aed; }
.hover\:bg-violet-700:hover { background-color: #6d28d9; }
.hover\:bg-destructive\/90:hover { background-color: color-mix(in srgb, var(--destructive) 90%, transparent); }

/* --------------------------------------------------------------------------
   30s. Focus States
   -------------------------------------------------------------------------- */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-1:focus { box-shadow: 0 0 0 1px var(--ring); }
.focus\:ring-ring:focus { box-shadow: 0 0 0 1px var(--ring); }

/* --------------------------------------------------------------------------
   30t. States
   -------------------------------------------------------------------------- */
.disabled\:opacity-60:disabled { opacity: 0.6; }
.pointer-events-none { pointer-events: none; }

/* --------------------------------------------------------------------------
   30u. Grid
   -------------------------------------------------------------------------- */
.col-span-2 { grid-column: span 2 / span 2; }

/* --------------------------------------------------------------------------
   30v. Ring (box-shadow based)
   -------------------------------------------------------------------------- */
.ring-2 {
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), 0 0 #0000;
  --tw-ring-shadow: 0 0 calc(2px + 0px) var(--tw-ring-color, #000);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), 0 0 calc(2px + 0px) var(--tw-ring-color, #000);
}
.ring-violet-500 { --tw-ring-color: #8b5cf6; }
.ring-emerald-500 { --tw-ring-color: #10b981; }
.ring-sky-500 { --tw-ring-color: #0ea5e9; }
.ring-amber-500 { --tw-ring-color: #f59e0b; }
.ring-rose-500 { --tw-ring-color: #f43f5e; }
.ring-transparent { --tw-ring-color: transparent; }
.ring-offset-2 { --tw-ring-offset-width: 2px; --tw-ring-offset-shadow: 0 0 0 var(--tw-ring-offset-width, 2px) var(--tw-ring-offset-color, #fff); }
.ring-offset-background { --tw-ring-offset-color: var(--background); }

/* --------------------------------------------------------------------------
   30w. Responsive Utilities
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
}

@media (min-width: 768px) {
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:p-6 { padding: 1.5rem; }
  .md\:hidden { display: none; }
  .md\:relative { position: relative; }
  .md\:translate-x-0 { transform: translateX(0); }
  .md\:flex { display: flex; }
  .md\:block { display: block; }
}

/* --------------------------------------------------------------------------
   30x. WhatsApp Preview Styles (used in templates page)
   -------------------------------------------------------------------------- */
.wa-preview {
  background-color: #e5ddd5;
  border-radius: 8px;
  padding: 16px;
  max-width: 320px;
  margin: 0 auto;
}
.wa-header {
  background-color: #075e54;
  color: white;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px 8px 0 0;
}
.wa-bubble-out {
  background-color: #dcf8c6;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.4;
  border-radius: 8px 0 8px 8px;
  position: relative;
  margin-top: 4px;
}
.wa-body { white-space: pre-wrap; word-break: break-word; }
.wa-footer {
  font-size: 11px;
  color: #667781;
  text-align: center;
  padding: 4px 12px;
  margin-top: 4px;
}
.wa-button-row {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.wa-button {
  background: none;
  border: none;
  color: #075e54;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 0;
  cursor: pointer;
}
.wa-tpl-var {
  background-color: rgba(0, 132, 255, 0.15);
  color: #0084ff;
  padding: 1px 2px;
  border-radius: 2px;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   30y. Campaign Wizard Step Styles
   -------------------------------------------------------------------------- */
.campaign-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid var(--border);
  color: var(--muted-foreground);
  transition: all 200ms;
  flex-shrink: 0;
}
.campaign-step-indicator.active {
  border-color: var(--primary);
  background-color: var(--primary);
  color: #fff;
}
.campaign-step-indicator.completed {
  border-color: var(--primary);
  background-color: var(--primary);
  color: #fff;
}
.campaign-step-line {
  flex: 1;
  height: 2px;
  background-color: var(--border);
  transition: background-color 200ms;
}
.campaign-step-line.active,
.campaign-step-line.completed {
  background-color: var(--primary);
}
.template-option {
  border-color: var(--border);
  transition: border-color 150ms, background-color 150ms;
}
.template-option:hover {
  border-color: var(--muted-foreground);
}
.template-option.selected {
  border-color: var(--primary);
  background-color: color-mix(in srgb, var(--primary) 5%, transparent);
}
.syncing .sync-icon {
  animation: spin 0.6s linear infinite;
}
.campaign-status-draft { background-color: #f4f4f5; color: #71717a; }
.campaign-status-scheduled { background-color: #fef3c7; color: #d97706; }
.campaign-status-sending { background-color: #dbeafe; color: #2563eb; }
.campaign-status-sent { background-color: #d1fae5; color: #059669; }
.campaign-status-completed { background-color: #d1fae5; color: #059669; }
.campaign-status-failed { background-color: #fee2e2; color: #dc2626; }

/* --------------------------------------------------------------------------
   30z. Dark Mode Overrides — WA Preview & Campaign Status
   -------------------------------------------------------------------------- */
[data-theme="dark"] .wa-preview { background-color: #1a1a1a; }
[data-theme="dark"] .wa-bubble-out { background-color: #005c4b; }
[data-theme="dark"] .wa-header { background-color: #054640; }
[data-theme="dark"] .wa-footer { color: #8696a0; }
[data-theme="dark"] .wa-tpl-var { background-color: rgba(0, 132, 255, 0.25); color: #60a5fa; }

[data-theme="dark"] .campaign-status-draft { background-color: #27272a; color: #a1a1aa; }
[data-theme="dark"] .campaign-status-scheduled { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; }
[data-theme="dark"] .campaign-status-sending { background-color: rgba(37, 99, 235, 0.15); color: #60a5fa; }
[data-theme="dark"] .campaign-status-sent { background-color: rgba(5, 150, 105, 0.15); color: #34d399; }
[data-theme="dark"] .campaign-status-completed { background-color: rgba(5, 150, 105, 0.15); color: #34d399; }
[data-theme="dark"] .campaign-status-failed { background-color: rgba(220, 38, 38, 0.15); color: #f87171; }

/* --------------------------------------------------------------------------
   END
   -------------------------------------------------------------------------- */