* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0f1115;
  color: #eaeaea;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #161a22;
  border-bottom: 1px solid #222;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.controls input,
.controls button {
  padding: 6px 10px;
  font-size: 14px;
}

.container {
  padding: 20px;
  max-width: 1200px;
  margin: auto;
}

.card {
  background: #161a22;
  border: 1px solid #222;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi {
  background: #0f1115;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.kpi h3 {
  margin: 0;
  font-size: 13px;
  color: #aaa;
}

.kpi p {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: bold;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid #222;
  text-align: center;
}

th {
  background: #0f1115;
  font-size: 13px;
  color: #aaa;
}

.status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status.healthy { background: #052e16; color: #4cff9d; }
.status.warning { background: #3a2f0b; color: #facc15; }
.status.danger  { background: #3a0b0b; color: #f87171; }

nav a.active {
  color: #4cff9d;
  font-weight: bold;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;

  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
}

.filter-item select,
.filter-item input[type="date"] {
  height: 36px;
  padding: 0 12px;

  background: #0f172a;
  color: #e5e7eb;

  border: 1px solid #1f2937;
  border-radius: 8px;

  font-size: 13px;
}

.filter-item select:focus,
.filter-item input[type="date"]:focus {
  outline: none;
  border-color: #4cff9d;
}

/* Primary button */
.btn-primary {
  height: 36px;
  padding: 0 16px;

  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #052e16;

  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(1.1);
}
/* =========================
   MODAL
========================= */

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.modal-card {
  position: relative;
  width: 360px;
  margin: 15vh auto;
  padding: 20px;

  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 12px;
}

.modal-card h3 {
  margin-bottom: 12px;
}

.modal-card input {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;

  background: #020617;
  color: #e5e7eb;

  border: 1px solid #1f2937;
  border-radius: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  padding: 8px 14px;
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #1f2937;
  border-radius: 8px;
  cursor: pointer;
}
.date-shortcuts {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.date-shortcuts button {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  background: #020617;
  color: #e5e7eb;
  border: 1px solid #1f2937;
  cursor: pointer;
  margin-top: 8px;
}

.date-shortcuts button:hover {
  background: #111827;
}

.date-shortcuts button.active {
  background: #16a34a;
  border-color: #16a34a;
  color: #022c22;
}

input[type="date"] {
  background-color: #0f172a;        /* dark but distinct */
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  height: 38px;
}

input[type="date"]:hover {
  border-color: #22c55e;
}

input[type="date"]:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

/* Chrome / Edge / Brave */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.9;
  cursor: pointer;
}

/* Hover effect */
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
/* components.css */
.btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn + .btn {
  margin-left: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #121826;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
}

.kpi-label {
  opacity: 0.7;
  margin-top: 4px;
}

.kpi-card.positive { color: #22c55e; }
.kpi-card.negative { color: #ef4444; }
.kpi-card.neutral  { color: #e5e7eb; }
.kpi-card.healthy  { color: #38bdf8; }

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.insight-card {
  background: #121826;
  padding: 14px;
  border-radius: 10px;
}
