/* === OCUK Brand Theme === */
:root {
  --color-bg: #0b0c10;
  --color-surface: #13151a;
  --color-surface-alt: #1a1c22;
  --color-border: rgba(255,255,255,0.06);
  --color-border-hover: rgba(255,255,255,0.12);
  --color-text: #f1f1f2;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #8b8b94;
  --color-primary: #e63946;
  --color-primary-dim: rgba(230,57,70,0.12);
  --color-green: #34d399;
  --color-green-dim: rgba(52,211,153,0.12);
  --color-red: #f87171;
  --color-red-dim: rgba(248,113,113,0.12);
  --color-blue: #4a9ede;
  --color-blue-dim: rgba(74,158,222,0.12);
  --color-orange: #fb923c;
  --color-purple: #c084fc;
  --color-purple-dim: rgba(192,132,252,0.12);
  --color-ocuk-red: #D0202D;
  --color-ocuk-blue: #1258A4;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

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

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 1600px; margin: 0 auto; padding: 20px 24px; }

/* Table scrolling */
.table-scroll { overflow-x: auto; }

/* Column toggles */
.column-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}
.col-toggle {
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.col-toggle:hover { border-color: var(--color-text-muted); }
.col-toggle.active {
  background: var(--color-primary-dim);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-logo {
  height: 28px;
  opacity: 0.9;
}
.header h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.header h1 span {
  background: linear-gradient(135deg, #D0202D, #e63946);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-meta { color: var(--color-text-muted); font-size: 12px; text-align: right; }

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0;
}
.tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--color-text-secondary); }
.tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Sub-tabs (nested tabs within a tab) */
.sub-tab-bar {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0;
}
.sub-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.sub-tab:hover { color: var(--color-text-secondary); }
.sub-tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-primary);
}
.sub-tab-content { display: none; }
.sub-tab-content.active { display: block; }

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s, transform 0.15s;
}
.kpi-card:hover { border-color: var(--color-border-hover); }
.kpi-card[style*="cursor"]:hover { border-color: var(--color-primary); transform: translateY(-1px); }
.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.kpi-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.kpi-sub {
  font-size: 12px;
  margin-top: 4px;
}
.kpi-value.green { color: var(--color-green); }
.kpi-value.red { color: var(--color-red); }
.kpi-value.blue { color: var(--color-blue); }
.kpi-value.purple { color: var(--color-purple); }

/* Cards / Sections */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--color-border-hover); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.card-header h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.card-count {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
  background: var(--color-surface-alt);
  padding: 2px 10px;
  border-radius: 20px;
}
.card-body { padding: 0; }
.card-description {
  color: var(--color-text-secondary);
  font-size: 13px;
  padding: 12px 20px 0;
  line-height: 1.5;
}

/* Section header */
.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: 24px 0 8px 0;
  margin-bottom: 16px;
}

/* Two-column grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Filter input */
.filter-bar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
}
.filter-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.15s;
}
.filter-input::placeholder { color: var(--color-text-muted); }
.filter-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-dim); }
.filter-select {
  padding: 6px 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  color: var(--color-text);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  margin-right: 8px;
}
.filter-select:focus { outline: none; border-color: var(--color-primary); }
.filter-bar-multi { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  padding: 10px 16px;
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  transition: color 0.15s, background 0.15s;
}
.data-table th:hover { color: var(--color-text-secondary); background: rgba(255,255,255,0.02); }
.data-table th:active { background: rgba(255,255,255,0.05); }
.data-table th.sort-asc::after,
.data-table th.sort-desc::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}
.data-table th.sort-asc::after { border-bottom: 5px solid var(--color-text-muted); }
.data-table th.sort-desc::after { border-top: 5px solid var(--color-text-muted); }
.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
}
.data-table tr:hover td { color: var(--color-text); background: rgba(255,255,255,0.02); }
.data-table a { color: var(--color-blue); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }

