.admin-body {
  background: var(--bg);
}

/* ---------- Admin login ---------- */

.admin-login-card .login-logo {
  background: #1e293b;
  color: #fff;
}

/* ---------- Admin shell ---------- */

.admin-shell {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}

.admin-topbar {
  background: #10241f;
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}

.admin-main {
  flex: 1;
  padding: 20px 16px 60px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px 10px;
  text-align: center;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary-dark);
}

.stat-card .label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.panel {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-header h2 {
  font-size: 16px;
  margin: 0;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.secondary {
  background: #eef1f0;
  color: var(--text);
}

.btn.danger {
  background: var(--danger-light);
  color: #991b1b;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.teacher-search {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
}

table.teachers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 520px;
}

table.teachers-table th {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}

table.teachers-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.teachers-table td.national-id {
  direction: ltr;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  border: none;
  background: #f1f4f3;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 14px;
}

/* Toggle switch */

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  transition: 0.2s;
  border-radius: 999px;
}

.slider::before {
  position: absolute;
  content: '';
  height: 20px;
  width: 20px;
  right: 3px;
  bottom: 3px;
  background: #fff;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
  background: var(--call);
}

input:checked + .slider::before {
  transform: translateX(-20px);
}

.status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}

.status-pill.on {
  background: #dcfce7;
  color: #15803d;
}

.status-pill.off {
  background: #fee2e2;
  color: #b91c1c;
}

/* Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 18, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-card h3 {
  margin: 0 0 16px;
  font-size: 17px;
}

.form-group {
  margin-bottom: 14px;
  text-align: right;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-footer .btn {
  flex: 1;
}

.import-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.7;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 50%;
  transform: translateX(50%);
  background: #10241f;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 420px) {
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .stat-card .value {
    font-size: 20px;
  }
}
