/* Custom Styles for MG Student Invoice & Payment Portal */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --dark-bg: #0f172a;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: #3b82f6;
    --body-bg: #f8fafc;
    --card-border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Wrapper Layout */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
#sidebar-wrapper {
    min-width: 250px;
    max-width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
}

body.sb-sidenav-toggled #sidebar-wrapper {
    margin-left: -250px;
}

#sidebar-wrapper .sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar-wrapper .sidebar-brand i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

#sidebar-wrapper .nav-link {
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

#sidebar-wrapper .nav-link i {
    font-size: 1.1rem;
}

#sidebar-wrapper .nav-link:hover {
    color: var(--sidebar-active);
    background-color: rgba(255, 255, 255, 0.05);
}

#sidebar-wrapper .nav-link.active {
    color: var(--sidebar-active);
    background-color: rgba(59, 130, 246, 0.15);
    border-left-color: var(--primary-color);
}

/* Main Content Area */
#page-content-wrapper {
    width: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.top-navbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dashboard Summary Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Cards & Tables */
.card-custom {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    background: #ffffff;
    margin-bottom: 1.5rem;
}

.card-custom .card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.table-custom th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #e2e8f0;
}

.table-custom td {
    vertical-align: middle;
    font-size: 0.95rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Document & Receipt Styling */
.document-box {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    max-width: 850px;
    margin: 0 auto;
}

.doc-header-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 1px;
}

/* Mobile Responsive Rules */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        max-width: 80vw;
        margin-left: -260px !important;
        box-shadow: 4px 0 25px rgba(0,0,0,0.35);
        z-index: 1050;
        transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        touch-action: pan-y;
    }

    body.sb-sidenav-toggled #sidebar-wrapper {
        margin-left: 0 !important;
    }

    #sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(2px);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    body.sb-sidenav-toggled #sidebar-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .top-navbar {
        padding: 0.75rem 1rem;
    }

    .container-fluid {
        padding: 0.85rem !important;
    }

    .document-box {
        padding: 1.25rem;
        border-radius: 8px;
    }

    .stat-card {
        margin-bottom: 0.5rem;
    }

    .table-responsive {
        border-radius: 8px;
    }
}

/* Custom Searchable Select Combobox */
.combobox-trigger {
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    padding: 0.65rem 1rem;
    background-color: #ffffff;
}

.combobox-trigger:focus, .combobox-trigger.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

.combobox-dropdown-menu {
    top: 100%;
    left: 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
}

.combobox-option-item {
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.925rem;
    color: #1e293b;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.combobox-option-item:hover, .combobox-option-item.highlighted {
    background-color: #f1f5f9;
    color: #2563eb;
}

.combobox-option-item.selected {
    background-color: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

/* Print Styles */
@media print {
    #sidebar-wrapper, .top-navbar, .no-print, footer {
        display: none !important;
    }
    #page-content-wrapper {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body {
        background: #ffffff !important;
    }
    .document-box {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}
