/* ==========================================================================
   IKADRAN Design System — Call Center Quality Auditing Platform
   Complete CSS for 44-screen POC
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ========================================================================== */

:root {
  /* Brand */
  --primary: #1E40AF;
  --primary-hover: #1E3A8A;
  --primary-light: #DBEAFE;
  --primary-50: #EFF6FF;
  --accent: #0891B2;
  --accent-light: #CFFAFE;

  /* Neutral */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-hover: #F1F5F9;
  --surface-active: #E2E8F0;
  --border: #E2E8F0;
  --border-focus: #93C5FD;
  --sidebar-bg: #0F172A;
  --sidebar-text: #CBD5E1;
  --sidebar-active: #1E40AF;
  --sidebar-active-text: #FFFFFF;
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  /* Semantic */
  --success: #059669;
  --success-light: #D1FAE5;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --error: #DC2626;
  --error-light: #FEE2E2;
  --info: #2563EB;
  --info-light: #DBEAFE;

  /* Typography */
  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-focus: 0 0 0 3px rgba(30, 64, 175, 0.15);

  /* Layout */
  --sidebar-width: 220px;
  --sidebar-collapsed: 64px;
  --header-height: 56px;
  --content-max-width: 1400px;
}

/* ==========================================================================
   2. CSS RESET & BASE STYLES
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

.display {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
}

.body {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

.body-medium {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.small {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

.tiny {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.kpi-number {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

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

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

.text-warning {
  color: var(--warning);
}

.text-error {
  color: var(--error);
}

/* ==========================================================================
   4. LAYOUT — App Shell
   ========================================================================== */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 60;
  transition: width 200ms ease;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-logo {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.sidebar-logo img {
  max-height: 32px;
}

.sidebar-logo span {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

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

.sidebar-section {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748B;
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.sidebar-item {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  font-size: 14px;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  margin: 0 var(--space-2);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
  position: relative;
  gap: var(--space-3);
  text-decoration: none;
}

.sidebar-item svg,
.sidebar-item .sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active {
  background-color: var(--sidebar-active);
  color: var(--sidebar-active-text);
}

.sidebar-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: var(--space-3);
}

.sidebar-user {
  padding: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.sidebar-user-role {
  font-size: 12px;
  color: #64748B;
}

/* ---------- Main Content Area ---------- */

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

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

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

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

.header-title {
  font-size: 16px;
  font-weight: 600;
}

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

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

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.page-header-actions {
  display: flex;
  gap: var(--space-2);
}

/* ==========================================================================
   5. GRID SYSTEM
   ========================================================================== */

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ==========================================================================
   6. KPI / STAT CARDS
   ========================================================================== */

.stat-card {
  background-color: var(--surface);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

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

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

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

.stat-card-icon.error {
  background-color: var(--error-light);
  color: var(--error);
}

.stat-card-icon.accent {
  background-color: var(--accent-light);
  color: var(--accent);
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-card-trend {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.stat-card-trend.up {
  color: var(--success);
}

.stat-card-trend.down {
  color: var(--error);
}

/* ==========================================================================
   7. CARDS
   ========================================================================== */

.card {
  background-color: var(--surface);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

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

.card-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.card-actions {
  display: flex;
  gap: var(--space-2);
}

.card-body {
  /* Content flows naturally */
}

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   8. BUTTONS
   ========================================================================== */

.btn {
  height: 36px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: none;
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

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

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

.btn-secondary {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-secondary:hover {
  background-color: var(--primary-50);
}

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

.btn-ghost:hover {
  background-color: var(--surface-hover);
}

.btn-danger {
  background-color: var(--error);
  color: #fff;
}

.btn-danger:hover {
  background-color: #B91C1C;
}

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

.btn-success:hover {
  background-color: #047857;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-lg {
  height: 44px;
  padding: 0 var(--space-6);
  font-size: 16px;
}

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

.btn-icon.btn-sm {
  width: 28px;
  padding: 0;
}

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

/* ==========================================================================
   9. TABLES
   ========================================================================== */

.table-container {
  overflow-x: auto;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.table-container table {
  width: 100%;
}

.table-container th {
  background-color: #F8FAFC;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-container td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  font-size: 14px;
}

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

.table-container tbody tr:hover {
  background-color: #F8FAFC;
}

.table-container tbody tr.selected {
  background-color: #EFF6FF;
  border-left: 3px solid var(--primary);
}

.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.table-pagination-pages {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.table-pagination-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 150ms ease;
}

.table-pagination-btn:hover {
  background-color: var(--surface-hover);
}

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

/* ==========================================================================
   10. FORMS
   ========================================================================== */

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  background-color: var(--surface);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.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 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

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

.form-error {
  font-size: 13px;
  color: var(--error);
  margin-top: var(--space-1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

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

.form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.form-checkbox,
.form-radio {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 14px;
}

.form-checkbox input,
.form-radio input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ==========================================================================
   11. STATUS BADGES
   ========================================================================== */

.badge {
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

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

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

.badge-error {
  background-color: var(--error-light);
  color: #991B1B;
}

.badge-info {
  background-color: var(--info-light);
  color: #1E40AF;
}

.badge-neutral {
  background-color: #F1F5F9;
  color: #475569;
}

.badge-critical {
  background-color: var(--error);
  color: #fff;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: var(--space-1);
  flex-shrink: 0;
}

/* ==========================================================================
   12. MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.5);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  animation: scaleIn 200ms ease-out;
}

.modal-sm {
  width: 400px;
}

.modal-lg {
  width: 800px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-6) var(--space-6) 0;
}

.modal-header-title {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background-color 150ms ease;
}

.modal-close:hover {
  background-color: var(--surface-hover);
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: 0 var(--space-6) var(--space-6);
}

/* ==========================================================================
   13. TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  width: 360px;
  background-color: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4);
  border-left: 4px solid;
  display: flex;
  gap: var(--space-3);
  animation: slideInRight 300ms ease-out;
}

.toast-info {
  border-left-color: var(--info);
}

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

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

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

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

.toast-content {
  flex: 1;
}

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

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

.toast-close {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ==========================================================================
   14. COMPLIANCE SCORE
   ========================================================================== */

.score-gauge {
  position: relative;
  width: 200px;
  height: 100px;
  overflow: hidden;
}

.score-gauge-arc {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 12px solid var(--border);
  border-bottom-color: transparent;
  border-right-color: transparent;
  transform: rotate(-45deg);
  position: absolute;
  top: 0;
  left: 0;
}

.score-value {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.score-label {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

.score-excellent {
  color: #059669;
}

.score-good {
  color: #0891B2;
}

.score-moderate {
  color: #D97706;
}

.score-poor {
  color: #EA580C;
}

.score-critical {
  color: #DC2626;
}

.progress-bar {
  height: 8px;
  background-color: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 400ms ease;
}

.progress-bar-fill.primary {
  background-color: var(--primary);
}

.progress-bar-fill.success {
  background-color: var(--success);
}

.progress-bar-fill.warning {
  background-color: var(--warning);
}

.progress-bar-fill.error {
  background-color: var(--error);
}

.progress-bar-fill.accent {
  background-color: var(--accent);
}

/* ==========================================================================
   15. AUDIO PLAYER
   ========================================================================== */

.audio-player {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.audio-waveform {
  flex: 1;
  height: 48px;
  background-color: #F8FAFC;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.audio-waveform-progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background-color: var(--primary-light);
  transition: width 100ms linear;
}

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

.audio-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.audio-play-btn:hover {
  background-color: var(--primary-hover);
}

.audio-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.audio-speed {
  height: 24px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
}

/* ==========================================================================
   16. TRANSCRIPT DISPLAY
   ========================================================================== */

.transcript {
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
}

.transcript-segment {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid #F1F5F9;
  transition: background-color 150ms ease;
  cursor: pointer;
}

.transcript-segment:last-child {
  border-bottom: none;
}

.transcript-segment:hover {
  background-color: var(--surface-hover);
}

.transcript-segment.active {
  background-color: #EFF6FF;
}

.transcript-speaker {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.transcript-speaker.agent {
  color: var(--primary);
}

.transcript-speaker.customer {
  color: var(--text-secondary);
}

.transcript-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  float: right;
}

.transcript-text {
  font-size: 14px;
  line-height: 1.6;
}

.transcript-highlight {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.transcript-highlight.pass {
  background-color: var(--success-light);
}

.transcript-highlight.fail {
  background-color: var(--error-light);
}

/* ==========================================================================
   17. SEARCH & FILTER BAR
   ========================================================================== */

.filter-bar {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-input input {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-3) 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  background-color: var(--surface);
}

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

.search-input svg,
.search-input .search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.filter-select {
  min-width: 150px;
}

/* ==========================================================================
   18. TABS
   ========================================================================== */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
}

.tab {
  padding: var(--space-3) var(--space-5);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
}

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

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

.tab-content {
  padding-top: var(--space-6);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ==========================================================================
   19. ALERTS / BANNERS
   ========================================================================== */

.alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: 14px;
}

.alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-info {
  background-color: var(--info-light);
  border: 1px solid #93C5FD;
  color: #1E40AF;
}

.alert-success {
  background-color: var(--success-light);
  border: 1px solid #6EE7B7;
  color: #065F46;
}

.alert-warning {
  background-color: var(--warning-light);
  border: 1px solid #FCD34D;
  color: #92400E;
}

.alert-error {
  background-color: var(--error-light);
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

/* ==========================================================================
   20. EMPTY STATE
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

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

.empty-state-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   21. DROPDOWN MENU
   ========================================================================== */

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

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  min-width: 200px;
  padding: var(--space-1);
  z-index: 50;
  display: none;
  margin-top: var(--space-1);
}

.dropdown-menu.active {
  display: block;
  animation: fadeIn 150ms ease-out;
}

.dropdown-item {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: background-color 150ms ease;
}

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

.dropdown-item.danger {
  color: var(--error);
}

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

/* ==========================================================================
   22. LOADING / SKELETON
   ========================================================================== */

.skeleton {
  background-color: #E2E8F0;
  border-radius: var(--radius-sm);
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-text {
  height: 14px;
  width: 100%;
  border-radius: var(--radius-sm);
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.medium {
  width: 80%;
}

.skeleton-heading {
  height: 20px;
  width: 40%;
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-md);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

.spinner-sm {
  width: 16px;
  height: 16px;
}

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

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

/* ==========================================================================
   23. AUTH PAGES
   ========================================================================== */

.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
}

.auth-card {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-12);
  width: 420px;
  max-width: 90vw;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-logo img {
  height: 40px;
  margin: 0 auto;
}

.auth-logo span {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.auth-title {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  font-size: 14px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   24. ANIMATIONS
   ========================================================================== */

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

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

/* ==========================================================================
   25. UTILITIES
   ========================================================================== */

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

/* Gap */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Margin Top */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

/* Margin Bottom */
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* Padding */
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Sizing */
.w-full { width: 100%; }
.h-full { height: 100%; }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Visibility */
.hidden { display: none; }
.visible { display: block; }

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

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }

/* Border */
.border { border: 1px solid var(--border); }
.border-top { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Background */
.bg-surface { background-color: var(--surface); }
.bg-primary { background-color: var(--primary); }
.bg-primary-light { background-color: var(--primary-light); }

/* Avatar */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background-color: var(--primary);
  flex-shrink: 0;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

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

.avatar-xl {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

/* Divider */
.divider {
  height: 1px;
  background-color: var(--border);
  margin: var(--space-4) 0;
}

/* ==========================================================================
   26. RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet and below */
@media (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }

  .sidebar .sidebar-section,
  .sidebar .sidebar-item span,
  .sidebar .sidebar-user-name,
  .sidebar .sidebar-user-role {
    display: none;
  }

  .sidebar .sidebar-item {
    justify-content: center;
    padding: 0;
    margin: 0 var(--space-2);
  }

  .sidebar .sidebar-user {
    justify-content: center;
  }

  .sidebar .sidebar-badge {
    right: var(--space-1);
    top: var(--space-1);
  }

  .main-content {
    margin-left: var(--sidebar-collapsed);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile landscape / small tablet */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    transition: transform 200ms ease;
    z-index: 100;
    pointer-events: none;
    visibility: hidden;
  }

  .sidebar.open {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
  }

  .sidebar .sidebar-section,
  .sidebar .sidebar-item span,
  .sidebar .sidebar-user-name,
  .sidebar .sidebar-user-role {
    display: block;
  }

  .sidebar .sidebar-item {
    justify-content: flex-start;
    padding: 0 var(--space-4);
  }

  .sidebar .sidebar-user {
    justify-content: flex-start;
  }

  .main-content {
    margin-left: 0;
  }

  .header {
    padding: 0 var(--space-4);
  }

  .content {
    padding: var(--space-4);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .modal {
    width: 100%;
    max-width: 100vw;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90vh;
    margin-top: auto;
  }

  .modal-overlay.active {
    align-items: flex-end;
  }

  .table-container {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .page-header-actions {
    width: 100%;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input {
    min-width: unset;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-card {
    padding: var(--space-8);
  }

  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
  }

  .toast {
    width: 100%;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  .content {
    padding: var(--space-4);
  }

  .stat-card {
    padding: var(--space-4);
  }

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

  .auth-card {
    padding: var(--space-6);
    border-radius: var(--radius-md);
  }

  .btn-lg {
    width: 100%;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .audio-player {
    flex-direction: column;
    align-items: stretch;
  }

  .audio-controls {
    justify-content: center;
  }
}

/* ==========================================================================
   27. SIDEBAR TOGGLE (mobile hamburger)
   ========================================================================== */

.sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: flex;
  }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  z-index: 49;
}

.sidebar-backdrop.active {
  display: block;
}

/* ==========================================================================
   28. PRINT STYLES
   ========================================================================== */

@media print {
  .sidebar,
  .header,
  .toast-container,
  .sidebar-backdrop {
    display: none !important;
  }

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

  .content {
    max-width: 100%;
    padding: 0;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card,
  .stat-card,
  .table-container {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ==========================================================================
   29. POC — ADDITIONAL STYLES (app.js components)
   ========================================================================== */

/* Login Page */
.login-page {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  width: 100%;
  max-width: 440px;
  padding: var(--space-6);
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-subtitle {
  color: var(--text-muted);
  margin-top: var(--space-2);
  font-size: 14px;
}

.login-error {
  background: var(--error-light);
  color: var(--error);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: 13px;
}

.login-demo {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.login-demo-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  text-align: center;
}

.login-demo-accounts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.login-demo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}

.login-demo-btn:hover {
  border-color: var(--primary);
  background: var(--primary-50);
}

.login-demo-role {
  font-weight: 600;
  font-size: 12px;
  color: var(--primary);
}

.login-demo-email {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.login-footer {
  text-align: center;
  margin-top: var(--space-6);
  color: rgba(255,255,255,0.4);
  font-size: 12px;
}

.link-text {
  color: var(--primary);
  font-size: 13px;
}

.link-text:hover {
  text-decoration: underline;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: var(--space-4);
}

.btn-block {
  width: 100%;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-outline:hover {
  background: var(--primary-50);
}

/* Sidebar — app.js naming */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}

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

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.sidebar-nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
}

.sidebar-nav-item .icon {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-footer .sidebar-user {
  padding: var(--space-2) 0;
  border-top: none;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

/* Header — app.js naming */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
}

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

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

.header-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: var(--space-2);
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

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

.header-search {
  position: relative;
}

.header-search-input {
  width: 240px;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-8);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  transition: all 0.15s;
}

.header-search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
  width: 300px;
}

.header-search .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.header-icon-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.header-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.header-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.header-user-menu {
  cursor: pointer;
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

/* Dropdown menus */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 100;
  padding: var(--space-2) 0;
  opacity: 1;
  transition: opacity 0.15s;
}

.dropdown-menu.hidden {
  display: none;
}

.dropdown-header {
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s;
}

.dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

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

.dropdown-notif {
  min-width: 320px;
  max-height: 400px;
  overflow-y: auto;
}

.dropdown-notif-item {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.dropdown-notif-title {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.dropdown-notif-msg {
  font-size: 12px;
  color: var(--text-secondary);
}

.dropdown-notif-time {
  font-size: 11px;
  color: var(--text-muted);
}

.dropdown-empty {
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: var(--space-1);
}

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

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

.stats-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stats-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

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

.stat-card-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-card-icon {
  color: var(--text-muted);
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.stat-card-footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.stat-trend.trend-up {
  color: var(--success);
}

.stat-trend.trend-down {
  color: var(--error);
}

.stat-card-period {
  font-size: 12px;
  color: var(--text-muted);
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

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

/* Card p-0 */
.card-body.p-0,
.p-0 {
  padding: 0;
}

/* Data table */
.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

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

.cell-main {
  font-weight: 500;
  color: var(--text);
}

.cell-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

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

.badge-secondary {
  background: var(--surface-active);
  color: var(--text-secondary);
}

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

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

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

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

/* Gauge */
.gauge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gauge svg {
  position: absolute;
}

.gauge-label {
  text-align: center;
  z-index: 1;
}

.gauge-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.gauge-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: var(--space-4) var(--space-2);
  min-width: 0;
  overflow-x: auto;
}

.bar-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar-chart-bar {
  width: 100%;
  max-width: 40px;
  min-height: 4px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.3s ease;
}

.bar-chart-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: var(--space-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface-active);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.2s;
}

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

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

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: var(--space-1);
  border-radius: var(--radius-md);
  cursor: pointer;
}

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

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

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

/* Toast */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--error);
}

.toast-info {
  border-left: 3px solid var(--info);
}

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

.page-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
  background: var(--surface-hover);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.filter-select {
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.filter-search {
  position: relative;
}

.filter-search-input {
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  min-width: 220px;
}

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

.filter-search .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.filter-date {
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
}

/* Waveform Player */
.waveform-player {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg);
  border-radius: var(--radius-lg);
}

.waveform-play-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.waveform-play-btn:hover {
  background: var(--primary-hover);
}

.waveform-track {
  flex: 1;
  height: 48px;
  position: relative;
  overflow: hidden;
}

.waveform-bars {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2px;
}

.waveform-bar {
  flex: 1;
  background: var(--primary-light);
  border-radius: 1px;
  min-width: 2px;
  transition: background 0.1s;
}

.waveform-bar:hover {
  background: var(--primary);
}

.waveform-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: rgba(30, 64, 175, 0.1);
}

.waveform-time {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.waveform-speed-btn {
  padding: var(--space-1) var(--space-2);
  background: var(--surface-active);
  border: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Transcript */
.transcript {
  max-height: 500px;
  overflow-y: auto;
}

.transcript-scroll {
  max-height: 500px;
  overflow-y: auto;
}

.transcript-segment {
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid transparent;
  margin-bottom: var(--space-2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.segment-agent {
  border-left-color: var(--primary);
  background: var(--primary-50);
}

.segment-customer {
  border-left-color: var(--accent);
  background: var(--accent-light);
}

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

.segment-speaker {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.segment-agent .segment-speaker {
  color: var(--primary);
}

.segment-customer .segment-speaker {
  color: var(--accent);
}

.segment-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.segment-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

/* Analysis */
.analysis-section {
  margin-bottom: var(--space-5);
}

.analysis-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-3);
}

.analysis-summary {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.talk-ratio-bar {
  display: flex;
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 24px;
  margin-bottom: var(--space-2);
}

.talk-ratio-agent {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.talk-ratio-customer {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.talk-ratio-silence {
  font-size: 12px;
  color: var(--text-muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.metric {
  display: flex;
  flex-direction: column;
  padding: var(--space-3);
  background: var(--bg);
  border-radius: var(--radius-md);
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.metric-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Scoring */
.scoring-category {
  margin-bottom: var(--space-5);
}

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

.category-title {
  font-size: 14px;
  font-weight: 600;
}

.criteria-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.criteria-row:last-child {
  border-bottom: none;
}

.criteria-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.criteria-name {
  font-weight: 500;
}

.criteria-desc {
  font-size: 12px;
}

.criteria-meta {
  display: flex;
  gap: var(--space-2);
}

.criteria-score {
  font-weight: 600;
  color: var(--primary);
}

.criteria-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Weight bar (scoring grid visual) */
.scoring-grid-visual {
  margin-bottom: var(--space-6);
}

.weight-bar {
  display: flex;
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 32px;
}

.weight-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

/* Version history */
.version-history {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.version-history h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.version-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: 13px;
}

/* Annotations */
.annotation-item {
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--space-3);
}

.annotation-positive {
  border-color: var(--success);
  background: var(--success-light);
}

.annotation-improvement {
  border-color: var(--warning);
  background: var(--warning-light);
}

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

.annotation-author {
  font-weight: 600;
  font-size: 12px;
}

.annotation-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.annotation-text {
  font-size: 13px;
}

/* Agent cards */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition: all 0.15s;
}

.agent-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.agent-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

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

.agent-card-name {
  font-weight: 600;
  font-size: 14px;
}

.agent-card-email {
  font-size: 12px;
  color: var(--text-muted);
}

.agent-card-stats {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.agent-card-stat {
  flex: 1;
  text-align: center;
}

.agent-card-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.agent-card-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.agent-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-3);
}

/* Agent ranking */
.agent-ranking {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  transition: background 0.1s;
}

.ranking-item:hover {
  background: var(--surface-hover);
}

.ranking-pos {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 14px;
  min-width: 28px;
}

.ranking-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.ranking-info {
  flex: 1;
}

.ranking-name {
  font-weight: 500;
  font-size: 13px;
}

.ranking-detail {
  font-size: 12px;
  color: var(--text-muted);
}

.ranking-score {
  flex-shrink: 0;
}

/* Alerts list */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.alert-item {
  padding: var(--space-4);
  border-left: 3px solid;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--bg);
  cursor: pointer;
  transition: background 0.15s;
}

.alert-item:hover {
  background: var(--surface-hover);
}

.alert-high {
  border-color: var(--error);
}

.alert-medium {
  border-color: var(--warning);
}

.alert-low {
  border-color: var(--info);
}

.alert-unread {
  background: var(--primary-50);
}

.alert-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.alert-item-title {
  font-weight: 600;
  font-size: 13px;
}

.alert-item-msg {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.alert-item-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* Coaching */
.coaching-session-card {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.coaching-session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.coaching-session-title {
  font-size: 15px;
  font-weight: 600;
}

.coaching-session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.coaching-session-meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.coaching-session-objectives {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.coaching-session-feedback {
  font-size: 13px;
  color: var(--text-secondary);
  padding: var(--space-3);
  background: var(--bg);
  border-radius: var(--radius-md);
}

.coaching-item {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.coaching-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.coaching-item-title {
  font-weight: 600;
  font-size: 13px;
}

.coaching-item-meta {
  display: flex;
  gap: var(--space-3);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.coaching-item-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.coaching-item-objectives {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.coaching-item-feedback {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

.coaching-notes {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.coaching-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

.coaching-note-author {
  font-weight: 600;
  color: var(--text);
}

/* Playlists */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-4);
}

.playlist-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

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

.playlist-header h4 {
  font-size: 15px;
  font-weight: 600;
}

.playlist-items {
  margin-top: var(--space-4);
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.playlist-item:last-child {
  border-bottom: none;
}

.playlist-item-order {
  font-weight: 700;
  color: var(--text-muted);
  min-width: 24px;
}

.playlist-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.playlist-item-info a {
  color: var(--primary);
  font-weight: 500;
}

.playlist-item-info a:hover {
  text-decoration: underline;
}

.playlist-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 12px;
}

/* Template grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.template-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
}

.template-icon {
  color: var(--primary);
  margin-bottom: var(--space-3);
}

.template-card h4 {
  font-size: 14px;
  margin-bottom: var(--space-2);
}

.template-sections {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  justify-content: center;
  margin-top: var(--space-3);
}

/* Connectors */
.connector-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.connector-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.connector-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.connector-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* GDPR checklist */
.gdpr-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.gdpr-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 13px;
  color: var(--success);
}

.gdpr-item span {
  color: var(--text);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--space-6);
}

.tab-btn {
  padding: var(--space-3) var(--space-5);
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

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

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

/* Icon sizing in buttons/inline */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .main-wrapper {
    margin-left: 0;
  }

  .main-content {
    margin-left: 0;
  }

  .header-toggle {
    display: flex;
  }

  .header-search {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .agent-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
  }

  .page-header {
    flex-direction: column;
    gap: var(--space-3);
  }
}

/* Sidebar collapsed state */
body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-nav-label,
body.sidebar-collapsed .sidebar-user-info {
  display: none;
}

body.sidebar-collapsed .sidebar-nav-item {
  justify-content: center;
  padding: var(--space-3);
}

body.sidebar-collapsed .sidebar-user {
  justify-content: center;
}

body.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-collapsed);
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* ==========================================================================
   Language Switcher
   ========================================================================== */

.lang-switcher {
  position: relative;
  margin-right: 12px;
}

.lang-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 1000;
  margin-top: 4px;
  overflow: hidden;
}

.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}

.lang-dropdown a:hover {
  background: var(--surface-hover);
}

.lang-dropdown a strong {
  font-weight: 600;
}

/* ==========================================================================
   Entity / Campaign Meta Rows
   ========================================================================== */

.campaign-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
}

.meta-row + .meta-row {
  border-top: 1px solid var(--border);
}

.meta-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Connector Status Dot
   ========================================================================== */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.active {
  background: var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.inactive {
  background: var(--text-muted);
}

.status-dot.syncing {
  background: var(--warning);
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(5, 150, 105, 0); }
}

/* ==========================================================================
   Entity Badge (inline with icon)
   ========================================================================== */

.entity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  background: var(--info-light);
  color: var(--info);
}

/* ==========================================================================
   Assign Rules Two-Column Layout
   ========================================================================== */

.rules-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.rules-column h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.rules-column-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
}

.rules-column-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.rules-column-item:last-child {
  border-bottom: none;
}

.rules-column-item:hover {
  background: var(--surface-hover);
}
