/* SESSI Portal — Components */

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .icon { color: var(--primary-2); }
.card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.card-body { padding: 16px; }
.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  font-size: 12px;
  color: var(--text-2);
}
.card.elevated { box-shadow: var(--shadow); }
.card.flush .card-body { padding: 0; }
.card.hover-lift { transition: transform var(--t), box-shadow var(--t); }
.card.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* KPI cards */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
}
.kpi-card.success::before { background: var(--success); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.danger::before { background: var(--danger); }
.kpi-card.info::before { background: var(--info); }
.kpi-card.accent::before { background: var(--accent); }
.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.kpi-label {
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.kpi-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--primary-soft);
  color: var(--primary-2);
}
.kpi-card.success .kpi-icon { background: var(--success-soft); color: var(--success); }
.kpi-card.warning .kpi-icon { background: var(--warning-soft); color: var(--warning); }
.kpi-card.danger .kpi-icon { background: var(--danger-soft); color: var(--danger); }
.kpi-card.info .kpi-icon { background: var(--info-soft); color: var(--info); }
.kpi-card.accent .kpi-icon { background: var(--accent-soft); color: var(--accent); }
.kpi-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.kpi-delta {
  margin-top: 8px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
}
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta-icon { width: 12px; height: 12px; }
.kpi-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-2); }
.btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn.accent { background: var(--accent); color: #1a1a1a; border-color: var(--accent); }
.btn.danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn.danger:hover { background: #dc2626; border-color: #dc2626; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.success { background: var(--success); color: white; border-color: var(--success); }
.btn.warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn.sm { padding: 5px 10px; font-size: 11px; }
.btn.lg { padding: 10px 18px; font-size: 14px; }
.btn.block { display: flex; width: 100%; justify-content: center; }
.btn .icon { width: 14px; height: 14px; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border var(--t-fast);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-textarea { min-height: 80px; resize: vertical; font-family: inherit; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-select { appearance: none; 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='%239aaa9a' 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: 32px; }
[dir="rtl"] .form-select { background-position: left 12px center; padding-right: 12px; padding-left: 32px; }
.form-input.icon-left { padding-left: 32px; }
[dir="rtl"] .form-input.icon-left { padding-left: 12px; padding-right: 32px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-3); }
[dir="rtl"] .input-icon svg { transform: translateY(-50%) scaleX(-1); }
.form-help { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* Toggle */
.toggle {
  width: 36px; height: 20px;
  background: var(--border-2);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.toggle.on { background: var(--primary); }
.toggle::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  top: 2px;
  inset-inline-start: 2px;
  transition: transform var(--t-fast);
}
.toggle.on::after { inset-inline-start: 18px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.toggle-label { flex: 1; min-width: 0; }
.toggle-title { font-size: 13px; font-weight: 500; }
.toggle-desc { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* Checkbox & Radio */
.check, .radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}
.check-box, .radio-circle {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-2);
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.radio-circle { border-radius: 50%; }
.check input, .radio input { display: none; }
.check input:checked + .check-box, .radio input:checked + .radio-circle {
  background: var(--primary);
  border-color: var(--primary);
}
.check input:checked + .check-box::after {
  content: '';
  width: 4px; height: 8px;
  border: 2px solid white;
  border-top: 0; border-left: 0;
  transform: rotate(45deg);
  margin-top: -2px;
}
.radio input:checked + .radio-circle::after {
  content: '';
  width: 6px; height: 6px;
  background: white;
  border-radius: 50%;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--neutral-soft);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.primary { background: var(--primary-soft); color: var(--primary-2); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.dot::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge.lg { font-size: 12px; padding: 4px 10px; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.table th {
  text-align: start;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.table th:hover { color: var(--text); }
.table th .sort-icon { color: var(--text-3); margin-inline-start: 4px; }
.table th.sorted .sort-icon { color: var(--primary-2); }
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--bg-2); }
.table tbody tr.clickable { cursor: pointer; }
.table.compact td { padding: 7px 10px; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform var(--t);
  box-shadow: var(--shadow-lg);
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal.lg { max-width: 800px; }
.modal.xl { max-width: 1100px; }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-2);
}

/* Toast */
.toast-stack {
  position: fixed;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}
.toast.success { border-inline-start-color: var(--success); }
.toast.warning { border-inline-start-color: var(--warning); }
.toast.danger { border-inline-start-color: var(--danger); }
.toast.info { border-inline-start-color: var(--info); }
.toast-title { font-weight: 600; }
.toast-msg { color: var(--text-2); margin-top: 2px; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
[dir="rtl"] .toast-stack { animation-direction: reverse; }
[dir="rtl"] @keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-2); border-bottom-color: var(--primary); font-weight: 600; }
.tab .tab-count { font-size: 10px; background: var(--surface-2); padding: 1px 6px; border-radius: 99px; margin-inline-start: 6px; font-weight: 600; }

/* Progress */
.progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width var(--t-slow);
}
.progress.success .progress-bar { background: var(--success); }
.progress.warning .progress-bar { background: var(--warning); }
.progress.danger .progress-bar { background: var(--danger); }
.progress.lg { height: 10px; }

/* Avatars + lists */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  cursor: pointer;
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--bg-2); }
.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-size: 13px; font-weight: 500; }
.list-item-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.list-item-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Heatmap */
.heatmap {
  display: grid;
  gap: 2px;
  font-size: 10px;
}
.heatmap-cell {
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--t-fast);
}
.heatmap-cell:hover { transform: scale(1.15); z-index: 1; }
.heatmap-cell[data-level="0"] { background: var(--surface-2); color: var(--text-3); }
.heatmap-cell[data-level="1"] { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.heatmap-cell[data-level="2"] { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.heatmap-cell[data-level="3"] { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.heatmap-cell[data-level="4"] { background: rgba(34, 197, 94, 0.45); color: var(--success); }
.heatmap-cell[data-level="5"] { background: rgba(34, 197, 94, 0.7); color: white; }
.heatmap-header { font-size: 10px; font-weight: 600; color: var(--text-2); padding: 4px; text-align: center; }
.heatmap-row { display: flex; align-items: center; gap: 6px; }
.heatmap-label { font-size: 11px; color: var(--text-2); width: 60px; flex-shrink: 0; text-align: end; padding-inline-end: 8px; }

/* Charts */
.chart-container { width: 100%; height: 100%; min-height: 200px; }
.chart-bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 200px; padding: 12px 0; }
.chart-bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 4px; position: relative; transition: all var(--t); cursor: pointer; }
.chart-bar:hover { background: var(--primary-2); }
.chart-bar.success { background: var(--success); }
.chart-bar.warning { background: var(--warning); }
.chart-bar.danger { background: var(--danger); }
.chart-bar.info { background: var(--info); }
.chart-bar-label { font-size: 10px; color: var(--text-3); text-align: center; padding-top: 4px; }
.chart-bar-value { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 600; color: var(--text); white-space: nowrap; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2; }
.chart-line.area { fill: var(--primary-soft); stroke: none; }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2,2; }
.chart-axis { font-size: 10px; fill: var(--text-3); }

