/* Fims Schools — brand: deep navy #0f2a4a, teal #0e7c7b, white, gold #c9a227 */
:root {
  --navy: #0f2a4a;
  --navy-2: #163a63;
  --teal: #0e7c7b;
  --teal-2: #12a3a1;
  --gold: #c9a227;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1c2733;
  --muted: #5d6b7a;
  --border: #dfe5ec;
  --danger: #c0392b;
  --ok: #1e7e34;
  --warn: #b7791f;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: var(--navy-2); }
a:hover { color: var(--teal); }

/* layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--navy); color: #fff; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand .logo { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.brand .logo .fims { color: #fff; }
.brand .logo .schools { color: var(--gold); }
.brand .tag { font-size: 11px; color: #b9c7d8; }
.nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav a { display: block; color: #dbe4ef; text-decoration: none; padding: 10px 18px; font-size: 14.5px; border-left: 3px solid transparent; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.08); border-left-color: var(--gold); color: #fff; font-weight: 600; }
.nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #8fa3ba; padding: 14px 18px 6px; }
.sidefoot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; color: #b9c7d8; }
.sidefoot a { color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 10px 20px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; }
.topbar .title { font-size: 19px; font-weight: 700; color: var(--navy); margin: 0; flex: 1; }
.topbar .who { font-size: 13px; color: var(--muted); }
.content { padding: 22px; max-width: 1280px; width: 100%; margin: 0 auto; }
.demo-banner { background: #7a4d00; color: #fff; padding: 8px 16px; font-size: 13px; font-weight: 600; text-align: center; }
.lang-toggle a { text-decoration: none; font-size: 13px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; }
.lang-toggle a.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* cards, stats */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 14px 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(15,42,74,.06); }
.stat { text-decoration: none; color: inherit; }
.stat .num { font-size: 26px; font-weight: 800; color: var(--navy); }
.stat .lbl { font-size: 13px; color: var(--muted); }
.stat .sub { font-size: 12px; color: var(--muted); }
.section-title { font-size: 17px; font-weight: 700; color: var(--navy); margin: 26px 0 10px; border-bottom: 2px solid var(--gold); display: inline-block; padding-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.finance-note { background: #fff8e6; border: 1px solid #ecd28a; color: #6b5200; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin: 12px 0; }

/* tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { background: var(--navy); color: #fff; text-align: left; padding: 10px 12px; font-weight: 600; white-space: nowrap; }
table.data td { padding: 9px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
table.data tr:nth-child(even) td { background: #f8fafc; }
table.data tr:hover td { background: #eef4f8; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.b-green { background: #e3f4e5; color: #1e7e34; }
.b-red { background: #fbe3e0; color: #a93226; }
.b-amber { background: #fdf0d5; color: #8a5a00; }
.b-blue { background: #e2eefb; color: #1c4f8a; }
.b-grey { background: #eef1f4; color: #5d6b7a; }
.b-teal { background: #def3f2; color: #0b5f5e; }

/* forms */
form .field { margin-bottom: 14px; }
label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; color: var(--navy); }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=email], input[type=password], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 14.5px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-2); border-color: var(--teal); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.btn { display: inline-block; padding: 9px 18px; border-radius: 7px; border: none; cursor: pointer; font-size: 14.5px; font-weight: 600; text-decoration: none; font-family: inherit; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-2); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--navy); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.filters .field { margin: 0; min-width: 150px; }
.pagination { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 14px; }

/* alerts + states */
.alert { padding: 11px 15px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert-success { background: #e3f4e5; color: #145a24; border: 1px solid #a9d8b0; }
.alert-error { background: #fbe3e0; color: #8f2b1f; border: 1px solid #efa9a0; }
.alert-info { background: #e2eefb; color: #1c4f8a; border: 1px solid #a9c8ec; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--border); border-radius: 10px; }
.empty .big { font-size: 40px; }
.loading { text-align: center; padding: 30px; color: var(--muted); }

/* profile */
.profile-head { display: flex; gap: 18px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 14px; }
.profile-head img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); }
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--gold); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; font-size: 14.5px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }

/* print docs */
.print-doc { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 34px 38px; max-width: 800px; margin: 0 auto 20px; font-size: 14px; }
.print-doc .doc-head { text-align: center; border-bottom: 3px double var(--navy); padding-bottom: 12px; margin-bottom: 16px; }
.print-doc .doc-head h2 { margin: 4px 0; color: var(--navy); }
.print-doc .doc-head .gold { color: var(--gold); font-weight: 700; letter-spacing: 2px; font-size: 12px; }
.sig-row { display: flex; justify-content: space-between; margin-top: 56px; gap: 20px; }
.sig { flex: 1; text-align: center; border-top: 1px solid #333; padding-top: 6px; font-size: 13px; }

/* mobile */
.mobile-nav { display: none; }
.hamburger { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--navy); }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; top: 0; z-index: 100; transition: left .25s; width: 250px; }
  body.nav-open .sidebar { left: 0; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 90; }
  .hamburger { display: inline-block; }
  .content { padding: 14px; }
  .grid2 { grid-template-columns: 1fr; }
  .topbar .title { font-size: 16px; }
  .print-doc { padding: 18px; }
  .kv { grid-template-columns: 130px 1fr; }
}

/* RTL (Urdu) */
[dir="rtl"] .sidebar { order: 1; }
[dir="rtl"] .nav a { border-left: none; border-right: 3px solid transparent; }
[dir="rtl"] .nav a.active { border-right-color: var(--gold); }
[dir="rtl"] table.data th, [dir="rtl"] table.data td { text-align: right; }
[dir="rtl"] .kv { direction: rtl; }

/* ===== print: hide app chrome, show only .print-doc ===== */
@media print {
  .sidebar, .topbar, .demo-banner, .no-print, .toolbar, .tabs { display: none !important; }
  body { background: #fff; }
  .app { display: block; }
  .main { display: block; }
  .content { padding: 0; max-width: none; }
  .print-doc { border: none; border-radius: 0; padding: 0; max-width: none; margin: 0; box-shadow: none; }
  table.data { font-size: 12px; }
  table.data th { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.data td, table.data th { padding: 5px 7px; }
  .card, .table-wrap { box-shadow: none; }
  a { text-decoration: none; color: #000; }
  @page { size: A4; margin: 14mm; }
}
