:root {
  --primary: #2a5310;
  --secondary: #5a8729;
  --accent: #89a952;
  --text: #4f6f1e;
  --bg: #fffbf5;
  --blob: #e8f0d4;
  --card: #ffffff;
  --danger: #b42318;
  --muted: #6b7a5a;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Tajawal", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--primary);
  min-height: 100vh;
}

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.side {
  background: var(--primary);
  color: #fff;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side a, .side button.link {
  color: #e8f0d4;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.side a.active, .side a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.brand { font-weight: 800; font-size: 22px; margin-bottom: 16px; }
.main { padding: 24px; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(42, 83, 16, 0.06);
}
.kpi { cursor: pointer; }
.kpi strong { display: block; font-size: 28px; }
.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-inline-end: 6px; }
.ok { background: #2e7d32; }
.bad { background: #c62828; }

input, button, .btn {
  font-family: inherit;
}
input[type=text], input[type=password], input[type=search] {
  border: 1px solid #d7e3c2;
  border-radius: 999px;
  padding: 10px 14px;
  min-width: 220px;
}
button, .btn {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
button.danger { background: var(--danger); }
button.lang {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.side button.lang { color: #fff; border-color: #e8f0d4; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid #eadfc8; text-align: start; }
a.plain { color: var(--primary); font-weight: 700; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card { width: min(420px, 100%); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.notice { background: var(--blob); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.error { color: var(--danger); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr; }
}