/* Empty state */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-2);
}
.empty-state .icon { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--text-3); }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-state p { font-size: 13px; max-width: 400px; margin: 0 auto; }

/* Stats with sparkline */
.sparkline {
  width: 80px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
}
.sparkline path { fill: none; stroke: var(--primary); stroke-width: 1.5; }
.sparkline.success path { stroke: var(--success); }
.sparkline.danger path { stroke: var(--danger); }
.sparkline.warning path { stroke: var(--warning); }

/* Gauge */
.gauge {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto;
}
.gauge svg { transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.gauge-fill { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset var(--t-slow); }
.gauge-value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  flex-direction: column;
  text-align: center;
}
.gauge-number { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.gauge-label { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }

/* Activity feed */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.activity-item:last-child { border-bottom: 0; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.activity-dot.warning { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.activity-dot.success { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.activity-dot.danger { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.activity-content { flex: 1; min-width: 0; }
.activity-title { font-size: 13px; }
.activity-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* Calendar */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.calendar-day-header { background: var(--surface-2); padding: 8px; font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--text-2); text-align: center; }
.calendar-day { background: var(--surface); min-height: 90px; padding: 6px; position: relative; }
.calendar-day.muted { background: var(--bg-2); color: var(--text-3); }
.calendar-day.today { background: var(--primary-soft); }
.calendar-day .day-number { font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.calendar-day.today .day-number { color: var(--primary-2); }
.calendar-event {
  font-size: 10px;
  padding: 2px 4px;
  background: var(--primary-soft);
  color: var(--primary-2);
  border-radius: 3px;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-event.warning { background: var(--warning-soft); color: var(--warning); }
.calendar-event.danger { background: var(--danger-soft); color: var(--danger); }
.calendar-event.success { background: var(--success-soft); color: var(--success); }
.calendar-event.info { background: var(--info-soft); color: var(--info); }

/* Helpers */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.v-divider { width: 1px; background: var(--border); margin: 0 8px; align-self: stretch; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.no-print { display: block; }
@media print { .no-print { display: none !important; } }

/* Print-only */
.print-only { display: none; }
@media print { .print-only { display: block; } }

/* Notification dot */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.success { background: var(--success); }
.dot.warning { background: var(--warning); }
.dot.danger { background: var(--danger); }
.dot.info { background: var(--info); }
.dot.muted { background: var(--text-3); }

/* Stat box */
.stat-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
}
.stat-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; flex-shrink: 0; }
.stat-content { flex: 1; min-width: 0; }
.stat-value { font-size: 18px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.tag.primary { background: var(--primary-soft); color: var(--primary-2); border-color: var(--primary-soft); }
.tag.success { background: var(--success-soft); color: var(--success); border-color: var(--success-soft); }
.tag.warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-soft); }
.tag.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }

/* Timeline */
.timeline { position: relative; padding-inline-start: 20px; }
.timeline::before { content: ''; position: absolute; inset-inline-start: 6px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before { content: ''; position: absolute; inset-inline-start: -19px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg); }
.timeline-item.success::before { background: var(--success); }
.timeline-item.warning::before { background: var(--warning); }
.timeline-item.danger::before { background: var(--danger); }
.timeline-item.muted::before { background: var(--text-3); }
.timeline-title { font-size: 13px; font-weight: 500; }
.timeline-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.timeline-content { font-size: 12px; color: var(--text-2); margin-top: 6px; }

/* Code/keyboard */
kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--text-2);
  font-weight: 600;
}

/* Cmd-K palette */
.cmdk-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 150;
  display: grid;
  place-items: start center;
  padding-top: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.cmdk-backdrop.open { opacity: 1; pointer-events: auto; }
.cmdk {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform var(--t);
}
.cmdk-backdrop.open .cmdk { transform: scale(1); }
.cmdk-input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 16px 20px;
  font-size: 15px;
  outline: none;
  border-bottom: 1px solid var(--border);
}
.cmdk-list { max-height: 400px; overflow-y: auto; }
.cmdk-section { padding: 8px 0; }
.cmdk-section-title { padding: 6px 20px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-3); letter-spacing: 0.05em; }
.cmdk-item {
  padding: 10px 20px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--t-fast);
}
.cmdk-item:hover, .cmdk-item.selected { background: var(--bg-2); }
.cmdk-item .icon { color: var(--text-3); width: 16px; height: 16px; }
.cmdk-item .kbd-hint { margin-inline-start: auto; }
.cmdk-empty { padding: 40px 20px; text-align: center; color: var(--text-2); font-size: 13px; }

