/* portal.css — sirf certificate-verification aur admin pages ke liye.
   Main website ka style.css alag hai, usko touch nahi kiya. Colors wahi ITCS blue hain. */

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #f3f4f6;
  --white: #ffffff;
  --border: #e5e7eb;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.top {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: inherit; text-decoration: none; font-weight: 600; font-size: 1.1rem; }
.brand img { height: 40px; object-fit: contain; }
.top-link { color: var(--white); text-decoration: none; opacity: 0.9; }
.top-link:hover { opacity: 1; text-decoration: underline; }
.who { margin-right: 0.6rem; font-size: 0.9rem; opacity: 0.9; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; flex: 1; }
.wrap.narrow { max-width: 640px; }
.wrap.tiny { max-width: 400px; }

.card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card.center { text-align: center; }
h1 { font-size: 1.5rem; margin-bottom: 0.3rem; color: var(--primary-dark); }
h2 { font-size: 1.15rem; margin-bottom: 0.8rem; }
.muted { color: var(--muted); }
.small-note { font-size: 0.85rem; margin-top: 0.8rem; }

.foot { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 1rem; }

/* ---------- Form controls ---------- */
input[type="text"], input[type="password"], input[type="date"] {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--white);
}
input:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
label { display: block; font-size: 0.9rem; font-weight: 600; }
label input { margin-top: 0.3rem; font-weight: 400; }

.stack { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 0.6rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  border: 1px solid var(--primary);
  padding: 0.65rem 1.3rem;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-light { background: var(--white); color: var(--primary-dark); border-color: var(--border); }
.btn-light:hover { background: var(--bg); border-color: var(--border); }
.btn-danger { background: var(--white); color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.inline { display: inline-flex; align-items: center; }

/* ---------- Search ---------- */
.search-form { display: flex; gap: 0.6rem; margin-top: 1rem; }
.search-form.small { margin-top: 0; }
.list-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 0.8rem; }
.list-head h2 { margin: 0; }

/* ---------- Alerts ---------- */
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin: 1rem 0; font-size: 0.95rem; }
.wrap > .alert { margin-top: 0; }
.alert.success { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.alert.error { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }

/* ---------- Certificate result ---------- */
.result { text-align: center; border-top: 5px solid var(--border); }
.result .icon {
  width: 56px; height: 56px; margin: 0 auto 0.6rem;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700; color: var(--white);
}
.result.good { border-top-color: var(--green); }
.result.good .icon { background: var(--green); }
.result.good h2 { color: var(--green); }
.result.bad { border-top-color: var(--red); }
.result.bad .icon { background: var(--red); }
.result.bad h2 { color: var(--red); }
.result.warn { border-top-color: var(--amber); }
.result.warn .icon { background: var(--amber); }
.result.warn h2 { color: var(--amber); }

.details { text-align: left; margin-top: 1.2rem; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.details > div { display: flex; padding: 0.7rem 1rem; gap: 1rem; border-bottom: 1px solid var(--border); }
.details > div:last-child { border-bottom: 0; }
.details > div:nth-child(odd) { background: var(--bg); }
.details dt { flex: 0 0 140px; color: var(--muted); font-size: 0.9rem; }
.details dd { font-weight: 600; word-break: break-word; }

/* ---------- Admin dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--white); border-radius: 12px; box-shadow: var(--shadow); padding: 1rem; text-align: center; color: var(--muted); font-size: 0.9rem; }
.stat span { display: block; font-size: 1.8rem; font-weight: 700; color: var(--primary-dark); }
.stat.ok span { color: var(--green); }
.stat.no span { color: var(--red); }

.table-wrap { overflow-x: auto; }   /* chhoti screen pe table side mein scroll hoga, page nahi toota */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.65rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: var(--bg); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
td small { display: block; color: var(--muted); font-size: 0.8rem; }
td.actions { white-space: nowrap; }
td.actions > * { margin-right: 0.3rem; }

.badge { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge.valid { background: var(--green-bg); color: var(--green); }
.badge.revoked { background: var(--red-bg); color: var(--red); }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .brand span { font-size: 0.95rem; }
  .search-form { flex-direction: column; }
  .details > div { flex-direction: column; gap: 0.1rem; }
  .details dt { flex: none; }
  .stats { gap: 0.5rem; }
  .who { display: none; }
}

/* ---------- Admin: import, batch bar, textarea, select ---------- */
textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
  margin-top: 0.3rem;
  resize: vertical;
}
textarea:focus, select:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
select {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--white);
}
details summary { cursor: pointer; font-size: 1.05rem; }
code { background: var(--bg); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.88rem; }
.mono { font-family: Consolas, 'Courier New', monospace; letter-spacing: 0.04em; }

.batch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.inline-form { display: inline-flex; align-items: center; gap: 0.4rem; }
.inline-label { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 0.9rem; }

.alert ul { margin: 0.5rem 0 0 1.2rem; font-size: 0.9rem; }

/* ---------- Verification page: student photo ---------- */
.photo { display: block; width: 120px; height: 150px; object-fit: cover; margin: 1rem auto 0; border-radius: 8px; border: 1px solid var(--border); }
