:root {
    --inst-primary: #005f73;
    --inst-secondary: #0a9396;
    --inst-accent: #ee9b00;
    --inst-warm: #ca6702;
    --inst-ink: #1d1f2f;
    --inst-soft: #f6f8fc;
    --inst-surface: #ffffff;
    --inst-success: #2a9d8f;
    --inst-shadow: 0 14px 40px rgba(0, 46, 73, 0.18);
    /* Cambie aqui la imagen del lado izquierdo del login */
    --inst-login-image: url("../img/instituto-basico.svg");
    /* Ajuste de encuadre de imagen */
    --inst-login-image-position-desktop: center center;
    --inst-login-image-position-mobile: center 35%;
}

body {
    font-family: "Nunito Sans", "Segoe UI", sans-serif;
    color: var(--inst-ink);
    background: radial-gradient(circle at 15% 10%, rgba(10, 147, 150, 0.22), transparent 32%),
                radial-gradient(circle at 88% 16%, rgba(238, 155, 0, 0.28), transparent 28%),
                linear-gradient(140deg, #f3f8ff 0%, #eef9fa 48%, #fff8ea 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

@media (min-width: 769px) {
    body.layout-fixed {
        overflow-y: hidden;
    }
}

@media (max-width: 768px) {
    body.layout-fixed {
        overflow-y: auto;
    }
}

.brand-wave {
    position: relative;
    overflow-x: hidden;
}

.brand-wave::before,
.brand-wave::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 40% 60% 70% 30% / 40% 30% 70% 60%;
    z-index: 0;
    animation: morph 12s linear infinite;
    opacity: 0.15;
}

.brand-wave::before {
    background: var(--inst-secondary);
    top: -110px;
    left: -90px;
}

.brand-wave::after {
    background: var(--inst-accent);
    bottom: -120px;
    right: -90px;
    animation-direction: reverse;
}

.brand-content {
    position: relative;
    z-index: 1;
}

.app-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: fixed !important;
    top: 4.5rem;
    right: 1.1rem;
    z-index: 1080;
    width: min(360px, calc(100vw - 2rem));
    min-height: 58px;
    margin: 0;
    padding: 0.8rem 1rem 0.8rem 0.8rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(0, 46, 73, 0.24);
    font-size: 0.95rem;
    font-weight: 700;
    animation: app-toast-in 220ms ease-out both;
    transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast-success {
    background: #e8f8f2;
    color: #176b52;
}

.app-toast-error {
    background: #fff0f0;
    color: #9b2c2c;
}

.app-toast-icon {
    display: inline-flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
}

.app-toast-success .app-toast-icon {
    background: var(--inst-success);
}

.app-toast-error .app-toast-icon {
    background: #d64545;
}

.app-toast-message {
    line-height: 1.35;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.table-actions form {
    display: inline-flex;
    margin: 0;
}

.table-actions .btn {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.table-actions-wrap {
    flex-wrap: nowrap;
}

.table-actions-wrap .form-control {
    width: 65px;
    margin-right: 0.25rem !important;
    padding: 0.25rem 0.3rem;
    font-size: 0.75rem;
}

.table-actions-wrap .btn {
    padding: 0.2rem 0.35rem;
    font-size: 0.72rem;
}

.edit-modal-holder {
    display: none;
}

.catalog-edit-modal {
    z-index: 1060 !important;
}

#assign-student-courses {
    z-index: 2000 !important;
}

#assign-student-courses + .modal-backdrop {
    z-index: 1990 !important;
}

.activity-grade-modal {
    z-index: 4000 !important;
}

.activity-grade-modal .modal-dialog {
    position: relative;
    z-index: 4001 !important;
}

.activity-grade-modal + .modal-backdrop {
    z-index: 3990 !important;
}

.activity-grade-modal .modal-header {
    background: linear-gradient(130deg, rgba(0, 95, 115, 0.92), rgba(10, 147, 150, 0.86));
    color: #fff;
}

.activity-grade-modal .modal-header .close {
    color: #fff;
    opacity: 0.92;
}

.student-report-card-modal {
    z-index: 2000 !important;
}

.student-report-card-modal .modal-header {
    background: linear-gradient(130deg, rgba(0, 95, 115, 0.92), rgba(10, 147, 150, 0.86));
    color: #fff;
}

.student-report-card-modal .modal-header .close {
    color: #fff;
    opacity: 0.92;
}

.role-privilege-header-info {
    min-width: 0;
}

.role-privilege-header-info .card-title,
.role-privilege-description {
    display: block;
    white-space: normal;
}

.role-privilege-header-info .card-title {
    margin-right: 1rem;
}

.catalog-edit-modal .modal-dialog {
    width: calc(100% - 2rem);
    max-width: 760px;
}

.catalog-edit-modal .modal-header {
    background: linear-gradient(135deg, var(--inst-primary), var(--inst-secondary));
    color: #ffffff;
}

.catalog-edit-modal .modal-header .close {
    color: #ffffff;
    opacity: 0.9;
}

.catalog-edit-modal .modal-header .close:hover {
    opacity: 1;
}

.catalog-edit-modal .modal-body .btn-primary {
    border-color: var(--inst-secondary);
    background: linear-gradient(135deg, var(--inst-primary), var(--inst-secondary));
    color: #ffffff;
}

.catalog-edit-modal .modal-body .btn-primary:hover,
.catalog-edit-modal .modal-body .btn-primary:focus {
    border-color: var(--inst-primary);
    background: linear-gradient(135deg, #004b5a, var(--inst-primary));
    color: #ffffff;
}

.table-actions-wrap + * {
    white-space: nowrap;
}

.app-toast-hide {
    opacity: 0;
    transform: translateY(-8px);
}

@keyframes app-toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 576px) {
    .app-toast {
        top: 4rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
}

/* ===== RESPONSIVE MOBILE-FIRST COMPREHENSIVE ===== */

/* Sidebar mobile behavior */
@media (max-width: 767.98px) {
    .main-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1100;
    }
    .sidebar-open .main-sidebar {
        transform: translateX(0);
    }
    .sidebar-open .content-wrapper {
        filter: blur(2px);
        pointer-events: none;
    }
    .sidebar-open::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1099;
    }

    /* Sidebar overlay backdrop - only on mobile */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1099;
    }
    .sidebar-open .sidebar-backdrop {
        display: block;
    }
}