/* Wizard */
.wizard-steps {
  display: flex;
  margin-bottom: 24px;
  gap: 8px;
}
.wizard-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  position: relative;
}
.wizard-step.active { background: var(--primary-soft); border-color: var(--primary); }
.wizard-step.completed { background: var(--success-soft); border-color: var(--success); }
.wizard-step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--border-2);
  color: var(--text);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.wizard-step.active .wizard-step-num { background: var(--primary); color: white; }
.wizard-step.completed .wizard-step-num { background: var(--success); color: white; }
.wizard-step-label { font-size: 12px; font-weight: 500; }

/* Course card */
.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--t-fast);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.course-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.course-card-header {
  height: 100px;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
  position: relative;
  display: grid;
  place-items: center;
  color: white;
}
.course-card-header.alt-1 { background: linear-gradient(135deg, #0d7a3e, #0a5a2e); }
.course-card-header.alt-2 { background: linear-gradient(135deg, #d4a017, #b88800); }
.course-card-header.alt-3 { background: linear-gradient(135deg, #3b82f6, #1e40af); }
.course-card-header.alt-4 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.course-card-header.alt-5 { background: linear-gradient(135deg, #ec4899, #be185d); }
.course-card-header.alt-6 { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.course-card-header.alt-7 { background: linear-gradient(135deg, #f97316, #c2410c); }
.course-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.course-card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.course-card-desc { font-size: 12px; color: var(--text-2); margin-bottom: 10px; flex: 1; }
.course-card-stats { display: flex; gap: 12px; font-size: 11px; color: var(--text-2); margin-top: auto; }

/* Hero card */
.hero-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
  border-radius: var(--radius-lg);
  padding: 24px;
  color: white;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.15), transparent 50%);
  pointer-events: none;
}
.hero-card-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.hero-card-desc { font-size: 13px; opacity: 0.9; }
.hero-card-meta { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; opacity: 0.85; }

/* Animated counter */
.counter { font-variant-numeric: tabular-nums; }

/* Hierarchy */
.tree { font-size: 12px; }
.tree-item { padding: 6px 0; border-bottom: 1px solid var(--border); }
.tree-item-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.tree-item-children { padding-inline-start: 18px; }

/* Profile cover */
.profile-cover {
  height: 140px;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
  border-radius: var(--radius-lg);
  position: relative;
  margin-bottom: 60px;
  overflow: hidden;
}
.profile-avatar-overlay {
  position: absolute;
  bottom: -40px;
  inset-inline-start: 24px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--surface);
}

/* QR placeholder */
.qr-placeholder {
  width: 120px;
  height: 120px;
  background: white;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
}
.qr-placeholder svg { width: 100%; height: 100%; }

/* Voice input mock */
.voice-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.voice-input .waveform {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}
.voice-input .waveform .bar {
  width: 2px;
  background: var(--primary);
  border-radius: 1px;
  animation: wave 1.4s ease-in-out infinite;
}
@keyframes wave {
  0%, 100% { height: 4px; }
  50% { height: 24px; }
}
.voice-input .waveform .bar:nth-child(2) { animation-delay: 0.1s; }
.voice-input .waveform .bar:nth-child(3) { animation-delay: 0.2s; }
.voice-input .waveform .bar:nth-child(4) { animation-delay: 0.3s; }
.voice-input .waveform .bar:nth-child(5) { animation-delay: 0.4s; }
.voice-input .waveform .bar:nth-child(6) { animation-delay: 0.5s; }
.voice-input .waveform .bar:nth-child(7) { animation-delay: 0.6s; }
.voice-input .waveform .bar:nth-child(8) { animation-delay: 0.7s; }

/* Drag drop */
.drop-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast);
  background: var(--bg-2);
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.drop-zone .icon { width: 32px; height: 32px; color: var(--text-3); margin: 0 auto 8px; }

/* Accordion */
.accordion-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface); }
.accordion-header { padding: 12px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.accordion-header:hover { background: var(--bg-2); }
.accordion-icon { transition: transform var(--t-fast); margin-inline-start: auto; }
.accordion-item.open .accordion-icon { transform: rotate(90deg); }
[dir="rtl"] .accordion-item.open .accordion-icon { transform: rotate(-90deg); }
.accordion-body { padding: 0 14px 14px; display: none; }
.accordion-item.open .accordion-body { display: block; }

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
}

/* Print styles */
@media print {
  body { background: white; color: black; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .kpi-card { box-shadow: none; border: 1px solid #ccc; }
  .btn { display: none; }
}
