/* ============================================================
   jamia.css — Self-contained styles, zero external requests
   جامعہ اسلامیہ بکرآباد
   ============================================================ */

/* Load Noto Nastaliq Urdu locally — 156KB woff2, loads fast on mobile */
@font-face {
    font-family: 'NotoNastaliq';
    src: url('/assets/fonts/NotoNastaliqUrdu.woff2') format('woff2');
    font-weight: normal;
    font-style:  normal;
    font-display: swap;
}

* {
    font-family:
        'NotoNastaliq',
        'Noto Nastaliq Urdu',
        'Jameel Noori Nastaleeq',
        'Urdu Typesetting',
        serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================================
   Base
   ============================================================ */
html { font-size: 16px; }
body { background: #F2F4F7; min-height: 100vh; direction: rtl; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
input, select, textarea, button {
    font-family: inherit;
    font-size: 1rem;
}

/* ============================================================
   Layout
   ============================================================ */
.container { max-width: 700px; margin: 0 auto; padding: 0 1rem; }
.page-content { padding: 1.25rem 1rem; }

/* ============================================================
   Navigation
   ============================================================ */
.nav {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-inner {
    max-width: 700px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.nav-sub   { font-size: 0.75rem; color: #a5d6a7; }
.nav-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; cursor: pointer;
    border: 2px solid rgba(255,255,255,0.3);
    overflow: hidden;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Dropdown menu */
.nav-menu {
    position: absolute; top: calc(100% + 8px); left: 0;
    background: white; border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid #e5e7eb;
    min-width: 200px; overflow: hidden;
    display: none; z-index: 200;
}
.nav-menu.open { display: block; }
.nav-menu-header { padding: 0.75rem 1rem; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.nav-menu-header .name  { font-weight: 700; font-size: 0.9rem; color: #1f2937; }
.nav-menu-header .role  { font-size: 0.75rem; color: #6b7280; }
.nav-menu a {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; color: #374151; font-size: 0.9rem;
}
.nav-menu a:hover { background: #f9fafb; }
.nav-menu a.danger { color: #dc2626; }
.nav-menu a.danger:hover { background: #fef2f2; }
.nav-menu-divider { border-top: 1px solid #e5e7eb; }
.nav-menu-wrapper { position: relative; }

/* ============================================================
   Impersonation Banner
   ============================================================ */
.impersonation-banner {
    background: #fbbf24; color: #78350f;
    text-align: center; padding: 0.5rem 1rem;
    font-size: 0.85rem; font-weight: 600;
}
.impersonation-banner a { color: #92400e; text-decoration: underline; font-weight: 700; }

/* ============================================================
   Cards
   ============================================================ */
.card {
    background: white; border-radius: 1rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.card-p { padding: 1.25rem; }
.card-header {
    padding: 1rem 1.25rem; border-bottom: 1px solid #f3f4f6;
    font-weight: 700; font-size: 1.05rem; color: #1f2937;
    text-align: right;
}

/* ============================================================
   Welcome Header
   ============================================================ */
.welcome-header {
    background: linear-gradient(135deg, #1B5E20, #2E7D32, #43A047);
    color: white; border-radius: 1rem; padding: 1.25rem;
    margin-bottom: 1rem;
}
.welcome-header .title { font-size: 1.2rem; font-weight: 700; }
.welcome-header .sub   { font-size: 0.8rem; color: #a5d6a7; margin-top: 0.25rem; }

/* ============================================================
   Stats Grid
   ============================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.stats-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stat-card {
    background: white; border-radius: 1rem; padding: 1rem;
    text-align: center; border: 1px solid #e5e7eb;
}
.stat-number { font-size: 1.8rem; font-weight: 700; }
.stat-label  { font-size: 0.7rem; color: #6b7280; margin-top: 0.2rem; }
.stat-green  { color: #15803d; }
.stat-blue   { color: #1d4ed8; }
.stat-purple { color: #7c3aed; }

/* ============================================================
   Menu Tiles
   ============================================================ */
.tile-section-label {
    font-size: 0.75rem; font-weight: 600; color: #6b7280;
    padding: 0 0.25rem; margin: 1rem 0 0.5rem;
}
.tile {
    background: white; border-radius: 1rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.25rem; margin-bottom: 0.75rem;
    cursor: pointer; transition: background 0.15s;
    text-align: right;
}
.tile:hover { background: #f9fafb; }
.tile-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}
.tile-body { flex: 1; min-width: 0; }
.tile-title { font-weight: 700; font-size: 1rem; color: #1f2937; }
.tile-sub   { font-size: 0.75rem; color: #6b7280; margin-top: 0.15rem; }
.tile-arrow { color: #9ca3af; font-size: 1.2rem; flex-shrink: 0; }

/* Tile icon colors */
.icon-green  { background: #dcfce7; }
.icon-blue   { background: #dbeafe; }
.icon-teal   { background: #ccfbf1; }
.icon-yellow { background: #fef9c3; }
.icon-purple { background: #ede9fe; }
.icon-orange { background: #ffedd5; }
.icon-red    { background: #fee2e2; }
.icon-pink   { background: #fce7f3; }
.icon-gray   { background: #f3f4f6; }
.icon-indigo { background: #e0e7ff; }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 1rem; }
.form-label {
    display: block; text-align: right;
    font-size: 0.85rem; font-weight: 600; color: #374151;
    margin-bottom: 0.35rem;
}
.form-control {
    width: 100%; border: 1.5px solid #d1d5db; border-radius: 0.75rem;
    padding: 0.75rem 1rem; font-size: 0.95rem; text-align: right;
    font-family: inherit; color: #1f2937;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: white;
}
.form-control:focus {
    outline: none; border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}
.form-control:disabled { background: #f9fafb; color: #9ca3af; cursor: not-allowed; }
.form-hint { font-size: 0.72rem; color: #9ca3af; margin-top: 0.25rem; text-align: right; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.4rem; padding: 0.7rem 1.25rem;
    border-radius: 0.75rem; font-weight: 700; font-size: 0.9rem;
    border: none; cursor: pointer; transition: all 0.15s;
    font-family: inherit;
}
.btn-block { width: 100%; display: flex; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; border-radius: 1rem; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; border-radius: 0.5rem; }

.btn-primary   { background: #15803d; color: white; }
.btn-primary:hover   { background: #166534; }
.btn-secondary { background: #f3f4f6; color: #374151; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-danger    { background: #fee2e2; color: #dc2626; }
.btn-danger:hover    { background: #fecaca; }
.btn-blue      { background: #dbeafe; color: #1d4ed8; }
.btn-blue:hover      { background: #bfdbfe; }
.btn-warning   { background: #fef9c3; color: #a16207; }

/* ============================================================
   Alerts
   ============================================================ */
.alert { border-radius: 0.75rem; padding: 0.85rem 1rem; margin-bottom: 1rem; font-size: 0.88rem; text-align: right; }
.alert ul { padding-right: 1rem; }
.alert li { margin-bottom: 0.15rem; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
    display: inline-block; padding: 0.2rem 0.6rem;
    border-radius: 9999px; font-size: 0.72rem; font-weight: 600;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: #f3f4f6; color: #6b7280; }
.badge-orange { background: #ffedd5; color: #c2410c; }

/* ============================================================
   Teacher / Student Cards
   ============================================================ */
.person-card {
    background: white; border-radius: 1rem; border: 1px solid #e5e7eb;
    padding: 1rem 1.25rem; margin-bottom: 0.75rem;
    display: flex; align-items: center; gap: 0.85rem;
}
.person-card.inactive { opacity: 0.55; }
.person-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: #dcfce7; color: #15803d;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
    overflow: hidden; border: 2px solid #e5e7eb;
}
.person-avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-info { flex: 1; text-align: right; min-width: 0; }
.person-name { font-weight: 700; font-size: 1rem; color: #1f2937; }
.person-meta { font-size: 0.75rem; color: #6b7280; margin-top: 0.2rem; }
.person-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* ============================================================
   Photo Upload Preview
   ============================================================ */
.photo-upload-wrap { display: flex; align-items: center; gap: 1rem; }
.photo-preview-circle {
    width: 80px; height: 80px; border-radius: 50%;
    background: #f3f4f6; border: 2px dashed #d1d5db;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0; font-size: 2rem;
}
.photo-preview-circle img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload-input { flex: 1; }
.photo-upload-input input[type=file] { font-size: 0.8rem; color: #6b7280; width: 100%; }

/* ============================================================
   Search Bar
   ============================================================ */
.search-bar {
    position: relative; margin-bottom: 1rem;
}
.search-bar input {
    width: 100%; padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1.5px solid #d1d5db; border-radius: 0.75rem;
    font-size: 0.9rem; text-align: right; font-family: inherit;
    background: white;
}
.search-bar input:focus { outline: none; border-color: #16a34a; }
.search-bar .search-icon {
    position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
    color: #9ca3af; pointer-events: none;
}

/* ============================================================
   Page Header Row
   ============================================================ */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem;
}
.page-title { font-size: 1.2rem; font-weight: 700; color: #1f2937; }
.back-link  { font-size: 0.85rem; color: #15803d; }

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
    text-align: center; padding: 3rem 1rem; color: #9ca3af;
    font-size: 0.95rem;
}
.empty-state .emoji { font-size: 3rem; margin-bottom: 0.75rem; }

/* ============================================================
   Count Badge
   ============================================================ */
.count-label { font-size: 0.75rem; color: #6b7280; margin-bottom: 0.5rem; text-align: left; }

/* ============================================================
   Utility
   ============================================================ */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-sm     { font-size: 0.85rem; }
.text-xs     { font-size: 0.75rem; }
.text-gray   { color: #6b7280; }
.text-green  { color: #15803d; }
.text-red    { color: #dc2626; }
.font-bold   { font-weight: 700; }
.flex        { display: flex; }
.items-center{ align-items: center; }
.gap-2       { gap: 0.5rem; }
.gap-3       { gap: 0.75rem; }
.w-full      { width: 100%; }
.hidden      { display: none; }

/* ============================================================
   Class Filter Tabs
   ============================================================ */
.class-tabs {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.class-tab {
    padding: 0.4rem 0.85rem; border-radius: 9999px;
    border: 1.5px solid #d1d5db; background: white;
    font-size: 0.82rem; font-family: inherit; cursor: pointer;
    color: #374151; transition: all 0.15s;
}
.class-tab.active {
    background: #15803d; border-color: #15803d; color: white; font-weight: 700;
}
.class-tab:hover:not(.active) { border-color: #15803d; color: #15803d; }

/* Live search input (no button) */
.search-live input {
    width: 100%; padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1.5px solid #d1d5db; border-radius: 0.75rem;
    font-size: 0.9rem; text-align: right; font-family: inherit;
    background: white;
}
.search-live input:focus { outline: none; border-color: #16a34a; }
.search-live .search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: #9ca3af; }

/* ============================================================
   Welcome header inner row fix
   ============================================================ */
.welcome-header-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.welcome-header-row .title { font-size: 1.1rem; font-weight: 700; }
.welcome-header-row .sub   { font-size: 0.8rem; color: #a5d6a7; margin-top: 0.2rem; }

/* Font size boost for Nastaleeq — this font renders better slightly larger */
body { font-size: 17px; }
.tile-title  { font-size: 1.05rem; }
.tile-sub    { font-size: 0.82rem; }
.nav-brand   { font-size: 1.05rem; }
.form-label  { font-size: 0.9rem; }
.btn         { font-size: 0.95rem; }