/* Desktop: sidebar-backdrop always hidden */
@media (min-width: 768px) {
    .sidebar-backdrop {
        display: none !important;
    }
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Improve text readability on small screens */
@media (max-width: 576px) {
    body {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.15rem; }
    h4 { font-size: 1rem; }
    .card-title { font-size: 1rem; }
}

/* Landscape phone specific */
@media (max-width: 767.98px) and (orientation: landscape) {
    .inst-login-hero {
        min-height: 180px;
    }
    .inst-login-body {
        min-height: auto;
    }
}

/* Print styles */
@media print {
    .main-header, .main-sidebar, .main-footer,
    .btn, .form-control, .custom-select,
    .table-actions, .card-header .card-tools,
    .sidebar-backdrop {
        display: none !important;
    }
    .content-wrapper {
        padding: 0;
        margin: 0;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    .table-responsive {
        overflow: visible;
    }
    .table-responsive > .table {
        min-width: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --inst-primary: #004050;
        --inst-secondary: #006065;
        --inst-accent: #b37400;
    }
    .card { border: 2px solid #000; }
    .btn { border: 2px solid currentColor; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

#record-detail-modal {
    z-index: 1060 !important;
}

#record-detail-modal .modal-header {
    background: linear-gradient(135deg, var(--inst-primary), var(--inst-secondary));
    color: #ffffff;
    border-bottom: 0;
}

#record-detail-modal .modal-header .close {
    color: #ffffff;
    opacity: 0.9;
}

#record-detail-modal .modal-header .close:hover {
    opacity: 1;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.login-page {
    background: transparent;
    overflow-x: hidden;
}

.login-page.brand-wave {
    overflow: hidden !important;
    height: 100vh;
}

.login-box {
    width: min(470px, 92vw);
}

.inst-login-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.4rem;
}

.inst-login-box {
    width: min(1000px, 96vw) !important;
    margin: 0 auto;
}

.inst-login-card {
    border: 0;
    border-radius: 24px;
    box-shadow: var(--inst-shadow);
    overflow: hidden;
    backdrop-filter: blur(2px);
}

.inst-login-hero {
    min-height: 560px;
    background-image: var(--inst-login-image);
    background-size: cover;
    background-position: var(--inst-login-image-position-desktop);
    background-repeat: no-repeat;
}

.inst-login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(145deg, rgba(0, 95, 115, 0.32), rgba(238, 155, 0, 0.24)),
        radial-gradient(circle at 80% 20%, rgba(238, 155, 0, 0.22), transparent 50%);
}

.inst-login-hero > div {
    position: relative;
    z-index: 1;
}

.inst-login-hero-content {
    max-width: 440px;
}

.inst-login-panel {
    display: flex;
}

.inst-login-body {
    width: 100%;
    min-height: 560px;
    display: flex;
}

.inst-login-form-wrap {
    width: 100%;
    max-width: 410px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.inst-login-footnote {
    margin-top: 1.1rem;
}

.inst-login-header {
    background: linear-gradient(130deg, var(--inst-primary), var(--inst-secondary));
    color: #fff;
    padding: 1.3rem 1.2rem;
    text-align: center;
}

.inst-login-header h1 {
    font-family: "Sora", "Trebuchet MS", sans-serif;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin-bottom: 0.2rem;
}

.inst-login-header p {
    margin-bottom: 0;
    opacity: 0.92;
}

.login-card-body {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.94);
}

.inst-field .form-control {
    border-radius: 12px;
    border-color: #dde4f2;
    background: #fdfefe;
}

.inst-field .input-group-text {
    border-radius: 0 12px 12px 0;
    border-color: #dde4f2;
    background: #f4f8ff;
}

.btn-inst-primary {
    background: linear-gradient(125deg, var(--inst-primary), var(--inst-secondary));
    border: 0;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #fff;
}

.btn-inst-primary:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
    color: #fff;
}

.btn-inst-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(10, 147, 150, 0.28);
    color: #fff;
}

.main-header.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(0, 95, 115, 0.14);
}

/* User profile avatar button */
.user-avatar-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-btn:focus {
    outline: none;
}

.user-avatar-btn:focus .user-avatar-circle {
    box-shadow: 0 0 0 3px rgba(10, 147, 150, 0.4);
}

.user-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--inst-secondary);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 6px rgba(0, 95, 115, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar-btn:hover .user-avatar-circle,
.user-avatar-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 95, 115, 0.25);
}

/* Profile Modal */
.profile-modal {
    z-index: 1060 !important;
}

.profile-modal .modal-dialog {
    position: relative;
    z-index: 1061 !important;
}

.profile-modal + .modal-backdrop {
    z-index: 1050 !important;
}

.profile-modal .modal-content {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 46, 73, 0.2);
}

.profile-modal .modal-header {
    background: linear-gradient(130deg, var(--inst-primary), var(--inst-secondary));
    color: #fff;
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    padding: 1.25rem 1.5rem;
}

