/* Meeting Brief Tool — стили */

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

:root {
  --red: #0066FF;
  --red-dark: #0052CC;
  --navy: #0A0E27;
  --navy-light: #14193A;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --border: #E4E7EF;
  --text: #1A1F2C;
  --muted: #6B7585;
  --green: #1A7A45;
  --amber: #B26B00;
  --blue: #0066FF;
  --cyan: #00CCFF;
  --pink: #FF6699;
  --grad: linear-gradient(90deg, #0066FF, #00CCFF, #FF6699);
  --grad-135: linear-gradient(135deg, #0066FF, #00CCFF, #FF6699);
}

/* brand stripe under topbar */
.topbar { position: relative; }
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--grad);
}

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

/* ---------- layout ---------- */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.topbar {
  background: var(--navy);
  color: #fff;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-logo { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.topbar-logo span {
  background: var(--grad); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.topbar-sub { font-size: 12px; color: rgba(255,255,255,0.55); }
.topbar-badge { margin-left: auto; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 20px; padding: 3px 12px; font-size: 12px; color: rgba(255,255,255,0.7); }

.main { display: flex; flex: 1; overflow: hidden; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-search {
  padding: 12px;
  flex-shrink: 0;
}
.sidebar-search input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.sidebar-search input::placeholder { color: rgba(255,255,255,0.35); }
.sidebar-search input:focus { border-color: rgba(255,255,255,0.3); }

.sectors-wrap { padding: 0 12px 10px; flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.sector-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.sector-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.sector-btn.active { background: var(--red); border-color: var(--red); color: #fff; }

.company-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.company-list::-webkit-scrollbar { width: 4px; }
.company-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.company-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  border: 1px solid transparent;
}
.company-item:hover { background: rgba(255,255,255,0.06); }
.company-item.active { background: rgba(200,16,46,0.18); border-color: rgba(200,16,46,0.4); }

.company-emoji { font-size: 22px; flex-shrink: 0; }
.company-item-info { flex: 1; min-width: 0; }
.company-item-name { font-weight: 600; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-item-sector { font-size: 11px; color: rgba(255,255,255,0.45); }
.company-item-rev { font-size: 11px; color: rgba(255,255,255,0.5); white-space: nowrap; flex-shrink: 0; }

.empty-state { color: rgba(255,255,255,0.3); font-size: 13px; text-align: center; padding: 32px 16px; }

/* ---------- detail ---------- */
#detail {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}
#detail::-webkit-scrollbar { width: 6px; }
#detail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.back-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  margin-bottom: 12px;
}
.back-btn:hover { background: var(--surface); color: var(--text); }

/* detail header */
.detail-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 24px 28px 0;
}
.detail-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.detail-emoji { font-size: 36px; }
.detail-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.detail-sector { font-size: 13px; color: var(--muted); margin-top: 2px; }
.detail-desc { font-size: 14px; color: #444; line-height: 1.6; margin-bottom: 20px; max-width: 720px; }

.metrics-row { display: flex; gap: 12px; flex-wrap: wrap; padding-bottom: 20px; }
.metric { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; min-width: 130px; }
.metric-val { font-size: 22px; font-weight: 700; color: var(--navy); }
.metric-val span { font-size: 13px; font-weight: 400; color: var(--muted); }
.metric-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.metric-warn .metric-val { color: var(--red); }
.yoy { font-size: 11px; font-weight: 600; color: var(--green); background: #E8F5EE; border-radius: 4px; padding: 0 5px; margin-left: 4px; }

/* tabs */
.tabs { display: flex; gap: 0; border-top: 1px solid var(--border); background: var(--surface); padding: 0 28px; }
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--red); border-bottom-color: var(--red); }

.tab-panel { display: none; padding: 24px 28px; }
.tab-panel.active { display: block; }

/* section blocks */
.section-block { margin-bottom: 24px; }
.section-block h3 { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { color: var(--muted); font-weight: 500; width: 160px; white-space: nowrap; }
.data-table tr:last-child th, .data-table tr:last-child td { border-bottom: none; }

.bullet-list { padding-left: 18px; }
.bullet-list li { margin-bottom: 6px; font-size: 13px; color: #3A3A4A; }

.numbered-list { padding-left: 20px; }
.numbered-list li { margin-bottom: 8px; font-size: 13px; color: #3A3A4A; line-height: 1.5; }

/* news */
.news-item { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; background: var(--surface); }
.news-date { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; }
.news-headline { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.news-impl { font-size: 12px; color: #555; background: #FFF9E5; border-left: 3px solid var(--amber); padding: 6px 10px; border-radius: 0 6px 6px 0; }

/* strategies */
.strategy-item { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; }
.strategy-num { width: 26px; height: 26px; background: var(--navy); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.strategy-dir { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.strategy-ev { font-size: 12px; color: var(--muted); }

/* ideas */
.profile-badge { display: inline-block; background: #EFF3FE; border: 1px solid #C5D0F5; color: var(--blue); border-radius: 20px; padding: 4px 14px; font-size: 12px; font-weight: 500; margin-bottom: 16px; }

.idea-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; border-left: 3px solid var(--red); transition: box-shadow 0.15s; }
.idea-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.idea-num { font-size: 11px; color: var(--red); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.idea-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.idea-row { font-size: 13px; color: #444; margin-bottom: 5px; line-height: 1.5; }
.idea-lbl { font-weight: 600; color: var(--muted); }
.idea-lbl.first-step { color: var(--green); }

/* scenario */
.ask-block { background: var(--navy); color: #fff; border-radius: 12px; padding: 18px 20px; margin-bottom: 20px; }
.ask-label { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.ask-text { font-size: 15px; font-weight: 600; line-height: 1.5; }

/* ---------- mobile ---------- */
@media (max-width: 768px) {
  .sidebar { width: 100%; display: flex; }
  .main { flex-direction: column; }
  #detail { position: fixed; inset: 52px 0 0; transform: translateX(100%); transition: transform 0.25s ease; z-index: 10; }
  #detail.visible { transform: translateX(0); }
  .back-btn { display: block; }
  .topbar-sub { display: none; }
  .detail-header { padding: 16px 16px 0; }
  .tab-panel { padding: 16px; }
  .detail-hero h1 { font-size: 20px; }
}

/* ---------- tab PDF button ---------- */
.tab-pdf {
  background: var(--red) !important;
  color: #fff !important;
  border-radius: 6px !important;
  margin: 6px 0 !important;
  padding: 4px 14px !important;
  border-bottom: none !important;
  font-size: 12px !important;
}
.tab-pdf:hover { background: var(--red-dark) !important; }

/* ---------- full brief doc ---------- */
.brief-doc { max-width: 780px; margin: 0 auto; padding: 0 0 40px; }

.brief-pdf-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #FFFBEA; border: 1px solid #F5D76E; border-radius: 10px;
  padding: 10px 16px; margin: 16px 0; font-size: 13px; color: #7A5900;
}
.pdf-btn {
  background: var(--red); color: #fff; border: none;
  border-radius: 8px; padding: 7px 18px; font-size: 13px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.pdf-btn:hover { background: var(--red-dark); }

.brief-page { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 40px 44px; }

.brief-letterhead {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 20px; border-bottom: 2px solid var(--red); margin-bottom: 24px;
}
.brief-logo { font-size: 20px; font-weight: 800; color: var(--navy); }
.brief-logo span {
  background: var(--grad); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.brief-logo-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.brief-letterhead-right { text-align: right; font-size: 13px; color: var(--muted); line-height: 1.7; }

.brief-title-block { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.brief-company-emoji { font-size: 40px; }
.brief-title { font-size: 28px; font-weight: 800; color: var(--navy); letter-spacing: -0.5px; }
.brief-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

.brief-desc { font-size: 14px; color: #444; line-height: 1.65; margin-bottom: 16px; }

.brief-incumbent {
  background: #EEF5FF; border-left: 3px solid var(--red);
  padding: 10px 14px; border-radius: 0 8px 8px 0;
  font-size: 13px; margin-bottom: 24px;
}

.brief-section { margin-bottom: 28px; }
.brief-section h2 {
  font-size: 13px; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.brief-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.brief-table th { background: #F5F6F8; font-weight: 600; color: var(--muted); padding: 7px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.brief-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); }
.brief-table tr:last-child td { border-bottom: none; }

.brief-news { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.brief-news:last-child { border-bottom: none; }
.brief-news-date { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; margin-bottom: 3px; }
.brief-news-head { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.brief-news-impl { font-size: 12px; color: #666; background: #FFFBEA; padding: 4px 8px; border-radius: 4px; }

.brief-strategy { margin-bottom: 10px; font-size: 13px; line-height: 1.5; }

.brief-idea { background: #F8F9FB; border-left: 3px solid var(--red); border-radius: 0 8px 8px 0; padding: 12px 14px; margin-bottom: 10px; font-size: 13px; }
.brief-idea-num { font-size: 10px; color: var(--red); font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
.brief-idea-title { font-weight: 700; margin-bottom: 6px; }
.brief-lbl { font-weight: 600; color: var(--muted); }
.brief-lbl.green { color: var(--green); }

.brief-ul, .brief-ol { padding-left: 18px; }
.brief-ul li, .brief-ol li { font-size: 13px; margin-bottom: 5px; }

.brief-profile-note { background: #EFF3FE; border-radius: 6px; padding: 6px 12px; font-size: 12px; color: var(--blue); margin-bottom: 12px; }

.brief-ask {
  background: var(--navy); color: #fff; border-radius: 10px;
  padding: 18px 20px; margin-bottom: 28px;
}
.brief-ask-label { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px; }
.brief-ask-text { font-size: 15px; font-weight: 600; line-height: 1.5; }

.brief-footer { font-size: 11px; color: var(--muted); text-align: center; padding-top: 20px; border-top: 1px solid var(--border); }
.brief-muted { color: var(--muted); font-size: 13px; }

/* ---------- print ---------- */
@media print {
  /* скрываем всё UI, оставляем только brief-page */
  .topbar, .sidebar, .back-btn, .detail-header, .tabs,
  .tab-panel:not(#tab-brief), .brief-pdf-bar, .no-print { display: none !important; }

  #tab-brief { display: block !important; padding: 0 !important; }
  .brief-doc { max-width: 100%; padding: 0; }
  #detail { position: static !important; transform: none !important; overflow: visible !important; }
  .app { display: block; height: auto; overflow: visible; }
  .main { display: block; overflow: visible; }

  .brief-page {
    border: none !important; border-radius: 0 !important;
    padding: 20px 24px !important; box-shadow: none !important;
  }
  .brief-idea { break-inside: avoid; }
  .brief-section { break-inside: avoid; }
  @page { margin: 15mm 15mm; size: A4; }
}
