/* ইসলামিয়া মডেল একাডেমি — স্টাইলশিট */
:root {
    --green-deep: #1a4731;
    --green-mid: #2d6a4f;
    --green-light: #40916c;
    --green-pale: #d8f3dc;
    --gold: #c9a84c;
    --gold-light: #f4e4b0;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f0;
    --gray-200: #e2e8e0;
    --gray-400: #94a394;
    --gray-600: #4b5b4b;
    --gray-800: #1e2b1e;
    --red: #c0392b;
    --red-light: #fdecea;
    --yellow: #d68910;
    --yellow-light: #fef9e7;
    --sidebar-w: 220px;
    --nav-h: 60px;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --font-bn: 'Noto Serif Bengali', serif;
    --font-ui: 'Noto Sans Bengali', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-ui);
    background: var(--gray-100);
    color: var(--gray-800);
    font-size: 15px;
    line-height: 1.6;
}

/* ===== TOPNAV ===== */
.topnav {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: var(--green-deep);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.nav-brand { display: flex; align-items: center; gap: 12px; }

.brand-logo {
    width: 40px; height: 40px;
    background: var(--gold);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-bn);
    font-size: 22px; font-weight: 700;
    color: var(--green-deep);
}

.brand-text { display: flex; flex-direction: column; }
.brand-main { font-family: var(--font-bn); font-size: 16px; font-weight: 700; color: var(--white); }
.brand-sub { font-size: 11px; color: var(--green-pale); letter-spacing: 0.5px; }

.nav-right { display: flex; align-items: center; gap: 14px; }

.user-info { display: flex; align-items: center; gap: 10px; }

.user-avatar {
    width: 36px; height: 36px;
    background: var(--gold);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-bn); font-weight: 700; font-size: 16px;
    color: var(--green-deep);
}

.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 600; color: var(--white); }
.user-role { font-size: 11px; color: var(--green-pale); }

.btn-logout {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: var(--nav-h); left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    z-index: 900;
    padding: 16px 0;
}

.sidebar-menu { display: flex; flex-direction: column; }

.menu-group-label {
    font-size: 10px; font-weight: 600;
    color: var(--gray-400);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 12px 18px 4px;
}

.menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: var(--gray-100);
    color: var(--green-mid);
    border-left-color: var(--green-light);
}

.menu-item.active {
    background: var(--green-pale);
    color: var(--green-deep);
    font-weight: 600;
    border-left-color: var(--green-mid);
}

.menu-icon { font-size: 16px; width: 20px; text-align: center; }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-top: var(--nav-h);
    margin-left: var(--sidebar-w);
    padding: 28px;
    min-height: calc(100vh - var(--nav-h));
}

.main-content.full-width { margin-left: 0; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-family: var(--font-bn);
    font-size: 22px; font-weight: 700;
    color: var(--green-deep);
}

.page-title small {
    display: block;
    font-size: 13px; font-weight: 400;
    color: var(--gray-400);
    font-family: var(--font-ui);
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    font-weight: 600; font-size: 15px;
    color: var(--green-deep);
}

.card-body { padding: 20px; }

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--green-light);
    text-align: center;
}

.stat-card.gold { border-top-color: var(--gold); }
.stat-card.red { border-top-color: var(--red); }
.stat-card.yellow { border-top-color: var(--yellow); }

.stat-num {
    font-size: 36px; font-weight: 700;
    color: var(--green-deep);
    line-height: 1;
}

.stat-card.gold .stat-num { color: var(--gold); }
.stat-card.red .stat-num { color: var(--red); }
.stat-card.yellow .stat-num { color: var(--yellow); }

.stat-label { font-size: 13px; color: var(--gray-400); margin-top: 6px; }

/* ===== FORMS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

label {
    font-size: 13px; font-weight: 600;
    color: var(--gray-600);
}

label .req { color: var(--red); margin-left: 2px; }

input[type=text], input[type=date], input[type=email],
input[type=tel], input[type=number], input[type=password],
input[type=file], select, textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--green-light);
    box-shadow: 0 0 0 3px rgba(64,145,108,0.15);
}

textarea { resize: vertical; min-height: 90px; }

.section-divider {
    grid-column: 1 / -1;
    border: none;
    border-top: 2px dashed var(--gray-200);
    margin: 8px 0;
    position: relative;
}

.section-title {
    grid-column: 1 / -1;
    font-family: var(--font-bn);
    font-size: 16px; font-weight: 700;
    color: var(--green-mid);
    padding: 4px 0;
    border-bottom: 2px solid var(--green-pale);
    margin-bottom: 4px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px;
    border-radius: 7px;
    font-family: var(--font-ui);
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary { background: var(--green-mid); color: var(--white); }
.btn-primary:hover { background: var(--green-deep); }

.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: #b8943c; }

.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #a93226; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--green-mid);
    color: var(--green-mid);
}
.btn-outline:hover { background: var(--green-pale); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    background: var(--green-deep);
    color: var(--white);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--gray-200); transition: background 0.15s; }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 11px 14px; vertical-align: middle; }

.student-photo {
    width: 38px; height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--green-pale);
}

.no-photo {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--green-pale);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--green-mid);
    font-family: var(--font-bn); font-weight: 700;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px; font-weight: 600;
}

.badge-success { background: var(--green-pale); color: var(--green-deep); }
.badge-warning { background: var(--yellow-light); color: var(--yellow); }
.badge-danger { background: var(--red-light); color: var(--red); }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid;
}

.alert-success { background: var(--green-pale); border-color: var(--green-mid); color: var(--green-deep); }
.alert-warning { background: var(--yellow-light); border-color: var(--yellow); color: var(--yellow); }
.alert-danger { background: var(--red-light); border-color: var(--red); color: var(--red); }

/* ===== SEARCH BAR ===== */
.search-bar {
    display: flex; gap: 10px; align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-bar input, .search-bar select {
    flex: 1; min-width: 160px; max-width: 260px;
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center; justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 90%; max-width: 520px;
    padding: 28px;
    position: relative;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-title {
    font-family: var(--font-bn);
    font-size: 18px; font-weight: 700;
    color: var(--green-deep);
    margin-bottom: 16px;
}

.modal-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none;
    font-size: 22px; cursor: pointer; color: var(--gray-400);
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 60%, var(--green-light) 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%; max-width: 420px;
    overflow: hidden;
}

.login-header {
    background: var(--green-deep);
    padding: 32px 28px;
    text-align: center;
}

.login-logo {
    width: 70px; height: 70px;
    background: var(--gold);
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-bn); font-size: 36px; font-weight: 700;
    color: var(--green-deep);
}

.login-title {
    font-family: var(--font-bn);
    font-size: 20px; font-weight: 700;
    color: var(--white);
}

.login-subtitle { font-size: 13px; color: var(--green-pale); margin-top: 4px; }

.login-body { padding: 28px; }

.login-body .form-group { margin-bottom: 16px; }

/* ===== DETAIL VIEW ===== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: 12px; color: var(--gray-400); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-value { font-size: 15px; color: var(--gray-800); }

.student-big-photo {
    width: 100px; height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid var(--green-pale);
    display: block; margin: 0 auto 16px;
}

/* ===== FOOTER ===== */
.site-footer {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-200);
    margin-top: 40px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.d-flex { display: flex; }
.gap-2 { gap: 10px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