.profile-modal .modal-header .close {
    color: #fff;
    opacity: 0.9;
    text-shadow: none;
}

.profile-modal .modal-header .close:hover {
    opacity: 1;
}

.profile-modal .modal-body {
    padding: 1.5rem;
}

.profile-modal .modal-footer {
    border-top: 1px solid rgba(0, 95, 115, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 0 0 18px 18px;
}

.profile-modal .user-avatar-circle {
    width: 90px;
    height: 90px;
    border-width: 3px;
}

/* Avatar upload with camera overlay */
.avatar-upload-wrapper {
    display: inline-block;
    position: relative;
    width: 90px;
    height: 90px;
}

.avatar-upload-wrapper .user-avatar-circle {
    width: 100%;
    height: 100%;
    border-width: 3px;
}

.avatar-camera-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--inst-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 95, 115, 0.3);
    border: 3px solid #fff;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.avatar-camera-overlay:hover {
    background: var(--inst-secondary);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 95, 115, 0.4);
}

.avatar-camera-overlay:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 147, 150, 0.4);
}

.avatar-file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

@media (max-width: 576px) {
    .profile-modal .user-avatar-circle,
    .avatar-upload-wrapper {
        width: 70px;
        height: 70px;
    }
    
    .avatar-camera-overlay {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

.profile-modal .form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--inst-ink);
    margin-bottom: 0.4rem;
}

.profile-modal .form-control {
    border-radius: 10px;
    border-color: #dde4f2;
    background: #fdfefe;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
}

.profile-modal .form-control:focus {
    border-color: var(--inst-secondary);
    box-shadow: 0 0 0 0.2rem rgba(10, 147, 150, 0.15);
}

.profile-modal .form-text {
    font-size: 0.8rem;
}

.profile-modal hr {
    border-color: rgba(0, 95, 115, 0.1);
}

.profile-modal h6 {
    color: var(--inst-primary);
    font-weight: 700;
}

/* Password Change Modal - Modern Professional Design */
.password-change-modal {
    z-index: 1060 !important;
}

.password-change-modal .modal-dialog {
    position: relative;
    z-index: 1061 !important;
    max-width: 420px;
}

.password-change-modal .modal-content {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 46, 73, 0.25);
    overflow: hidden;
}

.password-change-modal .modal-header {
    background: linear-gradient(135deg, var(--inst-primary) 0%, var(--inst-secondary) 100%);
    color: #fff;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem 1.5rem 1rem;
}

.password-change-modal .modal-header .close {
    display: none;
}

.password-change-modal .modal-icon-bg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.password-change-modal .modal-header small {
    opacity: 0.9;
    font-weight: 400;
}

.password-change-modal .modal-body {
    padding: 2rem 1.5rem;
}

.password-change-modal .modal-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--inst-primary), var(--inst-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 95, 115, 0.3);
}

.password-change-modal .modal-body h6 {
    color: var(--inst-primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.password-change-modal .modal-body p {
    font-size: 0.85rem;
    line-height: 1.5;
}

.password-change-modal .form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--inst-ink);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.password-change-modal .form-control {
    border-radius: 12px;
    border: 2px solid #e8eef4;
    background: #fafbfc;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.password-change-modal .form-control:focus {
    border-color: var(--inst-secondary);
    box-shadow: 0 0 0 0.25rem rgba(10, 147, 150, 0.15);
    background: #fff;
}

.password-change-modal .form-control::placeholder {
    color: #adb5bd;
    font-size: 0.85rem;
}

.password-change-modal .password-strength small {
    color: var(--inst-secondary);
    font-weight: 500;
}

.password-change-modal .alert {
    border-radius: 12px;
    border: 0;
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
}

.password-change-modal .alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.password-change-modal .alert .close {
    color: #991b1b;
    opacity: 0.7;
    text-shadow: none;
}

.password-change-modal .alert .close:hover {
    opacity: 1;
}

.password-change-modal .modal-footer {
    border-top: 1px solid rgba(0, 95, 115, 0.08);
    padding: 1.25rem 1.5rem;
    border-radius: 0 0 20px 20px;
    background: #fafbfc;
}

.password-change-modal .btn-primary {
    background: linear-gradient(135deg, var(--inst-primary), var(--inst-secondary));
    border: 0;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.025em;
    box-shadow: 0 4px 15px rgba(0, 95, 115, 0.3);
    transition: all 0.2s ease;
}

.password-change-modal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 95, 115, 0.4);
}

.password-change-modal .btn-primary:active {
    transform: translateY(0);
}

@media (max-width: 576px) {
    .password-change-modal .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .password-change-modal .modal-icon-large {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }
    
    .password-change-modal .modal-icon-bg {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .password-change-modal .modal-header {
        padding: 1.25rem 1.25rem 0.75rem;
    }
    
    .password-change-modal .modal-body {
        padding: 1.5rem 1.25rem;
    }
    
    .password-change-modal .modal-footer {
        padding: 1rem 1.25rem;
    }
}

.profile-modal .form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--inst-ink);
    margin-bottom: 0.4rem;
}

.profile-modal .form-control {
    border-radius: 10px;
    border-color: #dde4f2;
    background: #fdfefe;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
}

.profile-modal .form-control:focus {
    border-color: var(--inst-secondary);
    box-shadow: 0 0 0 0.2rem rgba(10, 147, 150, 0.15);
}

.profile-modal .form-text {
    font-size: 0.8rem;
}

.profile-modal hr {
    border-color: rgba(0, 95, 115, 0.1);
}

.profile-modal h6 {
    color: var(--inst-primary);
    font-weight: 700;
}