.show-more-row { text-align: center; padding: 16px; }
.show-more-btn {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 8px 24px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.show-more-btn:hover { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-border-hover); }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}
.badge-short { background: rgba(251,146,60,0.12); color: var(--color-orange); }
.badge-exact { background: var(--color-green-dim); color: var(--color-green); }
.badge-token { background: var(--color-purple-dim); color: var(--color-purple); }
.badge-fuzzy { background: var(--color-blue-dim); color: var(--color-blue); }
.badge-partial { background: rgba(251,191,36,0.12); color: #d97706; }
.badge-gained { background: var(--color-green-dim); color: var(--color-green); }
.badge-lost { background: var(--color-red-dim); color: var(--color-red); }
.badge-yes { background: var(--color-green-dim); color: var(--color-green); }
.badge-no { background: rgba(113,113,122,0.12); color: var(--color-text-muted); }
.badge-new { background: var(--color-purple-dim); color: var(--color-purple); }

/* Toggle button group (inline tab-like filter) */
.toggle-group { display: flex; gap: 2px; background: var(--color-surface); border-radius: 8px; padding: 2px; border: 1px solid var(--color-border); }
.toggle-btn {
  padding: 5px 14px; font-size: 0.78rem; border: none; border-radius: 6px;
  background: transparent; color: var(--color-text-muted); cursor: pointer; font-weight: 500;
  transition: all 0.15s;
}
.toggle-btn:hover { color: var(--color-text); }
.toggle-btn.active { background: var(--color-primary); color: #fff; }

/* Expandable citation panel */
.citation-row td { padding: 0 !important; border-top: none !important; }
.citation-panel {
  background: var(--color-surface); border-left: 3px solid var(--color-primary);
  margin: 0 12px 8px 12px; padding: 12px 16px; border-radius: 0 8px 8px 0;
}
.citation-panel h4 { margin: 0 0 8px 0; font-size: 0.8rem; color: var(--color-text-muted); font-weight: 600; }
.citation-list { list-style: none; padding: 0; margin: 0; }
.citation-list li {
  display: flex; align-items: baseline; gap: 8px; padding: 4px 0;
  font-size: 0.75rem; border-bottom: 1px solid var(--color-border);
}
.citation-list li:last-child { border-bottom: none; }
.citation-pos { font-weight: 700; color: var(--color-primary); min-width: 20px; text-align: right; }
.citation-domain { color: var(--color-text-muted); min-width: 140px; }
.citation-title { color: var(--color-text); font-weight: 500; min-width: 120px; max-width: 260px; margin-right: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citation-url { color: var(--color-text-muted); word-break: break-all; font-size: 0.65rem; }
.citation-url a { color: var(--color-text-muted); text-decoration: none; }
.citation-url a:hover { text-decoration: underline; color: var(--color-primary); }
.citation-owned { background: var(--color-green-dim); color: var(--color-green); font-size: 0.65rem; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
tr.expandable { cursor: pointer; }
tr.expandable td:first-child { position: relative; padding-left: 32px; }
tr.expandable td:first-child::before { content: '\25B8'; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); font-size: 22px; transition: transform 0.15s ease; }
tr.expandable:hover { background: rgba(99,102,241,0.04); }
tr.expanded { background: rgba(99,102,241,0.06); }
tr.expanded td:first-child::before { transform: translateY(-50%) rotate(90deg); color: var(--color-primary); }

/* Column header tooltips */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: var(--color-surface-alt); color: var(--color-text); border: 1px solid var(--color-border-hover);
  padding: 6px 10px; border-radius: var(--radius-xs); font-size: 11px; font-weight: 400;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.15s;
  z-index: 100; box-shadow: var(--shadow);
}
[data-tooltip]:hover::after { opacity: 1; }

/* Detail panel sub-tabs */
.detail-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--color-border);
  margin: -4px 0 12px 0;
}
.detail-tab {
  padding: 6px 14px; font-size: 11px; font-weight: 600; cursor: pointer;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--color-text-muted); transition: color 0.15s, border-color 0.15s;
}
.detail-tab:hover { color: var(--color-text-secondary); }
.detail-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.detail-tab-content { display: none; }
.detail-tab-content.active { display: block; }

