/* =============================================
   ASCO KOL Content Platform — Design System
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  /* ASCO Brand Colors */
  --asco-teal: #00A499;
  --asco-teal-dark: #007A72;
  --asco-teal-light: #E6F7F6;
  --asco-navy: #003366;
  --asco-navy-mid: #0A4B8A;
  --asco-gold: #F2A900;
  --asco-gold-light: #FFF8E7;

  /* UI Colors */
  --bg-primary: #F8FAFB;
  --bg-card: #FFFFFF;
  --bg-sidebar: #0E1B2E;
  --bg-sidebar-hover: #1A2E47;

  /* Text */
  --text-primary: #0D1B2E;
  --text-secondary: #4A5568;
  --text-muted: #8A96A8;
  --text-white: #FFFFFF;
  --text-on-teal: #FFFFFF;

  /* Status Colors */
  --status-draft: #8A96A8;
  --status-ai-gen: #805AD5;
  --status-review: #D97706;
  --status-published: #059669;
  --status-scheduled: #3B82F6;

  /* Borders */
  --border-light: #E8ECF0;
  --border-medium: #CBD5E0;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.14);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Spacing */
  --sidebar-width: 260px;
  --topbar-height: 64px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ---- App Layout ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--asco-teal), var(--asco-navy-mid));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.sidebar-logo .logo-text {
  display: flex; flex-direction: column;
}

.sidebar-logo .logo-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #FFFFFF;
  letter-spacing: -0.3px;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* KOL Profile Mini */
.sidebar-profile {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-profile .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--asco-teal), #00D4C8);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white; flex-shrink: 0;
}

.sidebar-profile .profile-info .name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.sidebar-profile .profile-info .handle {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}

.sidebar-profile .x-connected {
  margin-left: auto;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #10B981;
  flex-shrink: 0;
}

.x-connected.disconnected { background: #EF4444; }

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,0.55);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  color: rgba(255,255,255,0.9);
  background: var(--bg-sidebar-hover);
}

.nav-item.active {
  color: #FFFFFF;
  background: rgba(0, 164, 153, 0.2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--asco-teal);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--asco-teal);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-footer .asco-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,164,153,0.1);
  border: 1px solid rgba(0,164,153,0.2);
  border-radius: var(--radius-md);
}

.asco-badge .badge-year {
  font-size: 13px;
  font-weight: 700;
  color: var(--asco-teal);
}

.asco-badge .badge-text {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  line-height: 1.3;
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Bar */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.topbar-breadcrumb .crumb {
  font-size: 13px;
  color: var(--text-muted);
}

.topbar-breadcrumb .crumb.active {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-breadcrumb .separator { color: var(--text-muted); font-size: 12px; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  width: 220px;
}

.topbar-search input {
  background: none;
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
}

.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search .search-icon { color: var(--text-muted); font-size: 13px; }

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 15px;
  transition: var(--transition);
  position: relative;
}

.topbar-btn:hover { background: var(--asco-teal-light); color: var(--asco-teal); border-color: var(--asco-teal); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid white;
}

.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--asco-teal), #00D4C8);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.topbar-avatar:hover { border-color: var(--asco-teal); }

/* Page Content */
.page-content {
  flex: 1;
  padding: 28px;
}

/* Page Views - show/hide */
.page-view { display: none; }
.page-view.active { display: block; }

/* ==========================================
   PAGE HEADERS
   ========================================== */
.page-header {
  margin-bottom: 28px;
}

.page-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title { font-size: 24px; color: var(--text-primary); margin-bottom: 4px; }
.page-subtitle { font-size: 14px; color: var(--text-muted); font-weight: 400; }

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--asco-teal);
  color: white;
  box-shadow: 0 2px 8px rgba(0,164,153,0.3);
}

.btn-primary:hover {
  background: var(--asco-teal-dark);
  box-shadow: 0 4px 14px rgba(0,164,153,0.4);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: var(--bg-primary);
  border-color: var(--asco-teal);
  color: var(--asco-teal);
}

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

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

.btn-danger {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

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

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; }

