/* ============================================
   dashboard.css — App Shell for Dashboard & Admin
   Uses design tokens from styles.css
   ============================================ */

:root {
  --border-color: var(--line, #E8EBF2);
  --primary-blue: var(--blue, #3355FF);
  --primary-blue-hover: var(--blue-dark, #1E3AD1);
  --card-tint: var(--blue-soft, #EEF1FF);
  --border-tint: rgba(51,85,255,0.2);
  --text-heading: var(--ink, #0B0D12);
  --text-body: var(--ink-soft, #5B6472);
  --text-muted: var(--ink-faint, #9AA2B1);
  --bg-secondary: var(--bg-soft, #F5F7FC);
}

/* ---- App Layout ---- */
.app-page {
  min-height: 100vh;
  background: var(--bg-secondary);
  padding-top: 0;
}

/* App Top Bar (dashboard island variant) */
.app-topbar {
  position: sticky;
  top: 16px;
  z-index: 100;
  margin: 16px auto;
  width: min(95%, 1200px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.75rem 1.5rem;
  box-shadow: var(--shadow-soft);
}

.topbar-brand {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}

.topbar-brand span {
  color: var(--primary-blue);
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-credits {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--card-tint);
  border: 1px solid var(--border-tint);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-blue);
}

.topbar-credits-icon {
  font-size: 0.9rem;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem 0.35rem 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.topbar-user:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.topbar-nav-links {
  display: none;
  gap: 0.5rem;
}

.topbar-nav-links a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-body);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  transition: all 0.2s;
}

.topbar-nav-links a:hover, .topbar-nav-links a.active {
  background: var(--card-tint);
  color: var(--primary-blue);
}

@media (min-width: 768px) {
  .topbar-nav-links {
    display: flex;
  }
}

/* ---- Dashboard Main Layout ---- */
.dash-container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

/* ---- Stats Strip ---- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .stats-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
  opacity: 0;
  transition: opacity 0.25s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-tint);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0.3rem 0 0.2rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-card .stat-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-card.highlight .stat-value {
  color: var(--primary-blue);
}

/* ---- Bento Grid ---- */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .bento-wide {
    grid-column: span 2;
  }
  .bento-full {
    grid-column: span 3;
  }
}

.bento-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: all 0.25s var(--ease-out);
}

.bento-card:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: var(--shadow-lg);
}

.bento-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.bento-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
}

.bento-card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--card-tint);
  color: var(--primary-blue);
  border: 1px solid var(--border-tint);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}

.bento-card-badge.success {
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.2);
}

/* ---- Track Navigation Tabs ---- */
.track-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 1.5rem;
}

.track-tabs::-webkit-scrollbar {
  display: none;
}

.track-tab {
  border: none;
  background: transparent;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-body);
  white-space: nowrap;
  transition: all 0.25s var(--ease-out);
  cursor: pointer;
}

.track-tab:hover {
  color: var(--primary-blue);
  background: rgba(37, 99, 235, 0.06);
}

.track-tab.active {
  background: #fff;
  color: var(--primary-blue);
  box-shadow: var(--shadow-soft);
}

/* ---- Checklist ---- */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.checklist-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-body);
  transition: all 0.2s;
}

.checklist-row:hover {
  border-color: var(--border-tint);
  background: var(--card-tint);
}

.checklist-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-blue);
  flex-shrink: 0;
  cursor: pointer;
}

.checklist-row.done {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Progress bar */
.progress-bar-wrap {
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-out);
}

/* ---- Niche Selector ---- */
.niche-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.niche-btn {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: transparent;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.niche-btn:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.niche-btn.active {
  background: var(--primary-blue);
  color: #fff;
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.niche-details-box {
  background: var(--card-tint);
  border: 1px solid var(--border-tint);
  border-radius: 12px;
  padding: 1rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-body);
  min-height: 80px;
  transition: all 0.3s var(--ease-out);
}

/* ---- Hook Analyzer ---- */
.hook-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hook-input-group textarea {
  flex: 1;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 72px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hook-input-group textarea:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.hook-score-display {
  display: none;
  text-align: center;
  padding: 1.25rem;
  border-radius: 12px;
  transition: all 0.4s var(--ease-out);
}

.hook-score-display.visible {
  display: block;
}

.hook-score-ring {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.25rem;
}

.hook-score-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hook-breakdown {
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-body);
  line-height: 1.8;
}

/* ---- Posting Calendar Grid ---- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 480px) {
  .cal-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cal-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  background: var(--bg-secondary);
  text-align: center;
  padding: 0.3rem;
}

.cal-cell:hover {
  border-color: var(--primary-blue);
  background: var(--card-tint);
  color: var(--primary-blue);
  transform: scale(1.05);
}

.cal-cell.posted {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.cal-cell .day-label {
  font-size: 0.6rem;
  font-weight: 600;
  opacity: 0.75;
  text-transform: uppercase;
}

.cal-cell .day-content {
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

/* ---- Affiliate Card ---- */
.ref-link-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.ref-link-box code {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-body);
  word-break: break-all;
  font-family: var(--font-mono);
}

.btn-copy {
  background: var(--primary-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.4rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s var(--ease-out);
  flex-shrink: 0;
}

.btn-copy:hover {
  background: var(--primary-blue-hover);
  transform: scale(1.03);
}

.btn-copy.copied {
  background: var(--success);
}

.aff-stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.aff-stat {
  text-align: center;
}

.aff-stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.03em;
}