@media (max-width: 576px) {
    .profile-dropdown-menu {
        min-width: 200px;
        right: -1rem !important;
        left: auto !important;
    }

    .profile-modal .modal-dialog {
        margin: 1rem;
    }
    
    .profile-modal .user-avatar-circle {
        width: 70px;
        height: 70px;
    }
}

.main-sidebar {
    background: #2a344a;
}

.main-sidebar .sidebar {
    overflow-x: hidden;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.main-sidebar .sidebar::-webkit-scrollbar {
    width: 6px;
}

.main-sidebar .sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.main-sidebar .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.brand-link {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
}

.brand-text {
    font-family: "Sora", "Verdana", sans-serif;
    font-weight: 700 !important;
    letter-spacing: 0.35px;
    line-height: 1;
}

.nav-sidebar .nav-link {
    border-radius: 10px;
    margin: 0.1rem 0.35rem;
    color: rgba(235, 244, 255, 0.9) !important;
}

.nav-sidebar .nav-link.active {
    background: linear-gradient(120deg, rgba(238, 155, 0, 0.9), rgba(202, 103, 2, 0.92)) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.content-wrapper {
    background: transparent;
    padding-bottom: 72px;
}

.content-wrapper > .content {
    padding-bottom: 1rem;
}

.dashboard-audit-scroll {
    max-height: 300px;
    overflow-y: auto !important;
    scrollbar-gutter: stable both-edges;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 95, 115, 0.45) transparent;
}

.dashboard-audit-scroll::-webkit-scrollbar {
    width: 6px;
}

.dashboard-audit-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-audit-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 95, 115, 0.45);
    border-radius: 4px;
}

.enrollment-course-table-scroll {
    max-height: 360px;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 95, 115, 0.45) transparent;
}

.enrollment-course-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.enrollment-course-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.enrollment-course-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 95, 115, 0.45);
    border-radius: 4px;
}

.enrollment-course-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--inst-surface);
}

.records-table-scroll {
    max-height: 360px;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 95, 115, 0.45) transparent;
}

.records-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.records-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.records-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 95, 115, 0.45);
    border-radius: 4px;
}

.records-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--inst-surface);
}

.relatives-table-scroll {
    max-height: 360px;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 95, 115, 0.45) transparent;
}

.relatives-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.relatives-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.relatives-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 95, 115, 0.45);
    border-radius: 4px;
}

.relatives-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--inst-surface);
}

.documents-table-scroll {
    max-height: 360px;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 95, 115, 0.45) transparent;
}

.documents-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.documents-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.documents-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 95, 115, 0.45);
    border-radius: 4px;
}

.documents-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--inst-surface);
}

.enrollment-table-scroll {
    max-height: 320px;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 95, 115, 0.45) transparent;
}

.enrollment-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.enrollment-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.enrollment-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 95, 115, 0.45);
    border-radius: 4px;
}

.enrollment-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--inst-surface);
}

.relatives-table-scroll,
.students-table-scroll,
.assignments-table-scroll {
    max-height: 360px;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 95, 115, 0.45) transparent;
}

.relatives-table-scroll::-webkit-scrollbar,
.students-table-scroll::-webkit-scrollbar,
.assignments-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.relatives-table-scroll::-webkit-scrollbar-track,
.students-table-scroll::-webkit-scrollbar-track,
.assignments-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.relatives-table-scroll::-webkit-scrollbar-thumb,
.students-table-scroll::-webkit-scrollbar-thumb,
.assignments-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 95, 115, 0.45);
    border-radius: 4px;
}

.relatives-table-scroll thead th,
.students-table-scroll thead th,
.assignments-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--inst-surface);
}

.grades-students-table-scroll {
    max-height: 360px;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 95, 115, 0.45) transparent;
}

.grades-students-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.grades-students-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.grades-students-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 95, 115, 0.45);
    border-radius: 4px;
}

.grades-students-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--inst-surface);
}

.audit-table-scroll {
    max-height: 360px;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 95, 115, 0.45) transparent;
}

.audit-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.audit-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.audit-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 95, 115, 0.45);
    border-radius: 4px;
}

.audit-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--inst-surface);
}

.users-table-scroll {
    max-height: 360px;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 95, 115, 0.45) transparent;
}

.users-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.users-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.users-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 95, 115, 0.45);
    border-radius: 4px;
}

.users-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--inst-surface);
}

.dashboard-audit-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--inst-surface);
}

.user-create-form .card-body {
    padding: 1rem;
}

.user-create-form .form-group {
    margin-bottom: 0.65rem;
}

.user-create-form label {
    margin-bottom: 0.25rem;
    font-size: 0.88rem;
}

.user-create-form .form-control {
    min-height: 36px;
    height: 36px;
    padding: 0.35rem 0.65rem;
    font-size: 0.9rem;
}

.user-create-form .card-footer {
    padding: 0.75rem 1rem;
}

.compact-create-form .card-body {
    padding: 1rem;
}

.compact-create-form .form-group {
    margin-bottom: 0.65rem;
}

.compact-create-form label {
    margin-bottom: 0.25rem;
    font-size: 0.88rem;
}

.compact-create-form .form-control,
.compact-create-form .custom-select {
    min-height: 36px;
    height: 36px;
    padding: 0.35rem 0.65rem;
    font-size: 0.9rem;
}

.compact-create-form .card-footer {
    padding: 0.75rem 1rem;
}

.compact-create-form textarea.form-control {
    height: auto;
    min-height: 58px;
}

.container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

.card + .card,
.small-box {
    margin-bottom: 0.9rem;
}

.card {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(24, 46, 69, 0.1);
}

.table {
    font-size: 0.93rem;
}

