/* IB 报表两页 · 精修皮肤（IB数据业绩概览 / 客户交易账号数据总览）
   两页共用 .ib-report-page 外壳，但表格区各用一套 class：
   业绩概览走共享的 admin-ib-reports.css（.ib-report-*，另有三张后台报表也在用，不能改那份），
   账号总览走自己的 ib-trading-account-data-overview.css（.ib-account-overview-*）。
   所以这份皮肤分成「两页共用」和「各自命名空间」两段，link 放在所有样式表最后。
   两页都支持深色主题（admin-ib-reports.css 里有 60+ 条 dark 分支），
   因此这里一律不写死颜色，只改字号 / 字重 / 间距 / 控件高度。 */

/* ---------- 两页共用：外壳 ---------- */

body:is([data-layout-page="ib-data-performance-overview-report"], [data-layout-page="ib-trading-account-data-overview"]) .ib-report-page {
  padding: clamp(18px, 2vw, 28px) clamp(16px, 2.2vw, 34px) 56px;
}

/* ---------- IB数据业绩概览（.ib-report-*） ---------- */

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-heading {
  gap: 16px;
  margin-bottom: 12px;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-heading h1 {
  font-size: 23px;
  line-height: 1.28;
  font-weight: 750;
  letter-spacing: -0.01em;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-heading p {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 450;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-filter-card {
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table-card {
  border-radius: 10px;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-filter-grid {
  gap: 10px;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-field > span:first-child {
  margin-bottom: 5px;
  font-size: 11.5px;
  font-weight: 600;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-field input,
body[data-layout-page="ib-data-performance-overview-report"] .ib-report-field select,
body[data-layout-page="ib-data-performance-overview-report"] .ib-report-date-range,
body[data-layout-page="ib-data-performance-overview-report"] .ib-report-combobox {
  height: 34px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-field input,
body[data-layout-page="ib-data-performance-overview-report"] .ib-report-field select {
  padding: 0 10px;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-date-range input {
  font-size: 12.5px;
  font-weight: 500;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-button,
body[data-layout-page="ib-data-performance-overview-report"] .ib-report-filter-actions .ib-report-button {
  min-height: 34px;
  height: 34px;
  gap: 6px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 650;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-button.icon-only {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-toolbar {
  min-height: 48px;
  gap: 12px;
  padding: 10px 14px;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-toolbar-left,
body[data-layout-page="ib-data-performance-overview-report"] .ib-report-toolbar-right {
  gap: 8px;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-segmented {
  min-height: 30px;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-segmented button {
  min-width: 58px;
  height: 28px;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 650;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table th,
body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table td {
  padding: 0 11px;
  font-size: 12.5px;
  font-weight: 500;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table td {
  height: 60px;
  padding: 10px 11px;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table th {
  height: 34px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

/* 固定代理信息列；独立边框避免 sticky 单元格滚动时丢失分隔线。 */
body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table-wrap {
  isolation: isolate;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table {
  border-collapse: separate;
  border-spacing: 0;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table-wrap .ib-report-table thead th {
  background: var(--surface-muted);
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table-wrap .ib-report-table tbody td {
  background: var(--surface-raised);
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table :is(th, td):first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow:
    1px 0 0 var(--border),
    8px 0 12px -8px color-mix(in srgb, var(--border) 60%, transparent);
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table thead th:first-child {
  z-index: 3;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table-wrap .ib-report-table tbody tr:hover td {
  background: var(--surface-hover);
}

/* 选中底色叠在实色表面上，深色主题也不会透出后面的滚动内容。 */
body[data-layout-page="ib-data-performance-overview-report"] .ib-report-table-wrap .ib-report-table tbody tr:is(.is-selected, .is-expanded, .is-active) td {
  background:
    linear-gradient(var(--surface-selected), var(--surface-selected)),
    var(--surface-raised);
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-agent-cell {
  gap: 5px;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-money,
body[data-layout-page="ib-data-performance-overview-report"] .ib-report-link {
  font-weight: 600;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-footer {
  gap: 12px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 500;
}

body[data-layout-page="ib-data-performance-overview-report"] .ib-report-pager button {
  height: 28px;
  font-size: 12px;
  font-weight: 600;
}

/* 表格下限不在这份皮肤里：共享文件写的是 min-width: var(--ib-table-min, 2440px)，
   而这个变量由控制器 ib-data-performance-overview.js 以行内 style 写在 .ib-report-shell 上，
   行内样式压过任何表里的规则。硬用 min-width 盖过去会让变量和实际值对不上，
   所以直接改控制器里那个字面量（2290px → 1800px），变量仍是唯一出处。
   数值是逐档实测的：单元格收紧后 1650px 起 17 列就都不截字，留到 1800px 兜更长的代理名。 */

/* ---------- 客户交易账号数据总览（.ib-account-overview-*） ---------- */

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-heading {
  gap: 16px;
  margin-bottom: 24px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-heading h1 {
  font-size: 23px;
  line-height: 1.28;
  font-weight: 750;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-heading p {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 450;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-filter {
  margin-bottom: 24px;
  padding: 22px 24px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-filter-grid {
  gap: 20px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-field {
  gap: 8px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-field > span {
  font-size: 12px;
  font-weight: 600;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-field input,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-field select,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-date-range {
  height: 44px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-field input,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-field select {
  padding: 0 12px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 4px;
  padding: 0 8px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-date-range input {
  height: 100%;
  padding: 0 4px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-date-range > i {
  display: none;
}

@media (min-width: 1181px) {
  body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(290px, 1.2fr);
  }
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-filter-actions {
  margin-top: 22px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-filter-hint {
  gap: 6px;
  font-size: 11.5px;
  font-weight: 450;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-button {
  height: 40px;
  gap: 6px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-toolbar {
  min-height: 68px;
  gap: 16px;
  padding: 14px 20px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-toolbar-title strong {
  font-size: 15px;
  font-weight: 700;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-toolbar-title span {
  font-size: 11.5px;
  font-weight: 450;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-table th,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-table td {
  height: 60px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-table th {
  height: 44px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-identity strong,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-server strong,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-account strong,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-stack strong {
  font-size: 13px;
  font-weight: 650;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-identity small,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-server small,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-account small,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-stack small {
  font-size: 11.5px;
  font-weight: 450;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-identity,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-server,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-account,
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-stack {
  gap: 4px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-pill {
  min-height: 18px;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 700;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-link {
  padding: 4px 0;
  font-size: 12.5px;
  font-weight: 650;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-empty {
  padding: 36px 16px;
  font-size: 13px;
  font-weight: 550;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-footer {
  gap: 16px;
  padding: 16px 20px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-footer-summary {
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-footer-summary label {
  height: 34px;
  padding: 0 3px 0 8px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-footer-summary select {
  height: 30px;
  font-size: 12px;
  font-weight: 600;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-pager button {
  min-width: 34px;
  height: 34px;
  font-size: 12px;
  font-weight: 600;
}

/* 给双行身份信息和数值列留出内边距，更多指标在表格内横向滚动。 */
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-table {
  min-width: 3180px;
}

body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-table th:nth-child(3),
body[data-layout-page="ib-trading-account-data-overview"] .ib-account-overview-table td:nth-child(3) {
  min-width: 128px;
}