.aff-stat small {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---- AI Widget Panel ---- */
.ai-panel {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 200;
}

.ai-panel-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-spring);
}

.ai-panel-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.45);
}

.ai-panel-body {
  position: absolute;
  bottom: 64px;
  right: 0;
  width: min(380px, 90vw);
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  max-height: 70vh;
}

.ai-panel-body.open {
  display: flex;
}

.ai-panel-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-panel-head strong {
  font-size: 0.95rem;
  color: var(--text-heading);
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ai-msg {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.ai-msg.user {
  align-self: flex-end;
  background: var(--primary-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ai-msg.assistant {
  align-self: flex-start;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  border-bottom-left-radius: 4px;
}

.ai-input-row {
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
}

.ai-input-row input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-input-row input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

/* ---- Community Chat ---- */
.community-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.channel-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.channel-tab {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.2s;
}

.channel-tab.active {
  background: var(--primary-blue);
  color: #fff;
  border-color: var(--primary-blue);
}

.chat-thread {
  min-height: 280px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.5rem 0;
}

.chat-msg {
  display: flex;
  gap: 0.6rem;
  font-size: 0.875rem;
}

.chat-msg-mine {
  flex-direction: row-reverse;
}

.chat-bubble {
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  max-width: 80%;
  border-bottom-left-radius: 4px;
}

.chat-msg-mine .chat-bubble {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: #fff;
  border-radius: 14px;
  border-bottom-right-radius: 4px;
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chat-input-row input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-row input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

/* ---- Asset Library ---- */
.asset-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.asset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.2s;
}

.asset-item:hover {
  border-color: var(--border-tint);
  background: var(--card-tint);
}

.asset-item strong {
  font-size: 0.9rem;
  color: var(--text-heading);
}

.asset-item small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Admin Specific ---- */
.admin-topbar-badge {
  font-size: 0.72rem;
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.6rem;
  font-weight: 700;
}

.admin-search-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-search-input {
  flex: 1;
  max-width: 360px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: #fff;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-search-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

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

.data-table thead th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

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

.data-table tbody td {
  padding: 0.8rem 0.85rem;
  color: var(--text-heading);
  vertical-align: middle;
}

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

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

/* Tier select / role buttons */
.tier-select {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-heading);
  cursor: pointer;
  transition: border-color 0.2s;
}

.tier-select:focus {
  border-color: var(--primary-blue);
  outline: none;
}

.tier-select.active-tier {
  border-color: rgba(22, 163, 74, 0.4);
  background: rgba(22, 163, 74, 0.05);
  color: var(--success);
}

.role-btn {
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1.5px solid;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.role-btn.make-admin {
  color: var(--primary-blue);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.05);
}

.role-btn.make-admin:hover {
  background: var(--primary-blue);
  color: #fff;
}

.role-btn.revoke-admin {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.05);
}

.role-btn.revoke-admin:hover {
  background: var(--danger);
  color: #fff;
}

/* Tier badges */
.tier-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
}

.tier-badge.active {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.tier-badge.free {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Add Content Form */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .admin-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input, .form-group select, .form-group textarea {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
  font-size: 0.875rem;
  color: var(--text-heading);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
  background: #fff;
}

.form-status-msg {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0;
  color: var(--success);
}

/* Log table monospaced columns */
.mono-col {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Utility helpers ---- */
.hidden { display: none !important; }

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

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title .icon {
  font-size: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   CUSTOMER DIRECT SUPPORT CHAT WIDGET & DRAWER (INSTAGRAM STYLE)
   ============================================================ */

.support-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  background: linear-gradient(135deg, #3A5AFF 0%, #1E3AD1 100%);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: 99px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(58, 90, 255, 0.4);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.support-chat-trigger:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 40px rgba(58, 90, 255, 0.5);
}

.support-chat-drawer {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 380px;
  height: 540px;
  background: #0F1424;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 160;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.support-chat-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.support-drawer-header {
  background: rgba(15, 20, 36, 0.95);
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.support-drawer-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.support-drawer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2FAE6B 0%, #3A5AFF 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.support-drawer-title {
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
}
.support-drawer-sub {
  color: #5AE09A;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.support-close-btn {
  color: rgba(255, 255, 255, 0.6);
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s;
}
.support-close-btn:hover {
  color: #fff;
}

.support-drawer-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #07090E;
}

.cust-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  max-width: 80%;
}
.cust-msg-row.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.cust-msg-row.received {
  align-self: flex-start;
}
.cust-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-word;
}
.cust-msg-row.sent .cust-msg-bubble {
  background: linear-gradient(135deg, #3A5AFF 0%, #1E3AD1 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.cust-msg-row.received .cust-msg-bubble {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
}
.cust-msg-time {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 3px;
  text-align: right;
}

.support-drawer-footer {
  padding: 12px 16px;
  background: rgba(15, 20, 36, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}
.support-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.84rem;
  outline: none;
  font-family: inherit;
}
.support-input:focus {
  border-color: #3A5AFF;
}
.support-send-btn {
  background: #3A5AFF;
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
}

@media (max-width: 480px) {
  .support-chat-drawer {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 80px;
    height: 480px;
  }
  .support-chat-trigger {
    right: 16px;
    bottom: 16px;
    padding: 10px 16px;
    font-size: 0.82rem;
  }
}
