﻿/* ================================================================
   DraftPilot Dashboard - Phase 2: Production Sidebar
   Professional SaaS design inspired by Linear/Vercel/Notion
   ================================================================ */

/* ===== GLOBAL OVERRIDES ===== */
/* Hide auth badge - using sidebar user card instead */
#auth-badge {
  display: none !important;
}

/* ===== CSS VARIABLES ===== */
:root {
  /* Colors - Calm Cyan Accent */
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, 0.15);
  
  /* Backgrounds */
  --bg-base: #020617;
  --bg-sidebar: #0a0f1f;
  --bg-card: rgba(15, 23, 42, 0.7);
  --bg-elevated: rgba(30, 41, 59, 0.5);
  
  /* Borders */
  --border-subtle: rgba(148, 163, 184, 0.1);
  --border-medium: rgba(148, 163, 184, 0.2);
  
  /* Text */
  --text-primary: #e2e8f0;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  
  /* Radius & Shadows */
  --radius-lg: 12px;
  --radius-md: 8px;
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-sidebar: inset -1px 0 0 rgba(255, 255, 255, 0.05), 2px 0 20px rgba(0, 0, 0, 0.4);

  --bg-secondary: rgba(15, 23, 42, 0.75);
  --border-color: rgba(148, 163, 184, 0.18);
  --text-secondary: #cbd5e1;
}

/* ===== BASE RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== NUMBER INPUT SPINNER REMOVAL ===== */
/* Hide up/down arrows on number input fields */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* ===== SELECT/DROPDOWN STYLING ===== */
/* Fix dropdown appearance and prevent text cursor */
select {
  cursor: pointer !important;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* Ensure dropdown options match theme */
select option {
  background: #0f1529;
  color: #f4f6fb;
}

/* ===== LAYOUT SHELL ===== */
.dp-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-base);
}

/* ===== SIDEBAR ===== */
.dp-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  box-shadow: var(--shadow-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  overflow-y: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Collapse Toggle Button - positioned absolutely in top right */
.dp-sidebar__toggle {
  position: absolute;
  top: 20px;
  right: 16px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
  z-index: 10;
}

.dp-sidebar__toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: rgba(148, 163, 184, 0.4);
}

.dp-sidebar__toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
}

/* Collapsed Sidebar State */
.dp-sidebar.dp-sidebar--collapsed {
  width: 72px;
}

.dp-sidebar.dp-sidebar--collapsed .dp-sidebar__toggle svg {
  transform: rotate(180deg);
}

.dp-sidebar.dp-sidebar--collapsed .dp-brand-logo {
  display: none;
}

.dp-sidebar.dp-sidebar--collapsed .dp-sidebar__brand {
  padding: 20px 12px;
}

.dp-sidebar.dp-sidebar--collapsed .dp-sidebar__toggle {
  position: static;
  margin: 0 auto;
}