.btn-x {
  background: #000;
  color: #fff;
  gap: 8px;
}
.btn-x:hover { background: #1a1a1a; transform: translateY(-1px); }

.btn-claude {
  background: linear-gradient(135deg, #D97757, #E8906D);
  color: white;
}
.btn-claude:hover { filter: brightness(1.05); transform: translateY(-1px); }

.btn-slack {
  background: #4A154B;
  color: white;
}
.btn-slack:hover { background: #3A0E3B; transform: translateY(-1px); }

/* ==========================================
   CARDS
   ========================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* ==========================================
   STAT CARDS
   ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, var(--asco-teal));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--stat-bg, var(--asco-teal-light));
  color: var(--stat-color, var(--asco-teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

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

.stat-card .stat-change {
  position: absolute;
  top: 20px; right: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-change.up { background: #ECFDF5; color: #059669; }
.stat-change.down { background: #FEF2F2; color: #DC2626; }

/* ==========================================
   STATUS BADGES
   ========================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-draft { background: #F1F5F9; color: #64748B; }
.badge-ai_generated { background: #F3EFFF; color: #7C3AED; }
.badge-review { background: #FFFBEB; color: #B45309; }
.badge-published { background: #ECFDF5; color: #059669; }
.badge-scheduled { background: #EFF6FF; color: #2563EB; }

.badge-connected { background: #ECFDF5; color: #059669; }
.badge-disconnected { background: #FEF2F2; color: #DC2626; }

/* ==========================================
   FORMS & INPUTS
   ========================================== */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.form-label .required { color: #EF4444; margin-left: 3px; }

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-primary);
  transition: var(--transition);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--asco-teal);
  box-shadow: 0 0 0 3px rgba(0,164,153,0.1);
}

.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%238A96A8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }

/* ==========================================
   CONTENT LIST / TABLE
   ========================================== */
.content-list { display: flex; flex-direction: column; gap: 12px; }

.content-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
  cursor: pointer;
}

.content-item:hover { border-color: var(--asco-teal); box-shadow: var(--shadow-md); }

.content-item .content-type-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.content-item .content-meta { flex: 1; min-width: 0; }
.content-item .content-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.content-item .content-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.content-item .content-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.content-item .content-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  opacity: 0;
  transition: var(--transition);
}

.content-item:hover .content-actions { opacity: 1; }

.action-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.action-btn:hover { background: var(--bg-primary); border-color: var(--border-medium); }
.action-btn.publish:hover { background: var(--asco-teal-light); color: var(--asco-teal); border-color: var(--asco-teal); }
.action-btn.delete:hover { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }

/* ==========================================
   CONTENT STUDIO
   ========================================== */
.studio-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

.studio-main { display: flex; flex-direction: column; gap: 16px; }

.studio-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.studio-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, #FAFCFF, var(--bg-card));
}

.studio-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-panel-body { padding: 20px; }

/* AI Generate Button Area */
.ai-generate-bar {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.ai-generate-bar .generate-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--text-primary);
  transition: var(--transition);
}

.ai-generate-bar .generate-input:focus {
  border-color: var(--asco-teal);
  box-shadow: 0 0 0 3px rgba(0,164,153,0.1);
  background: white;
  outline: none;
}

/* AI Thinking Animation */
.ai-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #F3EFFF, #FAF8FF);
  border: 1px solid #E9E3FF;
  border-radius: var(--radius-md);
  margin: 16px 0;
}

.ai-thinking .thinking-dots span {
  display: inline-block;
  width: 6px; height: 6px;
  background: #7C3AED;
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

.ai-thinking .thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking .thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Content Editor Area */
.editor-area {
  width: 100%;
  min-height: 280px;
  padding: 16px;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  resize: vertical;
  transition: var(--transition);
  background: var(--bg-card);
}

.editor-area:focus {
  border-color: var(--asco-teal);
  box-shadow: 0 0 0 3px rgba(0,164,153,0.1);
}

.char-counter {
  text-align: right;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

.char-counter.warning { color: var(--asco-gold); }
.char-counter.over { color: #EF4444; }

/* Thread Preview */
.thread-preview {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tweet-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  position: relative;
}

.tweet-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px; top: 46px;
  bottom: 0;
  width: 2px;
  background: var(--border-light);
}

.tweet-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--asco-teal), #00D4C8);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
}

.tweet-content {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-primary);
}

.tweet-number {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

/* ==========================================
   RIGHT SIDEBAR (Studio)
   ========================================== */
.studio-sidebar { display: flex; flex-direction: column; gap: 14px; }

/* Tool Connectors */
.connector-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}

.connector-item:hover { border-color: var(--asco-teal); background: var(--asco-teal-light); }
.connector-item.connected { border-color: #10B981; background: #F0FDF4; }
.connector-item.disconnected { border-color: var(--border-light); }

.connector-item .connector-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.connector-item .connector-info .connector-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.connector-item .connector-info .connector-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Tags */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  min-height: 44px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--asco-teal-light);
  color: var(--asco-teal-dark);
  padding: 3px 10px 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.tag .tag-remove {
  cursor: pointer;
  margin-left: 2px;
  opacity: 0.5;
  transition: var(--transition);
  font-size: 13px;
  line-height: 1;
}

