:root {
  --primary: #4CAF50;
  --danger: #f44336;
  --warning: #ff9800;
  --text: #333;
  --border: #ddd;
  --bg-light: #f8f9fa;
}

/* === Reset and base === */
* {
  box-sizing: border-box;
}
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 10px;
  color: var(--text);
  max-width: 100%;
  line-height: 1.6;
  font-size: 14px;
}
h1 {
  font-size: 1.5rem;
  margin: 10px 0;
}
h2 {
  font-size: 1.2rem;
}

/* === Reusable card === */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 15px;
  margin-bottom: 15px;
  width: 100%;
}

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}
th, td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background-color: var(--bg-light);
  font-weight: 600;
}
@media (max-width: 600px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* === Forms === */
.form-group {
  margin-bottom: 10px;
}
label {
  display: block;
  margin-bottom: 3px;
  font-weight: 500;
  font-size: 13px;
}
input, select, button {
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
}
input, select {
  border: 1px solid var(--border);
}
button {
  background-color: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 4px;
  width: auto; /* ✅ Allow to shrink to content */
  display: inline-block;
  margin-top: 5px;
}

/* === Utility classes === */
.up { color: var(--primary); }
.down { color: var(--danger); }
.neutral { color: var(--warning); }
.no-data {
  text-align: center;
  padding: 15px;
  color: #666;
  font-style: italic;
  font-size: 13px;
}
.total-row {
  font-weight: bold;
  background-color: var(--bg-light);
}
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: bold;
}
.badge.up { background: #e8f5e9; color: #2e7d32; }
.badge.down { background: #ffebee; color: #c62828; }
.badge.neutral { background: #fff8e1; color: #f57f17; }

/* === Header nav === */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-light);
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.nav-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.2s;
}
.main-nav a:hover {
  background-color: #e0f2f1;
  color: #2e7d32;
}
.main-nav a.active {
  background-color: var(--primary);
  color: white;
}

/* === Button containers === */
.button-group,
#quickFilters,
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chart-container {
  width: 100%;
  max-width: 98%;
  height: 280px;
  margin: 20px;
  padding: 0;
}

@media (min-width: 768px) {
  .chart-container {
    max-width: 96%;
    height: 500px;
  }
}

@media (min-width: 1440px) {
  .chart-container {
    max-width: 60%; /* ✅ wide enough for 1920px screen */
    height: 640px;     /* ✅ taller for better visibility */
  }
}

@media (min-width: 1920px) {
  .chart-container {
    max-width: 55%;
    height: 660px;
  }
}

.filters {
  margin: 15px 0;
}
.filters label {
  margin-right: 5px;
  font-weight: bold;
}

.asset-item {
  padding: 5px 0;
  font-size: 14px;
}
.asset-list {
  border-left: 2px solid #ddd;
  margin-bottom: 10px;
  padding-left: 10px;
}
