:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1f2937;
  --primary: #2563eb;
  --success: #10b981;
  --border: #e5e7eb;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f8fafc;
  --border: #334155;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: 0.3s;
}

/* HEADER (תיקון חשוב) */
header {
  background: var(--card);
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* NAV */
nav {
  display: flex;
  gap: 10px;
  padding: 15px;
  max-width: 1200px;
  margin: auto;
  flex-wrap: wrap;
}

nav button {
  padding: 10px 15px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
}

nav button:hover {
  background: var(--primary);
  color: white;
}

/* CARDS */
.card {
  background: var(--card);
  padding: 20px;
  margin: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* INPUTS */
input, select {
  width: 100%;
  padding: 10px;
  margin: 5px 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

/* BUTTONS */
button {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

th {
  background: rgba(0,0,0,0.05);
}

/* STATS */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* HIDDEN */
.hidden {
  display: none !important;
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-box {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  width: 320px;
}

/* SMALL CHART FIX */
#chart {
  max-height: 220px;
}

/* DEBT */
.debt-high {
  color: red;
  font-weight: bold;
}