.dp-sidebar.dp-sidebar--collapsed .dp-nav-group__label {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.dp-sidebar.dp-sidebar--collapsed .dp-nav-item {
  justify-content: center;
  padding: 12px;
}

.dp-sidebar.dp-sidebar--collapsed .dp-nav-item__label {
  display: none;
}

.dp-sidebar.dp-sidebar--collapsed .dp-nav-item--active::before {
  left: 0;
  width: 3px;
  height: 24px;
}

.dp-sidebar.dp-sidebar--collapsed .dp-sidebar__footer {
  padding: 12px 8px 16px;
}

.dp-sidebar.dp-sidebar--collapsed .dp-user-card {
  justify-content: center;
  padding: 8px;
}

.dp-sidebar.dp-sidebar--collapsed .dp-user-card__info,
.dp-sidebar.dp-sidebar--collapsed .dp-user-card__chevron {
  display: none;
}

.dp-sidebar.dp-sidebar--collapsed .dp-user-menu {
  left: 72px;
  right: auto;
  bottom: 16px;
  width: 200px;
}

/* Collapsed sidebar logo placeholder */
.dp-sidebar__collapsed-logo {
  width: 32px;
  height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.dp-sidebar.dp-sidebar--collapsed .dp-sidebar__collapsed-logo {
  display: flex;
}

/* Main content adjustment for collapsed sidebar */
.dp-shell.dp-sidebar-collapsed .dp-main-wrapper {
  margin-left: 72px;
}

.dp-main-wrapper {
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Brand Area */
.dp-sidebar__brand {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  position: relative;
}

.dp-brand-logo {
  width: 100%;
  height: auto;
  display: block;
}

.dp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dp-brand__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.dp-brand__text {
  flex: 1;
  min-width: 0;
}

.dp-brand__wordmark {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.dp-brand__subtitle {
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-top: 2px;
  font-weight: 500;
}

/* Navigation */
.dp-sidebar__nav {
  flex: 1;
  padding: 20px 12px 48px;
  overflow-y: hidden;
}

.dp-nav-group {
  margin-bottom: 24px;
}

.dp-nav-group:last-child {
  margin-bottom: 0;
}

.dp-nav-group__label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 12px 8px;
  margin-bottom: 4px;
}

.dp-nav-group__items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dp-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.dp-nav-item:hover {
  background: rgba(148, 163, 184, 0.06);
  color: #e2e8f0;
}

.dp-nav-item__icon {
  width: 18px;
  height: 18px;
  opacity: 0.75;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.dp-nav-item:hover .dp-nav-item__icon {
  opacity: 1;
}

.dp-nav-item__label {
  flex: 1;
  min-width: 0;
}

/* Active Navigation Item */
.dp-nav-item--active {
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent);
  font-weight: 600;
}

.dp-nav-item--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.dp-nav-item--active .dp-nav-item__icon {
  opacity: 1;
  color: var(--accent);
}

/* Spacer */
.dp-sidebar__spacer {
  flex: 1;
  min-height: 20px;
}

/* Remove old spacer element from sidebar layout */
.dp-sidebar__spacer {
  display: none !important;
}

/* User Footer */
.dp-sidebar__footer {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.dp-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.03);
  transition: background 0.15s ease;
  cursor: pointer;
}

.dp-user-card:hover {
  background: rgba(148, 163, 184, 0.08);
}

.dp-user-card__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #0ea5e9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: white;
  flex-shrink: 0;
}

.dp-user-card__info {
  flex: 1;
  min-width: 0;
}

.dp-user-card__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e5e7eb;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dp-user-card__status {
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.2;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dp-user-menu {
  position: absolute;
  bottom: 60px;
  left: 12px;
  right: 12px;
  background: #1a1f3a;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  z-index: 1000;
}

.dp-user-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s ease;
}

.dp-user-menu__item:hover {
  background: rgba(148, 163, 184, 0.08);
}

.dp-user-menu__icon {
  width: 18px;
  height: 18px;
  color: #94a3b8;
}

/* ===== MAIN CONTENT AREA ===== */
.dp-main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOP BAR ===== */
/* Temporarily hide unused header controls app-wide */
.dp-topbar-actions,  /* sun + bell container */
.dp-topbar-right,    /* right side icon cluster */
.dp-topbar-center,   /* search bar container */
.dp-search-row,      /* search bar row wrapper */
.dp-search {         /* search input container */
  display: none !important;
}

.dp-topbar {
  min-height: 72px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 90;
}

/* Left: Title & Subtitle */
.dp-topbar-left {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dp-topbar-heading {
  flex: 1;
  min-width: 0;
}

.dp-topbar__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e5e7eb;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.dp-topbar__subtitle {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Center: Search */
.dp-topbar-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  max-width: 480px;
  min-width: 0;
}

.dp-search {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.dp-search__input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  color: #e5e7eb;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dp-search__input::placeholder {
  color: #64748b;
}

.dp-search__input:focus {
  outline: none;
  border-color: #38bdf8;
  background: rgba(255, 255, 255, 0.08);
}

.dp-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}

/* Right: Icon Cluster */
.dp-topbar-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dp-topbar-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.dp-topbar-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
}

.dp-topbar-icon--menu {
  display: none; /* Hidden on desktop, shown on mobile */
}