/* Rankings mini-table inside detail panels */
.rankings-mini-table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px;
}
.rankings-mini-table th {
  text-align: left; padding: 4px 10px; font-size: 10px; font-weight: 600;
  color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--color-border);
}
.rankings-mini-table td {
  padding: 5px 10px; border-bottom: 1px solid var(--color-border);
}
.rankings-mini-table tr:last-child td { border-bottom: none; }
.rankings-mini-table a { color: var(--color-blue); text-decoration: none; }
.rankings-mini-table a:hover { text-decoration: underline; }

/* Video match review UI */
.confidence-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.conf-high { background: rgba(52,211,153,0.15); color: #34d399; }
.conf-med { background: rgba(251,191,36,0.15); color: #fbbf24; }
.conf-low { background: rgba(239,68,68,0.15); color: #ef4444; }

.match-candidate {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--color-border); border-radius: 8px; margin-bottom: 8px;
  transition: border-color 0.15s;
}
.match-candidate:hover { border-color: var(--color-primary); }
.match-candidate .candidate-rank {
  font-size: 11px; font-weight: 700; color: var(--color-text-muted);
  width: 20px; flex-shrink: 0; text-align: center;
}
.match-candidate .candidate-info { flex: 1; min-width: 0; }
.match-candidate .candidate-title {
  font-size: 12px; font-weight: 500; color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.match-candidate .candidate-url {
  font-size: 10px; color: var(--color-text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.match-candidate .candidate-url a { color: var(--color-blue); text-decoration: none; }
.match-candidate .candidate-url a:hover { text-decoration: underline; }
.match-candidate .candidate-field {
  font-size: 10px; color: var(--color-text-muted); background: rgba(255,255,255,0.04);
  padding: 1px 6px; border-radius: 4px; margin-top: 2px; display: inline-block;
}
.match-candidate .score-bar {
  width: 60px; height: 6px; background: var(--color-border);
  border-radius: 3px; flex-shrink: 0; overflow: hidden;
}
.match-candidate .score-fill { height: 100%; border-radius: 3px; }

.decision-btn {
  padding: 4px 12px; border-radius: 6px; font-size: 11px; font-weight: 600;
  border: 1px solid; cursor: pointer; transition: opacity 0.15s; flex-shrink: 0;
}
.decision-btn:hover { opacity: 0.8; }
.decision-btn.accept { border-color: #34d399; color: #34d399; background: rgba(52,211,153,0.08); }
.decision-btn.reject { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.08); }
.decision-btn.defer { border-color: #fbbf24; color: #fbbf24; background: rgba(251,191,36,0.08); }
.decision-btn.undo { border-color: var(--color-text-muted); color: var(--color-text-muted); background: rgba(255,255,255,0.04); }

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

.decision-current {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--color-border);
  border-radius: 8px; margin-bottom: 12px; font-size: 12px;
}
.decision-current .decision-label { font-weight: 600; }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.status-dot.accepted { background: #34d399; }
.status-dot.rejected { background: #ef4444; }
.status-dot.deferred { background: #fbbf24; }
.status-dot.pending { background: #6b7280; }

.review-empty {
  color: var(--color-text-muted); font-size: 12px; font-style: italic; padding: 12px 0;
}

/* Chart containers */
.chart-container {
  padding: 20px;
  height: 300px;
  position: relative;
}

/* Stat bar (horizontal bar for competitor domains etc) */
.stat-bar-container { padding: 20px; }
.stat-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}
.stat-bar-label {
  width: 400px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 12px;
}
.stat-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  margin: 0 12px;
  overflow: hidden;
  max-width: 200px;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-bar-value {
  width: 70px;
  text-align: right;
  flex-shrink: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* VS Actions cards */
.vs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 20px;
}
.vs-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: border-color 0.15s;
}
.vs-card:hover { border-color: var(--color-border-hover); }
.vs-card-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.vs-card-metric {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.vs-card-change {
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 64px 24px;
  color: var(--color-text-muted);
}

/* Period toggle buttons */
.period-toggles {
  display: flex;
  gap: 4px;
}
.period-btn {
  padding: 3px 10px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.period-btn:hover { color: var(--color-text-secondary); border-color: var(--color-border-hover); }
.period-btn.active {
  background: var(--color-primary-dim);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Topic row expand/collapse */
.topic-row { cursor: pointer; }
.topic-row:hover td { background: var(--color-surface-alt); }
.topic-chevron {
  display: inline-block;
  transition: transform 0.2s;
  margin-right: 6px;
  font-size: 22px;
  color: var(--color-text-muted);
}
.topic-row.expanded .topic-chevron { transform: rotate(90deg); }
.topic-kw-row { display: none; }
.topic-kw-row.visible { display: table-row; }

/* Action tracking badges & forms */
.action-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; line-height: 1.5; cursor: default;
}
.action-badge.tracked { background: var(--color-blue-dim); color: var(--color-blue); }
.action-badge.pending { background: rgba(251,146,60,0.12); color: var(--color-orange); }
.action-badge.won { background: var(--color-green-dim); color: var(--color-green); }
.action-badge.no-change { background: rgba(113,113,122,0.12); color: var(--color-text-muted); }
.action-badge.expired { background: var(--color-red-dim); color: var(--color-red); }
.action-badge.auto-detected { background: var(--color-purple-dim); color: var(--color-purple); font-style: italic; }
.track-btn {
  padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 500;
  border: 1px solid var(--color-border); background: transparent;
  color: var(--color-text-muted); cursor: pointer; transition: all 0.15s;
}
.track-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Action form inside citation panel */
.action-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-border); }
.action-form h4 { margin: 0 0 8px 0; font-size: 0.8rem; color: var(--color-text-muted); font-weight: 600; }
.form-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.form-row label { font-size: 11px; color: var(--color-text-muted); min-width: 60px; font-weight: 500; }
.form-row select, .form-row input[type="date"], .form-row input[type="text"] {
  background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 6px;
  color: var(--color-text); padding: 4px 8px; font-size: 12px; font-family: inherit;
}
.form-row select:focus, .form-row input:focus { outline: none; border-color: var(--color-primary); }
.form-row textarea {
  background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 6px;
  color: var(--color-text); padding: 6px 8px; font-size: 12px; font-family: inherit;
  width: 100%; min-height: 40px; resize: vertical;
}
.form-row textarea:focus { outline: none; border-color: var(--color-primary); }
.form-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-save {
  padding: 4px 14px; border-radius: 6px; font-size: 12px; font-weight: 500;
  border: none; background: var(--color-primary); color: #fff; cursor: pointer;
  transition: opacity 0.15s;
}
.btn-save:hover { opacity: 0.85; }
.btn-remove {
  padding: 4px 14px; border-radius: 6px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--color-red); background: transparent; color: var(--color-red);
  cursor: pointer; transition: all 0.15s;
}
.btn-remove:hover { background: var(--color-red-dim); }
.action-detail { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-border); }
.action-detail h4 { margin: 0 0 8px 0; font-size: 0.8rem; color: var(--color-text-muted); font-weight: 600; }
.action-detail-row { display: flex; gap: 12px; font-size: 12px; margin-bottom: 4px; }
.action-detail-label { color: var(--color-text-muted); min-width: 80px; }
.action-detail-value { color: var(--color-text); }

/* AIO Timeline — dual track (AIO exists + You Cited) */
.aio-timeline { margin: 12px 0 4px 0; padding-top: 12px; border-top: 1px solid var(--color-border); }
.aio-timeline h4 { font-size: 0.8rem; color: var(--color-text-muted); font-weight: 600; margin-bottom: 6px; }
.timeline-wrapper { display: grid; grid-template-columns: 40px 1fr; row-gap: 4px; align-items: center; }
.timeline-row-label { font-size: 10px; color: var(--color-text-muted); font-weight: 600; text-align: right; padding-right: 8px; }
.timeline-track { display: flex; align-items: center; flex: 1; position: relative; }
.timeline-track.timeline-dates { margin-top: 2px; }
.timeline-point {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--color-border);
  position: relative; z-index: 1; flex-shrink: 0;
}
.timeline-point.cited { background: var(--color-green); border-color: var(--color-green); }
.timeline-point.not-cited { background: var(--color-red); border-color: var(--color-red); }
.timeline-point.has-aio { background: #60a5fa; border-color: #60a5fa; }
.timeline-point.no-aio { background: var(--color-surface-alt); border-color: var(--color-border); }
.timeline-point.unknown { background: var(--color-surface-alt); border-color: var(--color-border); }
.timeline-line { flex: 1; height: 2px; background: var(--color-border); min-width: 4px; }
.timeline-line.invisible { visibility: hidden; }
.timeline-label { font-size: 9px; color: var(--color-text-muted); text-align: center; }
.timeline-segment { display: flex; flex-direction: column; align-items: center; }

/* Export/Import bar */
.export-bar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.btn-export, .btn-import {
  padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--color-border); background: transparent;
  color: var(--color-text-muted); cursor: pointer; transition: all 0.15s;
}
.btn-export:hover, .btn-import:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .tabs { overflow-x: auto; flex-wrap: nowrap; gap: 0; }
  .tab { white-space: nowrap; flex-shrink: 0; }
  .data-table td, .data-table th { padding: 8px 12px; font-size: 12px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat-bar-label { width: 200px; }
}

/* === Feedback System === */
.feedback-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #c9303c);
  border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(230,57,70,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.feedback-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(230,57,70,0.5); }
.feedback-fab svg { width: 24px; height: 24px; fill: white; }
.feedback-fab .badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--color-blue); color: white;
  font-size: 11px; font-weight: 700; padding: 2px 6px;
  border-radius: 10px; min-width: 18px; text-align: center;
}

.feedback-panel {
  position: fixed; top: 0; right: -420px; z-index: 1001;
  width: 400px; height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
  transition: right 0.3s ease;
  display: flex; flex-direction: column;
}
.feedback-panel.open { right: 0; }
.feedback-panel-header {
  padding: 20px; border-bottom: 1px solid var(--color-border);
  display: flex; justify-content: space-between; align-items: center;
}
.feedback-panel-header h3 { font-size: 16px; font-weight: 600; }
.feedback-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--color-text-muted); font-size: 24px; line-height: 1;
}
.feedback-close:hover { color: var(--color-text); }

