/* ═══════════════════════════════════════════════════════════════════════
   VSHRED AI PLATFORM — COMPONENT LIBRARY
   Creative Director: Phase 0 Design Foundation

   Every reusable component, fully styled with all interaction states.
   Engineers: Apply these classes exactly. Don't improvise.
   
   INTERACTION STATES documented inline:
   - :hover — mouse over
   - :active — mouse pressed
   - :focus-visible — keyboard focus (not mouse focus)
   - :disabled / .disabled — non-interactive
   - .loading — async in progress
   - .error — validation/API failure
   - .success — confirmed action
   - .empty — no content
   ═══════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────────────── */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background: var(--color-bg-base);
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary-light); }

::selection {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
}

/* Focus ring — visible only for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-default); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }


/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS
   Variants: primary, secondary, ghost, danger
   Sizes: sm, md (default), lg
   ═══════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--btn-height-md);
  padding: var(--btn-padding-md);
  border: 1.5px solid transparent;
  border-radius: var(--btn-radius);
  font-family: var(--font-heading);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  letter-spacing: var(--btn-letter-spacing);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn svg,
.btn .btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Primary — Fire gradient, the main CTA */
.btn-primary {
  background: var(--gradient-fire);
  color: var(--color-text-on-primary);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(227, 24, 55, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(227, 24, 55, 0.4);
  filter: brightness(1.1);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(227, 24, 55, 0.3);
  filter: brightness(0.95);
}

/* Shimmer sweep on hover */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}
.btn-primary:hover::after { left: 100%; }

/* Secondary — Outlined, understated */
.btn-secondary {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border-default);
}
.btn-secondary:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
}
.btn-secondary:active {
  background: var(--color-primary-muted);
}

/* Ghost — No border, minimal presence */
.btn-ghost {
  background: transparent;
  color: var(--color-text-tertiary);
  border-color: transparent;
}
.btn-ghost:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
}
.btn-ghost:active {
  background: var(--color-bg-overlay);
}

/* Danger — Destructive actions */
.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border-color: var(--color-danger);
}
.btn-danger:hover {
  background: var(--color-danger);
  color: var(--color-text-on-primary);
  box-shadow: 0 4px 16px var(--color-danger-muted);
}
.btn-danger:active {
  filter: brightness(0.9);
}

/* Sizes */
.btn-sm {
  height: var(--btn-height-sm);
  padding: var(--btn-padding-sm);
  font-size: var(--text-xs);
}
.btn-lg {
  height: var(--btn-height-lg);
  padding: var(--btn-padding-lg);
  font-size: var(--text-base);
}

/* States */
.btn:disabled,
.btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

.btn.loading {
  color: transparent;
  pointer-events: none;
}
.btn.loading::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--color-text-on-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Button Group */
.btn-group {
  display: flex;
  gap: var(--space-2);
}
.btn-group .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.btn-group .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }


/* ═══════════════════════════════════════════════════════════════════════
   CARDS
   Variants: metric-card, activity-card, detail-card, agent-card
   ═══════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  position: relative;
  transition: all var(--transition-base);
}

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

/* Metric Card — Dashboard KPI */
.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

/* Top accent line — hidden by default, reveals on hover */
.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-fire);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.metric-card:hover {
  border-color: rgba(227, 24, 55, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(227, 24, 55, 0.08);
}
.metric-card:hover::before { opacity: 1; }

.metric-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.metric-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}
.metric-card__icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.metric-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}
.metric-card__trend--up {
  background: var(--color-success-subtle);
  color: var(--color-success);
}
.metric-card__trend--down {
  background: var(--color-danger-subtle);
  color: var(--color-danger);
}

.metric-card__value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  line-height: var(--leading-none);
  margin-bottom: var(--space-2);
}

.metric-card__label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

/* Activity Card — Feed items */
.activity-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-base);
  border-radius: var(--radius-lg);
  border-left: 3px solid transparent;
  transition: all var(--transition-base);
  cursor: default;
}

.activity-card:hover {
  background: var(--color-primary-subtle);
  border-left-color: var(--color-primary);
  transform: translateX(4px);
}

