/* Ilm Seekho - shared styles. System fonts only (nothing loaded from other sites).
   Logical properties (inline-start/end) are used so Urdu (right-to-left) works. */

:root {
  --green-900: #0a3d2e;
  --green-700: #0b6b4f;
  --green-600: #0f8261;
  --green-100: #dff1ea;
  --green-50: #f0f8f5;
  --amber-600: #b8741a;
  --amber-100: #fbecd3;
  --red-600: #b3362b;
  --red-100: #fbe3e0;
  --slate-600: #55615c;
  --slate-100: #e9ece9;
  --ink: #16211c;
  --muted: #5f6b66;
  --line: #dfe3dd;
  --paper: #f6f4ee;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 40, 30, .06), 0 6px 20px rgba(20, 40, 30, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.5; }
html[lang="ur"] body { font-family: var(--font-ur); line-height: 1.9; }
h1, h2, h3, p { margin: 0; }
a { color: var(--green-700); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: .9em; }
.ur { font-family: var(--font-ur); }
.nowrap { white-space: nowrap; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: inherit; }
.brand img { width: 38px; height: 38px; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; line-height: 1.1; }
.brand-sub { font-size: .78rem; opacity: .8; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.field { margin-bottom: 1rem; }
.hint { font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.optional { font-weight: 400; color: var(--muted); }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="search"], input[type="url"], input[type="number"], input[type="date"], input[type="time"], input[type="month"], input[type="datetime-local"], select, textarea {
  width: 100%; padding: .62rem .75rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #c9cfc8; border-radius: 8px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(15, 130, 97, .3); outline-offset: 1px; border-color: var(--green-600);
}
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red-600); }
.field-error { color: var(--red-600); font-size: .84rem; margin-top: .25rem; }
.input-group { display: flex; }
.input-group input { border-start-end-radius: 0; border-end-end-radius: 0; }
.input-group .addon {
  display: flex; align-items: center; padding: 0 .75rem; background: var(--slate-100); color: var(--slate-600);
  border: 1px solid #c9cfc8; border-inline-start: 0; border-start-end-radius: 8px; border-end-end-radius: 8px;
  font-size: .9rem; white-space: nowrap; direction: ltr;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.05rem; font: inherit; font-weight: 600; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; background: var(--green-700); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--green-600); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.block { width: 100%; padding-block: .72rem; }
