:root {
  --bg-main: #f3f6fb;
  --bg-elev: #ffffff;
  --bg-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ee;
  --line-strong: #c7d3e2;
  --accent: #1d4ed8;
  --accent-strong: #1e40af;
  --good: #15803d;
  --bad: #b91c1c;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg-main);
  min-height: 100vh;
}

.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% -10%, #dbeafe, transparent 35%),
    radial-gradient(circle at 95% 0%, #e2e8f0, transparent 40%),
    linear-gradient(180deg, #f8fbff 0%, #f3f6fb 65%, #eef2f7 100%);
  z-index: -1;
}

.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 16px 12px 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
  font-weight: 700;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.btn-primary,
.btn-light {
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #1d4ed8, #1e40af);
}

.btn-light {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
}

.btn-light:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.card {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 10px;
  padding: 9px;
  box-shadow: var(--shadow);
}

.summary {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.summary h3 {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.big {
  margin: 4px 0 1px;
  font-size: 1.1rem;
  font-weight: 700;
}

.small {
  margin: 6px 0 1px;
  font-size: 0.8rem;
}

h2 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 6px 6px;
  font-size: 0.82rem;
  white-space: nowrap;
}

th {
  color: #475569;
  font-weight: 700;
  background: #f8fafc;
}

tbody tr:nth-child(even) {
  background: #fbfdff;
}

tbody tr:hover {
  background: #eff6ff;
}

.holding-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}

.holding-form input,
.watchlist-form input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  font-size: 0.82rem;
  color: var(--text);
}

.holding-form input:focus,
.watchlist-form input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.watchlist-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-bottom: 6px;
}

.btn-link,
.btn-danger {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-link {
  color: var(--accent);
  margin-right: 8px;
}

.btn-link:hover {
  color: var(--accent-strong);
}

.btn-danger {
  color: var(--bad);
}

.btn-danger:hover {
  color: #991b1b;
}

.hidden {
  display: none;
}


.chart-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chart-card h2 {
  margin-bottom: 7px;
}

.mini-chart {
  display: grid;
  gap: 7px;
}

.chart-row {
  display: grid;
  gap: 4px;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.79rem;
  color: #334155;
  font-weight: 600;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: #e7eef7;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.bar-fill.alloc {
  background: linear-gradient(90deg, #1d4ed8, #60a5fa);
}

.bar-fill.pos {
  background: linear-gradient(90deg, #15803d, #4ade80);
}

.bar-fill.neg {
  background: linear-gradient(90deg, #b91c1c, #f97316);
}

.manager-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eff6ff;
  font-size: 0.79rem;
  font-weight: 600;
  color: #1e3a8a;
}

.chip button {
  border: 0;
  background: transparent;
  color: var(--bad);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0;
}

.events-section {
  margin-top: 8px;
}

.events-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.events-topbar h2 {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #334155;
}

.events-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.events-grid .card {
  padding: 7px;
}

.events-grid .card h2 {
  margin: 0 0 4px;
  font-size: 0.86rem;
}

.range {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.event-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.event-item {
  border: 1px solid var(--line);
  border-left: 3px solid #94a3b8;
  border-radius: 7px;
  padding: 4px 6px;
  background: var(--bg-soft);
  line-height: 1.25;
}

.event-item strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
}

.event-item .meta {
  margin-top: 1px;
}

.meta {
  color: var(--muted);
  font-size: 0.74rem;
}

.pos {
  color: var(--good);
}

.neg {
  color: var(--bad);
}

@media (max-width: 900px) {
  .summary-grid,
  .chart-grid,
  .manager-grid,
  .events-grid {
    grid-template-columns: 1fr;
  }

  .holding-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .events-topbar {
    gap: 6px;
    flex-direction: column;
    align-items: flex-start;
  }
}