.dp-topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  display: none; /* Hidden - using sidebar user card instead */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.dp-topbar-avatar:hover {
  transform: scale(1.05);
}

/* Legacy class cleanup - keep for backwards compatibility but hide */
.dp-topbar__actions {
  display: none;
}

.dp-icon-btn {
  display: none;
}

/* ===== MAIN CONTENT GRID ===== */
.dp-main {
  flex: 1;
  padding: 32px 64px;
  overflow-y: auto;
}

.dp-grid {
  display: grid;
  gap: 24px;
  max-width: 100%;
  margin: 0 auto;
}

/* Mobile: Everything stacks */
.dp-grid {
  grid-template-columns: 1fr;
}

/* Desktop: 2-column layout with hero spanning full */
@media (min-width: 900px) {
  .dp-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .dp-card--hero {
    grid-column: 1 / -1;
  }
  
  .dp-card--full {
    grid-column: 1 / -1;
  }
}

/* ===== CARDS ===== */
.dp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.dp-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-elevated);
}

/* ===== DRAFTS CARD ===== */
/* Recent Drafts card: prevent layout jank when data loads */
.dp-card--recent-drafts {
  display: flex;
  flex-direction: column;
  height: 600px;
  min-height: 600px;
  max-height: 600px;
}

.dp-card--recent-drafts .dp-card__content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.dp-card--recent-drafts .dp-card__footer {
  justify-content: center;
  flex-shrink: 0;
}


/* ===== HERO CARD ===== */
.dp-card--hero {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(168, 85, 247, 0.10)), 
              var(--bg-card);
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 
    var(--shadow-elevated),
    0 0 40px rgba(56, 189, 248, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
}

@media (min-width: 900px) {
  .dp-card--hero {
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
  }
}

/* Hero Left Content */
.dp-hero-left {
  flex: 1;
  min-width: 0;
}

.dp-hero-overline {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #38bdf8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding: 4px 10px;
  background: rgba(56, 189, 248, 0.15);
  border-radius: 6px;
}

.dp-hero-title {
  font-size: 2rem;
  font-weight: 700;
  color: #e5e7eb;
  letter-spacing: -0.02em;
  margin: 0 0 12px 0;
  line-height: 1.2;
}

.dp-hero-subtext {
  font-size: 0.9375rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0 0 24px 0;
  max-width: 560px;
}

/* Hero CTA */
.dp-hero-cta {
  background: #38bdf8;
  color: #020617;
  border-radius: 9999px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 0.9375rem;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
  margin-bottom: 20px;
}

.dp-hero-cta:hover:not(.disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.dp-hero-cta:active:not(.disabled) {
  transform: translateY(0px);
  filter: brightness(0.95);
}

/* Hero Feature Chips */
.dp-hero-feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dp-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #cbd5e1;
  transition: all 0.15s ease;
}

.dp-chip:hover {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.3);
}

/* Hero Right Content */
.dp-hero-right {
  flex: 0 0 auto;
  min-width: 200px;
}

.dp-hero-metrics {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
}

@media (max-width: 899px) {
  .dp-hero-metrics {
    flex-direction: row;
    justify-content: space-around;
  }
}

.dp-metric {
  text-align: center;
}

.dp-metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #e5e7eb;
  margin-bottom: 4px;
  line-height: 1;
}

.dp-metric-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Legacy Card Styles */
.dp-card__header {
  margin-bottom: 16px;
}

.dp-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.dp-card__subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.dp-card__content {
  margin-bottom: 20px;
}

.dp-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* ===== BUTTONS ===== */
.dp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dp-btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.dp-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.4);
}

.dp-btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 2px solid var(--border-medium);
}

.dp-btn-secondary:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
  transform: translateY(-1px);
}

.dp-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid transparent;
}

