/* ============================================================
   School Management System - Main Stylesheet
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --topbar-height: 64px;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #4f46e5;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: color 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
    --transition-transform: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   DARK MODE PALETTE
   ============================================================ */
[data-bs-theme="dark"], body.dark-mode, .dark-mode {
    --body-bg: #0b0f19;
    --card-bg: #131b2e;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #232f48;
    --sidebar-bg: #070b14;
    --sidebar-text: #94a3b8;
    --primary-light: #1e1b4b;
    --dark: #f8fafc;
    --light: #1e293b;
}

[data-bs-theme="dark"] .card, body.dark-mode .card {
    background-color: var(--card-bg) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table, body.dark-mode .table {
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-bs-theme="dark"] .table th, [data-bs-theme="dark"] .table td,
body.dark-mode .table th, body.dark-mode .table td {
    border-color: var(--border) !important;
    background-color: transparent !important;
}

[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select,
body.dark-mode .form-control, body.dark-mode .form-select {
    background-color: #1a233a !important;
    border-color: #2a3756 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .form-control:focus, [data-bs-theme="dark"] .form-select:focus,
body.dark-mode .form-control:focus, body.dark-mode .form-select:focus {
    background-color: #1f2a45 !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .top-navbar, body.dark-mode .top-navbar {
    background-color: #131b2e !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .dropdown-menu, body.dark-mode .dropdown-menu {
    background-color: #151c2c !important;
    border-color: #2a3756 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .dropdown-item, body.dark-mode .dropdown-item {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .dropdown-item:hover, body.dark-mode .dropdown-item:hover {
    background-color: rgba(255,255,255,0.08) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .bg-light, body.dark-mode .bg-light {
    background-color: #1a233a !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .bg-white, body.dark-mode .bg-white {
    background-color: #131b2e !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .border, body.dark-mode .border {
    border-color: #232f48 !important;
}

[data-bs-theme="dark"] .text-dark, body.dark-mode .text-dark {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .text-muted, body.dark-mode .text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .modal-content, body.dark-mode .modal-content {
    background-color: #131b2e !important;
    color: #f1f5f9 !important;
    border-color: #2a3756 !important;
}

[data-bs-theme="dark"] .modal-header, [data-bs-theme="dark"] .modal-footer,
body.dark-mode .modal-header, body.dark-mode .modal-footer {
    border-color: #232f48 !important;
}

[data-bs-theme="dark"] .offcanvas, body.dark-mode .offcanvas {
    background-color: #131b2e !important;
    color: #f1f5f9 !important;
}

/* Bottom Mobile App Bar for PWA feel */
.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1030;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.06);
}

[data-bs-theme="dark"] .mobile-bottom-bar, body.dark-mode .mobile-bottom-bar {
    background: #0f172a;
    border-top-color: #1e293b;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.4);
}

.mobile-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    flex: 1;
    height: 100%;
    transition: all 0.2s ease;
}

.mobile-bottom-item i {
    font-size: 18px;
    margin-bottom: 2px;
}

.mobile-bottom-item.active, .mobile-bottom-item:hover {
    color: var(--primary);
}

[data-bs-theme="dark"] .mobile-bottom-item, body.dark-mode .mobile-bottom-item {
    color: #94a3b8;
}

[data-bs-theme="dark"] .mobile-bottom-item.active, body.dark-mode .mobile-bottom-item.active {
    color: #60a5fa;
}

/* ---- Reset & Base ---- */
* {
    box-sizing: border-box;
    scrollbar-width: auto;
    scrollbar-color: #6366f1 #e2e8f0;
}

[data-bs-theme="dark"] *, body.dark-mode * {
    scrollbar-color: #818cf8 #1e293b;
}

/* ============================================================
   PREMIUM 3D HIGHLIGHTED SCROLLBAR SYSTEM (THICK & VIBRANT)
   ============================================================ */
/* Global WebKit (Chrome, Edge, Safari, Opera, Brave) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #3b82f6 100%);
    border-radius: 8px;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 8px rgba(79, 70, 229, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.6);
    cursor: grab;
    transition: all 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 50%, #2563eb 100%);
    border: 2px solid #f8fafc;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.65), inset 0 1px 3px rgba(255, 255, 255, 0.85);
}

::-webkit-scrollbar-thumb:active {
    cursor: grabbing;
    background: linear-gradient(135deg, #312e81 0%, #1e1b4b 50%, #1d4ed8 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35), inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Dark Mode Global Scrollbar */
[data-bs-theme="dark"] ::-webkit-scrollbar-track, body.dark-mode ::-webkit-scrollbar-track {
    background: #0f172a;
    border: 1px solid #1e293b;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb, body.dark-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 50%, #3b82f6 100%);
    border: 2px solid #1e293b;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover, body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 50%, #60a5fa 100%);
    box-shadow: 0 0 16px rgba(129, 140, 248, 0.85), inset 0 1px 3px rgba(255, 255, 255, 0.7);
}

body {
    font-family: var(--font-family);
    background: var(--body-bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a, button, input, select, textarea, .nav-link, .btn, .dropdown-item {
    touch-action: manipulation;
}

/* Lightning-Fast Snappy Accordion & Collapse */
.collapsing {
    transition: height 0.08s ease-out !important;
}

.sidebar .collapsing {
    transition: height 0.06s ease-out !important;
}

a { color: var(--primary); text-decoration: none; transition: color 0.1s ease; }
a:hover { color: var(--primary-dark); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: var(--transition-transform);
    overflow: hidden;
    will-change: transform;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: var(--topbar-height);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 24px;
}

.sidebar-brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-close {
    color: var(--sidebar-text);
    display: none;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: #6366f1 rgba(15, 23, 42, 0.6);
}

.sidebar-body::-webkit-scrollbar {
    width: 9px;
}

.sidebar-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.65);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.sidebar-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #818cf8 0%, #6366f1 50%, #3b82f6 100%);
    border-radius: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.5);
    cursor: grab;
}

.sidebar-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a5b4fc 0%, #818cf8 50%, #60a5fa 100%);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 14px rgba(129, 140, 248, 0.85), inset 0 1px 2px rgba(255, 255, 255, 0.7);
}

