/* ============================================================
   MT-INSTITUTE Fee Management System — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
    --sidebar-w: 255px;
    --sidebar-collapsed: 70px;
    --primary: #1a3c6e;
    --primary-light: #2563eb;
    --primary-pale: #eff6ff;
    --accent: #0ea5e9;
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #0891b2;
    --info-light: #e0f2fe;
    --text-dark: #0f172a;
    --text-mid: #475569;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.13);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.22s ease;
    --topnav-h: 62px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-body);
    color: var(--text-dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 45%, #1d4ed8 100%);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    top: -200px; right: -150px;
}
.login-page::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    bottom: -150px; left: -100px;
}
.login-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}
.login-brand {
    text-align: center;
    margin-bottom: 32px;
}
.login-brand-icon {
    width: 68px; height: 68px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    margin-bottom: 14px;
    box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}
.login-brand h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}
.login-brand p {
    font-size: 0.82rem;
    color: var(--text-mid);
    margin-top: 4px;
    font-weight: 500;
}
.login-card .form-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.login-card .form-control {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.login-card .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    outline: none;
}
.btn-login {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    color: #fff;
    width: 100%;
    padding: 13px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
    margin-top: 6px;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.btn-login:hover {
    opacity: 0.93;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(37,99,235,0.4);
}
.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.78rem;
    color: var(--text-light);
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.wrapper { display: flex; min-height: 100vh; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1a3c6e 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    transition: width var(--transition);
    overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    min-height: 72px;
}
.brand-icon {
    width: 40px; height: 40px; flex-shrink: 0;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
}
.brand-name {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.brand-sub {
    display: block;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.45);
    font-weight: 400;
    white-space: nowrap;
}

.sidebar-nav { flex: 1; padding: 14px 0; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
.nav-list { list-style: none; }
.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.3);
    padding: 14px 20px 6px;
    white-space: nowrap;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
    margin: 1px 8px;
    border-radius: var(--radius-sm);
}
.nav-link i { font-size: 17px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-link.active {
    background: linear-gradient(90deg, rgba(37,99,235,0.35), rgba(37,99,235,0.15));
    color: #fff;
    border-left: 3px solid var(--accent);
}

.sidebar-footer {
    padding: 14px 8px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.logout-btn:hover { background: rgba(220,38,38,0.2); color: #fca5a5; }

/* Collapsed sidebar */
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .logout-btn span { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px; margin: 2px 10px; }
.sidebar.collapsed .logout-btn { justify-content: center; padding: 12px; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 16px; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    transition: margin-left var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.main-content.expanded { margin-left: var(--sidebar-collapsed); }

/* ── Top Navbar ── */
.topnav {
    height: var(--topnav-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.sidebar-toggle {
    background: none; border: none;
    font-size: 22px;
    color: var(--text-mid);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    line-height: 1;
}
.sidebar-toggle:hover { background: var(--bg-body); }
.topnav-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}
.topnav-search {
    margin: 0 16px;
}
.topnav-search .input-group-text {
    border-color: var(--border);
    transition: background-color var(--transition), border-color var(--transition);
}
.topnav-search .form-control {
    border-color: var(--border);
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.topnav-search .form-control:focus {
    background-color: #fff !important;
    border-color: var(--primary-light) !important;
    box-shadow: none !important;
}
.topnav-right { display: flex; align-items: center; margin-left: auto; }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 17px;
}
.user-name { font-size: 0.87rem; font-weight: 600; color: var(--text-dark); display: block; }
.user-role { font-size: 0.68rem; background: var(--primary-pale); color: var(--primary-light); border: none; }

/* ── Page Content ── */
.page-content { padding: 28px 28px; flex: 1; }

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
    height: 100%;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 54px; height: 54px; flex-shrink: 0;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.red { background: #fee2e2; color: #dc2626; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-icon.teal { background: #f0fdfa; color: #0d9488; }
.stat-label { font-size: 0.78rem; font-weight: 600; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text-dark); line-height: 1.1; margin-top: 2px; }
.stat-sub { font-size: 0.75rem; color: var(--text-light); margin-top: 3px; }

/* ============================================================
   CARDS & PANELS
   ============================================================ */
.panel {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.panel-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.panel-title {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-title i { color: var(--primary-light); }
.panel-body { padding: 22px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}
.data-table th {
    background: var(--bg-body);
    padding: 11px 14px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-mid);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dark);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-body); }

/* ============================================================
   FORMS
   ============================================================ */
.form-label { font-weight: 600; font-size: 0.82rem; color: var(--text-mid); margin-bottom: 5px; }
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 13px;
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: 'Inter', sans-serif;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
    outline: none;
}
.form-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-pale);
    margin-bottom: 16px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { font-family: 'Inter', sans-serif; font-weight: 600; border-radius: var(--radius-sm); }
.btn-primary { background: var(--primary-light); border-color: var(--primary-light); }
.btn-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge-active { background: var(--success-light); color: var(--success); padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.badge-completed { background: var(--info-light); color: var(--info); padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.badge-dropped { background: var(--danger-light); color: var(--danger); padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.reg-no { font-size: 0.78rem; font-weight: 700; color: var(--primary); background: var(--primary-pale); padding: 3px 8px; border-radius: 6px; }

/* Fee summary badges */
.fee-pkg  { color: var(--text-mid);  font-weight: 600; }
.fee-recv { color: var(--success);   font-weight: 700; }
.fee-due  { color: var(--danger);    font-weight: 700; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header-title { font-size: 1.35rem; font-weight: 800; color: var(--text-dark); }
.page-header-sub { font-size: 0.82rem; color: var(--text-light); margin-top: 2px; }

/* ============================================================
   SEARCH BOX
   ============================================================ */
.search-box { position: relative; }
.search-box input { padding-left: 38px; }
.search-box .search-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* ============================================================
   FEE COLLECT SEARCH
   ============================================================ */
.student-found-card {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1.5px solid #bae6fd;
    border-radius: var(--radius);
    padding: 22px;
    margin-top: 16px;
}
.fee-bar { height: 10px; border-radius: 10px; background: var(--border); margin-top: 8px; overflow: hidden; }
.fee-bar-fill { height: 100%; background: linear-gradient(90deg, #16a34a, #22c55e); border-radius: 10px; transition: width 0.5s ease; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 18px 14px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.35s ease both; }

/* Alert */
.alert { border-radius: var(--radius-sm); font-size: 0.9rem; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }
