/* ============================================
   COMPONENT LIBRARY — Corporate Orange
   ============================================ */

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(242,101,34,0.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(242,101,34,0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-medium);
}
.btn-ghost:hover { 
  background: var(--primary-soft); 
  border-color: var(--primary);
  color: var(--primary);
}

.btn-lg { padding: 14px 28px; font-size: 0.9375rem; }
.btn-sm { padding: 6px 14px; font-size: 0.75rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-group { display: inline-flex; }
.btn-group .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.btn-group .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* ============ INPUTS ============ */
.field { margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input, .input-wrap select, .input-wrap textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}

.input-wrap input:focus, .input-wrap select:focus, .input-wrap textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(242,101,34,0.1);
}

.input-wrap:has(.input-icon) input { padding-left: 42px; }

.input-action {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* ============ CHECKBOX ============ */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.checkbox input { display: none; }
.checkbox .checkmark {
  width: 20px; height: 20px;
  border: 2px solid var(--border-medium);
  border-radius: 4px;
  background: var(--white);
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.checkbox input:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox input:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

/* ============ LOGIN PAGE ============ */
.login-body { 
  min-height: 100vh; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  padding: 24px;
  background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
}

.login-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
  max-width: 1100px;
  min-height: 680px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.login-brand {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  background: linear-gradient(135deg, var(--dark) 0%, var(--charcoal) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

/* Orange accent line */
.login-brand::before {
  content: '';
  position: absolute;
  top: 48px;
  left: 48px;
  width: 60px;
  height: 4px;
  background: var(--primary);
}

.brand-top { display: flex; align-items: center; gap: 16px; }
.brand-logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 48px; height: 48px;
  background: var(--primary-gradient);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(242,101,34,0.4);
}
.logo-mark.small { width: 40px; height: 40px; }
.logo-mark svg { width: 24px; height: 24px; }
.brand-name { 
  font-family: var(--font-display); 
  font-size: 1.5rem; 
  font-weight: 700; 
  letter-spacing: -0.02em;
  color: white;
}
.brand-tag { 
  font-size: 0.75rem; 
  color: rgba(255,255,255,0.6); 
  padding: 4px 12px; 
  background: rgba(255,255,255,0.1); 
  border-radius: 20px; 
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.brand-hero h1 { 
  margin-bottom: 16px; 
  color: white;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}
.brand-hero p { 
  color: rgba(255,255,255,0.7); 
  max-width: 480px;
  font-size: 1rem;
}

.brand-features { display: flex; flex-wrap: wrap; gap: 10px; }
.feature-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 24px;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.9);
}
.feature-pill i { color: var(--primary-light); }

.brand-preview { 
  padding: 24px; 
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
}
.preview-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.traffic-lights { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #FF5F57; }
.dot.yellow { background: #FEBC2E; }
.dot.green { background: #28C840; }
.preview-title { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.1em; }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.mini-kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 0.6875rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.mini-kpi .kpi-value { font-size: 1.25rem; font-family: var(--font-display); color: white; }
.kpi-trend { font-size: 0.75rem; color: #34D399; font-weight: 600; }
.preview-chart { height: 60px; }
.preview-chart svg { width: 100%; height: 100%; }

.login-form-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  background: var(--white);
}

.login-card { 
  width: 100%; 
  max-width: 420px; 
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.login-card:hover { transform: none; box-shadow: none; }
.login-card-header { margin-bottom: 32px; }
.login-card-header h2 { 
  margin-bottom: 8px; 
  font-size: 2rem;
  color: var(--dark);
}
.login-card-header p { color: var(--text-muted); }

.form-row { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 24px; }
.link { color: var(--primary); text-decoration: none; font-size: 0.8125rem; font-weight: 600; }
.link:hover { text-decoration: underline; }

.alert { padding: 12px 16px; border-radius: var(--radius-md); font-size: 0.8125rem; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.alert-error { background: #FEE2E2; border: 1px solid #FECACA; color: #DC2626; }

.btn-loader { display: inline-flex; align-items: center; gap: 8px; }
.spinner { width: 16px; height: 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-footer { margin-top: 32px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.75rem; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.1em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }
.security-row { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.75rem; color: var(--text-muted); }
.security-row i { color: #10B981; }
.copyright { margin-top: 24px; font-size: 0.75rem; color: var(--text-muted); text-align: center; }

/* ============ APP LAYOUT ============ */
.app-body { 
  min-height: 100vh; 
  display: grid; 
  grid-template-columns: 260px 1fr;
  background: var(--bg-main);
}
.app-body.sidebar-collapsed { grid-template-columns: 72px 1fr; }

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  height: calc(100vh - 32px);
  margin: 16px 0 16px 16px;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  z-index: 10;
  background: var(--white);
  border: 1px solid var(--border-light);
}

.sidebar-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 0 8px 16px; 
  border-bottom: 2px solid var(--border-light); 
}

.company-switcher { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  padding: 12px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
}
.company-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--primary-gradient);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem;
  color: white;
  flex-shrink: 0;
}
.company-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.company-name { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-plan { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-section-label { 
  font-size: 0.6875rem; 
  text-transform: uppercase; 
  letter-spacing: 0.12em; 
  color: var(--text-muted); 
  padding: 0 12px 8px; 
  font-weight: 700; 
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border-left: 3px solid transparent;
}
.nav-item:hover { 
  background: var(--gray-100); 
  color: var(--text-primary); 
}
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.nav-item i { font-size: 1.125rem; flex-shrink: 0; }
.nav-item.logout { color: var(--text-muted); }
.nav-item.logout:hover { color: #DC2626; background: #FEE2E2; }

.platform-dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; }
.platform-dot.ig { background: var(--ig-color); }
.platform-dot.fb { background: var(--fb-color); }
.platform-dot.li { background: var(--li-color); }

.sidebar-footer { padding-top: 16px; border-top: 2px solid var(--border-light); display: flex; flex-direction: column; gap: 2px; }

/* ============ MAIN ============ */
.main { padding: 16px 16px 16px 0; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 16px;
  position: sticky;
  top: 16px;
  z-index: 5;
  background: var(--white);
  border: 1px solid var(--border-light);
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; }
.crumb { color: var(--text-muted); font-weight: 500; }
.crumb-sep { font-size: 0.75rem; color: var(--text-muted); }
.crumb.current { color: var(--text-primary); font-weight: 700; }

.date-picker { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  padding: 8px 16px; 
  cursor: pointer; 
  font-size: 0.8125rem; 
  position: relative;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  font-weight: 500;
}
.date-picker:hover { background: var(--border-light); }

.date-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  display: none;
  z-index: 100;
  background: var(--white);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
}
.date-dropdown.open { display: block; }
.date-option { padding: 10px 12px; border-radius: 8px; font-size: 0.8125rem; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.date-option:hover { background: var(--gray-100); color: var(--text-primary); }
.date-option.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.date-divider { height: 1px; background: var(--border-light); margin: 6px 0; }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-100);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.icon-btn.tiny { width: 30px; height: 30px; }

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--primary);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--white);
}

.user-menu { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; cursor: pointer; border-radius: var(--radius-md); }
.user-menu:hover { background: var(--gray-100); }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8125rem; font-weight: 700;
  color: white;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 0.8125rem; font-weight: 700; color: var(--text-primary); }
.user-role { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ============ VIEWS ============ */
.view-container { flex: 1; display: flex; flex-direction: column; gap: 24px; padding: 0 4px; }
.view { display: none; flex-direction: column; gap: 24px; animation: fadeIn 0.4s ease; }
.view.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.view-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: flex-start; 
  gap: 24px; 
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-light);
}
.view-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ KPI CARDS ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

.kpi-card { padding: 24px; position: relative; overflow: hidden; }
.kpi-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.kpi-label { 
  font-size: 0.6875rem; 
  text-transform: uppercase; 
  letter-spacing: 0.1em; 
  color: var(--text-muted); 
  font-weight: 700; 
}
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.kpi-icon i { font-size: 1.25rem; }

.kpi-value { 
  font-size: 2.25rem; 
  margin-bottom: 12px; 
  letter-spacing: -0.03em;
  color: var(--dark);
}

.kpi-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trend { 
  display: inline-flex; 
  align-items: center; 
  gap: 4px; 
  font-size: 0.8125rem; 
  font-weight: 700; 
  padding: 4px 10px; 
  border-radius: 6px;
}
.trend.positive { color: #059669; background: #D1FAE5; }
.trend.negative { color: #DC2626; background: #FEE2E2; }
.trend.neutral { color: #D97706; background: #FEF3C7; }

.sparkline { position: absolute; bottom: 0; right: 0; width: 100px; height: 40px; opacity: 0.4; pointer-events: none; }

/* ============ CHART CARD ============ */
.chart-card { padding: 28px; }
.card-head { 
  display: flex; 
  justify-content: space-between; 
  align-items: flex-start; 
  gap: 16px; 
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-light);
}
.card-head h3 { 
  display: flex; 
  align-items: center; 
  gap: 10px;
  font-size: 1.5rem;
}
.card-head h3 i { color: var(--primary); }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.chart-wrap { position: relative; height: 320px; }
.donut-wrap { height: 240px; }

.segmented { 
  display: inline-flex; 
  padding: 4px; 
  background: var(--gray-100); 
  border: 1px solid var(--border-light); 
  border-radius: var(--radius-md); 
  gap: 2px; 
}
.seg { 
  padding: 8px 16px; 
  font-size: 0.8125rem; 
  font-weight: 600; 
  color: var(--text-secondary); 
  background: transparent; 
  border: none; 
  border-radius: 8px; 
  cursor: pointer; 
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.seg:hover { color: var(--text-primary); }
.seg.active { 
  background: var(--primary); 
  color: white; 
  box-shadow: 0 2px 8px rgba(242,101,34,0.3);
}

.platform-filter { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip { 
  display: inline-flex; 
  align-items: center; 
  gap: 6px; 
  padding: 6px 14px; 
  background: var(--white); 
  border: 1px solid var(--border-light); 
  border-radius: 20px; 
  font-size: 0.75rem; 
  color: var(--text-secondary); 
  cursor: pointer; 
  transition: all 0.2s ease;
  font-weight: 500;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { 
  background: var(--primary); 
  border-color: var(--primary); 
  color: white;
  font-weight: 600;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; }

/* ============ PLATFORM CARDS ============ */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.platform-card { 
  padding: 24px; 
  position: relative; 
  overflow: hidden;
  border-top: 4px solid transparent;
}
.ig-card { border-top-color: var(--ig-color); }
.fb-card { border-top-color: var(--fb-color); }
.li-card { border-top-color: var(--li-color); }

.platform-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; position: relative; z-index: 1; }
.platform-icon { 
  width: 48px; height: 48px; 
  border-radius: 12px; 
  display: flex; align-items: center; justify-content: center; 
  color: white; 
  font-size: 1.25rem; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
}
.platform-head h4 { margin-bottom: 2px; font-size: 1.25rem; }

.badge { display: inline-flex; align-items: center; padding: 4px 12px; font-size: 0.6875rem; font-weight: 700; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em; }
.badge.connected { background: #D1FAE5; color: #059669; border: 1px solid #A7F3D0; }
.badge.ig { background: #FCE7F3; color: #BE185D; }
.badge.success { background: #D1FAE5; color: #059669; }
.badge.warning { background: #FEF3C7; color: #D97706; }

.platform-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; position: relative; z-index: 1; }
.platform-stats > div { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.stat-value { font-size: 1.375rem; color: var(--dark); }

.platform-bar { height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; position: relative; z-index: 1; }
.bar { height: 100%; border-radius: 3px; }

/* ============ INSIGHTS ============ */
.insights-list { display: flex; flex-direction: column; gap: 12px; }
.insight-item { 
  display: flex; 
  gap: 14px; 
  padding: 16px; 
  background: var(--gray-100); 
  border: 1px solid var(--border-light); 
  border-radius: var(--radius-md); 
  border-left: 4px solid var(--primary);
  transition: all 0.2s ease; 
}
.insight-item:hover { 
  background: var(--white); 
  box-shadow: var(--shadow-sm);
  transform: translateX(4px); 
}
.insight-icon { 
  width: 40px; height: 40px; 
  border-radius: 10px; 
  display: flex; align-items: center; justify-content: center; 
  flex-shrink: 0; 
}
.insight-item.positive .insight-icon { background: #D1FAE5; color: #059669; }
.insight-item.negative .insight-icon { background: #FEE2E2; color: #DC2626; }
.insight-item.neutral .insight-icon { background: #DBEAFE; color: #2563EB; }

/* ============ TOP CONTENT ============ */
.top-content { display: flex; flex-direction: column; gap: 10px; }
.content-row { 
  display: flex; 
  align-items: center; 
  gap: 14px; 
  padding: 12px; 
  border-radius: var(--radius-md); 
  transition: background 0.2s ease;
  border: 1px solid transparent;
}
.content-row:hover { background: var(--gray-100); border-color: var(--border-light); }
.content-thumb { 
  width: 56px; height: 56px; 
  border-radius: 12px; 
  display: flex; align-items: center; justify-content: center; 
  color: white; 
  font-size: 1.25rem; 
  flex-shrink: 0; 
}
.content-thumb.tiny { width: 40px; height: 40px; font-size: 0.875rem; }
.content-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.content-platform { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.content-platform.ig { color: var(--ig-color); }
.content-platform.fb { color: var(--fb-color); }
.content-platform.li { color: var(--li-color); }
.content-info p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); font-weight: 500; }
.content-metrics { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.metric { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8125rem; color: var(--text-secondary); }
.metric.strong { 
  font-family: var(--font-display); 
  font-size: 1.125rem; 
  font-weight: 700; 
  color: var(--primary); 
  padding: 4px 12px; 
  background: var(--primary-soft); 
  border-radius: 8px;
}

/* ============ DATA TABLE ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table thead th { 
  text-align: left; 
  padding: 12px 14px; 
  font-size: 0.6875rem; 
  text-transform: uppercase; 
  letter-spacing: 0.08em; 
  color: var(--text-muted); 
  font-weight: 700; 
  border-bottom: 2px solid var(--border-light);
  background: var(--gray-100);
}
.data-table tbody td { padding: 14px; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }
.data-table tbody tr:hover { background: var(--primary-soft); }
.data-table tbody tr:last-child td { border-bottom: none; }

.cell-post { display: flex; align-items: center; gap: 10px; color: var(--text-primary); font-weight: 500; }

.search-wrap { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  padding: 8px 14px; 
  background: var(--white); 
  border: 1px solid var(--border-light); 
  border-radius: var(--radius-md); 
}
.search-wrap input { background: transparent; border: none; outline: none; color: var(--text-primary); font-size: 0.8125rem; width: 160px; }

/* ============ COVERAGE ============ */
.coverage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.coverage-item { display: flex; flex-direction: column; gap: 8px; }
.coverage-head { display: flex; align-items: center; gap: 10px; font-size: 0.875rem; font-weight: 600; }
.coverage-pct { margin-left: auto; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.progress { height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; transition: width 0.6s ease; }

/* ============ TWO COL ============ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ============ PROFILE HERO ============ */
.profile-hero { 
  display: flex; 
  align-items: center; 
  gap: 20px; 
  padding: 28px; 
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary);
}
.profile-avatar { 
  width: 72px; height: 72px; 
  border-radius: 16px; 
  display: flex; align-items: center; justify-content: center; 
  color: white; 
  font-size: 1.75rem; 
  box-shadow: 0 8px 24px rgba(0,0,0,0.15); 
}
.profile-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

.profile-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.profile-stat { padding: 20px; display: flex; flex-direction: column; gap: 4px; }

/* ============ DONUT LEGEND ============ */
.donut-legend { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 20px; font-size: 0.8125rem; color: var(--text-secondary); font-weight: 500; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend .dot { width: 12px; height: 12px; border-radius: 3px; }

/* ============ REPORT ============ */
.report-layout { grid-template-columns: 1fr 1fr; align-items: start; }
.report-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.export-row { display: flex; gap: 8px; }
.export-row .btn { flex: 1; }

.input-row { display: flex; align-items: center; gap: 10px; }
.input-sep { color: var(--text-muted); font-weight: 600; }

.report-preview-wrap { position: sticky; top: 100px; }
.report-preview { padding: 16px; }
.preview-toolbar { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 10px 14px; 
  margin-bottom: 12px; 
  background: var(--gray-100); 
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.8125rem;
}
.report-page { 
  background: white; 
  border-radius: var(--radius-md); 
  padding: 40px; 
  min-height: 400px; 
  color: #1a1a1a;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}
.report-cover { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 320px; gap: 16px; }
.report-logo { display: flex; align-items: center; gap: 10px; color: #1a1a1a; }
.report-logo .logo-mark { background: var(--primary-gradient); border: none; }
.report-cover h2 { color: #1a1a1a; font-size: 1.75rem; }
.report-cover p { color: #666; }
.report-platforms { display: flex; gap: 8px; margin-top: 16px; }

/* ============ UPLOAD ============ */
.upload-card { padding: 32px; }
.upload-zone { 
  padding: 48px 24px; 
  text-align: center; 
  border: 2px dashed var(--border-medium); 
  border-radius: var(--radius-lg); 
  transition: all 0.3s ease; 
  cursor: pointer;
  background: var(--gray-100);
}
.upload-zone:hover { 
  border-color: var(--primary); 
  background: var(--primary-soft);
}
.upload-icon { margin-bottom: 16px; }
.upload-circle { 
  width: 80px; height: 80px; 
  border-radius: 50%; 
  background: var(--primary-soft); 
  border: 2px solid var(--primary); 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 1.75rem; 
  color: var(--primary); 
  margin: 0 auto 16px; 
}
.upload-formats { display: flex; justify-content: center; gap: 8px; margin: 16px 0 24px; }
.format-chip { 
  padding: 4px 12px; 
  background: var(--white); 
  border: 1px solid var(--border-light); 
  border-radius: 6px; 
  font-family: var(--font-mono); 
  font-size: 0.75rem; 
  color: var(--text-secondary);
  font-weight: 600;
}

.upload-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.upload-divider::before, .upload-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }

.templates h4 { margin-bottom: 14px; font-size: 1.125rem; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.template-card { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  padding: 16px; 
  background: var(--white); 
  border: 1px solid var(--border-light); 
  border-radius: var(--radius-md); 
  cursor: pointer; 
  transition: all 0.2s ease; 
  text-align: left; 
  color: var(--text-primary); 
  font-family: inherit; 
}
.template-card:hover { 
  border-color: var(--primary); 
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.template-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; }
.template-card div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.template-card div strong { font-weight: 700; }
.template-card i:last-child { color: var(--primary); font-size: 1.25rem; }

/* ============ STEPPER ============ */
.stepper { display: flex; align-items: flex-start; gap: 0; margin: 24px 0; overflow-x: auto; }
.step { display: flex; gap: 10px; align-items: flex-start; flex-shrink: 0; }
.step-dot { 
  width: 36px; height: 36px; 
  border-radius: 50%; 
  background: var(--white); 
  border: 2px solid var(--border-medium); 
  display: flex; align-items: center; justify-content: center; 
  font-size: 0.8125rem; font-weight: 700; 
  flex-shrink: 0;
  color: var(--text-muted);
}
.step.done .step-dot { 
  background: #059669; 
  border-color: #059669; 
  color: white; 
}
.step.active .step-dot { 
  background: var(--primary); 
  border-color: var(--primary); 
  color: white; 
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.step div:last-child { display: flex; flex-direction: column; gap: 2px; }
.step div:last-child strong { font-weight: 700; color: var(--text-primary); }
.step-line { flex: 1; height: 2px; background: var(--border-light); margin: 17px 8px 0; min-width: 30px; }
.step-line.done { background: #059669; }

.mapping-table { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.mapping-row { 
  display: grid; 
  grid-template-columns: 1fr auto 1fr auto; 
  gap: 12px; 
  align-items: center; 
  padding: 12px 16px; 
  background: var(--gray-100); 
  border: 1px solid var(--border-light); 
  border-radius: var(--radius-md); 
}
.mapping-row.header { 
  background: transparent; 
  border: none; 
  font-size: 0.6875rem; 
  text-transform: uppercase; 
  letter-spacing: 0.08em; 
  color: var(--text-muted); 
  font-weight: 700; 
  padding: 0 16px 8px; 
}
.mapping-row select { 
  padding: 8px 12px; 
  background: var(--white); 
  border: 1px solid var(--border-light); 
  border-radius: 8px; 
  color: var(--text-primary); 
  font-size: 0.8125rem;
  font-weight: 500;
}
.mapping-row i { color: var(--primary); }

.validation-summary { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 10px; 
  padding: 16px; 
  background: var(--gray-100); 
  border-radius: var(--radius-md); 
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
}
.val-item { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 500; }
.val-item.ok i { color: #059669; }
.val-item.warn i { color: #D97706; }

.import-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ============ SETTINGS ============ */
.settings-tabs { 
  display: flex; 
  gap: 0; 
  background: var(--gray-100); 
  border: 1px solid var(--border-light); 
  border-radius: var(--radius-md); 
  width: fit-content;
  overflow: hidden;
}
.tab { 
  padding: 10px 20px; 
  font-size: 0.8125rem; 
  font-weight: 600; 
  color: var(--text-secondary); 
  background: transparent; 
  border: none; 
  cursor: pointer; 
  transition: all 0.2s ease; 
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tab:hover { color: var(--text-primary); background: var(--white); }
.tab.active { 
  background: var(--primary); 
  color: white; 
}

.logo-upload { 
  display: flex; 
  align-items: center; 
  gap: 20px; 
  padding: 20px; 
  background: var(--gray-100); 
  border-radius: var(--radius-md); 
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
}
.logo-preview { 
  width: 88px; height: 88px; 
  border-radius: 16px; 
  display: flex; align-items: center; justify-content: center; 
  color: white; 
  flex-shrink: 0;
  font-size: 1.5rem;
}
.logo-upload div:last-child { display: flex; flex-direction: column; gap: 6px; }
.logo-upload div:last-child strong { font-weight: 700; font-size: 1rem; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-grid .full { grid-column: 1 / -1; }
.color-wrap { display: flex; gap: 10px; align-items: center; }
.color-wrap input[type="color"] { 
  width: 48px; height: 48px; 
  border: 2px solid var(--border-light); 
  border-radius: 10px; 
  cursor: pointer; 
  background: transparent;
  padding: 4px;
}

.settings-actions { 
  display: flex; 
  justify-content: flex-end; 
  gap: 10px; 
  margin-top: 24px; 
  padding-top: 24px; 
  border-top: 2px solid var(--border-light); 
}

.connected-list { display: flex; flex-direction: column; gap: 10px; }
.connected-item { 
  display: flex; 
  align-items: center; 
  gap: 14px; 
  padding: 16px; 
  background: var(--gray-100); 
  border: 1px solid var(--border-light); 
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}
.connected-item:hover { background: var(--white); box-shadow: var(--shadow-sm); }
.connected-item div:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.connected-item div:nth-child(2) strong { font-weight: 700; }

.mobile-menu { display: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .two-col, .report-layout { grid-template-columns: 1fr; }
  .report-preview-wrap { position: static; }
}

@media (max-width: 768px) {
  .app-body { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -300px; top: 0; height: 100vh; margin: 0; width: 280px; transition: left 0.3s ease; z-index: 100; }
  .sidebar.open { left: 0; }
  .main { padding: 16px; }
  .topbar { top: 0; margin: 0; border-radius: 0; }
  .mobile-menu { display: inline-flex; }
  .login-container { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .user-info { display: none; }
}
/* ============================================
   SIDEBAR COLLAPSED — proper icon-only mode
   ============================================ */
.app-body.sidebar-collapsed .sidebar {
  padding: 20px 8px;
}
.app-body.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 0 0 16px;
}
.app-body.sidebar-collapsed .sidebar-header .brand-name,
.app-body.sidebar-collapsed .company-info,
.app-body.sidebar-collapsed .nav-item span,
.app-body.sidebar-collapsed .nav-section-label,
.app-body.sidebar-collapsed .platform-dot {
  display: none !important;
}
.app-body.sidebar-collapsed .company-switcher {
  padding: 8px;
  justify-content: center;
}
.app-body.sidebar-collapsed .company-switcher .icon-btn { display: none; }
.app-body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}
.app-body.sidebar-collapsed .sidebar-toggle {
  position: absolute;
  top: 16px;
  right: 8px;
}
/* Toggle button always clickable */
.sidebar-toggle {
  min-width: 32px;
  min-height: 32px;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-toggle i,
.sidebar-toggle svg {
  width: 18px; height: 18px;
}

/* Brand SVG icons (inline) */
i.li-svg-brand { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; line-height: 0; }
i.li-svg-brand svg { width: 100%; height: 100%; }
/* Ensure Lucide-generated SVGs also stay sized reasonably */
i[data-lucide] svg, i.li svg { width: 18px; height: 18px; }
.kpi-icon i svg, .kpi-icon svg { width: 20px; height: 20px; color: white; }
.profile-avatar svg { width: 22px; height: 22px; color: white; }

/* App logo — used in sidebar, login, and reports */
.app-logo { display: block; max-width: 100%; height: auto; }
.app-logo-light { max-height: 40px; width: auto; }
.app-logo-dark  { max-height: 44px; width: auto; }
.login-brand .app-logo-dark { max-height: 56px; }
.sidebar-header .app-logo-light { max-height: 36px; }
.app-body.sidebar-collapsed .sidebar-header .app-logo { display: none; }
