/* Seerat Content Portal — Al-Burhan theme
   Royal navy, white space, rounded gradient cards, Poppins. */

:root {
  --ab-navy: #1F2F86;
  --ab-navy-2: #2A4BA0;
  --ab-navy-3: #3B5BD6;
  --ab-navy-dark: #141C5A;
  --ab-gold: #C9A86A;
  --ab-gold-2: #B08A4B;
  --ab-coral: #F26D6D;
  --ab-amber: #FFB703;
  --ab-teal: #12A594;
  --ab-green: #1F9D55;
  --ab-red: #E5484D;
  --ab-ink: #1B2140;
  --ab-muted: #6B7395;
  --ab-line: #E4E8F5;
  --ab-bg: #F4F6FC;
  --ab-card: #FFFFFF;
  --ab-radius: 18px;
  --ab-shadow: 0 8px 28px rgba(31, 47, 134, .08);
  --ab-shadow-hover: 0 14px 36px rgba(31, 47, 134, .16);
  --sidebar-w: 268px;
}

html { font-size: 15px; }
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--ab-bg);
  color: var(--ab-ink);
  min-height: 100vh;
}

/* Urdu: right-to-left, Nastaliq with generous line height */
.urdu, [lang="ur"], :lang(ur) { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; line-height: 2.1; }
[dir="auto"] { unicode-bidi: plaintext; }

a { color: var(--ab-navy-2); text-decoration: none; }
a:hover { color: var(--ab-navy); }

h1, h2, h3, h4, h5 { font-weight: 700; color: var(--ab-navy); letter-spacing: -.01em; }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #2238A0 0%, var(--ab-navy) 45%, var(--ab-navy-dark) 100%);
  color: #DCE2FF;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  overflow-y: auto;
  z-index: 1030;
}
.sidebar .brand { display: flex; align-items: center; gap: .75rem; padding: 1.4rem 1.25rem 1.1rem; color: #fff; }
.sidebar .brand img { width: 46px; height: 46px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.sidebar .brand .t1 { font-weight: 700; font-size: 1.02rem; line-height: 1.1; }
.sidebar .brand .t2 { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ab-gold); }
.sidebar .nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: #8F9BD8; padding: 1rem 1.4rem .35rem; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: .8rem;
  color: #DCE2FF; padding: .62rem 1rem; margin: .1rem .75rem; border-radius: 12px;
  font-size: .92rem; font-weight: 500; transition: background .15s, color .15s;
}
.sidebar .nav-link i { font-size: 1.1rem; width: 1.3rem; text-align: center; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: #fff; color: var(--ab-navy); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.sidebar .nav-link.active i { color: var(--ab-navy-2); }
.sidebar .side-foot { margin-top: auto; padding: 1rem 1.25rem 1.4rem; font-size: .75rem; color: #8F9BD8; }
.sidebar .mosque { opacity: .14; width: 100%; display: block; margin-bottom: .5rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1.75rem; background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ab-line); position: sticky; top: 0; z-index: 1020;
}
.topbar .page-title { font-weight: 700; color: var(--ab-navy); font-size: 1.15rem; margin: 0; }
.topbar .crumbs { font-size: .78rem; color: var(--ab-muted); }
.topbar .crumbs a { color: var(--ab-muted); }
.topbar .burger { display: none; border: 0; background: var(--ab-bg); border-radius: 10px; width: 40px; height: 40px; color: var(--ab-navy); font-size: 1.3rem; }
.user-chip { display: flex; align-items: center; gap: .65rem; margin-left: auto; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ab-navy-3), var(--ab-navy)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .9rem;
  box-shadow: 0 4px 12px rgba(31,47,134,.25);
}
.user-chip .name { font-weight: 600; color: var(--ab-navy); font-size: .9rem; line-height: 1.1; }
.user-chip .role { font-size: .7rem; color: var(--ab-muted); text-transform: uppercase; letter-spacing: .08em; }

.content { padding: 1.75rem; max-width: 1400px; width: 100%; }

@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(10,15,50,.45); }
  .topbar .burger { display: inline-flex; align-items: center; justify-content: center; }
  .content { padding: 1rem; }
  .user-chip .who { display: none; }
}