.activity-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-primary);
}
.activity-card__icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.activity-card__icon--success { background: var(--color-success-subtle); color: var(--color-success); }
.activity-card__icon--warning { background: var(--color-warning-subtle); color: var(--color-warning); }
.activity-card__icon--info { background: var(--color-info-subtle); color: var(--color-info); }

.activity-card__body { flex: 1; min-width: 0; }
.activity-card__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: 2px;
}
.activity-card__meta {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}
.activity-card__time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Detail Card — Settings/info panels */
.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  overflow: hidden;
}
.detail-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--gradient-dark-surface);
}
.detail-card__title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.detail-card__title svg { width: 20px; height: 20px; stroke: var(--color-primary); fill: none; stroke-width: 2; }
.detail-card__body { padding: var(--space-5) var(--space-6); }
.detail-card__footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-bg-raised);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Agent Status Card */
.agent-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: all var(--transition-base);
}
.agent-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}
.agent-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--gradient-fire);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text-on-primary);
  position: relative;
  flex-shrink: 0;
}
.agent-card__status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid var(--card-bg);
}
.agent-card__status-dot--online { background: var(--color-success); animation: breathe 2s ease-in-out infinite; }
.agent-card__status-dot--busy { background: var(--color-warning); }
.agent-card__status-dot--offline { background: var(--color-text-muted); }
.agent-card__info { flex: 1; }
.agent-card__name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  margin-bottom: 2px;
}
.agent-card__role {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}
.agent-card__status-label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}
.agent-card__status-label--online { color: var(--color-success); }
.agent-card__status-label--busy { color: var(--color-warning); }
.agent-card__status-label--offline { color: var(--color-text-muted); }


/* ═══════════════════════════════════════════════════════════════════════
   FORMS
   Inputs, selects, textareas, toggles, sliders
   ═══════════════════════════════════════════════════════════════════════ */

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

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-2);
}

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

/* Input */
.form-input {
  width: 100%;
  height: var(--input-height);
  padding: var(--input-padding);
  background: var(--input-bg);
  border: var(--input-border-width) solid var(--input-border);
  border-radius: var(--input-radius);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--input-text);
  transition: all var(--transition-base);
}
.form-input::placeholder { color: var(--input-placeholder); }
.form-input:hover { border-color: var(--color-border-strong); }
.form-input:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-subtle), 0 0 16px rgba(227, 24, 55, 0.1);
}
.form-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--color-bg-raised);
}
.form-input.error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px var(--color-danger-subtle);
}
.form-input.success {
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px var(--color-success-subtle);
}
.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Select */
.form-select {
  width: 100%;
  height: var(--input-height);
  padding: var(--input-padding);
  padding-right: var(--space-10);
  background: var(--input-bg);
  border: var(--input-border-width) solid var(--input-border);
  border-radius: var(--input-radius);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--input-text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: all var(--transition-base);
}
.form-select:hover { border-color: var(--color-border-strong); }
.form-select:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

/* Textarea */
.form-textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-3) var(--space-4);
  background: var(--input-bg);
  border: var(--input-border-width) solid var(--input-border);
  border-radius: var(--input-radius);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--input-text);
  resize: vertical;
  transition: all var(--transition-base);
  line-height: var(--leading-relaxed);
}
.form-textarea::placeholder { color: var(--input-placeholder); }
.form-textarea:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track {
  width: 44px;
  height: 24px;
  background: var(--color-bg-overlay);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border-default);
  transition: all var(--transition-base);
  position: relative;
}
.toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--color-text-tertiary);
  border-radius: 50%;
  transition: all var(--transition-spring);
}
.toggle input:checked ~ .toggle__track {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.toggle input:checked ~ .toggle__track .toggle__thumb {
  left: 22px;
  background: var(--color-text-on-primary);
}
.toggle input:focus-visible ~ .toggle__track {
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
}
.toggle__label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* Range Slider */
.slider {
  width: 100%;
  margin: var(--space-2) 0;
}
.slider__input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--color-bg-overlay);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}
.slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-bg-surface);
  box-shadow: 0 0 8px var(--color-primary-glow);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.slider__input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 16px var(--color-primary-glow);
}
.slider__input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-bg-surface);
  cursor: pointer;
}
.slider__labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.slider__value {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  text-align: center;
  margin-bottom: var(--space-1);
}

