/* ============================================================
   AL ADAB CBT — COMPONENTS CSS
   Buttons, Forms, Tables, Modals, Tabs, Pagination
   ============================================================ */

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 2px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  font-family: var(--font-primary);
  line-height: 1;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 50%;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%,-50%) scale(0);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.btn:active::after {
  transform: translate(-50%,-50%) scale(3);
  opacity: 0;
  transition: 0s;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: white;
  box-shadow: 0 2px 8px rgba(26,86,219,0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
  box-shadow: 0 4px 16px rgba(26,86,219,0.4);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

/* Secondary Button */
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-200);
}
.btn-secondary:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--primary-600);
  border-color: var(--primary-300);
}
.btn-outline:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
}

/* Success Button */
.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 16px rgba(16,185,129,0.35);
  transform: translateY(-1px);
}

/* Danger Button */
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 4px 16px rgba(239,68,68,0.35);
  transform: translateY(-1px);
}

/* Warning Button */
.btn-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: white;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.btn-warning:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
}

/* Gold Button */
.btn-gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: white;
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-600), var(--gold-700));
  transform: translateY(-1px);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--gray-600);
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

/* Icon-only Button */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  color: var(--gray-600);
}
.btn-icon:hover { background: var(--gray-200); color: var(--gray-800); }
.btn-icon.btn-primary { background: var(--primary-600); color: white; }
.btn-icon.btn-danger  { background: var(--danger-bg);   color: var(--danger); }

/* Button Sizes */
.btn-xs { padding: 5px 10px; font-size: 0.7rem; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn-xl { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

/* Button Group */
.btn-group {
  display: flex;
  gap: 0;
}
.btn-group .btn {
  border-radius: 0;
}
.btn-group .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.btn-group .btn:last-child  { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 3px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--gray-800);
  background: var(--bg-surface);
  transition: var(--transition-fast);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}

.form-control:disabled {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
}

.form-control::placeholder { color: var(--gray-400); }

.form-control.is-invalid {
  border-color: var(--danger);
}
.form-control.is-valid {
  border-color: var(--success);
}

.invalid-feedback {
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  color: var(--gray-400);
  font-size: 0.75rem;
  margin-top: 4px;
}

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

/* Textarea */
.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Input with Icon */
.input-group {
  position: relative;
}

.input-group-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.95rem;
  pointer-events: none;
}

.input-group-icon-right {
  left: auto;
  right: 12px;
  pointer-events: auto;
  cursor: pointer;
}

.input-group-icon-right:hover { color: var(--gray-700); }

.input-group .form-control {
  padding-left: 38px;
}

.input-group .form-control.has-right-icon {
  padding-right: 38px;
}

/* Search Input */
.search-input {
  max-width: 300px;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-600);
  flex-shrink: 0;
}

.form-check-label {
  font-size: 0.875rem;
  color: var(--gray-700);
  cursor: pointer;
}

/* Toggle Switch */
.form-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.toggle-track.active {
  background: var(--primary-600);
}

.toggle-thumb {
  width: 18px;
  height: 18px;
  background: white;
  border-radius: var(--radius-full);
  position: absolute;
  top: 3px;
  left: 3px;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.toggle-track.active .toggle-thumb {
  transform: translateX(20px);
}

/* File Upload */
.file-upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  background: var(--gray-50);
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
  border-color: var(--primary-400);
  background: var(--primary-50);
}

.file-upload-zone input[type="file"] { display: none; }

.file-upload-icon { font-size: 2.5rem; color: var(--gray-300); margin-bottom: 12px; }
.file-upload-title { font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.file-upload-desc { font-size: 0.8rem; color: var(--gray-400); }

/* Range Input */
.form-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
  outline: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-600);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

.table-toolbar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
}

.table-toolbar-left,
.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-wrapper {
  overflow-x: auto;
}

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

thead {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

th:hover { color: var(--primary-600); }

th .sort-icon {
  margin-left: 4px;
  opacity: 0.4;
}

th.sorted .sort-icon { opacity: 1; color: var(--primary-600); }

td {
  padding: 13px 16px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

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

tr:hover td {
  background: var(--gray-50);
}

.td-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.td-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.td-info strong { font-weight: 600; color: var(--gray-800); display: block; }
.td-info small  { font-size: 0.75rem; color: var(--gray-400); }

.td-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Table Pagination */
.table-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.table-info {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-100);
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.page-btn:hover { background: var(--primary-50); color: var(--primary-600); }
.page-btn.active { background: var(--primary-600); color: white; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.25s ease;
  overflow: hidden;
}

.modal-sm  { max-width: 400px; }
.modal-md  { max-width: 560px; }
.modal-lg  { max-width: 760px; }
.modal-xl  { max-width: 960px; }
.modal-2xl { max-width: 1200px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title i { color: var(--primary-600); }

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: var(--gray-50);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.tab-count {
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.tab-btn.active .tab-count {
  background: var(--primary-100);
  color: var(--primary-700);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }

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

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-100);
  z-index: 300;
  padding: 6px;
  animation: scaleIn 0.15s ease;
  transform-origin: top right;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--gray-50);
  color: var(--primary-600);
}

.dropdown-item.danger:hover { background: var(--danger-bg); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--gray-100); margin: 6px 0; }

