/* ============================================================
   Blog Report Tab Styles — blog-report-styles.css
   myispp.com / 36.9 Degree
   Date: 2026-10-23
   ============================================================
   Add to styles-v2.css (append at end) or load separately.
   Follows existing design tokens: --accent, --border, --bg,
   --fg/--ink, --muted, --card, --shadow, --radius
   ============================================================ */

/* ── Month Navigation ── */
.br-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 12px 0;
}
.br-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card, #fff);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, background .15s;
}
.br-nav-btn:hover {
  border-color: var(--accent);
  background: #eef5fd;
}
.br-nav-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.br-month-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  min-width: 120px;
  text-align: center;
}

/* ── Section Tabs (inside Blog Report) ── */
.br-section-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.br-sec-tab {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.br-sec-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.br-sec-tab:hover:not(.active) {
  color: var(--ink);
}

/* ── Section Content Area ── */
.br-section-content {
  min-height: 200px;
}

/* ── KPI Grid ── */
.br-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.br-kpi {
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
}
.br-kpi-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.br-kpi-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
}
.br-kpi-trend {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 600;
}
.br-kpi-trend.up {
  color: var(--green, #197a52);
}
.br-kpi-trend.down {
  color: var(--red, #e6463a);
}
.br-kpi-trend.flat {
  color: var(--muted);
}

/* ── Card ── */
.br-card {
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}
.br-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}

/* ── Table ── */
.br-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.br-table thead th {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.br-table tbody td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}
.br-table tbody tr:last-child td {
  border-bottom: none;
}
.br-table tbody tr:hover {
  background: var(--bg, #f4f7fa);
}

/* ── Tag ── */
.br-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #eef5fd;
  color: var(--accent);
  white-space: nowrap;
}

/* ── NEW badge ── */
.br-new-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: #fef3c7;
  color: #92400e;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── Bar Chart (pure CSS) ── */
.br-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  padding: 0 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.br-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 28px;
  height: 100%;
  justify-content: flex-end;
}
.br-chart-bar {
  width: 100%;
  max-width: 32px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height .3s ease;
  position: relative;
}
.br-chart-bar:hover {
  opacity: .85;
}
.br-chart-val {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
  white-space: nowrap;
}
.br-chart-label {
  font-size: 9px;
  color: var(--muted);
  margin-top: 5px;
  white-space: nowrap;
  text-align: center;
  transform: rotate(-35deg);
  transform-origin: top center;
}

/* ── Comments ── */
.br-comments {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.br-comments-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}
.br-comment {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--card, #fff);
}
.br-comment-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.br-comment-meta .br-comment-section {
  font-weight: 600;
  color: var(--accent);
  background: #eef5fd;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
}
.br-comment-text {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Comment form */
.br-comment-form {
  margin-top: 14px;
}
.br-comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  min-height: 72px;
  line-height: 1.6;
  transition: border-color .15s;
}
.br-comment-form textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(22,136,216,.1);
}
.br-comment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.br-comment-submit {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.br-comment-submit:hover:not(:disabled) {
  opacity: .9;
}
.br-comment-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .br-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .br-kpi {
    padding: 12px 10px;
  }
  .br-kpi-val {
    font-size: 20px;
  }
  .br-sec-tab {
    padding: 9px 10px;
    font-size: 11px;
  }
  .br-month-label {
    font-size: 15px;
  }
  .br-chart {
    height: 110px;
  }
  .br-chart-label {
    font-size: 8px;
  }
  .br-table {
    font-size: 12px;
  }
  .br-table thead th,
  .br-table tbody td {
    padding: 6px;
  }
}

/* ── Print / PDF export ── */
@media print {
  .br-month-nav .br-nav-btn,
  .br-comment-form,
  .br-section-tabs,
  .sd-tab-bar,
  [onclick*="blogReportPrint"] {
    display: none !important;
  }
  .br-section-content {
    page-break-inside: avoid;
  }
  .br-card {
    break-inside: avoid;
  }
}