/* Phone Input */
.phone-input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.phone-input__prefix {
  height: var(--input-height);
  padding: var(--input-padding);
  background: var(--color-bg-elevated);
  border: var(--input-border-width) solid var(--input-border);
  border-radius: var(--input-radius) 0 0 var(--input-radius);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  white-space: nowrap;
  border-right: none;
}
.phone-input__field {
  flex: 1;
  height: var(--input-height);
  padding: var(--input-padding);
  background: var(--input-bg);
  border: var(--input-border-width) solid var(--input-border);
  border-radius: 0 var(--input-radius) var(--input-radius) 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--input-text);
  transition: all var(--transition-base);
}
.phone-input__field:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
}


/* ═══════════════════════════════════════════════════════════════════════
   TABLES
   Sortable headers, row hover, responsive collapse
   ═══════════════════════════════════════════════════════════════════════ */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--table-border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table thead {
  background: var(--table-header-bg);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table th {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border-default);
  user-select: none;
}

.table th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}
.table th.sortable:hover { color: var(--color-primary); }
.table th.sortable::after {
  content: '↕';
  margin-left: var(--space-2);
  font-size: 10px;
  opacity: 0.4;
}
.table th.sorted-asc::after { content: '↑'; opacity: 1; color: var(--color-primary); }
.table th.sorted-desc::after { content: '↓'; opacity: 1; color: var(--color-primary); }

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

.table tbody tr {
  transition: background var(--transition-fast);
}
.table tbody tr:hover {
  background: var(--table-row-hover);
}
.table tbody tr:last-child td {
  border-bottom: none;
}

/* Responsive table — stack on mobile */
@media (max-width: 768px) {
  .table--responsive thead { display: none; }
  .table--responsive tr {
    display: block;
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border-subtle);
  }
  .table--responsive td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: none;
  }
  .table--responsive td::before {
    content: attr(data-label);
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
  }
}


/* ═══════════════════════════════════════════════════════════════════════
   NAVIGATION
   Sidebar, Top Bar, Mobile Hamburger
   ═══════════════════════════════════════════════════════════════════════ */

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

.sidebar__header {
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--color-border-subtle);
}

.sidebar__logo {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 24px var(--color-primary-glow);
}

.sidebar__logo-img {
  max-width: 160px;
  height: auto;
  filter: drop-shadow(0 0 16px var(--color-primary-glow));
}

.sidebar__subtitle {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  margin-top: var(--space-1);
}

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

.nav-section {
  margin-bottom: var(--space-6);
}

.nav-section__title {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  padding: 0 var(--space-5);
  margin-bottom: var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  color: var(--color-text-tertiary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  border-left: 3px solid transparent;
  text-decoration: none;
  position: relative;
}
.nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  flex-shrink: 0;
  transition: stroke var(--transition-fast);
}
.nav-item:hover {
  color: var(--color-text-primary);
  background: var(--sidebar-item-hover);
  border-left-color: var(--color-primary);
}
.nav-item:hover svg { stroke: var(--color-primary); }
.nav-item.active {
  color: var(--color-text-primary);
  background: var(--sidebar-item-active);
  border-left-color: var(--color-primary);
}
.nav-item.active svg { stroke: var(--color-primary); }

.nav-item__badge {
  margin-left: auto;
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: var(--weight-bold);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

/* Sidebar Footer — User Card */
.sidebar__footer {
  padding: var(--space-4) var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-bg-base);
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
}

.user-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-fire);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-text-on-primary);
  flex-shrink: 0;
}

.user-card__name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}

.user-card__role {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: var(--weight-medium);
}

/* Top Bar */
.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border-subtle);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

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

.topbar__breadcrumb {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.topbar__breadcrumb span { color: var(--color-primary); font-weight: var(--weight-bold); }

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

/* Hamburger Menu (mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-2);
  background: none;
  border: none;
}
.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--color-text-secondary);
  border-radius: 2px;
  transition: all var(--transition-base);
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Live Indicator */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-4);
  background: var(--color-success-subtle);
  border: 1px solid rgba(46, 204, 113, 0.25);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-success);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  position: relative;
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-success);
  border-radius: 50%;
  animation: live-pulse 2s ease-in-out infinite;
}

/* Notification Button */
.notification-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--color-text-tertiary);
}
.notification-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}
.notification-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.notification-btn__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-bg-surface);
}