.table td,
.table th {
    vertical-align: middle;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.btn,
.form-control,
.custom-select,
.input-group-text {
    min-height: 42px;
}

.form-control,
.custom-select,
.input-group-text,
.btn {
    font-size: 0.95rem;
}

.btn.btn-sm,
.form-control.form-control-sm,
.custom-select.custom-select-sm {
    min-height: 34px;
}

.card-header {
    border-bottom: 1px solid rgba(0, 95, 115, 0.12);
    background: linear-gradient(95deg, rgba(6, 77, 101, 0.06), rgba(10, 147, 150, 0.05));
}

.small-box {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.small-box .inner p,
.small-box .inner h3 {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.24);
}

.main-footer {
    background: rgba(255, 255, 255, 0.72);
    border-top: 1px solid rgba(0, 95, 115, 0.12);
    position: fixed;
    left: auto;
    right: 0;
    bottom: 0;
    z-index: 1030;
    width: calc(100% - 250px);
    margin-left: 250px;
    box-sizing: border-box;
}

.dashboard-hero-card {
    border: 1px solid rgba(7, 59, 76, 0.08);
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(7, 59, 76, 0.82), rgba(10, 99, 117, 0.74));
    color: #fff;
    box-shadow: 0 10px 22px rgba(7, 59, 76, 0.12);
}

.dashboard-hero-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1.35rem 1.45rem;
}

.dashboard-hero-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.82;
}

.dashboard-hero-title {
    font-family: "Sora", "Trebuchet MS", sans-serif;
    font-size: clamp(1.45rem, 2vw, 2.1rem);
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.dashboard-hero-subtitle {
    color: rgba(255, 255, 255, 0.8);
    max-width: 52rem;
}

.dashboard-hero-badge {
    min-width: 160px;
    padding: 0.8rem 0.95rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: right;
    backdrop-filter: blur(3px);
}

.dashboard-hero-badge-label {
    display: block;
    font-size: 0.69rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    opacity: 0.78;
    margin-bottom: 0.2rem;
}

.dashboard-hero-badge strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.15;
}

.dashboard-stat-card {
    border: 1px solid rgba(7, 59, 76, 0.08);
    border-radius: 18px;
    overflow: hidden;
    min-height: 136px;
    box-shadow: 0 8px 18px rgba(24, 46, 69, 0.05);
    position: relative;
}

.dashboard-stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
}

.dashboard-stat-card .card-body {
    padding: 0.95rem 1rem 1rem;
}

