:root {
  --primary: #FF6B35;
  --primary-dark: #E55A2B;
  --primary-light: #FF8F5E;
  --secondary: #004E89;
  --secondary-light: #1A6FB5;
  --success: #2ECC71;
  --warning: #F39C12;
  --danger: #E74C3C;
  --info: #3498DB;
  --bg: #F5F6FA;
  --bg-card: #FFFFFF;
  --bg-dark: #1A1D23;
  --text: #2C3E50;
  --text-light: #7F8C8D;
  --text-dark: #1A1D23;
  --border: #E8ECF1;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* App Shell */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-y: auto;
  padding-bottom: 80px;
}

@media(min-width:768px) {
  .app-container { max-width: 100%; padding-bottom: 0; }
  .desktop-layout { display: flex; }
  .desktop-sidebar { width: 240px; background: var(--bg-dark); min-height: 100vh; padding-top: 20px; }
  .desktop-main { flex:1; max-width: 480px; margin: 0 auto; }
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 16px 20px 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

.header-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600;
}

.header-name { font-size: 16px; font-weight: 600; }
.header-role { font-size: 11px; opacity: 0.8; margin-top: 2px; }

.header-actions { display: flex; gap: 12px; }
.header-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s;
  border: none; color: white; font-size: 14px;
}
.header-btn:hover { background: rgba(255,255,255,0.3); }

/* Time Filter */
.time-filter {
  display: flex; gap: 8px; background: rgba(255,255,255,0.15);
  padding: 4px; border-radius: 20px;
}

.time-btn {
  padding: 6px 14px; border-radius: 16px;
  font-size: 12px; color: white; background: transparent;
  cursor: pointer; transition: all 0.2s; border: none;
  white-space: nowrap;
}

.time-btn.active {
  background: rgba(255,255,255,0.9); color: var(--primary);
  font-weight: 600;
}

/* Page Content */
.page-content { padding: 16px 20px; }
.page { display: none; }
.page.active { display: block; }

/* Data Cards */
.data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.data-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.data-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.data-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
}

.data-card.recruit::before { background: var(--primary); }
.data-card.broadcast::before { background: var(--info); }
.data-card.friends::before { background: var(--success); }
.data-card.communicate::before { background: var(--warning); }
.data-card.intention::before { background: #9B59B6; }
.data-card.sign::before { background: var(--secondary); }
.data-card.week::before { background: var(--danger); }

.data-card .icon { font-size: 20px; margin-bottom: 6px; }
.data-card .value {
  font-size: 22px; font-weight: 700; color: var(--text-dark);
  line-height: 1;
}
.data-card .label {
  font-size: 11px; color: var(--text-light); margin-top: 4px;
}
.data-card .trend {
  font-size: 10px; margin-top: 4px;
}
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }

/* Section Title */
.section-title {
  font-size: 15px; font-weight: 600; color: var(--text-dark);
  margin-bottom: 12px; display: flex; align-items: center;
  justify-content: space-between;
}

.section-title .more {
  font-size: 12px; color: var(--primary); cursor: pointer;
}

/* Channel Tags */
.channel-section { margin-bottom: 24px; }