.feedback-form { padding: 20px; border-bottom: 1px solid var(--color-border); }
.feedback-form label { display: block; font-size: 12px; color: var(--color-text-muted); margin-bottom: 6px; font-weight: 500; }
.feedback-form select, .feedback-form input, .feedback-form textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--color-border); background: var(--color-surface-alt);
  color: var(--color-text); font-family: inherit; font-size: 13px;
  margin-bottom: 12px;
}
.feedback-form select:focus, .feedback-form input:focus, .feedback-form textarea:focus {
  outline: none; border-color: var(--color-primary);
}
.feedback-form textarea { min-height: 100px; resize: vertical; }
.feedback-submit {
  width: 100%; padding: 12px; border-radius: 8px; border: none;
  background: var(--color-primary); color: white;
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background 0.15s;
}
.feedback-submit:hover { background: #c9303c; }
.feedback-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.feedback-list { flex: 1; overflow-y: auto; padding: 16px; }
.feedback-item {
  background: var(--color-surface-alt); border-radius: 10px;
  padding: 14px; margin-bottom: 12px;
  border: 1px solid var(--color-border);
}
.feedback-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.feedback-item-tab {
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 4px; background: var(--color-primary-dim); color: var(--color-primary);
}
.feedback-item-meta { font-size: 11px; color: var(--color-text-muted); }
.feedback-item-message { font-size: 13px; line-height: 1.5; }
.feedback-item-status {
  display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 6px;
  border-radius: 4px; margin-top: 8px;
}
.feedback-item-status.open { background: var(--color-blue-dim); color: var(--color-blue); }
.feedback-item-status.resolved { background: var(--color-green-dim); color: var(--color-green); }
.feedback-item-status.noted { background: var(--color-purple-dim); color: var(--color-purple); }
.feedback-empty { text-align: center; color: var(--color-text-muted); padding: 40px 20px; }

.tab .feedback-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: white;
  font-size: 10px; font-weight: 700; padding: 1px 5px;
  border-radius: 8px; margin-left: 6px; min-width: 16px;
}