/* ═══════════════════════════════════════════════════════════════════════
   BADGES & PILLS
   Status indicators, priority tags
   ═══════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
}

.badge--success { background: var(--color-success-subtle); color: var(--color-success); }
.badge--warning { background: var(--color-warning-subtle); color: var(--color-warning); }
.badge--danger { background: var(--color-danger-subtle); color: var(--color-danger); }
.badge--info { background: var(--color-info-subtle); color: var(--color-info); }
.badge--primary { background: var(--color-primary-subtle); color: var(--color-primary); }
.badge--neutral { background: var(--color-bg-elevated); color: var(--color-text-tertiary); }

/* With dot indicator */
.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Priority Tags */
.priority-tag { padding: 4px 12px; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.priority-tag--critical { background: var(--color-danger); color: var(--color-text-on-primary); }
.priority-tag--high { background: var(--color-accent-orange); color: var(--color-text-on-primary); }
.priority-tag--medium { background: var(--color-warning); color: var(--color-text-inverse); }
.priority-tag--low { background: var(--color-bg-elevated); color: var(--color-text-tertiary); }


/* ═══════════════════════════════════════════════════════════════════════
   MODALS & DIALOGS
   ═══════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  padding: var(--space-4);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
}
.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

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

.modal__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.modal__close:hover { background: var(--color-bg-elevated); color: var(--color-text-primary); }
.modal__close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; }

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

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-bg-raised);
}

/* Confirmation Dialog — specialization */
.modal--confirm .modal__body {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}
.modal--confirm .modal__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal--confirm .modal__icon--danger {
  background: var(--color-danger-subtle);
  color: var(--color-danger);
}
.modal--confirm .modal__icon svg { width: 28px; height: 28px; stroke: currentColor; stroke-width: 2; }
.modal--confirm .modal__message {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  max-width: 360px;
  margin: 0 auto;
  line-height: var(--leading-relaxed);
}
.modal--confirm .modal__footer {
  justify-content: center;
}


/* ═══════════════════════════════════════════════════════════════════════
   LOADING STATES
   Skeleton screens, spinners
   ═══════════════════════════════════════════════════════════════════════ */

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border-default);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner--sm { width: 16px; height: 16px; border-width: 2px; }
.spinner--lg { width: 40px; height: 40px; border-width: 4px; }

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay);
  border-radius: inherit;
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-elevated) 25%, var(--color-bg-overlay) 37%, var(--color-bg-elevated) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-md);
}
.skeleton--text { height: 14px; margin-bottom: var(--space-2); border-radius: var(--radius-sm); }
.skeleton--text:last-child { width: 60%; }
.skeleton--heading { height: 24px; width: 40%; margin-bottom: var(--space-4); }
.skeleton--card { height: 120px; border-radius: var(--radius-xl); }
.skeleton--avatar { width: 44px; height: 44px; border-radius: var(--radius-lg); }
.skeleton--metric { height: 40px; width: 80px; margin-bottom: var(--space-2); }


/* ═══════════════════════════════════════════════════════════════════════
   EMPTY STATES
   Designed experiences, not error messages
   ═══════════════════════════════════════════════════════════════════════ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-8);
  text-align: center;
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--color-primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}
.empty-state__icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--color-primary);
  fill: none;
  stroke-width: 1.5;
}

.empty-state__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-2);
}

.empty-state__message {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  max-width: 320px;
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}


/* ═══════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 400px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  border-radius: var(--toast-radius);
  box-shadow: var(--toast-shadow);
  animation: toast-in 0.3s ease forwards;
  pointer-events: auto;
}
.toast.exiting { animation: toast-out 0.3s ease forwards; }

.toast__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast__icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

.toast--success { border-left: 3px solid var(--color-success); }
.toast--success .toast__icon { color: var(--color-success); }
.toast--error { border-left: 3px solid var(--color-danger); }
.toast--error .toast__icon { color: var(--color-danger); }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--warning .toast__icon { color: var(--color-warning); }
.toast--info { border-left: 3px solid var(--color-info); }
.toast--info .toast__icon { color: var(--color-info); }

.toast__content { flex: 1; }
.toast__title {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  margin-bottom: 2px;
}
.toast__message {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  line-height: var(--leading-relaxed);
}

.toast__close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.toast__close:hover { background: var(--color-bg-overlay); color: var(--color-text-primary); }
.toast__close svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; }


/* ═══════════════════════════════════════════════════════════════════════
   SEARCH / FILTER BAR
   ═══════════════════════════════════════════════════════════════════════ */

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-base);
  border: var(--input-border-width) solid var(--color-border-default);
  border-radius: var(--input-radius);
  transition: all var(--transition-base);
}
.search-bar:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
}
.search-bar__icon {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.search-bar__icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.search-bar__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}
.search-bar__input::placeholder { color: var(--color-text-muted); }
.search-bar__clear {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}
.search-bar__clear:hover { color: var(--color-text-primary); }