.channel-tags {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.channel-tag {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; gap: 10px;
}

.channel-tag:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.channel-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.channel-tag.boss .channel-icon { background: #FFF3E0; color: #FF6B35; }
.channel-tag.external .channel-icon { background: #E3F2FD; color: #1976D2; }
.channel-tag.local .channel-icon { background: #E8F5E9; color: #2E7D32; }
.channel-tag.referral .channel-icon { background: #FCE4EC; color: #C62828; }

.channel-info .name { font-size: 13px; font-weight: 600; }
.channel-info .count { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.channel-info .rate { font-size: 11px; color: var(--success); margin-top: 2px; }

/* Progress Ring Section */
.progress-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.progress-grid {
  display: flex;
  justify-content: space-around;
  gap: 16px;
}

.progress-item {
  text-align: center;
  flex: 1;
}

.progress-ring {
  width: 100px; height: 100px;
  position: relative;
  margin: 0 auto 8px;
}

.progress-ring svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}

.progress-ring .bg-circle {
  fill: none; stroke: #E8ECF1; stroke-width: 8;
}

.progress-ring .fg-circle {
  fill: none; stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.progress-ring .center-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px; font-weight: 700;
  color: var(--text-dark);
}

.progress-label {
  font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: 2px;
}

.progress-detail {
  font-size: 11px; color: var(--text-light);
}

.progress-warning {
  background: #FFF3E0;
  color: var(--warning);
  font-size: 11px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 12px;
  display: flex; align-items: center; gap: 6px;
}

/* Anchor Tier */
.tier-section { margin-bottom: 24px; }

.tier-cards {
  display: flex; flex-direction: column; gap: 10px;
}

.tier-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.tier-badge {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
  flex-shrink: 0;
}

.tier-badge.top { background: linear-gradient(135deg, #FF6B35, #E55A2B); }
.tier-badge.mid { background: linear-gradient(135deg, #3498DB, #2980B9); }
.tier-badge.potential { background: linear-gradient(135deg, #2ECC71, #27AE60); }
.tier-badge.incubate { background: linear-gradient(135deg, #F39C12, #E67E22); }

.tier-info { flex: 1; }
.tier-name { font-size: 14px; font-weight: 600; }
.tier-rule { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.tier-count { font-size: 12px; margin-top: 4px; }
.tier-count span { font-weight: 700; color: var(--primary); }

.tier-arrow { color: var(--text-light); font-size: 16px; }

/* Anchor List Page */
.anchor-list { display: flex; flex-direction: column; gap: 10px; }

.anchor-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}

.anchor-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: #F0F0F0; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--text-light);
  flex-shrink: 0;
  overflow: hidden;
}

.anchor-avatar img { width: 100%; height: 100%; object-fit: cover; }

.anchor-main { flex: 1; }
.anchor-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.anchor-meta { font-size: 11px; color: var(--text-light); margin-top: 3px; }

.anchor-badges { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.anchor-badge-item {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: #F0F0F0; color: var(--text-light);
}
.anchor-badge-item.top { background: #FFE0B2; color: #E65100; }
.anchor-badge-item.mid { background: #BBDEFB; color: #0D47A1; }
.anchor-badge-item.potential { background: #C8E6C9; color: #1B5E20; }
.anchor-badge-item.incubate { background: #FFF3E0; color: #E65100; }
.anchor-badge-item.music { background: #F3E5F5; color: #6A1B9A; }
.anchor-badge-item.night { background: #EDE7F6; color: #283593; }
.anchor-badge-item.high-potential { background: #FFEBEE; color: #C62828; }
.anchor-badge-item.needs-support { background: #FFF8E1; color: #F57F17; }

.anchor-stats {
  text-align: right; flex-shrink: 0;
}
.anchor-income { font-size: 14px; font-weight: 700; color: var(--primary); }
.anchor-income-label { font-size: 10px; color: var(--text-light); }

/* Filter Tabs */
.filter-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
  overflow-x: auto; padding-bottom: 4px;
}

.filter-tab {
  padding: 8px 16px; border-radius: 20px;
  font-size: 12px; background: var(--bg-card);
  color: var(--text); cursor: pointer;
  transition: all 0.2s; border: 1px solid var(--border);
  white-space: nowrap;
}

.filter-tab.active {
  background: var(--primary); color: white; border-color: var(--primary);
}

/* Lead Pipeline */
.pipeline-section { margin-bottom: 20px; }

.pipeline-flow {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; padding: 10px 0;
}

.pipeline-step {
  display: flex; flex-direction: column; align-items: center;
  min-width: 70px; position: relative;
}

.pipeline-dot {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: white;
  background: var(--border); position: relative;
}

.pipeline-dot.active { background: var(--primary); }
.pipeline-dot.current { background: var(--success); box-shadow: 0 0 0 4px rgba(46,204,113,0.3); }

.pipeline-connector {
  width: 30px; height: 2px; background: var(--border);
  flex-shrink: 0;
}
.pipeline-connector.active { background: var(--primary); }

.pipeline-label { font-size: 10px; color: var(--text-light); margin-top: 6px; text-align: center; }
.pipeline-count { font-size: 10px; color: var(--primary); font-weight: 600; }

/* Lead Items */
.lead-list { display: flex; flex-direction: column; gap: 10px; }

.lead-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.lead-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}

.lead-name { font-size: 14px; font-weight: 600; }
.lead-status {
  font-size: 11px; padding: 4px 10px; border-radius: 12px;
  font-weight: 500;
}
.lead-status.new { background: #FFF3E0; color: #E65100; }
.lead-status.communicating { background: #E3F2FD; color: #0D47A1; }
.lead-status.intention { background: #F3E5F5; color: #6A1B9A; }
.lead-status.signed { background: #E8F5E9; color: #1B5E20; }
.lead-status.training { background: #FFF8E1; color: #F57F17; }
.lead-status.assessing { background: #E0F2F1; color: #00695C; }
.lead-status.live { background: #C8E6C9; color: #2E7D32; }

.lead-channel {
  font-size: 11px; color: var(--text-light); margin-bottom: 6px;
  display: flex; align-items: center; gap: 4px;
}

.lead-notes {
  font-size: 12px; color: var(--text);
  background: #F8F9FA; padding: 8px 10px; border-radius: 6px;
  margin-top: 8px;
}

.lead-actions {
  display: flex; gap: 8px; margin-top: 10px;
}

.lead-action-btn {
  padding: 6px 12px; border-radius: 6px;
  font-size: 11px; cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
  transition: all 0.2s;
}

.lead-action-btn.primary {
  background: var(--primary); color: white; border-color: var(--primary);
}

/* Streamer Details Database */
.streamer-summary {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.streamer-chip {
  font-size: 11px; padding: 6px 12px; border-radius: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); white-space: nowrap;
}
.streamer-chip.total { background: #FFF3E0; color: #E65100; border-color: #FFE0B2; }
.streamer-chip.signed { background: #E8F5E9; color: #1B5E20; border-color: #C8E6C9; }
.streamer-chip.new { background: #E3F2FD; color: #0D47A1; border-color: #BBDEFB; }
.streamer-chip.live { background: #C8E6C9; color: #2E7D32; border-color: #A5D6A7; }
.streamer-chip.pipeline { background: #E3F2FD; color: #0D47A1; border-color: #BBDEFB; }
.streamer-chip.contact { background: #F3E5F5; color: #6A1B9A; border-color: #E1BEE7; }
.streamer-chip.channel { background: #E0F2F1; color: #00695C; border-color: #B2DFDB; }
.streamer-chip.violations { background: #FFEBEE; color: #C62828; border-color: #FFCDD2; }
.streamer-chip.tier { background: #FFF8E1; color: #F57F17; border-color: #FFE082; }

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

.streamer-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}
.streamer-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: #FFF3E0; color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.streamer-main { flex: 1; min-width: 0; }
.streamer-name {
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.streamer-status-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 500;
  background: #F0F0F0; color: var(--text-light);
}
.streamer-status-badge.new { background: #FFF3E0; color: #E65100; }
.streamer-status-badge.communicating { background: #E3F2FD; color: #0D47A1; }
.streamer-status-badge.intention { background: #F3E5F5; color: #6A1B9A; }
.streamer-status-badge.signed { background: #E8F5E9; color: #1B5E20; }
.streamer-status-badge.training { background: #FFF8E1; color: #F57F17; }
.streamer-status-badge.assessing { background: #E0F2F1; color: #00695C; }
.streamer-status-badge.live { background: #C8E6C9; color: #2E7D32; }
.streamer-status-badge.none { background: #F5F5F5; color: #9E9E9E; }
.streamer-tier-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600;
  background: #F0F0F0; color: var(--text-light);
}
.streamer-tier-badge.top { background: #FFE0B2; color: #E65100; }
.streamer-tier-badge.mid { background: #BBDEFB; color: #0D47A1; }
.streamer-tier-badge.potential { background: #C8E6C9; color: #1B5E20; }
.streamer-tier-badge.incubate { background: #FFF3E0; color: #E65100; }
.streamer-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 500;
  background: #E0F2F1; color: #00695C;
}
.streamer-tag.new { background: #E3F2FD; color: #0D47A1; }
.streamer-meta { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.streamer-contact { font-size: 11px; color: #0D47A1; margin-top: 3px; font-weight: 500; }
.streamer-violation {
  font-size: 11px; color: #C62828; margin-top: 3px; font-weight: 500;
  background: #FFEBEE; padding: 4px 8px; border-radius: 6px; display: inline-block;
}
.streamer-notes {
  font-size: 11px; color: var(--text); margin-top: 6px;
  background: #F8F9FA; padding: 6px 8px; border-radius: 6px;
}
.streamer-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

.lead-action-btn:hover { opacity: 0.8; }

.lead-warning {
  background: #FFF3E0; border-left: 3px solid var(--warning);
  padding: 6px 10px; font-size: 11px; color: #E65100;
  margin-top: 8px; display: flex; align-items: center; gap: 4px;
}

/* Report Charts */
.report-section { margin-bottom: 20px; }

.report-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.report-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }

.chart-container {
  width: 100%; height: 180px; position: relative;
}

.bar-chart {
  display: flex; align-items: flex-end; justify-content: space-around;
  height: 140px; padding-top: 20px;
}

.bar-item {
  display: flex; flex-direction: column; align-items: center;
  flex: 1;
}

.bar {
  width: 32px; border-radius: 4px 4px 0 0;
  background: var(--primary); transition: height 0.8s ease;
  position: relative;
}

.bar.secondary { background: var(--secondary-light); }
.bar.success { background: var(--success); }

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

.bar-label {
  font-size: 10px; color: var(--text-light); margin-top: 6px;
  text-align: center;
}

/* Conversion Funnel */
.funnel-container {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 10px 0;
}

.funnel-step {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-radius: 8px;
  color: white; font-size: 12px; font-weight: 500;
  width: 100%; position: relative;
}

.funnel-step .num { font-weight: 700; font-size: 16px; }

.funnel-step:nth-child(1) { background: var(--primary); width: 100%; }
.funnel-step:nth-child(2) { background: var(--primary-light); width: 88%; margin: 0 auto; }
.funnel-step:nth-child(3) { background: #9B59B6; width: 76%; margin: 0 auto; }
.funnel-step:nth-child(4) { background: var(--secondary); width: 64%; margin: 0 auto; }
.funnel-step:nth-child(5) { background: var(--success); width: 52%; margin: 0 auto; }

.funnel-rate {
  font-size: 10px; background: rgba(255,255,255,0.3);
  padding: 2px 8px; border-radius: 10px;
}

/* Tools Page */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.tool-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
}

.tool-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.tool-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin: 0 auto 8px;
}

.tool-item.tt .tool-icon { background: #FFE0B2; color: #E65100; }
.tool-item.script .tool-icon { background: #E3F2FD; color: #0D47A1; }
.tool-item.task .tool-icon { background: #F3E5F5; color: #6A1B9A; }
.tool-item.export .tool-icon { background: #E8F5E9; color: #1B5E20; }
.tool-item.label .tool-icon { background: #FFF3E0; color: #E65100; }
.tool-item.setting .tool-icon { background: #ECEFF1; color: #546E7A; }

.tool-name { font-size: 12px; font-weight: 600; }

/* Script Library */
.script-section { margin-bottom: 16px; }

.script-category-title {
  font-size: 13px; font-weight: 600; color: var(--primary);
  margin-bottom: 8px; padding-left: 8px;
  border-left: 3px solid var(--primary);
}

.script-list { display: flex; flex-direction: column; gap: 6px; }

.script-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between;
}

.script-text { font-size: 12px; color: var(--text); flex: 1; }
.script-copy {
  padding: 4px 10px; border-radius: 4px;
  background: var(--primary); color: white;
  font-size: 11px; cursor: pointer;
  border: none;
}
.script-copy:active { background: var(--primary-dark); }

/* Task List */
.task-list { display: flex; flex-direction: column; gap: 8px; }

.task-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex; align-items: flex-start; gap: 10px;
}

.task-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); cursor: pointer;
  flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.task-check.done {
  background: var(--success); border-color: var(--success);
  color: white; font-size: 12px;
}

.task-content { flex: 1; }
.task-title { font-size: 13px; font-weight: 600; }
.task-title.done { color: var(--text-light); text-decoration: line-through; }
.task-desc { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.task-time { font-size: 10px; color: var(--primary); margin-top: 3px; }

.task-priority {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 6px;
}
.task-priority.high { background: var(--danger); }
.task-priority.medium { background: var(--warning); }
.task-priority.low { background: var(--success); }

/* TT Backend Panel */
.tt-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.tt-status {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}

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

.tt-status-dot.syncing { background: var(--warning); animation: pulse 1s infinite; }
.tt-status-dot.offline { background: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.tt-status-text { font-size: 12px; color: var(--success); font-weight: 500; }

.tt-data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tt-data-item {
  background: #F8F9FA; border-radius: 6px;
  padding: 10px; text-align: center;
}

.tt-data-value { font-size: 16px; font-weight: 700; color: var(--text-dark); }
.tt-data-label { font-size: 10px; color: var(--text-light); margin-top: 2px; }

.tt-actions {
  display: flex; gap: 8px; margin-top: 12px;
}

.tt-action-btn {
  flex: 1; padding: 8px; border-radius: 6px;
  font-size: 11px; cursor: pointer; border: none;
  text-align: center; transition: all 0.2s;
}

.tt-action-btn.sync {
  background: var(--primary); color: white;
}
.tt-action-btn.open {
  background: var(--secondary); color: white;
}
.tt-action-btn:hover { opacity: 0.85; }

/* Incubation Tracker */
.incubate-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

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

.incubate-name { font-size: 14px; font-weight: 600; }
.incubate-goal-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: #FFF3E0; color: #E65100;
}

.incubate-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}

.incubate-stat {
  background: #F8F9FA; border-radius: 6px;
  padding: 8px; text-align: center;
}

.incubate-stat .val { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.incubate-stat .lbl { font-size: 9px; color: var(--text-light); margin-top: 2px; }

/* Stream Interruption Alert */
.alert-section { margin-bottom: 16px; }

.alert-item {
  background: #FFF5F5;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
}

.alert-icon { font-size: 18px; flex-shrink: 0; }

.alert-content { flex: 1; }
.alert-anchor { font-size: 13px; font-weight: 600; }
.alert-detail { font-size: 11px; color: var(--text-light); margin-top: 2px; }

.alert-action {
  padding: 6px 12px; border-radius: 6px;
  background: var(--danger); color: white;
  font-size: 11px; cursor: pointer; border: none;
}

/* Performance Dashboard */
.perf-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.perf-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
  text-align: center;
}

.perf-value { font-size: 24px; font-weight: 700; color: var(--primary); }
.perf-label { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  display: none; align-items: center; justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 400px; width: 90%;
  max-height: 80vh; overflow-y: auto;
}

.modal-title {
  font-size: 16px; font-weight: 600; margin-bottom: 16px;
}

.modal-close {
  float: right; background: none; border: none;
  font-size: 18px; cursor: pointer; color: var(--text-light);
}

/* Toast */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--bg-dark); color: white;
  padding: 10px 20px; border-radius: 20px;
  font-size: 13px; z-index: 300;
  animation: fadeInOut 2s ease forwards;
  pointer-events: none;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  85% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--bg-card);
  display: flex;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  flex: 1; padding: 10px 0; text-align: center;
  cursor: pointer; transition: all 0.2s;
  border: none; background: none;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  min-width: 0;  /* prevent overflow */
}

.nav-item .nav-icon { font-size: 18px; }
.nav-item .nav-label { font-size: 10px; color: var(--text-light); white-space: nowrap; }

.nav-item.active .nav-icon { color: var(--primary); }
.nav-item.active .nav-label { color: var(--primary); font-weight: 600; }

/* Quick Actions Bar */
.quick-actions {
  display: flex; gap: 8px; margin-bottom: 20px;
  overflow-x: auto; padding-bottom: 4px;
}

.quick-action {
  padding: 8px 14px; border-radius: 20px;
  font-size: 11px; background: var(--bg-card);
  color: var(--text); cursor: pointer;
  border: 1px solid var(--border);
  white-space: nowrap; transition: all 0.2s;
  display: flex; align-items: center; gap: 4px;
}

.quick-action:hover { border-color: var(--primary); color: var(--primary); }
.quick-action.primary {
  background: var(--primary); color: white; border-color: var(--primary);
}

/* Settings Form */
.settings-form { display: flex; flex-direction: column; gap: 12px; }

.form-group { display: flex; flex-direction: column; gap: 4px; }

.form-label { font-size: 12px; font-weight: 600; color: var(--text); }

.form-input {
  padding: 10px 12px; border-radius: 6px;
  border: 1px solid var(--border); font-size: 13px;
  font-family: var(--font); outline: none; transition: border 0.2s;
}

.form-input:focus { border-color: var(--primary); }

.form-save {
  padding: 10px; border-radius: 6px;
  background: var(--primary); color: white;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; margin-top: 8px;
}

/* API Status Badge */
.api-mode-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 4px 10px; border-radius: 12px;
  font-weight: 500;
}

.api-mode-badge.real {
  background: #E8F5E9; color: #2E7D32;
}

.api-mode-badge.demo {
  background: #FFF3E0; color: #E65100;
}

/* Checkbox styling */
input[type="checkbox"] {
  accent-color: var(--primary);
}

/* Code styling in settings */
code {
  background: #ECEFF1; padding: 1px 5px;
  border-radius: 3px; font-size: 10px;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

/* Empty State */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-light);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 13px; }

/* Export Button */
.export-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 20px;
  background: var(--success); color: white;
  font-size: 12px; cursor: pointer; border: none;
  transition: all 0.2s;
}

.export-btn:hover { opacity: 0.85; }

/* File upload button hover */
.tt-action-btn.upload:hover { opacity: 0.85; }

/* Log entry styles already above */

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Update Log */
.log-entry {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.log-entry:last-child { border-bottom: none; }

.log-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; margin-top: 5px;
}

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

.log-header {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}

.log-icon { font-size: 13px; }
.log-action { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.log-time { font-size: 10px; color: var(--text-light); margin-left: auto; white-space: nowrap; }

.log-detail {
  font-size: 12px; color: var(--text); margin-top: 3px;
  line-height: 1.4;
}

.log-meta {
  font-size: 10px; color: var(--text-light); margin-top: 3px;
}
