/* =====================================================
   CRM EDUKS - Componentes
   ===================================================== */

/* LAYOUT PRINCIPAL */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--header-height);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-info));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
}

.sidebar-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0;
}

.sidebar-section {
  padding: 0 var(--space-4);
  margin-bottom: var(--space-6);
}

.sidebar-section-title {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: var(--space-2);
  padding: 0 var(--space-3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--color-primary);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.content {
  flex: 1;
  padding: var(--space-6);
  max-width: 100%;
}

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  user-select: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-success {
  background: var(--color-success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: 0.8125rem;
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
}

.btn-icon {
  padding: var(--space-2);
  width: 36px;
  height: 36px;
}

/* INPUTS */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--color-danger);
}

.form-control {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  height: 38px;
}

.form-control:hover {
  border-color: var(--border-strong);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.form-control:disabled {
  background: var(--bg-hover);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

textarea.form-control {
  height: auto;
  min-height: 80px;
  padding: var(--space-3);
  resize: vertical;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  appearance: none;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.form-error {
  font-size: 0.75rem;
  color: var(--color-danger);
  margin-top: var(--space-1);
}

.input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  overflow: hidden;
}

.input-group:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.input-group .form-control {
  border: none;
  background: transparent;
}

.input-group .form-control:focus {
  box-shadow: none;
}

.input-group-icon {
  padding: 0 var(--space-3);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
}

.input-group-icon svg {
  width: 18px;
  height: 18px;
}

/* TABLES */
.table-container {
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table thead {
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-light);
}

.table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

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

.table tbody tr:hover {
  background: var(--bg-hover);
}

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

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-2);
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-default {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.badge-primary {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.badge-success {
  background: var(--color-success-light);
  color: #047857;
}

.badge-warning {
  background: var(--color-warning-light);
  color: #b45309;
}

.badge-danger {
  background: var(--color-danger-light);
  color: #b91c1c;
}

.badge-info {
  background: var(--color-info-light);
  color: #0e7490;
}

.badge-purple {
  background: var(--color-purple-light);
  color: #6d28d9;
}

.badge-pink {
  background: var(--color-pink-light);
  color: #be185d;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* STATUS PILLS */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* AVATAR */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.avatar-xl {
  width: 72px;
  height: 72px;
  font-size: 1.5rem;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

@keyframes connected-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.connected-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.12);
  color: var(--success, #16a34a);
  animation: connected-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* LEAD TAGS (estilo WhatsApp) */
.lead-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  transition: filter 0.15s, transform 0.1s;
}

.lead-tag:hover {
  filter: brightness(0.95);
}

.lead-tag-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lead-tag-remove {
  background: none;
  border: 0;
  padding: 0 0 0 2px;
  margin-left: 2px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.15s;
}

.lead-tag-remove:hover {
  opacity: 1;
}

.lead-tag-add {
  background: transparent !important;
  border: 1px dashed var(--border-light, #cbd5e1) !important;
  color: var(--text-secondary, #64748b) !important;
  cursor: pointer;
  padding: 3px 10px;
}

.lead-tag-add:hover {
  border-color: var(--primary, #3b82f6) !important;
  color: var(--primary, #3b82f6) !important;
}

/* TAG PICKER MODAL */
.tag-picker-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 -4px;
  padding: 4px;
}

.tag-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.tag-picker-item:hover {
  background: var(--bg-hover, #f1f5f9);
}

.tag-picker-item.is-attached {
  background: var(--bg-active, #e0f2fe);
}

.tag-picker-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tag-picker-check {
  margin-left: auto;
  color: var(--primary, #3b82f6);
  opacity: 0;
  transition: opacity 0.15s;
}

.tag-picker-item.is-attached .tag-picker-check {
  opacity: 1;
}

/* STAT CARDS */
.stat-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 12px;
  padding: 16px 20px;
  transition: all 0.15s;
}

.stat-card:hover {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-label {
  font-size: 12px;
  color: var(--text-tertiary, #64748b);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  line-height: 1.2;
}

/* KANBAN enhancements */
.kanban-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-light, #e2e8f0);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-page, #f8fafc);
  border-radius: 0 0 8px 8px;
}

.kanban-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.15s;
}

.kanban-card:hover .kanban-card-actions {
  opacity: 1;
}

/* SWITCH TOGGLE */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-light, #cbd5e1);
  border-radius: 24px;
  transition: 0.2s;
}

.switch .slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background-color: var(--success, #16a34a);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* DASHBOARD GRID */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4, 16px);
  margin-bottom: var(--space-4, 16px);
}

@media (max-width: 1024px) {
  .dashboard-grid-2 { grid-template-columns: 1fr; }
}

/* TASKS */
.task-item { transition: all 0.15s; }
.task-item:hover { border-color: var(--primary, #3b82f6) !important; }
.task-check:hover { border-color: var(--primary, #3b82f6) !important; }
.task-list .text-xs.text-tertiary { color: var(--text-tertiary); }

/* CAMPAIGN MINI CARDS (dashboard) */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  padding: 12px;
}

.campaign-mini-card {
  background: var(--bg-page, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.campaign-mini-card:hover {
  border-color: var(--primary, #3b82f6);
  background: var(--bg-card, #fff);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.campaign-mini-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.campaign-mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.campaign-mini-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.campaign-mini-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.campaign-mini-stat {
  text-align: center;
}

.campaign-mini-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  line-height: 1.1;
}

.campaign-mini-lbl {
  font-size: 9px;
  color: var(--text-tertiary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.campaign-mini-revenue {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary, #3b82f6);
  padding-top: 6px;
  border-top: 1px solid var(--border-light, #e2e8f0);
  text-align: center;
}

.campaign-mini-totals {
  display: flex;
  justify-content: space-around;
  padding: 10px 12px;
  border-top: 1px solid var(--border-light, #e2e8f0);
  font-size: 12px;
  color: var(--text-tertiary, #64748b);
  background: var(--bg-card, #fff);
}

/* NAV BADGE */
.nav-badge {
  margin-left: auto;
  background: var(--danger, #ef4444);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* CHAT CENTER (estilo WhatsApp Web) */
.chat-page {
  display: flex;
  height: calc(100vh - 64px);
  margin: -24px;
  background: var(--bg-page, #f8fafc);
}

.chat-sidebar {
  width: 360px;
  border-right: 1px solid var(--border-light, #e2e8f0);
  background: var(--bg-card, #fff);
  display: flex;
  flex-direction: column;
}

.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
}

.chat-sidebar-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.chat-search {
  position: relative;
  margin-bottom: 12px;
}

.chat-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary, #64748b);
}

.chat-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg-page, #f8fafc);
}

.chat-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-page, #f8fafc);
  border-radius: 8px;
  padding: 3px;
}

.chat-tab {
  flex: 1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary, #64748b);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.chat-tab.active {
  background: var(--bg-card, #fff);
  color: var(--primary, #3b82f6);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  transition: background 0.1s;
  position: relative;
}

.chat-item:hover { background: var(--bg-page, #f8fafc); }
.chat-item.is-active { background: var(--bg-active, #e0f2fe); }

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--primary, #3b82f6);
  object-fit: cover;
}

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

.chat-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.chat-item-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-time {
  font-size: 11px;
  color: var(--text-tertiary, #64748b);
  white-space: nowrap;
  margin-left: 8px;
}

.chat-item-preview {
  font-size: 12px;
  color: var(--text-tertiary, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-tags {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.lead-tag-mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.lead-tag-mini .lead-tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.chat-unread {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--success, #10b981);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(rgba(255,255,255,0.92), rgba(255,255,255,0.92)),
    repeating-linear-gradient(45deg, #f1f5f9 0, #f1f5f9 10px, #f8fafc 10px, #f8fafc 20px);
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary, #64748b);
  gap: 12px;
  text-align: center;
  padding: 24px;
}

.chat-main-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-card, #fff);
  border-bottom: 1px solid var(--border-light, #e2e8f0);
}

.chat-main-header-info {
  flex: 1;
  min-width: 0;
}

.chat-main-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary, #1e293b);
}

.chat-main-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-tertiary, #64748b);
  margin-top: 2px;
  flex-wrap: wrap;
}

.chat-main-tags {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
}

.chat-date-divider span {
  background: rgba(255,255,255,0.9);
  color: var(--text-tertiary, #64748b);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-msg {
  display: flex;
  max-width: 70%;
}

.chat-msg.from-me { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.from-them { align-self: flex-start; }

.chat-msg-bubble {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  max-width: 100%;
}

.chat-msg.from-me .chat-msg-bubble {
  background: #d9fdd3;
  color: #111;
  border-top-right-radius: 2px;
}

.chat-msg.from-them .chat-msg-bubble {
  background: white;
  color: #111;
  border-top-left-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-msg-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  font-size: 10px;
  color: var(--text-tertiary, #64748b);
  margin-top: 2px;
}

.chat-status.read { color: #34b7f1; }
.chat-status.delivered, .chat-status.sent { color: var(--text-tertiary, #64748b); }

.chat-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px 20px;
  background: var(--bg-card, #fff);
  border-top: 1px solid var(--border-light, #e2e8f0);
}

#chat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  max-height: 120px;
  min-height: 40px;
  line-height: 1.4;
  background: var(--bg-page, #f8fafc);
}

#chat-input:focus {
  outline: none;
  border-color: var(--primary, #3b82f6);
  background: var(--bg-card, #fff);
}

#chat-send-btn {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .chat-page { height: calc(100vh - 56px); }
  .chat-sidebar { width: 100%; }
  .chat-main { display: none; }
  .chat-page.chat-open .chat-sidebar { display: none; }
  .chat-page.chat-open .chat-main { display: flex; }
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform var(--transition-base);
}

.modal-backdrop.active .modal {
  transform: scale(1);
}

.modal-lg {
  max-width: 800px;
}

.modal-xl {
  max-width: 1100px;
}

.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* TOAST */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 400px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--color-info);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: slideInRight 0.3s ease;
  min-width: 280px;
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--color-success); }
.toast.error .toast-icon { color: var(--color-danger); }
.toast.warning .toast-icon { color: var(--color-warning); }
.toast.info .toast-icon { color: var(--color-info); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.toast-close {
  color: var(--text-tertiary);
  padding: 2px;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* STATS CARDS */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  transition: all var(--transition-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
  font-weight: 500;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: var(--space-1);
}

.stat-change.positive { color: var(--color-success); }
.stat-change.negative { color: var(--color-danger); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.primary { background: var(--color-primary-light); color: var(--color-primary); }
.stat-icon.success { background: var(--color-success-light); color: var(--color-success); }
.stat-icon.warning { background: var(--color-warning-light); color: var(--color-warning); }
.stat-icon.danger { background: var(--color-danger-light); color: var(--color-danger); }
.stat-icon.info { background: var(--color-info-light); color: var(--color-info); }
.stat-icon.purple { background: var(--color-purple-light); color: var(--color-purple); }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-secondary);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  background: var(--bg-hover);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

/* LOADING */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

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

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}

/* TABS */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}

.tab {
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.pagination-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0 var(--space-2);
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.pagination-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* CHAT */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.chat-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-card);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.chat-message {
  max-width: 70%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-message.from-me {
  align-self: flex-end;
  background: var(--color-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.from-them {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 4px;
}

.chat-message-time {
  font-size: 0.6875rem;
  opacity: 0.7;
  margin-top: 4px;
  display: block;
}

.chat-input-area {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.chat-input {
  flex: 1;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  resize: none;
  max-height: 120px;
  min-height: 38px;
  font-family: inherit;
}

.chat-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

/* TIMELINE */
.timeline {
  position: relative;
  padding-left: var(--space-6);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-light);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-4);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--border-light);
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.timeline-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 2px;
}

.timeline-description {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* FILTERS BAR */
.filters-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.filters-bar .form-control {
  min-width: 160px;
}

.filters-bar .search-input {
  flex: 1;
  min-width: 240px;
  max-width: 400px;
}

/* DROPDOWN */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-1);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-1) 0;
}

/* KANBAN */
.kanban {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-4);
  min-height: 500px;
}

.kanban-column {
  flex: 0 0 280px;
  background: var(--bg-page);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.kanban-header {
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-title {
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.kanban-count {
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kanban-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: grab;
  transition: all var(--transition-fast);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.kanban-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

/* CHARTS */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

/* ALERTS */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: 0.875rem;
  border: 1px solid;
}

.alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.alert-info {
  background: var(--color-info-light);
  color: #0e7490;
  border-color: #67e8f9;
}

.alert-success {
  background: var(--color-success-light);
  color: #047857;
  border-color: #6ee7b7;
}

.alert-warning {
  background: var(--color-warning-light);
  color: #b45309;
  border-color: #fcd34d;
}

.alert-danger {
  background: var(--color-danger-light);
  color: #b91c1c;
  border-color: #fca5a5;
}

/* MOBILE TOGGLE */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.mobile-menu-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* AUTH PAGE */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 50%, #faf5ff 100%);
}

.auth-container {
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-10);
  max-width: 440px;
  width: 100%;
  border: 1px solid var(--border-light);
}

.auth-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-info));
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 auto var(--space-4);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-6);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-4);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* CHECKBOX */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
}

.checkbox input {
  display: none;
}

.checkbox-mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.checkbox input:checked + .checkbox-mark {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.checkbox input:checked + .checkbox-mark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* SWITCH */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  display: none;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-slider {
  background: var(--color-primary);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(16px);
}

/* =====================================================
   DASHBOARD STYLES
   ===================================================== */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.dashboard-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.dashboard-subtitle {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.dashboard-filters {
  display: flex;
  gap: var(--space-2);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.6;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card-primary { color: var(--color-primary); }
.stat-card-primary .stat-icon { background: var(--color-primary-light); }
.stat-card-success { color: var(--color-success); }
.stat-card-success .stat-icon { background: var(--color-success-light); }
.stat-card-warning { color: var(--color-warning); }
.stat-card-warning .stat-icon { background: var(--color-warning-light); }
.stat-card-info { color: var(--color-info); }
.stat-card-info .stat-icon { background: var(--color-info-light); }
.stat-card-purple { color: var(--color-purple); }
.stat-card-purple .stat-icon { background: var(--color-purple-light); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: var(--space-2);
}

.stat-change.positive { color: var(--color-success); }
.stat-change.negative { color: var(--color-danger); }

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.dashboard-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.campaign-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.table-wrapper {
  overflow-x: auto;
  max-width: 100%;
}

.text-right { text-align: right; }
.text-success { color: var(--color-success); }

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid-2, .dashboard-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: var(--space-4); }
  .stat-value { font-size: 1.5rem; }
}

/* =====================================================
   BEAUTIFUL FILTERS
   ===================================================== */
.filters-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.filters-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.filters-panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filters-panel-body {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto;
  gap: var(--space-3);
  align-items: end;
}

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

.filter-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

@media (max-width: 1280px) {
  .filters-panel-body {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .filters-panel-body {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .filters-panel-body {
    grid-template-columns: 1fr;
  }
}

/* Tab de visualização (lista/kanban) */
.view-tabs {
  display: inline-flex;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.view-tab {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.view-tab:hover { color: var(--text-primary); }
.view-tab.active {
  background: var(--bg-card);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* Linha clicável */
.table tbody tr[data-link] { cursor: pointer; }
.table tbody tr[data-link]:hover {
  background: var(--color-primary-light);
}
