/* Dar-e-Ilm Credit Education System Portal. Deep navy and gold, mobile first. */
:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --navy-3: #1d4a7a;
  --gold: #c9a227;
  --gold-light: #f2d98c;
  --gold-dark: #9a7b14;
  --bg: #f4f1e8;
  --card: #ffffff;
  --text: #1a2433;
  --muted: #5a6577;
  --border: #d9d2bd;
  --green: #1e7a34;
  --red: #a61e1e;
  --amber: #8a5a00;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
[dir="rtl"] body { font-family: "Noto Nastaliq Urdu", system-ui, sans-serif; }
a { color: var(--navy-3); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }

/* Header and footer */
.site-header { background: var(--navy); color: #fff; border-bottom: 4px solid var(--gold); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.25rem; letter-spacing: 1px;
}
.brand h1 { margin: 0; font-size: 1.15rem; line-height: 1.25; }
.brand .campus { margin: 2px 0 0; color: var(--gold-light); font-size: 0.92rem; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.site-footer { background: var(--navy); color: #dbe4f0; margin-top: 32px; padding: 22px 0; font-size: 0.95rem; }
.site-footer a { color: var(--gold-light); }
.footer-inner { display: grid; gap: 16px; }
@media (min-width: 720px) { .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; } .brand h1 { font-size: 1.4rem; } }

/* Buttons, forms, cards */
.btn {
  display: inline-block; border: 1px solid var(--navy); background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-size: 1rem; cursor: pointer; text-decoration: none;
  line-height: 1.3; min-height: 44px;
}
.btn:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; border-color: var(--gold); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-gold { background: var(--gold); border-color: var(--gold-dark); color: var(--navy); font-weight: 700; }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { background: #fff; color: var(--navy); }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-small { padding: 6px 10px; min-height: 36px; font-size: 0.92rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 16px 0; box-shadow: 0 1px 4px rgba(11,37,69,.08); }
.card h2, .card h3 { color: var(--navy); margin-top: 0; }
.grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
label { display: block; font-weight: 600; margin: 12px 0 4px; color: var(--navy); }
input, select, textarea {
  width: 100%; padding: 11px 12px; font-size: 1rem; line-height: 1.4;
  border: 1px solid #9aa5b5; border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--gold-light); border-color: var(--navy); }
textarea { min-height: 84px; resize: vertical; }
.field-row { display: flex; gap: 8px; align-items: end; }
.field-row > * { flex: 1; }
.hint { color: var(--muted); font-size: 0.92rem; margin: 6px 0 0; }
.error { background: #fdecea; border: 1px solid #e0a49e; color: #7a1a14; padding: 12px; border-radius: 8px; margin: 12px 0; }
.success { background: #e6f4ea; border: 1px solid #9ecfa8; color: #14532d; padding: 12px; border-radius: 8px; margin: 12px 0; }
.banner { background: #fff7d6; border: 1px solid var(--gold); color: var(--navy); padding: 14px; border-radius: 8px; margin: 16px 0; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
.badge { display: inline-block; background: var(--red); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: 0.85rem; font-weight: 700; margin-left: 6px; }
.badge-gold { background: var(--gold); color: var(--navy); }
.badge-green { background: var(--green); }
.badge-grey { background: #6b7686; }
.pill { display: inline-block; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; margin: 2px; background: #fff; font-size: 0.92rem; }

/* Tabs and chips */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.tab { border: 1px solid var(--navy); background: #fff; color: var(--navy); border-radius: 999px; padding: 8px 14px; font-size: 1rem; cursor: pointer; min-height: 40px; }
.tab.active { background: var(--navy); color: #fff; }
.tab .badge { margin-left: 4px; }
.chips { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 10px 0; display: flex; gap: 8px; overflow-x: auto; border-bottom: 2px solid var(--gold); }
.chips a, .chips button { flex: 0 0 auto; background: #fff; border: 1px solid var(--navy); color: var(--navy); border-radius: 999px; padding: 8px 14px; text-decoration: none; font-weight: 600; font-size: 1rem; cursor: pointer; }
.chips a:hover, .chips button:hover { background: var(--navy); color: #fff; }

/* Tables and lists */
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.table-wrap { overflow-x: auto; margin: 12px 0; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--navy); color: #fff; }
tr:nth-child(even) td { background: #f8f6ee; }
.list-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list-row:last-child { border-bottom: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stat { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 16px; }
.stat strong { display: block; font-size: 2rem; line-height: 1.1; color: var(--gold-light); }
.stat span { color: #dbe4f0; }
.report-grade { font-size: 2.4rem; font-weight: 800; color: var(--navy); }
.attendance-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.attendance-btns .btn { padding: 6px 10px; min-height: 38px; }
.attendance-btns .btn[aria-pressed="true"] { outline: 3px solid var(--gold); }
.status-Present { color: var(--green); font-weight: 700; }
.status-Absent { color: var(--red); font-weight: 700; }
.status-Late { color: var(--amber); font-weight: 700; }
.status-Leave { color: var(--navy-3); font-weight: 700; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 8px;
  border: 1px solid var(--gold); max-width: 92vw; z-index: 50; box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.loading { padding: 24px; text-align: center; color: var(--muted); }
.day-col h3 { margin-bottom: 6px; border-bottom: 2px solid var(--gold); padding-bottom: 4px; }
/* My Students, teacher home screen */
.my-students { border-top: 4px solid var(--gold); }
.my-students h3 { margin-bottom: 4px; }
.student-row {
  border: 1px solid var(--border); border-left: 4px solid var(--gold);
  border-radius: 8px; padding: 12px 14px; margin: 12px 0; background: #fff;
}
.student-row h4 { margin: 0 0 4px; color: var(--navy); font-size: 1.05rem; }
.student-meta { margin: 0; font-size: 1rem; }
.att-summary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 0; font-size: 1rem; }
.att-label { font-weight: 700; color: var(--navy); }
.att-chip {
  display: inline-block; border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 10px; background: #f8f6ee; font-size: 1rem; white-space: nowrap;
}
.att-percent { font-weight: 800; color: var(--navy); background: var(--gold-light); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
@media (max-width: 520px) {
  body { font-size: 1rem; }
  .card { padding: 14px; }
  .brand h1 { font-size: 1.05rem; }
}