.dp-btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* ===== BADGES & PILLS ===== */
.dp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dp-badge--ai {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.dp-badge--success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ===== STATUS INDICATORS ===== */
.dp-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.dp-status--connected {
  color: var(--success);
}

.dp-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* ===== QUICK LINKS ===== */
.dp-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dp-chip:hover {
  background: var(--bg-card);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* ===== CONNECTIONS CARD ===== */
.dp-card-header {
  margin-bottom: 20px;
}

.dp-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.01em;
}

.dp-card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Fixed height for connections card to match drafts */
.dp-card--connections {
  display: flex;
  flex-direction: column;
  height: 600px;
  min-height: 600px;
  max-height: 600px;
}

.dp-card--connections .dp-connections-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.dp-card--connections .dp-card-footer {
  flex-shrink: 0;
}

.dp-connections-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .dp-connections-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* Connection Block (Provider Mini-Card) */
.dp-connection {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s ease;
}

.dp-connection:hover {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.3);
}

/* Connection Header */
.dp-connection-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dp-connection-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
}

.dp-connection-icon--dropbox {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.dp-connection-icon--ebay {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.dp-connection-info {
  flex: 1;
  min-width: 0;
}

.dp-connection-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #e5e7eb;
  margin: 0 0 6px 0;
}

.dp-connection-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(148, 163, 184, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.dp-connection-status--connected {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
}

/* Connection Details */
.dp-connection-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dp-connection-meta {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.dp-connection-folder {
  margin-top: 4px;
}

.dp-connection-folder-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dp-connection-folder-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-primary);
  font-size: 0.8125rem;
  outline: none;
  transition: all 0.15s ease;
}

.dp-connection-folder-select:focus {
  background: rgba(148, 163, 184, 0.12);
  border-color: #38bdf8;
}

.dp-connection-folder-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dp-connection-folder-msg {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* Connection Actions */
.dp-connection-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.dp-btn-sm {
  padding: 8px 16px;
  font-size: 0.8125rem;
  border-radius: 9999px;
}

.dp-connection-actions .dp-btn-ghost {
  padding: 6px 12px;
  font-size: 0.75rem;
}

/* Connection Footer */
.dp-card-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.dp-connections-footer {
  text-align: center;
}

.dp-muted {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

/* Legacy Compatibility */
.dp-conn-block {
  display: none;
}

.dp-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 4px 0;
}

/* ================================================================
   STANDARD DROPDOWN / SELECT COMPONENTS
   Outlined style with glow on hover/focus - matches FAQ accordion
   ================================================================ */

/* Standard Select (native <select> styling) */
.dp-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-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='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
  transition: all 0.2s ease;
}

.dp-select:hover {
  border-color: var(--accent);
}

.dp-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dp-select option {
  background: #0f1529;
  color: var(--text-primary);
}

/* Custom Dropdown Container */
.dp-dropdown {
  position: relative;
  width: 100%;
}

/* Dropdown Trigger Button */
.dp-dropdown__trigger {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.dp-dropdown__trigger:hover {
  border-color: var(--accent);
}

.dp-dropdown.open .dp-dropdown__trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.dp-dropdown__trigger-text {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.dp-dropdown__icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.dp-dropdown.open .dp-dropdown__icon {
  transform: rotate(180deg);
  color: var(--accent);
}

/* Dropdown Panel */
.dp-dropdown__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 320px;
  overflow-y: auto;
  box-shadow: var(--shadow-elevated);
  display: none;
}

.dp-dropdown.open .dp-dropdown__panel {
  display: block;
}

/* Dropdown Options */
.dp-dropdown__option {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid var(--border-subtle);
}

.dp-dropdown__option:last-child {
  border-bottom: none;
}

.dp-dropdown__option:hover {
  background: var(--accent-soft);
}

.dp-dropdown__option.selected {
  background: var(--accent-soft);
  color: var(--accent);
}

.dp-dropdown__option-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg-elevated);
}

.dp-dropdown__option-content {
  flex: 1;
  min-width: 0;
}

.dp-dropdown__option-title {
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dp-dropdown__option-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dropdown Search */
.dp-dropdown__search {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1;
}

.dp-dropdown__search input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.dp-dropdown__search input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Multi-select Chips */
.dp-dropdown__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.5rem;
}