.btn.secondary { background: #fff; color: var(--ink); border-color: #c9cfc8; }
.btn.secondary:hover { background: var(--green-50); }
.btn.danger { background: var(--red-600); }
.btn.danger:hover { background: #9c2c22; }
.btn.warn { background: var(--amber-600); }
.btn.warn:hover { background: #a06414; }
.btn.small { padding: .35rem .7rem; font-size: .87rem; }
.btn.link { background: none; border: 0; color: var(--green-700); padding: 0; font-weight: 600; }

.alert { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .93rem; }
.alert.error { background: var(--red-100); color: #7d241c; border: 1px solid #f0c2bd; }
.alert.ok { background: var(--green-100); color: var(--green-900); border: 1px solid #bfe0d4; }
.alert.info { background: var(--amber-100); color: #6d4410; border: 1px solid #f0d8ae; }

/* ---------- login / register ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; }
.auth-side {
  background: var(--green-900); color: #eaf5f0; padding: 2.5rem 2.75rem; display: flex; flex-direction: column;
  background-image: radial-gradient(circle at 15% 110%, rgba(15, 130, 97, .9), transparent 55%),
                    radial-gradient(circle at 110% -10%, rgba(184, 116, 26, .35), transparent 45%);
}
.auth-side .brand-name { font-size: 1.3rem; }
.auth-pitch { margin-top: auto; margin-bottom: auto; padding-block: 2rem; }
.auth-pitch h1 { font-size: 2rem; line-height: 1.25; font-weight: 700; max-width: 16ch; }
.auth-pitch p { margin-top: .9rem; opacity: .85; max-width: 38ch; }
.auth-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .65rem; }
.auth-points li { display: flex; gap: .6rem; align-items: baseline; opacity: .92; }
.auth-points li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #e3a84b; }
.auth-foot { font-size: .8rem; opacity: .65; }
.auth-main { display: flex; flex-direction: column; padding: 1.5rem 2rem 2.5rem; }
.auth-top { display: flex; justify-content: flex-end; }
.auth-card { width: 100%; max-width: 420px; margin: auto; }
.auth-card.wide { max-width: 640px; }
.auth-card h2 { font-size: 1.55rem; margin-bottom: .3rem; }
.auth-card .lead { color: var(--muted); margin-bottom: 1.5rem; }
.auth-alt { margin-top: 1.25rem; text-align: center; color: var(--muted); }
.section-title {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700;
  margin: 1.4rem 0 .8rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line);
}
html[lang="ur"] .section-title { letter-spacing: 0; font-size: .9rem; }
.success-box { text-align: center; padding: 1rem 0; }
.success-mark {
  width: 64px; height: 64px; border-radius: 50%; background: var(--green-100); color: var(--green-700);
  display: grid; place-items: center; font-size: 2rem; margin: 0 auto 1rem;
}
.lang-btn {
  font: inherit; font-size: .87rem; background: none; border: 1px solid #c9cfc8; border-radius: 999px;
  padding: .25rem .8rem; cursor: pointer; color: inherit;
}
.lang-btn:hover { background: rgba(15, 130, 97, .08); }

/* ---------- panel shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--green-900); color: #dcebe5; padding: 1.2rem .9rem; display: flex; flex-direction: column; gap: 1.4rem; }
.sidebar .brand { padding-inline: .45rem; }
.nav { display: grid; gap: .2rem; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .75rem;
  border-radius: 8px; color: #dcebe5; text-decoration: none; font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .07); }
.nav a.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.nav .count { background: #e3a84b; color: #3a2606; border-radius: 999px; font-size: .75rem; font-weight: 700; padding: 0 .5rem; }
.sidebar-foot { margin-top: auto; font-size: .78rem; opacity: .6; padding-inline: .45rem; }
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.75rem;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.2rem; }
.topbar-right { display: flex; align-items: center; gap: .8rem; }
.who { text-align: end; line-height: 1.25; }
.who strong { display: block; font-size: .92rem; }
.who span { font-size: .78rem; color: var(--muted); }
.content { padding: 1.5rem 1.75rem 3rem; max-width: 1180px; width: 100%; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 1rem; }
.card-body { padding: 1.1rem; }
.stack { display: grid; gap: 1.25rem; }
.cols { display: grid; grid-template-columns: 3fr 2fr; gap: 1.25rem; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.stat { padding: 1rem 1.1rem; border-inline-start: 4px solid var(--slate-600); }
.stat .num { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .88rem; margin-top: .15rem; }
.stat.pending { border-color: var(--amber-600); }
.stat.approved { border-color: var(--green-600); }
.stat.suspended { border-color: var(--red-600); }
.stat.rejected { border-color: #8a938e; }
.stat.users { border-color: #3b6ea5; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: .65rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: #fafaf7; }
html[lang="ur"] th { letter-spacing: 0; font-size: .85rem; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--green-50); }
.cell-title { font-weight: 600; }
.empty { padding: 2.2rem 1rem; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge.pending { background: var(--amber-100); color: #7a4c0e; }
.badge.approved, .badge.active { background: var(--green-100); color: var(--green-900); }
.badge.rejected, .badge.invited { background: var(--slate-100); color: var(--slate-600); }
.badge.suspended { background: var(--red-100); color: #7d241c; }

.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.tab { font: inherit; font-weight: 600; font-size: .9rem; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.tab.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.tab .n { opacity: .7; margin-inline-start: .3rem; font-weight: 500; }
.search { width: 320px; max-width: 100%; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1.1rem; border-top: 1px solid var(--line); }

.bars { display: grid; gap: .7rem; }
.bar-row { display: grid; grid-template-columns: 9.5rem 1fr 2rem; gap: .6rem; align-items: center; font-size: .9rem; }
.bar-track { background: var(--slate-100); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-fill { background: var(--green-600); height: 100%; border-radius: 999px; }
.bar-row .n { text-align: end; font-weight: 700; }

.detail-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.detail-head h2 { font-size: 1.5rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem 1.5rem; }
.dl dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
html[lang="ur"] .dl dt { letter-spacing: 0; font-size: .85rem; }
.dl dd { margin: .15rem 0 0; font-weight: 500; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.timeline li { padding-inline-start: 1rem; border-inline-start: 3px solid var(--green-100); }
.timeline .when { font-size: .8rem; color: var(--muted); }
.back { display: inline-block; margin-bottom: .9rem; text-decoration: none; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { background: var(--green-50); border: 1px solid #cfe5dc; border-radius: 6px; padding: .1rem .5rem; font-size: .8rem; }

dialog { border: 0; border-radius: 12px; padding: 0; width: min(460px, 92vw); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: var(--ink); }
dialog::backdrop { background: rgba(10, 30, 22, .5); }
.dialog-body { padding: 1.3rem 1.4rem .4rem; }
.dialog-body h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.dialog-body p { color: var(--muted); margin-bottom: 1rem; }
.dialog-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.4rem 1.2rem; }
.toast {
  position: fixed; inset-block-end: 1.4rem; inset-inline-end: 1.4rem; background: var(--green-900); color: #fff;
  padding: .7rem 1.1rem; border-radius: 8px; box-shadow: var(--shadow); z-index: 50;
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 1.4rem 1.5rem; }
  .auth-pitch, .auth-foot { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; flex-wrap: wrap; gap: .6rem; padding: .7rem 1rem; }
  .nav { display: flex; flex-wrap: wrap; }
  .sidebar-foot { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cols, .grid-2 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr 1fr; }
  .content, .topbar { padding-inline: 1rem; }
  .table-wrap { overflow-x: auto; }
}

button.addon { font: inherit; font-size: .87rem; cursor: pointer; }
.bar-fill { display: block; }

.offline { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: .7rem; text-align: center; padding: 2rem; max-width: 30rem; margin: 0 auto; }
.offline h1 { font-size: 1.6rem; margin-top: .5rem; }

/* join page and school codes */
.label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.code-input { text-transform: uppercase; letter-spacing: .12em; font-family: ui-monospace, Consolas, monospace; }
.code-input.big { font-size: 1.35rem; padding-block: .7rem; text-align: center; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.role-card { position: relative; display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.1rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 400; margin: 0; }
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card:has(input:checked) { border-color: var(--green-600); background: var(--green-50); }
.role-card:has(input:focus-visible) { outline: 3px solid rgba(15, 130, 97, .3); }
.role-ico { font-size: 1.6rem; }
.role-card strong { font-size: 1.05rem; }
.role-card small { color: var(--muted); }
.code-show { background: var(--amber-100); border: 1px dashed var(--amber-600); border-radius: 10px; padding: .8rem 1rem; margin: 0 auto 1.4rem; max-width: 30rem; }

a.tab { text-decoration: none; display: inline-block; }
.content > p.muted:first-child { margin-bottom: 1rem; }