/* Filter Pills */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 5px 14px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: all var(--transition-base);
  background: transparent;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.filter-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.filter-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-on-primary);
}


/* ═══════════════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════════════ */

.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border-subtle);
  overflow-x: auto;
}

.tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-base);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover {
  color: var(--color-text-primary);
}
.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.tab__count {
  background: var(--color-bg-elevated);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 10px;
}
.tab.active .tab__count {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}


/* ═══════════════════════════════════════════════════════════════════════
   DRAG & DROP UPLOAD ZONE
   ═══════════════════════════════════════════════════════════════════════ */

.upload-zone {
  border: 2px dashed var(--color-border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
}
.upload-zone.dragover {
  border-style: solid;
  box-shadow: inset 0 0 30px var(--color-primary-subtle);
}
.upload-zone__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--color-primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: transform var(--transition-base);
}
.upload-zone:hover .upload-zone__icon { transform: scale(1.05); }
.upload-zone__icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.upload-zone__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-2);
}
.upload-zone__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}
.upload-zone__subtitle span {
  color: var(--color-primary);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}


/* ═══════════════════════════════════════════════════════════════════════
   FILE LIST ITEM
   ═══════════════════════════════════════════════════════════════════════ */

.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-base);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  transition: all var(--transition-base);
}
.file-item:hover {
  border-color: var(--color-border-strong);
  background: var(--color-bg-raised);
}

.file-item__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-xl);
}
.file-item__icon--pdf { background: var(--color-danger-subtle); color: var(--color-danger); }
.file-item__icon--doc { background: var(--color-info-subtle); color: var(--color-info); }
.file-item__icon--img { background: var(--color-success-subtle); color: var(--color-success); }
.file-item__icon--default { background: var(--color-bg-elevated); color: var(--color-text-tertiary); }

.file-item__info { flex: 1; min-width: 0; }
.file-item__name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-item__meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

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


/* ═══════════════════════════════════════════════════════════════════════
   LIVE CALL INDICATOR
   Used in call activity view for active calls
   ═══════════════════════════════════════════════════════════════════════ */

.live-call {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg-base);
  border: 1px solid rgba(46, 204, 113, 0.2);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}
.live-call::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-success);
}
.live-call:hover {
  border-color: rgba(46, 204, 113, 0.4);
  background: var(--color-success-subtle);
}

.live-call__pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-success);
  flex-shrink: 0;
  position: relative;
}
.live-call__pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--color-success);
  animation: live-pulse 2s ease-in-out infinite;
}

.live-call__info { flex: 1; }
.live-call__caller { font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.live-call__meta { font-size: var(--text-xs); color: var(--color-text-tertiary); }

.live-call__timer {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-success);
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════════
   PERSONALITY PREVIEW
   Live preview panel for agent personality editor
   ═══════════════════════════════════════════════════════════════════════ */

.personality-preview {
  background: var(--color-bg-base);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: relative;
}
.personality-preview::before {
  content: 'LIVE PREVIEW';
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: var(--weight-bold);
  color: var(--color-success);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  background: var(--color-success-subtle);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.personality-preview__bubble {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
  max-width: 85%;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  animation: fade-in-up 0.3s ease;
}


/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE LAYOUT HELPERS
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .hamburger {
    display: flex;
  }
  .toast-container {
    right: var(--space-4);
    left: var(--space-4);
    max-width: none;
  }
}

@media (max-width: 375px) {
  .modal {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: calc(var(--z-sidebar) - 1);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}
.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}


/* ═══════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-primary { color: var(--color-primary) !important; }
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-muted { color: var(--color-text-muted) !important; }

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