.tag .tag-remove:hover { opacity: 1; }

/* ==========================================
   INTEGRATIONS PAGE
   ========================================== */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.integration-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.integration-card:hover { box-shadow: var(--shadow-md); }
.integration-card.connected { border-color: #10B981; }
.integration-card.connected::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #10B981;
}

.integration-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.integration-logo {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}

.integration-meta { margin-bottom: 16px; }
.integration-name { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.integration-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.integration-features {
  margin: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.integration-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.integration-feature .feat-icon { color: var(--asco-teal); font-size: 13px; }

/* ==========================================
   ONBOARDING / AUTH
   ========================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #001F3F 0%, #003366 35%, #004D7A 60%, #00695C 100%);
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.auth-bg-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(0,164,153,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0,51,102,0.2) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(242,169,0,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.auth-grid-lines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.auth-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.auth-card-header {
  background: linear-gradient(135deg, var(--bg-sidebar), var(--asco-navy-mid));
  padding: 32px 36px;
  text-align: center;
}

.auth-card-header .auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-logo .logo-mark {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--asco-teal), #00D4C8);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

.auth-logo .logo-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: white;
}

.auth-logo .logo-name span { color: var(--asco-teal); }

.auth-tagline {
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
}

.auth-card-body {
  padding: 32px 36px;
}

.auth-steps {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  position: relative;
}

.auth-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.auth-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 50%; right: -50%;
  top: 15px;
  height: 2px;
  background: var(--border-light);
  z-index: 0;
}

.auth-step.done:not(:last-child)::after { background: var(--asco-teal); }

.step-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  background: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  position: relative; z-index: 1;
  transition: var(--transition);
}

.auth-step.active .step-circle {
  border-color: var(--asco-teal);
  background: var(--asco-teal);
  color: white;
}

.auth-step.done .step-circle {
  border-color: var(--asco-teal);
  background: var(--asco-teal);
  color: white;
}

.step-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-align: center; }
.auth-step.active .step-label { color: var(--asco-teal); }

/* ==========================================
   MODAL
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

.modal-title { font-size: 17px; font-weight: 700; }

.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  transition: var(--transition);
}

.modal-close:hover { background: var(--bg-primary); color: var(--text-primary); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; gap: 10px; justify-content: flex-end; }

/* ==========================================
   LOADING / SKELETON
   ========================================== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-sidebar);
  color: white;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  max-width: 340px;
  pointer-events: all;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 4px solid var(--asco-teal);
}

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

.toast.success { border-color: #10B981; }
.toast.error { border-color: #EF4444; }
.toast.warning { border-color: var(--asco-gold); }
.toast .toast-icon { font-size: 16px; flex-shrink: 0; }

/* ==========================================
   PROGRESS BAR
   ========================================== */
.progress-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--asco-teal), #00D4C8);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   TEMPLATES GRID
   ========================================== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.template-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.template-card:hover {
  border-color: var(--asco-teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.template-card .template-icon {
  font-size: 26px;
  width: 48px; height: 48px;
  background: var(--asco-teal-light);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}

.template-card .template-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.template-card .template-type {
  font-size: 11.5px;
  color: var(--asco-teal-dark);
  font-weight: 600;
}

.template-card .template-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================
   ACTIVITY FEED
   ========================================== */
.activity-feed { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}

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

.activity-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.activity-content { flex: 1; }

.activity-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.activity-text strong { color: var(--asco-teal-dark); }

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ==========================================
   DASHBOARD GRID LAYOUT
   ========================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.dashboard-main { display: flex; flex-direction: column; gap: 20px; }
.dashboard-side { display: flex; flex-direction: column; gap: 20px; }

/* ==========================================
   ANALYTICS SECTION
   ========================================== */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.platform-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.platform-bar:last-child { border-bottom: none; }
.platform-bar .platform-name { width: 80px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.platform-bar .platform-track { flex: 1; height: 8px; background: var(--border-light); border-radius: var(--radius-full); overflow: hidden; }
.platform-bar .platform-fill { height: 100%; border-radius: var(--radius-full); }
.platform-bar .platform-value { width: 50px; font-size: 12px; font-weight: 700; color: var(--text-primary); text-align: right; }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1200px) {
  .studio-layout { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 220px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .integrations-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .topbar-search { display: none; }
}

/* ==========================================
   MISC UTILITIES
   ========================================== */
.divider { height: 1px; background: var(--border-light); margin: 16px 0; }
.text-muted { color: var(--text-muted); }
.text-teal { color: var(--asco-teal); }
.text-bold { font-weight: 700; }
.text-sm { font-size: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease forwards; }
