/* ========== DASHBOARD LAYOUT ========== */
.dashboard-body {
  background: var(--bg);
  min-height: 100vh;
}

.dash-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.dash-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.free-replies-pill {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-logout:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* Layout */
.dash-layout {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

.dash-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 24px 12px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}

.side-link:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.side-link.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-hover);
}

.side-icon {
  font-size: 16px;
}

.dash-main {
  flex: 1;
  padding: 32px 36px;
  overflow-y: auto;
}

/* Panels */
.panel {
  display: none;
}
.panel.active {
  display: block;
}

.panel-header {
  margin-bottom: 28px;
}

.panel-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.panel-header p {
  color: var(--text-muted);
  font-size: 15px;
}

.panel-header strong {
  color: var(--text);
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
  margin-top: 28px;
}

/* Connected channels status */
.channels-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  min-height: 0;
}

.connected-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
}

.connected-badge .status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
}

.connected-badge .disconnect-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
}
.connected-badge .disconnect-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Channel cards on dashboard */
.dash-connect-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-channel-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.15s;
}

.dash-channel-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.dash-channel-card .channel-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex-shrink: 0;
  margin: 0;
}

.dash-channel-info {
  flex: 1;
}

.dash-channel-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.dash-channel-info p {
  font-size: 13px;
  color: var(--text-muted);
}

.dash-channel-card.connected {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.04);
}

.dash-channel-card.connected .connect-channel-btn {
  background: transparent;
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: var(--success);
  cursor: default;
}

/* Inbox */
.inbox-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.inbox-empty h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.inbox-empty p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto 20px;
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inbox-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inbox-item-left h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.inbox-item-left p {
  font-size: 13px;
  color: var(--text-muted);
}

.inbox-item-right {
  font-size: 12px;
  color: var(--text-muted);
}

/* Analytics */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

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

.upgrade-box {
  background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(34,211,238,0.08) 100%);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

.upgrade-box h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.upgrade-box p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 18px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* Settings */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
}

.settings-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

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

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

/* Responsive */
@media (max-width: 800px) {
  .dash-layout {
    flex-direction: column;
  }
  .dash-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px;
  }
  .side-nav {
    flex-direction: row;
    overflow-x: auto;
  }
  .dash-main {
    padding: 24px 16px;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .user-name {
    display: none;
  }
}
