:root {
  --navy-deep: #1b1f3b;
  --navy-soft: #262b52;
  --indigo: #5b4fe9;
  --indigo-dark: #4338ca;
  --bg: #f5f6fb;
  --card: #ffffff;
  --green: #16a34a;
  --green-bg: #e9f9ef;
  --amber: #d97706;
  --amber-bg: #fef3e2;
  --red: #dc2626;
  --red-bg: #fdecec;
  --text-dark: #1e2233;
  --text-muted: #6b7280;
  --border: #e6e8f0;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-dark);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
}

a { text-decoration: none; }

/* --- Auth pages (login) --- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--navy-deep) 0%, var(--indigo-dark) 100%);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 16px;
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 50px rgba(27, 31, 59, 0.35);
}
.auth-card h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: .25rem;
}
.auth-card p.subtitle {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

/* --- App shell --- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--navy-deep);
  color: #cfd2e8;
  padding: 1.5rem 1rem;
}
.sidebar .brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0 .5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 1rem;
}
.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #cfd2e8;
  padding: .65rem .75rem;
  border-radius: 10px;
  font-size: .92rem;
  margin-bottom: .15rem;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: var(--indigo); color: #fff; }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.topbar .user-chip { font-size: .85rem; color: var(--text-muted); }

.content { padding: 1.5rem; }

/* --- Cards / stats --- */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .9rem;
}
.stat-card .icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  background: var(--indigo);
  color: #fff;
  flex-shrink: 0;
}
.stat-card .value { font-size: 1.35rem; font-weight: 700; line-height: 1; }
.stat-card .label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
}
.panel h2 {
  font-size: .98rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* --- Buttons --- */
.btn-brand {
  background: var(--indigo);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: .55rem 1.1rem;
}
.btn-brand:hover { background: var(--indigo-dark); color: #fff; }

/* --- Badges --- */
.badge-eligible { background: var(--green-bg); color: var(--green); font-weight: 600; }
.badge-pending { background: var(--amber-bg); color: var(--amber); font-weight: 600; }
.badge-error { background: var(--red-bg); color: var(--red); font-weight: 600; }

/* --- Tables --- */
.table thead th {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.table td { vertical-align: middle; font-size: .9rem; }

.alert-soft-error { background: var(--red-bg); color: var(--red); border: none; border-radius: 10px; }
.alert-soft-success { background: var(--green-bg); color: var(--green); border: none; border-radius: 10px; }

.form-label { font-size: .85rem; font-weight: 600; color: var(--text-dark); }
.form-control, .form-select {
  border-radius: 10px;
  border-color: var(--border);
  padding: .55rem .8rem;
}