.dp-dropdown__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--accent);
}

.dp-dropdown__chip img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 3px;
  background: var(--bg-elevated, #1a1a2e);
}

.dp-dropdown__chip-remove {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.dp-dropdown__chip-remove:hover {
  opacity: 1;
}

/* ================================================================
   STANDARD ACCORDION COMPONENT
   Collapsible sections with outline + glow styling
   ================================================================ */

.dp-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dp-accordion__item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.dp-accordion__item:hover {
  border-color: var(--accent);
}

.dp-accordion__trigger {
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: inherit;
  transition: color 0.15s ease;
}

.dp-accordion__trigger:hover {
  color: var(--accent);
}

.dp-accordion__icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.dp-accordion__item.open .dp-accordion__icon {
  transform: rotate(180deg);
  color: var(--accent);
}

.dp-accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.dp-accordion__item.open .dp-accordion__content {
  max-height: 1000px;
}

.dp-accordion__inner {
  padding: 0 20px 20px 20px;
  color: var(--text-muted);
  line-height: 1.6;
}

.dp-accordion__inner a {
  color: var(--accent);
  text-decoration: underline;
}

/* ================================================================
   MULTISELECT DROPDOWN
   Custom multi-select with checkboxes and search
   ================================================================ */

.dp-multiselect {
  position: relative;
  width: 100%;
}

.dp-multiselect__trigger {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  min-height: 46px;
}

.dp-multiselect__trigger:hover {
  border-color: var(--accent);
}

.dp-multiselect.open .dp-multiselect__trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dp-multiselect__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: var(--shadow-elevated);
  display: none;
}

.dp-multiselect.open .dp-multiselect__panel {
  display: block;
}

.dp-multiselect__option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.15s ease;
}

.dp-multiselect__option:hover {
  background: var(--accent-soft);
}

.dp-multiselect__option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* ================================================================
   PHASE 8: RESPONSIVE LAYOUT POLISH (CSS-ONLY)
   Three breakpoints: Desktop (≥1024px), Tablet (768-1023px), Mobile (≤767px)
   ================================================================ */

/* ===== TABLET LAYOUT (768px - 1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Sidebar: Slightly more compact */
  .dp-sidebar {
    width: 220px;
  }
  
  .dp-sidebar__brand {
    padding: 18px 14px;
  }
  
  .dp-sidebar__nav {
    padding: 18px 10px 48px;
  }
  
  .dp-nav-item {
    padding: 9px 10px;
  }
  
  .dp-main-wrapper {
    margin-left: 220px;
  }
  
  /* Top Bar: Smaller search */
  .dp-topbar {
    padding: 18px 20px;
  }
  
  .dp-topbar-center {
    max-width: 240px;
  }
  
  /* Main Grid: 2 columns with tighter spacing */
  .dp-main {
    padding: 28px 20px;
  }
  
  .dp-grid {
    gap: 20px;
  }
  
  /* Cards: Slightly reduced padding */
  .dp-card {
    padding: 20px;
  }
  
  .dp-card--hero {
    padding: 28px;
    gap: 32px;
  }
  
  /* Hero adjustments */
  .dp-hero-title {
    font-size: 1.75rem;
  }
  
  .dp-hero-subtext {
    font-size: 0.875rem;
  }
  
  .dp-hero-right {
    min-width: 180px;
  }
  
  /* Connections grid stays 2 columns */
  .dp-connections-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
  }
  
  .dp-connection {
    padding: 14px;
  }
  
  /* Recent Drafts table stays 4 columns */
  .dp-drafts-table__header,
  .dp-drafts-table__row {
    gap: 10px;
    padding: 12px 14px;
  }
}