.dashboard-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.dashboard-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.dashboard-stat-label {
    margin-left: auto;
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(29, 31, 47, 0.68);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dashboard-stat-value {
    font-family: "Sora", "Trebuchet MS", sans-serif;
    font-size: clamp(2rem, 4vw, 2.7rem);
    font-weight: 700;
    line-height: 1;
    margin-top: 0.8rem;
    color: var(--inst-ink);
}

.teacher-course-card .dashboard-stat-value {
    min-height: 2.4em;
    margin-top: 0.65rem;
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
    line-height: 1.2;
}

.teacher-course-grade {
    margin-top: -0.25rem;
    color: rgba(29, 31, 47, 0.68);
    font-size: 0.88rem;
    font-weight: 700;
}

.teacher-course-meta {
    display: grid;
    gap: 0.25rem;
    margin-top: 0.75rem;
    color: rgba(29, 31, 47, 0.72);
    font-size: 0.86rem;
}

.teacher-course-meta strong {
    color: var(--inst-ink);
}

.dashboard-stat-primary {
    background: linear-gradient(145deg, rgba(0, 95, 115, 0.025), rgba(0, 95, 115, 0.05));
}

.dashboard-stat-primary::before,
.dashboard-stat-primary .dashboard-stat-icon {
    background: linear-gradient(135deg, var(--inst-primary), var(--inst-secondary));
}

.dashboard-stat-secondary {
    background: linear-gradient(145deg, rgba(42, 157, 143, 0.025), rgba(42, 157, 143, 0.05));
}

.dashboard-stat-secondary::before,
.dashboard-stat-secondary .dashboard-stat-icon {
    background: linear-gradient(135deg, #188d83, var(--inst-success));
}

.dashboard-stat-accent {
    background: linear-gradient(145deg, rgba(238, 155, 0, 0.03), rgba(238, 155, 0, 0.06));
}

.dashboard-stat-accent::before,
.dashboard-stat-accent .dashboard-stat-icon {
    background: linear-gradient(135deg, var(--inst-accent), var(--inst-warm));
}

.dashboard-stat-warm {
    background: linear-gradient(145deg, rgba(202, 103, 2, 0.03), rgba(202, 103, 2, 0.06));
}

.dashboard-stat-warm::before,
.dashboard-stat-warm .dashboard-stat-icon {
    background: linear-gradient(135deg, var(--inst-warm), #d95d39);
}

.dashboard-summary-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(0, 95, 115, 0.08);
}

.dashboard-summary-line strong {
    color: var(--inst-ink);
}

.dashboard-summary-note {
    margin-top: 0.9rem;
    color: #5b6676;
}

.dashboard-panel-card {
    border: 1px solid rgba(7, 59, 76, 0.08);
    border-radius: 18px;
    box-shadow: 0 8px 18px rgba(24, 46, 69, 0.05);
}

.dashboard-panel-card .card-header {
    background: linear-gradient(95deg, rgba(7, 59, 76, 0.02), rgba(10, 147, 150, 0.02));
}

.dashboard-panel-card .card-body {
    background: rgba(255, 255, 255, 0.92);
}

.dashboard-panel-card .table thead th {
    color: rgba(29, 31, 47, 0.75);
    font-weight: 700;
}

.dashboard-panel-card .table td,
.dashboard-panel-card .table th {
    border-color: rgba(7, 59, 76, 0.08);
}

.catalogs-theme .card.card-outline {
    border-top: 3px solid rgba(0, 95, 115, 0.34) !important;
}

.catalogs-theme .catalogs-action-btn {
    font-weight: 700;
    white-space: nowrap;
    min-width: 0;
}

.catalogs-theme .card.h-100 {
    height: 100%;
}

.catalogs-theme .catalog-create-row {
    margin-left: -0.35rem;
    margin-right: -0.35rem;
}

.catalogs-theme .catalog-create-row > [class*="col-"] {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    margin-bottom: 0.5rem;
}

.catalogs-theme .catalog-create-row .form-control,
.catalogs-theme .catalog-create-row .custom-select,
.catalogs-theme .catalog-create-row .btn {
    min-height: 42px;
}

.catalog-name-picker {
    position: relative;
}

.catalog-name-input-wrap {
    position: relative;
}

.catalog-name-input {
    padding-right: 2.25rem;
}

.catalog-name-chevron {
    position: absolute;
    top: 50%;
    right: 0.8rem;
    color: #6c757d;
    pointer-events: none;
    transform: translateY(-50%);
    transition: transform 180ms ease;
}

.catalog-name-input[aria-expanded="true"] + .catalog-name-chevron {
    transform: translateY(-50%) rotate(180deg);
}

.catalog-name-options {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    left: 0;
    z-index: 20;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid rgba(0, 95, 115, 0.2);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(0, 46, 73, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-5px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.catalog-name-options.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.catalog-name-option {
    display: block;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--inst-ink);
    text-align: left;
    cursor: pointer;
}

.catalog-name-option:hover,
.catalog-name-option:focus {
    outline: 0;
    background: rgba(10, 147, 150, 0.1);
}

.catalog-name-option-new {
    border-top: 1px solid #e9ecef;
    color: var(--inst-primary);
}

.catalog-name-empty {
    padding: 0.55rem 0.7rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.catalog-context-menu {
    position: absolute;
    top: 0;
    right: 0.35rem;
    z-index: 30;
    display: none;
    min-width: 130px;
    padding: 0.3rem;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(0, 46, 73, 0.2);
}

.catalog-context-menu.is-open {
    display: block;
}

.catalog-context-menu button {
    display: block;
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--inst-ink);
    text-align: left;
    cursor: pointer;
}

.catalog-context-menu button:hover,
.catalog-context-menu button:focus {
    outline: 0;
    background: rgba(10, 147, 150, 0.1);
}

.catalog-context-menu button[data-action="delete"] {
    color: #c0392b;
}

.catalog-management {
    margin-top: 1rem;
    border-top: 1px solid #e9ecef;
    padding-top: 0.8rem;
}

.catalog-management summary {
    color: var(--inst-primary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    list-style-position: inside;
}

.catalog-management summary:focus {
    outline: 2px solid rgba(10, 147, 150, 0.3);
    outline-offset: 3px;
}

.catalog-management-body {
    max-height: 280px;
    overflow-y: auto;
    padding-top: 0.85rem;
}

.catalogs-theme .catalog-action-col .btn {
    width: 100%;
    max-width: 100%;
}

.catalogs-theme .btn-primary,
.catalogs-theme .btn-success,
.catalogs-theme .btn-warning,
.catalogs-theme .btn-info {
    background: linear-gradient(130deg, rgba(0, 95, 115, 0.88), rgba(10, 147, 150, 0.8));
    border: 0;
    color: #fff;
}

.catalogs-theme .btn-primary:hover,
.catalogs-theme .btn-success:hover,
.catalogs-theme .btn-warning:hover,
.catalogs-theme .btn-info:hover {
    filter: brightness(1.03);
    color: #fff;
}

.catalogs-theme .btn-outline-primary,
.catalogs-theme .btn-outline-success,
.catalogs-theme .btn-outline-warning,
.catalogs-theme .btn-outline-info {
    border-color: rgba(0, 95, 115, 0.36);
    color: rgba(0, 95, 115, 0.95);
}

.catalogs-theme .btn-outline-primary:hover,
.catalogs-theme .btn-outline-success:hover,
.catalogs-theme .btn-outline-warning:hover,
.catalogs-theme .btn-outline-info:hover {
    background: rgba(0, 95, 115, 0.08);
    color: rgba(0, 95, 115, 1);
}

@media (max-width: 767.98px) {
    .catalogs-theme .catalogs-action-btn {
        min-width: 0;
    }
}

/* Global module harmony: align all module accents with dashboard palette */
.content-wrapper .card.card-outline.card-primary,
.content-wrapper .card.card-outline.card-success,
.content-wrapper .card.card-outline.card-warning,
.content-wrapper .card.card-outline.card-info {
    border-top-width: 3px;
    border-top-style: solid;
}

.content-wrapper .card.card-outline.card-primary {
    border-top-color: rgba(0, 95, 115, 0.34) !important;
}

.content-wrapper .card.card-outline.card-success {
    border-top-color: rgba(42, 157, 143, 0.34) !important;
}

.content-wrapper .card.card-outline.card-warning {
    border-top-color: rgba(238, 155, 0, 0.34) !important;
}

.content-wrapper .card.card-outline.card-info {
    border-top-color: rgba(10, 147, 150, 0.34) !important;
}

.content-wrapper .card.card-primary,
.content-wrapper .card.card-success,
.content-wrapper .card.card-warning,
.content-wrapper .card.card-info {
    border-top: 3px solid rgba(0, 95, 115, 0.32);
}

.content-wrapper .card.card-success {
    border-top-color: rgba(42, 157, 143, 0.32);
}

.content-wrapper .card.card-warning {
    border-top-color: rgba(238, 155, 0, 0.32);
}

.content-wrapper .card.card-info {
    border-top-color: rgba(10, 147, 150, 0.32);
}

.content-wrapper .card.card-primary > .card-header,
.content-wrapper .card.card-success > .card-header,
.content-wrapper .card.card-warning > .card-header,
.content-wrapper .card.card-info > .card-header {
    background: linear-gradient(130deg, rgba(0, 95, 115, 0.9), rgba(10, 147, 150, 0.84)) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(0, 95, 115, 0.22);
}

.content-wrapper .card.card-primary > .card-header a,
.content-wrapper .card.card-success > .card-header a,
.content-wrapper .card.card-warning > .card-header a,
.content-wrapper .card.card-info > .card-header a,
.content-wrapper .card.card-primary > .card-header .card-title,
.content-wrapper .card.card-success > .card-header .card-title,
.content-wrapper .card.card-warning > .card-header .card-title,
.content-wrapper .card.card-info > .card-header .card-title {
    color: #ffffff !important;
}

.content-wrapper .btn-primary,
.content-wrapper .btn-success,
.content-wrapper .btn-warning,
.content-wrapper .btn-info {
    border: 0;
    color: #fff;
    background: linear-gradient(130deg, rgba(0, 95, 115, 0.9), rgba(10, 147, 150, 0.84));
    box-shadow: 0 6px 14px rgba(7, 59, 76, 0.12);
}

.content-wrapper .btn-primary:hover,
.content-wrapper .btn-success:hover,
.content-wrapper .btn-warning:hover,
.content-wrapper .btn-info:hover,
.content-wrapper .btn-primary:focus,
.content-wrapper .btn-success:focus,
.content-wrapper .btn-warning:focus,
.content-wrapper .btn-info:focus {
    color: #fff;
    filter: brightness(1.03);
}

.content-wrapper .btn-outline-primary,
.content-wrapper .btn-outline-success,
.content-wrapper .btn-outline-warning,
.content-wrapper .btn-outline-info {
    border-color: rgba(0, 95, 115, 0.36);
    color: rgba(0, 95, 115, 0.95);
}

.content-wrapper .btn-outline-primary:hover,
.content-wrapper .btn-outline-success:hover,
.content-wrapper .btn-outline-warning:hover,
.content-wrapper .btn-outline-info:hover,
.content-wrapper .btn-outline-primary:focus,
.content-wrapper .btn-outline-success:focus,
.content-wrapper .btn-outline-warning:focus,
.content-wrapper .btn-outline-info:focus {
    background: rgba(0, 95, 115, 0.08);
    color: rgba(0, 95, 115, 1);
}

.content-wrapper .btn.btn-block {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .dashboard-hero-body {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-hero-badge {
        text-align: left;
        width: 100%;
    }

    .dashboard-hero-badge strong {
        font-size: 1rem;
    }

    .dashboard-stat-card .card-body {
        padding: 0.9rem;
    }
}

/* Transition for smooth collapse/expand - let AdminLTE handle sidebar-mini styles */
.main-sidebar,
.content-wrapper,
.main-header,
.main-footer {
    transition: width 0.3s ease, margin-left 0.3s ease;
}

.reveal-up {
    animation: revealUp 0.55s ease both;
}

.reveal-delay-1 {
    animation-delay: 0.1s;
}

.reveal-delay-2 {
    animation-delay: 0.2s;
}

.reveal-delay-3 {
    animation-delay: 0.3s;
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes morph {
    0% {
        border-radius: 40% 60% 70% 30% / 40% 30% 70% 60%;
        transform: rotate(0deg);
    }
    50% {
        border-radius: 70% 30% 40% 60% / 50% 65% 35% 50%;
        transform: rotate(180deg);
    }
    100% {
        border-radius: 40% 60% 70% 30% / 40% 30% 70% 60%;
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .inst-login-shell {
        padding: 0.9rem;
    }

    .inst-login-box {
        width: min(520px, 96vw) !important;
    }

    .login-card-body {
        padding: 1.1rem;
    }

    .inst-login-card {
        border-radius: 16px;
    }

    .inst-login-body {
        min-height: auto;
    }

    .inst-login-form-wrap {
        max-width: none;
    }

    .inst-login-hero {
        min-height: 250px;
        padding: 1rem 0.8rem;
        background-position: var(--inst-login-image-position-mobile);
    }

    .inst-login-hero-padding {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .inst-login-hero h2 {
        font-size: 1.3rem;
    }

    .inst-login-hero p {
        font-size: 0.88rem;
    }

    .inst-login-hero-content {
        max-width: 92%;
        padding: 0.8rem 0.95rem;
        border-radius: 14px;
        background: linear-gradient(145deg, rgba(4, 18, 33, 0.58), rgba(0, 74, 95, 0.52));
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    }

    .inst-login-hero .fa-graduation-cap {
        font-size: 2.1rem !important;
        margin-bottom: 0.8rem !important;
    }

    .container-fluid {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .content-header,
    .content {
        padding-left: 0;
        padding-right: 0;
    }

    .card {
        border-radius: 12px;
    }

    .card-body,
    .card-header,
    .card-footer {
        padding: 0.85rem;
    }

    .table {
        font-size: 0.86rem;
        white-space: nowrap;
    }

    .table-responsive {
        border-radius: 10px;
    }

    .main-header .navbar-nav .nav-link {
        padding: 0.35rem 0.45rem;
    }

    .main-header .navbar-nav .nav-item.mr-3 {
        display: none;
    }

    .main-sidebar .brand-text {
        font-size: 0.95rem;
    }

    .small-box .inner h3 {
        font-size: 1.25rem;
    }

    .small-box .inner p {
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .row > [class*="col-"] {
        margin-bottom: 0.65rem;
    }

    .form-inline {
        display: block;
    }

    .form-inline .form-control,
    .form-inline .custom-select,
    .form-inline .btn {
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 0.4rem;
    }

    .main-footer {
        font-size: 0.78rem;
        text-align: center;
        width: 100%;
        margin-left: 0;
        line-height: 1.35;
        white-space: normal;
        padding: 0.55rem 0.7rem;
    }

    .nav-sidebar .nav-link {
        margin: 0.08rem 0.2rem;
    }

    .small-box h3 {
        font-size: 1.4rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    .card-body,
    .card-header,
    .card-footer {
        padding: 0.72rem;
    }

    .btn,
    .form-control,
    .custom-select,
    .input-group-text {
        min-height: 40px;
        font-size: 0.92rem;
    }

    .inst-login-hero {
        min-height: 205px;
    }

    .inst-login-hero h2 {
        font-size: 1.12rem;
    }

    .inst-login-hero p {
        font-size: 0.8rem;
    }

    .inst-login-form-wrap h3 {
        font-size: 1.3rem;
    }

    .table-responsive .table.is-mobile-stack {
        white-space: normal;
        margin-bottom: 0;
    }

    .table-responsive .table.is-mobile-stack thead {
        display: none;
    }

    .table-responsive .table.is-mobile-stack tbody,
    .table-responsive .table.is-mobile-stack tr,
    .table-responsive .table.is-mobile-stack td {
        display: block;
        width: 100%;
    }

    .table-responsive .table.is-mobile-stack tr {
        background: #ffffff;
        border: 1px solid rgba(0, 95, 115, 0.12);
        border-radius: 12px;
        margin-bottom: 0.65rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        overflow: hidden;
    }

    .table-responsive .table.is-mobile-stack td {
        border-top: 1px solid rgba(0, 95, 115, 0.08);
        text-align: left !important;
        padding: 0.6rem 0.72rem;
    }

    .table-responsive .table.is-mobile-stack td:first-child {
        border-top: 0;
    }

    .table-responsive .table.is-mobile-stack td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.73rem;
        font-weight: 700;
        color: #4e6475;
        text-transform: uppercase;
        letter-spacing: 0.35px;
        margin-bottom: 0.22rem;
    }

    .table-responsive .table.is-mobile-stack td .btn,
    .table-responsive .table.is-mobile-stack td .form-control,
    .table-responsive .table.is-mobile-stack td .custom-select {
        width: 100%;
    }
}

.course-assignment-form {
    border: 1px solid rgba(0, 95, 115, 0.16);
    border-radius: 12px;
    padding: 1rem;
    background: rgba(232, 248, 250, 0.62);
}

.enrollment-assignment-modal .modal-header {
    background: linear-gradient(130deg, rgba(0, 95, 115, 0.92), rgba(10, 147, 150, 0.86));
    color: #fff;
    border-bottom: 1px solid rgba(0, 95, 115, 0.22);
}

.enrollment-assignment-modal .modal-header .close {
    color: #fff;
    opacity: 0.92;
}

.enrollment-assignment-modal .modal-body {
    background: #f6f8fc;
}

.enrollment-course-card > .card-header {
    background: linear-gradient(130deg, rgba(0, 95, 115, 0.92), rgba(10, 147, 150, 0.86));
    color: #fff;
}

.course-assignment-form .btn-primary {
    border: 0;
    color: #fff;
    background: linear-gradient(130deg, rgba(0, 95, 115, 0.92), rgba(10, 147, 150, 0.86));
}

.course-assignment-form .btn-primary:hover,
.course-assignment-form .btn-primary:focus {
    color: #fff;
    filter: brightness(1.05);
}

.enrollment-course-card > .card-header .card-title {
    color: #fff;
}

.course-assignment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.65rem;
    min-height: 74px;
    padding: 0.15rem;
}

.course-option-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 68px;
    margin: 0;
    padding: 0.75rem;
    border: 1px solid rgba(0, 95, 115, 0.14);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.course-option-card:hover {
    border-color: rgba(10, 147, 150, 0.55);
    box-shadow: 0 5px 14px rgba(0, 95, 115, 0.1);
    transform: translateY(-1px);
}

.course-option-card:has(input:checked) {
    border-color: var(--inst-secondary);
    box-shadow: 0 0 0 2px rgba(10, 147, 150, 0.13);
}

.course-option-card input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    accent-color: var(--inst-secondary);
}

.course-option-card span {
    display: grid;
    gap: 0.2rem;
}

.course-option-card small {
    color: #697586;
    font-weight: 400;
}

.gradebook-add-activity-btn {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gradebook-selector-card {
    margin-bottom: 0.8rem;
}

.gradebook-selector-card > .card-header {
    padding: 0.65rem 1rem;
}

.gradebook-selector-card > .card-header .card-title {
    font-size: 1.15rem;
}

.gradebook-selector-card > .card-body {
    padding: 0.8rem 1rem;
}

.gradebook-selector-card .form-group {
    margin-bottom: 0.35rem;
}

.gradebook-selector-card label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.gradebook-selector-card .form-control {
    height: 38px;
    padding: 0.35rem 0.7rem;
    font-size: 0.92rem;
}

.gradebook-selector-card .alert {
    margin-top: 0.45rem !important;
    padding: 0.55rem 0.8rem;
    font-size: 0.9rem;
}