.feedback-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.feedback-overlay.open { opacity: 1; visibility: visible; }

/* === Track Suggestions Panel === */
.suggest-fab {
  position: fixed; bottom: 92px; right: 24px; z-index: 1000;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(249,115,22,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.suggest-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(249,115,22,0.5); }
.suggest-fab svg { width: 24px; height: 24px; fill: white; }
.suggest-fab .badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--color-primary); color: white;
  font-size: 11px; font-weight: 700; padding: 2px 6px;
  border-radius: 10px; min-width: 18px; text-align: center;
}
.suggest-panel {
  position: fixed; top: 0; right: -420px; z-index: 1001;
  width: 400px; height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
  transition: right 0.3s ease;
  display: flex; flex-direction: column;
}
.suggest-panel.open { right: 0; }
.suggest-panel-header {
  padding: 20px; border-bottom: 1px solid var(--color-border);
  display: flex; justify-content: space-between; align-items: center;
}
.suggest-panel-header h3 { font-size: 16px; font-weight: 600; }
.suggest-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--color-text-muted); font-size: 24px; line-height: 1;
}
.suggest-close:hover { color: var(--color-text); }
.suggest-filters {
  padding: 12px 20px; border-bottom: 1px solid var(--color-border);
  display: flex; gap: 6px; flex-wrap: wrap;
}
.suggest-chip {
  padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--color-border); background: transparent;
  color: var(--color-text-muted); cursor: pointer; transition: all 0.15s;
}
.suggest-chip.active { background: var(--color-orange); color: #fff; border-color: var(--color-orange); }
.suggest-chip:hover:not(.active) { border-color: var(--color-text-muted); }
.suggest-list { flex: 1; overflow-y: auto; padding: 12px 16px; }
.suggest-card {
  background: var(--color-surface-alt); border-radius: 10px;
  padding: 14px; margin-bottom: 10px;
  border: 1px solid var(--color-border); transition: border-color 0.15s;
}
.suggest-card:hover { border-color: var(--color-orange); }
.suggest-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.suggest-card-kw { font-size: 13px; font-weight: 600; color: var(--color-text); }
.suggest-card-source {
  font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px;
  white-space: nowrap;
}
.suggest-card-source.gap { background: var(--color-red-dim); color: var(--color-red); }
.suggest-card-source.cannibal { background: var(--color-orange); color: #fff; }
.suggest-card-source.quickwin { background: var(--color-blue-dim); color: var(--color-blue); }
.suggest-card-meta { font-size: 11px; color: var(--color-text-muted); margin-bottom: 6px; }
.suggest-card-reason { font-size: 11px; color: var(--color-text-muted); margin-bottom: 10px; line-height: 1.4; }
.suggest-card-actions { display: flex; gap: 6px; align-items: center; }
.suggest-card-actions select {
  flex: 1; padding: 6px 8px; border-radius: 6px; font-size: 11px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); font-family: inherit;
}
.suggest-track-btn {
  padding: 6px 14px; border-radius: 6px; border: none;
  background: var(--color-orange); color: #fff;
  font-size: 11px; font-weight: 600; cursor: pointer; transition: background 0.15s;
  white-space: nowrap;
}
.suggest-track-btn:hover { background: #ea580c; }
.suggest-empty { text-align: center; color: var(--color-text-muted); padding: 40px 20px; font-size: 13px; }
.suggest-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.suggest-overlay.open { opacity: 1; visibility: visible; }