.sidebar-body::-webkit-scrollbar-thumb:active {
    cursor: grabbing;
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Nav Items */
.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item { margin: 2px 8px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--sidebar-text);
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 13.5px;
    font-weight: 400;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.nav-link:active {
    transform: scale(0.985);
}

.nav-link.active {
    color: #fff;
    background: var(--sidebar-active);
    font-weight: 500;
}

.nav-link i:first-child {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nav-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-link:not(.collapsed) .nav-arrow {
    transform: rotate(180deg);
}

/* Sub Nav */
.nav-sub {
    list-style: none;
    padding: 4px 0 4px 50px;
    margin: 0;
}

.nav-sub li a {
    display: block;
    padding: 7px 16px;
    color: var(--sidebar-text);
    font-size: 13px;
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.nav-sub li a:hover,
.nav-sub li a.active {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.nav-sub li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1.5px solid var(--sidebar-text);
    transition: var(--transition);
}

.nav-sub li a:hover,
.nav-sub li a.active {
    color: #fff;
}

.nav-sub li a.active::before {
    background: var(--sidebar-active);
    border-color: var(--sidebar-active);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
    pointer-events: none !important;
}
.sidebar-overlay.show {
    display: block !important;
    pointer-events: auto !important;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.top-navbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.top-navbar .btn-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px;
}

.top-navbar .btn-link:hover {
    color: var(--text-primary);
}

.sidebar-toggle { display: none; }

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 20px;
    flex-shrink: 0;
}

.avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-badge {
    font-size: 10px;
    padding: 2px 5px;
}

.breadcrumb { font-size: 12px; }
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item.active { color: var(--text-secondary); }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
    padding: 24px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body { padding: 20px; }

/* Stat Cards */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.bg-primary-light { background: #eef2ff; color: var(--primary); }
.stat-icon.bg-success-light { background: #f0fdf4; color: var(--success); }
.stat-icon.bg-danger-light { background: #fef2f2; color: var(--danger); }
.stat-icon.bg-warning-light { background: #fffbeb; color: var(--warning); }
.stat-icon.bg-info-light { background: #eff6ff; color: var(--info); }

.stat-details h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.stat-details p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table {
    font-size: 13.5px;
}

.table thead th {
    background: var(--light);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.table-hover tbody tr:hover {
    background: var(--light);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
    border-radius: var(--radius);
    border-color: var(--border);
    font-size: 14px;
    padding: 8px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-text { font-size: 12px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 16px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

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

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-weight: 500;
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 6px;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    border-radius: var(--radius);
    font-size: 14px;
    border: none;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
/* ============================================================
   IEMIS NEPAL LOGIN PAGE
   ============================================================ */
.iemis-login-wrapper {
    min-height: 100vh;
    background-color: #063256;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    font-family: 'Mukta', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.iemis-top-header {
    text-align: center;
    margin-bottom: 25px;
}

.iemis-top-title {
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.iemis-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 920px;
    padding: 45px 50px 30px 50px;
}

.iemis-card-body {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.iemis-left-col {
    flex: 1 1 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-right: 25px;
}

.iemis-emblem {
    width: 110px;
    height: auto;
    margin-bottom: 14px;
}

.iemis-gov-text {
    color: #1e293b;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 12px;
}

.iemis-gov-title {
    font-size: 17px;
}

.iemis-gov-dept {
    font-size: 15.5px;
}

.iemis-gov-subdept {
    font-size: 15.5px;
}

.iemis-gov-location {
    font-size: 14.5px;
    font-weight: 600;
    color: #334155;
}

.iemis-contact-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
}

.iemis-contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #0284c7;
    font-weight: 500;
}

.iemis-contact-item i {
    font-size: 14px;
    color: #0b3b60;
}

.iemis-contact-item a {
    color: #0284c7;
    text-decoration: none;
    transition: color 0.2s;
}

.iemis-contact-item a:hover {
    color: #0369a1;
    text-decoration: underline;
}

.iemis-divider {
    width: 1.5px;
    background-color: #0b3b60;
    margin: 0 10px;
    align-self: stretch;
}

.iemis-right-col {
    flex: 1 1 380px;
    padding-left: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.iemis-form-title {
    color: #0b3b60;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 35px;
    text-transform: uppercase;
}

.iemis-form-group {
    position: relative;
    margin-bottom: 28px;
}

.iemis-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid #0b3b60;
    border-radius: 0;
    background: transparent;
    padding: 8px 30px 8px 0;
    font-size: 15px;
    color: #1e293b;
    transition: border-color 0.2s;
}

.iemis-input:focus {
    outline: none;
    border-bottom-color: #1b8bf2;
    box-shadow: none;
}

.iemis-input::placeholder {
    color: #94a3b8;
    font-size: 14px;
}

.iemis-toggle-pw {
    position: absolute;
    right: 0;
    bottom: 10px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
}

.iemis-forgot-wrap {
    text-align: right;
    margin-top: -12px;
    margin-bottom: 30px;
}

.iemis-forgot-link {
    color: #64748b;
    font-size: 13.5px;
    text-decoration: none;
    font-weight: 500;
}

.iemis-forgot-link:hover {
    color: #1b8bf2;
}

.iemis-btn-submit {
    background-color: #1b8bf2;
    color: #ffffff;
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.iemis-btn-submit:hover {
    background-color: #1372ca;
}

.iemis-btn-submit:active {
    transform: scale(0.99);
}

.iemis-footer-links {
    margin-top: 35px;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.iemis-footer-item {
    font-size: 13.5px;
    font-weight: 600;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: color 0.2s;
}

.iemis-footer-item:hover {
    color: #0369a1;
    text-decoration: underline;
}

.iemis-footer-item i {
    color: #0b3b60;
    font-size: 15px;
}

@media (max-width: 820px) {
    .iemis-card {
        padding: 30px 20px;
    }
    .iemis-divider {
        display: none;
    }
    .iemis-left-col {
        padding-right: 0;
        margin-bottom: 35px;
        padding-bottom: 25px;
        border-bottom: 1px solid #e2e8f0;
    }
    .iemis-right-col {
        padding-left: 0;
    }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted { color: var(--text-secondary) !important; }
.bg-light-custom { background: var(--light); }
.border-custom { border-color: var(--border) !important; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h5 {
    font-weight: 600;
    color: var(--text-primary);
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.filter-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

/* Quick Actions */
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: var(--transition);
    color: var(--text-primary);
    text-align: center;
    gap: 8px;
    background: var(--card-bg);
}

.quick-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-action i {
    font-size: 28px;
    color: var(--primary);
}

.quick-action span {
    font-size: 12.5px;
    font-weight: 500;
}

/* ============================================================
   RESPONSIVE LAYOUT ENGINE (Mobile, Tablet, Desktop Auto-Fix)
   ============================================================ */

/* Global Anti-Overflow Rules */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* Fluid Container & Main Content Bounds */
.main-content {
    max-width: 100%;
    overflow-x: hidden;
}

/* Enhanced Table Responsiveness */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.table-responsive::-webkit-scrollbar {
    height: 11px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #6366f1 0%, #4f46e5 50%, #3b82f6 100%);
    border-radius: 6px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
    cursor: grab;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #4338ca 0%, #3730a3 50%, #2563eb 100%);
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.6);
}

.table-responsive::-webkit-scrollbar-thumb:active {
    cursor: grabbing;
}

.table th, .table td {
    overflow-wrap: break-word;
    word-break: normal;
}

/* Auto-Wrap Action Buttons & Cards */
.btn-group-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-header-responsive {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Modal Responsiveness */
.modal-dialog {
    max-width: 95%;
    margin: 1.75rem auto;
}

@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px;
    }
    .modal-dialog.modal-lg {
        max-width: 800px;
    }
    .modal-dialog.modal-xl {
        max-width: 1140px;
    }
}

/* ============================================================
   RESPONSIVE DESIGN SYSTEM (DESKTOP / TABLET / MOBILE)
   ============================================================ */

/* Desktop Screens (min-width: 992px) */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0) !important;
        position: fixed;
        top: 0;
        left: 0;
        width: var(--sidebar-width);
        height: 100vh;
        z-index: 1040;
    }
    
    .sidebar-overlay {
        display: none !important;
        pointer-events: none !important;
    }

    .sidebar-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    /* Desktop Collapsible Mini Mode */
    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%) !important;
    }

    body.sidebar-collapsed .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Tablet & Mobile Screens (<= 991.98px) */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        width: 285px;
        max-width: 85vw;
        height: 100vh;
        z-index: 1060;
        box-shadow: none;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.show {
        transform: translateX(0) !important;
        box-shadow: 12px 0 35px rgba(0, 0, 0, 0.45) !important;
    }

    .sidebar-close { 
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        color: #ffffff !important;
        background: rgba(255, 255, 255, 0.15) !important;
        padding: 0;
        font-size: 14px;
        cursor: pointer;
    }
    
    .sidebar-overlay {
        display: none !important;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.65);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1055;
        pointer-events: none !important;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.show { 
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    .sidebar-toggle { 
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 8px;
        color: var(--text-primary) !important;
        font-size: 22px;
        padding: 0;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
    }

    .page-content {
        padding: 16px 14px;
    }

    .top-navbar {
        padding: 0 14px;
        height: 60px;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

/* Mobile Screens (<= 767.98px) */
@media (max-width: 767.98px) {
    .page-content {
        padding: 12px 10px;
    }

    .top-navbar {
        height: 56px;
        padding: 0 10px;
    }

    .top-navbar .avatar-sm {
        width: 32px;
        height: 32px;
    }

    /* Mobile Stat Cards */
    .stat-card {
        padding: 12px !important;
        border-radius: 12px !important;
        gap: 10px;
    }

    .stat-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 17px !important;
        border-radius: 10px !important;
    }

    .stat-details h3, .stat-details .fs-4 { 
        font-size: 18px !important; 
    }

    .card-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
        padding: 12px 14px;
    }

    .card-header > div,
    .card-header > a,
    .card-header > button {
        width: 100%;
    }

    .card-body {
        padding: 12px;
    }

    .filter-bar {
        padding: 10px;
    }

    .form-control, .form-select, .btn {
        font-size: 13px;
    }

    .btn {
        padding: 7px 12px;
        min-height: 38px;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 12px;
        min-height: 32px;
    }

    /* Fluid Touch Tables */
    .table-responsive {
        border-radius: 10px;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border);
    }

    .table {
        font-size: 12.5px;
    }

    .table td, .table th {
        padding: 8px 6px !important;
    }

    /* Modal Mobile Adaptations */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
    .page-content {
        padding: 8px 6px;
    }

    .card {
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .stat-card {
        padding: 10px !important;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .sidebar, .top-navbar, .sidebar-overlay { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
    .btn, .filter-bar { display: none !important; }
}