/* ============================================================
   ALERTS / BANNERS
   ============================================================ */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--alert-color);
  background: var(--alert-bg);
  color: var(--alert-text);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert i { flex-shrink: 0; margin-top: 1px; }

.alert-info    { --alert-color: var(--info);    --alert-bg: var(--info-bg);    --alert-text: #155e75; }
.alert-success { --alert-color: var(--success); --alert-bg: var(--success-bg); --alert-text: #065f46; }
.alert-warning { --alert-color: var(--warning); --alert-bg: var(--warning-bg); --alert-text: #92400e; }
.alert-danger  { --alert-color: var(--danger);  --alert-bg: var(--danger-bg);  --alert-text: #991b1b; }

/* ============================================================
   CHIPS / TAGS
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.chip-remove {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.5;
}

.chip-remove:hover { opacity: 1; background: var(--gray-300); }

/* ============================================================
   AVATAR GROUP
   ============================================================ */
.avatar-group {
  display: flex;
  align-items: center;
}

.avatar-group .td-avatar {
  border: 2px solid white;
  margin-left: -8px;
  font-size: 0.65rem;
  width: 28px;
  height: 28px;
}

.avatar-group .td-avatar:first-child { margin-left: 0; }

/* ============================================================
   STEP PROGRESS
   ============================================================ */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  flex: 1;
}

.step-item::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}

.step-item:last-child::before { display: none; }

.step-item.done::before { background: var(--primary-400); }

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: var(--transition-base);
}

.step-item.done .step-circle {
  background: var(--primary-600);
  color: white;
  box-shadow: var(--shadow-blue);
}

.step-item.active .step-circle {
  background: white;
  color: var(--primary-600);
  border: 3px solid var(--primary-600);
  box-shadow: 0 0 0 4px rgba(26,86,219,0.15);
}

.step-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-400);
  text-align: center;
  white-space: nowrap;
}

.step-item.done .step-label,
.step-item.active .step-label {
  color: var(--primary-600);
}

/* ============================================================
   STAT MINI
   ============================================================ */
.stat-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-100);
}

.stat-mini-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.stat-mini-value { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); }
.stat-mini-label { font-size: 0.72rem; color: var(--gray-500); }

/* ============================================================
   COLOR DOT INDICATOR
   ============================================================ */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-online  { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.dot-offline { background: var(--gray-300); }
.dot-busy    { background: var(--warning); }
.dot-active  { background: var(--primary-600); }

.dot-pulse {
  animation: pulse 2s ease infinite;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-400);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--primary-200);
}

.timeline-time {
  font-size: 0.72rem;
  color: var(--gray-400);
  margin-bottom: 3px;
}

.timeline-content {
  font-size: 0.85rem;
  color: var(--gray-700);
}

.timeline-title { font-weight: 600; color: var(--gray-800); }

/* ============================================================
   TOOLTIP
   ============================================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: white;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: var(--transition-fast);
  z-index: 400;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

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

/* ============================================================
   SEARCH & FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--gray-100);
  color: var(--gray-600);
  cursor: pointer;
  border: 1.5px solid var(--gray-200);
  transition: var(--transition-fast);
}

.filter-chip:hover { border-color: var(--primary-300); color: var(--primary-600); }
.filter-chip.active { background: var(--primary-100); color: var(--primary-700); border-color: var(--primary-300); }

/* ============================================================
   ACCORDION
   ============================================================ */
.accordion-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
}

.accordion-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: var(--gray-50);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-800);
  transition: var(--transition-fast);
}

.accordion-header:hover { background: var(--gray-100); }
.accordion-header.active { background: var(--primary-50); color: var(--primary-700); }

.accordion-icon {
  transition: var(--transition-fast);
  color: var(--gray-400);
}

.accordion-header.active .accordion-icon {
  transform: rotate(180deg);
  color: var(--primary-600);
}

.accordion-body {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.accordion-body.open {
  max-height: 500px;
  padding: 16px;
}

/* ============================================================
   CARD STATS CHART
   ============================================================ */
.chart-container {
  position: relative;
  height: 250px;
}

.chart-container-sm { height: 180px; }
.chart-container-lg { height: 350px; }

/* ============================================================
   RICH TEXT EDITOR (Quill wrapper)
   ============================================================ */
.editor-wrapper {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-fast);
}

.editor-wrapper:focus-within {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}

.ql-toolbar.ql-snow {
  border: none;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.ql-container.ql-snow {
  border: none;
  font-family: var(--font-primary);
  font-size: 0.875rem;
  min-height: 120px;
}

/* ============================================================
   PRINT HIDDEN
   ============================================================ */
@media print {
  .sidebar,
  .topbar,
  .btn,
  .table-toolbar,
  .table-footer,
  .no-print {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .page-content {
    padding: 0 !important;
  }
}