/* ===== MOBILE LAYOUT (≤767px) ===== */
@media (max-width: 767px) {
  /* ===== MOBILE NAVIGATION ===== */
  /* Show hamburger */
  .dp-topbar-icon--menu {
    display: flex;
  }

  /* Sidebar becomes a slide-in drawer */
  .dp-sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
    overflow-y: auto;
    border-right: none;
    box-shadow: var(--shadow-sidebar);
    padding-top: 1.25rem;
  }

  /* When shell has nav-open class, slide it in */
  .dp-shell.dp-shell--nav-open .dp-sidebar {
    transform: translateX(0);
  }

  /* Backdrop behind sidebar */
  .dp-mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 150;
  }

  .dp-shell.dp-shell--nav-open .dp-mobile-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Main shell becomes vertical layout */
  .dp-shell {
    flex-direction: column;
  }

  /* Prevent content from being pushed down */
  .dp-main-wrapper {
    margin-left: 0;
  }
  
  .dp-sidebar__brand {
    padding: 16px;
  }
  
  .dp-sidebar__nav {
    padding: 12px 16px 16px;
  }
  
  /* Compress nav groups */
  .dp-nav-group {
    margin-bottom: 16px;
  }
  
  .dp-nav-group__label {
    padding: 0 8px 6px;
  }
  
  .dp-nav-item {
    padding: 8px 12px;
    font-size: 0.875rem;
  }
  
  .dp-sidebar__footer {
    padding: 12px 16px;
  }
  
  /* ===== TOP BAR: Stack vertically ===== */
  .dp-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    min-height: auto;
    position: relative; /* Remove sticky on mobile to prevent overlay */
  }
  
  .dp-topbar-left {
    width: 100%;
  }
  
  .dp-topbar__title {
    font-size: 1.25rem;
  }
  
  .dp-topbar__subtitle {
    font-size: 0.8125rem;
    white-space: normal;
  }
  
  .dp-topbar-center {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }
  
  .dp-search {
    max-width: none;
  }
  
  .dp-topbar-right {
    align-self: flex-end;
    gap: 12px;
  }
  
  .dp-topbar-icon {
    width: 32px;
    height: 32px;
  }
  
  /* ===== MAIN GRID: Single column ===== */
  .dp-main {
    padding: 20px 16px;
  }
  
  .dp-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  
  /* All cards full width, no special spanning */
  .dp-card,
  .dp-card--hero,
  .dp-card--connections,
  .dp-card--recent-drafts,
  .dp-card--checklist,
  .dp-card--full {
    margin: 0;
    grid-column: 1;
  }
  
  .dp-card {
    padding: 20px;
  }
  
  /* ===== HERO CARD: Stack vertically ===== */
  .dp-card--hero {
    flex-direction: column;
    gap: 20px;
    padding: 24px;
  }
  
  .dp-hero-left {
    width: 100%;
  }
  
  .dp-hero-title {
    font-size: 1.5rem;
  }
  
  .dp-hero-subtext {
    font-size: 0.875rem;
    max-width: none;
  }
  
  .dp-hero-cta {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  
  .dp-hero-feature-chips {
    flex-wrap: wrap;
  }
  
  .dp-hero-right {
    width: 100%;
    min-width: 0;
  }
  
  .dp-hero-metrics {
    flex-direction: row;
    justify-content: space-around;
  }
  
  .dp-metric-value {
    font-size: 1.75rem;
  }
  
  /* ===== CONNECTIONS CARD: Stack providers ===== */
  .dp-connections-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  
  .dp-connection {
    padding: 16px;
  }
  
  .dp-connection-icon {
    width: 32px;
    height: 32px;
  }
  
  .dp-connection-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .dp-connection-actions .dp-btn {
    width: 100%;
    justify-content: center;
  }
  
  /* ===== SETUP CHECKLIST: Adjust layout ===== */
  .dp-check-label {
    align-items: flex-start;
  }
  
  .dp-check-text {
    line-height: 1.4;
  }
  
  .dp-check-description {
    margin-left: 32px;
  }
  
  /* ===== RECENT DRAFTS: Stacked rows ===== */
  .dp-drafts-table__header {
    display: none; /* Hide header on mobile */
  }
  
  .dp-drafts-table__row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
  }
  
  .dp-drafts-table__col {
    width: 100%;
  }
  
  .dp-drafts-table__col--title {
    order: 1;
    font-size: 0.9375rem;
    margin-bottom: 4px;
  }
  
  .dp-drafts-table__col--status {
    order: 2;
    font-size: 0.8125rem;
  }
  
  .dp-drafts-table__col--source {
    order: 3;
    font-size: 0.8125rem;
  }
  
  .dp-drafts-table__col--updated {
    order: 4;
    font-size: 0.8125rem;
  }
  
  /* Make status/source/updated inline chips */
  .dp-drafts-table__col--status,
  .dp-drafts-table__col--source,
  .dp-drafts-table__col--updated {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  
  /* Button adjustments */
  .dp-btn {
    width: 100%;
    justify-content: center;
  }
  
  .dp-card__actions .dp-btn {
    width: 100%;
  }

  /* ===== MOBILE FIXED HEADER ===== */
  .dp-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: var(--bg-base);
    padding-top: 8px;
    padding-bottom: 12px;
  }

  /* Ensure hamburger stays left and heading doesn't push it off-screen */
  .dp-topbar-left {
    display: flex;
    align-items: center;
    width: 100%;
  }

  /* Keep hamburger on the left side */
  .dp-topbar-icon--menu {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
  }

  /* Center the heading area on mobile */
  .dp-topbar-heading {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  /* Dashboard title centered */
  .dp-topbar__title {
    text-align: center;
    width: 100%;
  }

  /* Subtitle smaller + centered */
  .dp-topbar__subtitle {
    text-align: center;
    width: 100%;
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 2px;
  }

  /* Push the page content down so it isn't hidden under header */
  .dp-main-wrapper {
    padding-top: 72px; /* height of fixed topbar */
  }

  /* Mobile: dashboard cards should size to content, not fixed heights */
  .dp-dashboard-grid {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  /* Generic card auto-height on mobile */
  .dp-card,
  .dp-card--hero,
  .dp-card--stat,
  .dp-dashboard-card {
    height: auto;
    min-height: 0;
  }

  /* If any card previously relied on a large min-height, relax it */
  .dp-card[data-role="hero"],
  .dp-card[data-role="stats"],
  .dp-card[data-role="connections"] {
    min-height: 0;
  }

  /* Let stat rows wrap instead of forcing tall cards */
  .dp-stat-row,
  .dp-dashboard-stats {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  /* Compact dashboard header on mobile */
  .dp-topbar {
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
    margin-bottom: 0;
  }

  /* Reduce spacing in search area */
  .dp-topbar-center {
    margin-top: 6px;
    margin-bottom: 6px;
  }

  .dp-search {
    margin-top: 0;
    margin-bottom: 0;
  }

  /* Pull main content area closer to header */
  .dp-main {
    padding-top: 12px;
  }

  /* Pull the hero section closer to the top */
  .dp-card--hero {
    margin-top: 0;
  }
}

/* ===== EXTRA SMALL MOBILE (≤480px) ===== */
@media (max-width: 480px) {
  .dp-main {
    padding: 16px 12px;
  }
  
  .dp-card {
    padding: 16px;
  }
  
  .dp-card--hero {
    padding: 20px;
  }
  
  .dp-hero-title {
    font-size: 1.375rem;
  }
  
  .dp-hero-subtext {
    font-size: 0.8125rem;
  }
  
  .dp-hero-feature-chips {
    justify-content: flex-start;
  }
  
  .dp-metric-value {
    font-size: 1.5rem;
  }
  
  .dp-metric-label {
    font-size: 0.6875rem;
  }
  
  .dp-topbar__title {
    font-size: 1.125rem;
  }
  
  .dp-topbar-right {
    gap: 8px;
  }
  
  .dp-topbar-icon {
    width: 28px;
    height: 28px;
  }
  
  .dp-card-title {
    font-size: 1.125rem;
  }
  
  .dp-card-subtitle {
    font-size: 0.8125rem;
  }
  
  .dp-connection-name {
    font-size: 0.875rem;
  }
}

/* ===== DESKTOP COMPACT SPACING (≥1024px) ===== */
@media (min-width: 1024px) {
  /* Reduce top/bottom padding around the main dashboard content */
  .dp-main {
    padding-top: 24px;
    padding-bottom: 32px;
  }

  /* 3-row desktop grid layout */
  .dp-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "hero hero"
      "drafts drafts"
      "connections checklist";
    gap: 20px;
  }

  /* Grid area assignments */
  .dp-card--hero {
    grid-area: hero;
  }

  #connectionsSection {
    grid-area: connections;
  }

  .dp-card--recent-drafts {
    grid-area: drafts;
  }

  .dp-card--checklist {
    grid-area: checklist;
  }

  /* Remove fixed heights - let cards size to content */
  #connectionsSection,
  .dp-card--recent-drafts,
  .dp-card--checklist {
    height: auto;
    min-height: 0;
  }

  .dp-card--recent-drafts {
    max-height: none;
  }

  /* Slightly reduce vertical padding inside dashboard cards */
  .dp-card {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  /* Tighter padding for hero card */
  .dp-card--hero {
    padding-top: 24px;
    padding-bottom: 24px;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-muted {
  color: var(--text-muted);
}

.text-small {
  font-size: 0.875rem;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ===== RECENT DRAFTS TABLE ===== */
/* Loading State */
.dp-loading-state {
  text-align: center;
  padding: 64px 24px;
}

.dp-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dp-spin 0.8s linear infinite;
}

@keyframes dp-spin {
  to { transform: rotate(360deg); }
}

.dp-loading-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Empty State */
.dp-empty-state {
  text-align: center;
  padding: 48px 24px;
}

.dp-empty-state__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.dp-empty-state__description {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* Drafts Table */
.dp-drafts-table {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.dp-drafts-table__header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.dp-drafts-table__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
}

.dp-drafts-table__row:last-child {
  border-bottom: none;
}

.dp-drafts-table__row:hover {
  background: var(--bg-secondary);
  cursor: pointer;
}

.dp-drafts-table__col {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
}

.dp-drafts-table__col--title {
  color: var(--text-primary);
  font-weight: 500;
  max-width: 350px;
  overflow: hidden;
}

.dp-drafts-table__col--status,
.dp-drafts-table__col--source,
.dp-drafts-table__col--updated {
  color: var(--text-secondary);
}

.dp-draft-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
  color: var(--text-primary);
  font-weight: 500;
}

/* Status Pills */
.dp-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.dp-status-pill--ready {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.dp-status-pill--draft {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.dp-status-pill--needs-review {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

/* Source Chips */
.dp-source-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* Time Ago */
.dp-time-ago {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Card Footer with Link Button */
.dp-card__footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dp-link-button {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

.dp-link-button:hover {
  color: #7dd3fc;
}

.dp-link-button svg {
  transition: transform 0.15s ease;
}

.dp-link-button:hover svg {
  transform: translateX(3px);
}

/* ===== SETUP CHECKLIST (PHASE 7) ===== */
.dp-checklist-section {
  margin-bottom: 24px;
}

.dp-checklist-section:last-child {
  margin-bottom: 0;
}

.dp-checklist-section--optional {
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.dp-checklist-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.dp-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dp-checklist-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.dp-checklist-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dp-checklist-item:first-child {
  padding-top: 0;
}

.dp-check-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: not-allowed;
  user-select: none;
}

.dp-check-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.03);
  cursor: not-allowed;
  position: relative;
  margin-top: 2px;
  transition: all 0.2s ease;
}

.dp-check-input:checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
}

.dp-check-input:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.dp-check-text {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
}

.dp-check-description {
  margin: 8px 0 0 32px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ================================================================
   LEGACY CLEANUP - Minimal targeted hiding only
   ================================================================ */
/* Hide only specific unused legacy elements - no wildcards */
/* NOTE: Disabled - conflicting with drafts.html .card elements */
/*
.card,
.row,
.col {
  display: none !important;
}
*/

/* ================================================================
   PHASE 8: RESPONSIVE LAYOUT POLISH (CSS-ONLY)
   Three breakpoints: Desktop (≥1024px), Tablet (768-1023px), Mobile (≤767px)
   ================================================================ */
