:root {
  --bg1: #071a2c;
  --bg2: #123a5a;
  --panel: #173a59;
  --panel2: #102e49;
  --border: #4f7da4;
  --accent: #38bdf8;
  --green: #22c55e;
  --red: #fb7185;
  --amber: #facc15;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --shadow: 0 14px 32px rgba(0,0,0,0.28);
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  color: var(--text);
}

header {
  padding: 26px 42px;
  background: linear-gradient(135deg, #0b2b47, #14527a);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

h1 {
  margin: 0;
  color: var(--accent);
  font-size: 32px;
}

.sub {
  color: var(--muted);
  margin-top: 8px;
  font-size: 14px;
}

.container {
  padding: 30px 40px 45px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 420px repeat(3, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.action-card {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  min-height: 318px;
  box-shadow: var(--shadow);
}

.metric-column {
  display: grid;
  grid-template-rows: 1fr 1fr;
  min-height: 318px;
}

.metric-card {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  padding: 18px 20px;
  min-height: 159px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-card.top {
  border-radius: 18px 18px 0 0;
  border-bottom: 0;
}

.metric-card.bottom {
  border-radius: 0 0 18px 18px;
}
.metric-label {
  color: #e0f2fe;
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 12px;
}

.metric-value {
  color: #ffffff;
  font-size: 28px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.green {
  color: var(--green);
}

.red {
  color: var(--red);
}

button {
  background: #0ea5e9;
  color: white;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 14px;
  font-size: 15px;
}

button:hover {
  background: #0284c7;
}

.status {
  color: var(--amber);
  font-weight: 800;
  font-size: 17px;
  line-height: 1.35;
  margin-top: 12px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.chart-card {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  min-height: 330px;
}

.chart-card h2 {
  margin: 0 0 14px 0;
  color: #e0f2fe;
  font-size: 18px;
}

.chart-wrap {
  height: 255px;
  position: relative;
}
.table-card {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.table-card h2 {
  margin-top: 0;
  color: #e0f2fe;
}

.table-wrap {
  overflow-x: auto;
  max-height: 650px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #102e49;
  color: var(--text);
  font-size: 13px;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid #365b7a;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

th {
  background: #071a2c;
  color: #bae6fd;
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
}

td.num, th.num {
  text-align: right;
}

@media (max-width: 1100px) {
  .dashboard-grid,
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .metric-column {
    min-height: unset;
  }
}

/* COMPACT IBKR TOP BLOCKS */
header {
  padding: 18px 34px !important;
}

h1 {
  font-size: 30px !important;
}

.sub {
  margin-top: 5px !important;
  font-size: 13px !important;
}

.container {
  padding: 22px 34px 36px !important;
}

.dashboard-grid {
  grid-template-columns: 360px repeat(3, minmax(210px, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 18px !important;
}

.action-card {
  min-height: 190px !important;
  padding: 18px !important;
  border-radius: 16px !important;
}

.metric-column {
  min-height: 190px !important;
}

.metric-card {
  min-height: 95px !important;
  padding: 12px 16px !important;
}

.metric-label {
  font-size: 14px !important;
  margin-bottom: 8px !important;
}

.metric-value {
  font-size: 24px !important;
  line-height: 1.1 !important;
}

button {
  padding: 10px 14px !important;
  font-size: 13px !important;
  margin-bottom: 10px !important;
}

.status {
  font-size: 14px !important;
  margin-top: 8px !important;
}

.action-card div[style] {
  margin-top: 10px !important;
  font-size: 12px !important;
}

.charts-grid {
  gap: 14px !important;
  margin-bottom: 18px !important;
}

.chart-card {
  min-height: 280px !important;
  padding: 16px !important;
}

.chart-card h2 {
  font-size: 16px !important;
  margin-bottom: 10px !important;
}

.chart-wrap {
  height: 220px !important;
}

.table-card {
  padding: 16px !important;
}

.table-card h2 {
  font-size: 20px !important;
}
