
:root { --bg:#0f172a; --panel:#111827; --muted:#9ca3af; --fg:#e5e7eb; --accent:#22d3ee; --border:#1f2937; }
:root.light { --bg:#f6f7fb; --panel:#ffffff; --muted:#6b7280; --fg:#0b1220; --accent:#2563eb; --border:#e5e7eb; }
* { box-sizing: border-box; }
html, body { height:100%; }
body { margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial;
  background:var(--bg); color:var(--fg); transition: background .2s ease, color .2s ease; }
a { color: var(--accent); text-decoration: none; }
.container { max-width: 1080px; margin: 24px auto; padding: 0 16px; }
.card { background: var(--panel); border-radius: 14px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.12); border:1px solid var(--border); }
.header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:8px; flex-wrap: wrap; }
.header .flex a { padding:8px 10px; border-radius: 10px; background: transparent; }
.header .flex a:hover { background: rgba(0,0,0,0.1); }
input, select, textarea { width:100%; padding:10px; border-radius:10px; border:1px solid var(--border); background:transparent; color:var(--fg); }
button, .btn { background:#1f2937; color:var(--fg); border:none; border-radius:10px; padding:10px 14px; cursor:pointer;}
.btn-primary { background:var(--accent); }
.grid { display:grid; gap:12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.table { width:100%; border-collapse: collapse; }
.table th, .table td { border-bottom:1px solid var(--border); padding:8px; text-align:left; }
.badge { padding:4px 8px; border-radius:999px; font-size:12px; background:#1f2937; color:#fff; }
.right { text-align:right; }
small.muted { color: var(--muted); }

.table-responsive { overflow-x:auto; }
.theme-toggle { display:inline-flex; align-items:center; gap:8px; }
.theme-toggle button { background: transparent; border:1px solid var(--border); padding:8px 10px; border-radius: 10px; }

@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .header { gap:6px; }
}

/* Chart container fixes the height so Chart.js doesn't loop-resize */
.chart-box {
  position: relative;
  height: 300px;   /* adjust as you like */
  width: 100%;
}

/* Make canvas block-level to avoid extra baseline space */
.chart-box canvas, .card canvas {
  display: block;
}

/* Smaller height on mobile if you want */
@media (max-width: 720px) {
  .chart-box { height: 240px; }
}
