/**
 * E-JAMIA SaaS — shared styles (RTL, Nastaliq headings, admin look)
 */
:root {
  --bg: #f4f7f6;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #ef4444;
  --purple: #7c3aed;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 12px 32px -12px rgba(15,23,42,.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; }
.urdu, h1, h2, h3, .u { font-family: 'Noto Nastaliq Urdu', serif; line-height: 2.1; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- top bar ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 12px 26px; background: #0f172a; color: #fff;
  position: sticky; top: 0; z-index: 50;
}
.brand-link { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-link:hover { text-decoration: none; }
.logo { font-size: 22px; }
.brand-text b { display: block; font-size: 15px; letter-spacing: .2px; }
.brand-text small { display: block; font-size: 10px; color: #94a3b8;
  font-family: 'Noto Nastaliq Urdu', serif; }
.topnav { display: flex; gap: 18px; }
.topnav a { color: #cbd5e1; font-size: 13px; font-weight: 500; }
.topnav a:hover { color: #fff; }
.userchip { display: flex; align-items: center; gap: 12px; }
.userchip .uinfo { text-align: left; }
.userchip .uinfo b { display: block; font-size: 12.5px; }
.userchip .uinfo small { display: block; font-size: 10px; color: #94a3b8; }

/* ---------------- shells ---------------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 22px 60px; }
.wrap-narrow { max-width: 520px; margin: 40px auto; padding: 0 20px 60px; }

/* ---------------- cards ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.card .sub { color: var(--muted); font-size: 12px; margin: 0 0 16px;
  font-family: 'Noto Nastaliq Urdu', serif; line-height: 1.9; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title h2, .card-title h3 { margin: 0; }

/* ---------------- hero (login/register) ---------------- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.hero-left { background: linear-gradient(135deg, #1e3a8a, #1d4ed8 60%, #3b82f6);
  color: #fff; padding: 60px 54px; display: flex; flex-direction: column; justify-content: center; }
.hero-left h1 { font-size: 34px; margin: 0 0 8px; line-height: 1.7; }
.hero-left p { color: #dbeafe; font-size: 14px; max-width: 430px;
  font-family: 'Noto Nastaliq Urdu', serif; line-height: 2.15; }
.hero-right { background: #fff; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.hero-badge { display: inline-block; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px; padding: 4px 14px; font-size: 11px; margin-bottom: 18px; }
.feature-list { margin-top: 26px; display: grid; gap: 12px; }
.feature { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: #e0ecff;
  font-family: 'Noto Nastaliq Urdu', serif; line-height: 2; }
.feature .fi { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.16);
  display: grid; place-items: center; flex-shrink: 0; margin-top: 5px; font-size: 12px; }

/* ---------------- forms ---------------- */
label { display: block; font-size: 12px; font-weight: 600; color: #334155; margin: 0 0 6px; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px;
  font-size: 13px; background: #f8fafc; outline: none; font-family: inherit; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.field { margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 11px; color: var(--muted); margin: 6px 0 0;
  font-family: 'Noto Nastaliq Urdu', serif; line-height: 1.85; }
.hint.err { color: var(--red); }
.hint.ok { color: var(--green); }

/* ---------------- buttons ---------------- */
.btn { border: 0; border-radius: 11px; padding: 11px 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: transform .08s, background .15s, opacity .15s; font-family: inherit; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.btn-ghost:hover { background: rgba(255,255,255,.18); }
.btn-light { background: #f1f5f9; color: var(--ink); border: 1px solid var(--line); }
.btn-light:hover { background: #e2e8f0; }
.btn-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 12px; font-size: 11.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- tables ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: right; color: var(--muted); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .4px; padding: 9px 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
td { padding: 11px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafbfc; }

/* ---------------- pills / chips ---------------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 10.5px; font-weight: 600; }
.pill-green { background: #dcfce7; color: #15803d; }
.pill-amber { background: #fef3c7; color: #b45309; }
.pill-red { background: #fee2e2; color: #b91c1c; }
.pill-blue { background: #dbeafe; color: #1d4ed8; }
.pill-purple { background: #ede9fe; color: #6d28d9; }
.pill-slate { background: #f1f5f9; color: #475569; }

/* ---------------- stat tiles ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  box-shadow: var(--shadow); }
.stat .k { font-size: 10.5px; color: var(--muted); margin-bottom: 4px;
  font-family: 'Noto Nastaliq Urdu', serif; }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -.4px; }
.stat .s { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* ---------------- toast ---------------- */
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #0f172a; color: #fff; padding: 12px 24px; border-radius: 100px; font-size: 12.5px;
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.4); opacity: 0; transition: all .25s; z-index: 999;
  font-family: 'Noto Nastaliq Urdu', serif; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: #b91c1c; }
#toast.ok { background: #15803d; }

/* ---------------- file tree ---------------- */
.tree { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 11.5px;
  background: #0f172a; color: #cbd5e1; border-radius: 12px; padding: 18px 20px;
  overflow-x: auto; direction: ltr; text-align: left; line-height: 1.85; }
.tree .d { color: #7dd3fc; }
.tree .f { color: #e2e8f0; }
.tree .s { color: #64748b; }

/* ---------------- login toggle ---------------- */
.tabs { display: flex; gap: 6px; background: #f1f5f9; border-radius: 12px; padding: 5px; margin-bottom: 22px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit; }
.tabs button.active { background: #fff; color: var(--ink);
  box-shadow: 0 1px 3px rgba(15,23,42,.08); }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero-left { padding: 40px 26px; }
  .hero-right { padding: 34px 24px; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .topnav { order: 3; width: 100%; justify-content: center; padding-top: 6px; }
  .row2 { grid-template-columns: 1fr; }
  .wrap { padding: 18px 12px 50px; }
}