/* ---------- Cards ---------- */
.card-ab {
  background: var(--ab-card); border: 1px solid var(--ab-line); border-radius: var(--ab-radius);
  box-shadow: var(--ab-shadow); padding: 1.35rem;
}
.card-ab + .card-ab { margin-top: 1.25rem; }
.card-ab .card-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-ab .card-head h2, .card-ab .card-head h3 { margin: 0; font-size: 1.08rem; }
.card-ab .card-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.section-title { font-size: 1.05rem; font-weight: 700; color: var(--ab-navy); margin: 1.5rem 0 .85rem; }

/* Hero banner */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; color: #fff; padding: 1.75rem 2rem;
  background: radial-gradient(1200px 300px at 110% -40%, rgba(255,255,255,.22), transparent 60%),
              linear-gradient(120deg, var(--ab-navy-3) 0%, var(--ab-navy) 55%, var(--ab-navy-dark) 100%);
  box-shadow: 0 16px 40px rgba(31,47,134,.25);
}
.hero h1 { color: #fff; font-size: 1.6rem; margin-bottom: .35rem; }
.hero p { color: #D7DDFF; margin: 0; max-width: 680px; }
.hero .hero-art { position: absolute; right: -10px; bottom: -6px; height: 140%; opacity: .16; pointer-events: none; }
.hero .greet { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ab-gold); font-weight: 600; }

/* Stat tiles — the Al-Burhan activity-card palette */
.tile {
  border-radius: 20px; padding: 1.15rem 1.25rem; color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--ab-shadow); min-height: 118px; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .15s, box-shadow .15s;
}
a.tile:hover { transform: translateY(-3px); box-shadow: var(--ab-shadow-hover); color: #fff; }
.tile .num { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.tile .lbl { font-size: .82rem; opacity: .92; font-weight: 500; }
.tile .sub { font-size: .72rem; opacity: .8; }
.tile i.bg { position: absolute; right: .9rem; top: .8rem; font-size: 2.3rem; opacity: .35; }
.tile.navy  { background: linear-gradient(135deg, #2F47B8, #1B2A7A); }
.tile.gold  { background: linear-gradient(135deg, #D8BB82, #B08A4B); }
.tile.coral { background: linear-gradient(135deg, #FF8A8A, #E85A5A); }
.tile.amber { background: linear-gradient(135deg, #FFCC4D, #F5A300); color: #3A2A00; }
.tile.amber .lbl, .tile.amber .sub { color: #4A3600; }
.tile.teal  { background: linear-gradient(135deg, #2CC4B0, #0E8C7D); }

/* ---------- Tables ---------- */
.table-ab { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-ab thead th {
  background: #F1F4FD; color: var(--ab-navy); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  padding: .75rem .9rem; border-bottom: 1px solid var(--ab-line); white-space: nowrap;
}
.table-ab thead th:first-child { border-top-left-radius: 12px; }
.table-ab thead th:last-child { border-top-right-radius: 12px; }
.table-ab tbody td { padding: .8rem .9rem; border-bottom: 1px solid var(--ab-line); vertical-align: middle; font-size: .9rem; }
.table-ab tbody tr:hover td { background: #FAFBFF; }
.table-ab tbody tr:last-child td { border-bottom: 0; }
.table-ab .muted { color: var(--ab-muted); font-size: .8rem; }
.table-ab th a { color: inherit; }
.table-responsive { border-radius: 12px; }

/* ---------- Chips and badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600;
  padding: .22rem .62rem; border-radius: 999px; border: 1.5px solid currentColor; white-space: nowrap; background: #fff;
}
.chip.published, .chip.passed, .chip.pass, .chip.active, .chip.approved { color: var(--ab-green); }
.chip.draft, .chip.inprogress { color: #C98A00; }
.chip.archived, .chip.inactive, .chip.locked { color: #8A90AD; }
.chip.fail, .chip.danger { color: var(--ab-red); }
.chip.available, .chip.info { color: var(--ab-navy-2); }
.chip.solid { color: #fff; border-color: transparent; }
.chip.solid.navy { background: var(--ab-navy-2); }
.chip.solid.red { background: var(--ab-red); }
.chip.section-start { color: #1F7A4D; background: #E8F7EF; border-color: #BFE8D2; }
.chip.section-middle { color: #8A5A00; background: #FFF4D9; border-color: #FFE2A1; }
.chip.section-end { color: #9B2C2C; background: #FDECEC; border-color: #F7C6C6; }

/* Pill info bars, as in the Al-Burhan class information screen */
.pillbar {
  background: linear-gradient(135deg, var(--ab-navy-2), var(--ab-navy)); color: #fff; border-radius: 16px;
  padding: .85rem 1.1rem; display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; box-shadow: var(--ab-shadow);
}
.pillbar .kv { display: flex; flex-direction: column; min-width: 90px; }
.pillbar .kv .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #B9C3F5; }
.pillbar .kv .v { font-weight: 600; }
.pillbar .sep { width: 1px; align-self: stretch; background: rgba(255,255,255,.25); }

/* ---------- Buttons and forms ---------- */
.btn { border-radius: 12px; font-weight: 500; padding: .5rem 1rem; }
.btn-sm { border-radius: 10px; padding: .3rem .7rem; font-size: .82rem; }
.btn-ab { background: linear-gradient(135deg, var(--ab-navy-3), var(--ab-navy)); border: 0; color: #fff; box-shadow: 0 6px 16px rgba(31,47,134,.25); }
.btn-ab:hover, .btn-ab:focus { color: #fff; filter: brightness(1.08); box-shadow: 0 8px 20px rgba(31,47,134,.32); }
.btn-gold { background: linear-gradient(135deg, #D8BB82, #B08A4B); border: 0; color: #fff; }
.btn-gold:hover { color: #fff; filter: brightness(1.06); }
.btn-soft { background: #EEF1FC; color: var(--ab-navy); border: 0; }
.btn-soft:hover { background: #E2E7FA; color: var(--ab-navy); }
.btn-soft-danger { background: #FDECEC; color: var(--ab-red); border: 0; }
.btn-soft-danger:hover { background: #FAD9D9; color: #C7343A; }
.btn-soft-success { background: #E6F6EC; color: var(--ab-green); border: 0; }
.btn-soft-success:hover { background: #D3F0DE; color: #187C43; }

.form-label { font-weight: 600; font-size: .84rem; color: var(--ab-navy); margin-bottom: .3rem; }
.form-control, .form-select { border-radius: 12px; border-color: #D9DEF0; padding: .55rem .85rem; font-size: .92rem; }
.form-control:focus, .form-select:focus { border-color: var(--ab-navy-3); box-shadow: 0 0 0 .2rem rgba(59,91,214,.15); }
.form-text { color: var(--ab-muted); font-size: .78rem; }
.form-check-input:checked { background-color: var(--ab-navy-2); border-color: var(--ab-navy-2); }
textarea.form-control { min-height: 96px; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.field-validation-error { color: var(--ab-red); font-size: .8rem; }

.alert { border-radius: 14px; border: 0; }
.alert-success { background: #E6F6EC; color: #176B3C; }
.alert-danger { background: #FDECEC; color: #9B2C2C; white-space: pre-line; }
.alert-warning { background: #FFF6DB; color: #7A5700; }
.alert-info { background: #EEF1FC; color: var(--ab-navy); }

/* Tabs */
.tabs-ab { display: flex; gap: .4rem; border-bottom: 1px solid var(--ab-line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs-ab a {
  padding: .7rem 1rem; color: var(--ab-muted); font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap; font-size: .92rem;
}
.tabs-ab a.active { color: var(--ab-navy); border-color: var(--ab-navy-2); font-weight: 600; }
.tabs-ab a .count { background: #EEF1FC; color: var(--ab-navy); border-radius: 999px; padding: 0 .5rem; font-size: .72rem; margin-left: .3rem; }

/* Lesson resource categories */
.cat-card {
  border-radius: 16px; border: 1px solid var(--ab-line); padding: 1rem 1.1rem; background: #fff; height: 100%;
  box-shadow: 0 4px 14px rgba(31,47,134,.05);
}
.cat-card .cat-icon {
  width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.cat-1 .cat-icon { background: #E8ECFF; color: var(--ab-navy-2); }
.cat-2 .cat-icon { background: #F6EEDD; color: var(--ab-gold-2); }
.cat-3 .cat-icon { background: #FDECEC; color: var(--ab-red); }
.cat-4 .cat-icon { background: #E3F6F3; color: var(--ab-teal); }
.cat-5 .cat-icon { background: #FFF4D6; color: #B07A00; }
.cat-6 .cat-icon { background: #EEE8FF; color: #6A4FD0; }

.res-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-top: 1px dashed var(--ab-line); }
.res-row:first-of-type { border-top: 0; }
.res-row .meta { font-size: .76rem; color: var(--ab-muted); }

/* Question cards */
.q-card { border: 1px solid var(--ab-line); border-radius: 14px; padding: .9rem 1rem; background: #fff; }
.q-card + .q-card { margin-top: .6rem; }
.q-card .q-text { font-weight: 500; }
.q-opt { display: flex; gap: .5rem; align-items: flex-start; font-size: .86rem; padding: .15rem 0; color: #3B4266; }
.q-opt .letter { width: 22px; height: 22px; border-radius: 7px; background: #EEF1FC; color: var(--ab-navy); font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.q-opt.correct .letter { background: var(--ab-green); color: #fff; }
.q-opt.selected.wrong .letter { background: var(--ab-red); color: #fff; }
.q-opt.correct { color: #176B3C; font-weight: 600; }

/* Section meter for the three-part blueprint */
.blueprint { display: flex; border-radius: 12px; overflow: hidden; height: 12px; background: #EEF1FC; }
.blueprint span { display: block; height: 100%; }
.blueprint .s { background: #3CB27A; } .blueprint .m { background: #FFB703; } .blueprint .e { background: #F26D6D; }

.progress-ab { height: 9px; border-radius: 999px; background: #EAEFFC; overflow: hidden; }
.progress-ab > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ab-navy-3), var(--ab-navy)); }

/* Guidance infographic preview */
.g-section { border-radius: 16px; border: 1px solid var(--ab-line); background: #fff; padding: 1.1rem; }
.g-section + .g-section { margin-top: .9rem; }
.g-icon { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, var(--ab-navy-3), var(--ab-navy)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.g-item { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .2rem; border-top: 1px dashed var(--ab-line); }
.g-step { width: 26px; height: 26px; border-radius: 50%; background: var(--ab-gold); color: #fff; font-size: .78rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Auth screens */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
  background: #fff;
}
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 500px at 120% -10%, rgba(255,255,255,.18), transparent 60%),
              linear-gradient(160deg, #4050C8 0%, var(--ab-navy) 50%, var(--ab-navy-dark) 100%);
}
.auth-art h1 { color: #fff; font-size: 2.1rem; }
.auth-art p { color: #D7DDFF; max-width: 460px; }
.auth-art .mosque { position: absolute; bottom: 0; left: 0; width: 100%; opacity: .16; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-form .inner { width: 100%; max-width: 420px; }
@media (max-width: 991.98px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { padding: 2rem 1.5rem; min-height: 220px; }
  .auth-art h1 { font-size: 1.5rem; }
}

.empty {
  text-align: center; padding: 2.5rem 1rem; color: var(--ab-muted);
}
.empty i { font-size: 2.4rem; color: #B8C1E8; display: block; margin-bottom: .5rem; }

.pager { display: flex; gap: .35rem; align-items: center; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 .6rem; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #EEF1FC; color: var(--ab-navy); font-size: .85rem; }
.pager span.current { background: var(--ab-navy-2); color: #fff; }
.pager span.disabled { opacity: .45; }

.kbd-hint { font-size: .75rem; color: var(--ab-muted); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--ab-bg) 30%); padding-top: 1rem; }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: .4rem; }
.icon-pick label { border: 1.5px solid var(--ab-line); border-radius: 12px; height: 46px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.15rem; color: var(--ab-navy); }
.icon-pick input { display: none; }
.icon-pick input:checked + label { border-color: var(--ab-navy-2); background: #EEF1FC; box-shadow: 0 0 0 3px rgba(59,91,214,.15); }

.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
