html,
body {
    margin: 0;
    min-height: 100%;
    background: #f4f6f9;
    font-family: Arial, sans-serif;
}

body {
    overflow-y: auto;
    overflow-x: hidden;
}

/* ================= ADMIN LAYOUT ================= */

.srisoft-admin-shell {
    min-height: 100vh;
    width: 100%;
}

/* Old sidebar/mobile overlay controls are no longer needed */
.menu-toggle-btn,
.sidebar-overlay {
    display: none !important;
}

body.sidebar-open {
    overflow-y: auto !important;
}

/* ================= ADMIN TOP NAVIGATION ================= */

.srisoft-sidebar {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    box-sizing: border-box;
    background: linear-gradient(135deg, #0b2c4d, #123d66);
    color: #ffffff;
    padding: 8px 20px;
    z-index: 9000 !important;
    overflow: visible !important;
    transition: none !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-radius: 0;
}

.sidebar-brand {
    margin: 0 4px 0 0;
    padding-left: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 260px;
    max-width: 430px;
}

.sidebar-logo-text {
    font-size: 18px;
    font-weight: bold;
    line-height: 1.1;
    white-space: nowrap;
}

.sidebar-logo-text span {
    color: #f58220;
}

.sidebar-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: #ffffff;
    padding: 3px;
    border-radius: 0;
    flex: 0 0 auto;
}

.sidebar-brand-text {
    min-width: 0;
}

.sidebar-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.72);
    line-height: 1.2;
}

.sidebar-institute-meta {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.15;
    color: rgba(255,255,255,0.7);
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-institute-meta span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.srisoft-nav-links {
    display: flex;
    align-items: center;
    gap: 1px;
    flex: 1;
    flex-wrap: wrap;
}

.srisoft-sidebar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    padding: 9px 13px;
    border-radius: 0;
    margin: 0;
    white-space: nowrap;
    font-size: 14px;
    line-height: 1.2;
    background: rgba(255,255,255,0.07);
    transition: background 0.2s ease;
}

.srisoft-sidebar a:hover,
.srisoft-sidebar a.active-menu {
    background: #f58220;
    color: #ffffff;
    font-weight: bold;
    transform: none;
}

.logout-link {
    margin-left: auto !important;
    margin-top: 0 !important;
    background: #dc3545 !important;
    color: #ffffff !important;
    text-align: center;
    font-weight: 700;
    padding-left: 18px !important;
    padding-right: 18px !important;
}

.logout-link:hover {
    background: #bb2d3b !important;
}

/* Main Content
   Keep page contents padded, but allow the top bar to stretch full width. */
.srisoft-main {
    min-width: 0;
    margin-left: 0 !important;
    padding: 1px 20px 20px 20px !important;
    box-sizing: border-box;
}

/* Top Bar */
.srisoft-topbar {
    background: linear-gradient(135deg, #0b2c4d, #123d66);
    color: #ffffff;
    padding: 10px 18px;
    min-height: 52px;
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin: 0 -20px 16px -20px;
    box-shadow: 0 3px 10px rgba(11,44,77,0.18);
    border: 0 !important;
    width: calc(100% + 40px);
    box-sizing: border-box;
}

.srisoft-topbar h3 {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

.srisoft-topbar .topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

/* Cards */
.dashboard-card {
    background: #ffffff;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border: 0 !important;
    margin-bottom: 14px;
}

.dashboard-card h5 {
    color: #0b2c4d;
    font-size: 16px;
    font-weight: 700;
}

.dashboard-card h6 {
    font-size: 14px;
    font-weight: 700;
}

/* Buttons */
.btn-srisoft {
    background: #0b2c4d;
    color: #ffffff;
    border: none;
}

.btn-srisoft:hover {
    background: #f58220;
    color: #ffffff;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table thead {
    background: #0b2c4d;
    color: #ffffff;
}

.table th {
    font-weight: 600;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

/* Floating Alerts */
.srisoft-floating-alerts {
    position: fixed;
    top: 20px;
    right: 25px;
    z-index: 3000;
    width: min(420px, calc(100% - 36px));
}

/* Student Search */
.student-search-wrap {
    position: relative;
}

.student-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1200;
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.student-suggestion-item {
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
}

.student-suggestion-item:hover,
.student-suggestion-item.active {
    background: #fff1e6;
}

.student-suggestion-item small {
    display: block;
    color: #6c757d;
}

/* ================= LOGIN ================= */

.srisoft-login-box {
    max-width: 420px;
    margin: 80px auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.srisoft-title {
    color: #0b2c4d;
    font-weight: bold;
}

.srisoft-orange {
    color: #f58220;
}

/* ================= DARK MODE ================= */

body.dark-mode {
    background: #121826;
    color: #ffffff;
}

body.dark-mode .srisoft-login-box,
body.dark-mode .dashboard-card,
body.dark-mode .lesson-topbar,
body.dark-mode .lesson-extra-box {
    background: #1f2937;
    color: #ffffff;
}

body.dark-mode .srisoft-topbar {
    background: linear-gradient(135deg, #0b2c4d, #0f172a);
    color: #ffffff;
    border: 0 !important;
}

body.dark-mode .srisoft-topbar h3,
body.dark-mode .dashboard-card h5 {
    color: #f58220;
}

body.dark-mode .form-control {
    background: #111827;
    color: #ffffff;
    border-color: #374151;
}

body.dark-mode .student-suggestions {
    background: #111827;
    border-color: #374151;
}

body.dark-mode .student-suggestion-item {
    border-bottom-color: #1f2937;
}

body.dark-mode .student-suggestion-item:hover,
body.dark-mode .student-suggestion-item.active {
    background: #374151;
}

/* ================= STUDENT LEARNING PAGE ================= */

.student-learning-shell {
    display: flex;
    min-height: 100vh;
}

.lesson-left-panel {
    width: 320px;
    height: 100vh;
    background: #0b2c4d;
    color: #ffffff;
    padding: 22px 16px;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.lesson-brand {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
}

.lesson-brand span {
    color: #f58220;
}

.lesson-side-action,
.lesson-link {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
}

.lesson-side-action {
    background: rgba(255,255,255,0.12);
    padding: 10px 12px;
    margin-bottom: 18px;
}

.module-heading {
    color: #f58220;
    font-weight: bold;
    margin: 22px 0 8px;
    font-size: 14px;
    text-transform: uppercase;
}

.lesson-link {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.06);
    font-size: 14px;
}

.lesson-link:hover,
.lesson-link.active {
    background: #f58220;
    color: #ffffff;
}

.lesson-link.locked {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.lesson-content-panel {
    flex: 1;
    margin-left: 320px;
    padding: 24px;
}

.lesson-topbar {
    background: linear-gradient(135deg, #0b2c4d, #123d66);
    color: #ffffff;
    padding: 18px 22px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    box-shadow: 0 6px 18px rgba(11,44,77,0.25);
    border: 0 !important;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
}

.video-wrapper iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
}

.large-video iframe {
    width: 100%;
    height: 420px;
    border-radius: 10px;
}

.video-watermark {
    position: absolute;
    right: 18px;
    bottom: 14px;
    background: rgba(0,0,0,0.45);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
}

.lesson-extra-box {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
    background: #fbfdff;
}

.payment-access-box {
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    color: #8a5a00;
}

.locked-lesson-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 30px;
    border: 1px solid #eeeeee;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {
    .srisoft-sidebar {
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }

    .sidebar-brand {
        width: 100%;
        max-width: none;
        margin-right: 0;
    }

    .srisoft-nav-links {
        width: 100%;
        gap: 6px;
    }

    .srisoft-sidebar a {
        flex: 1 1 calc(50% - 6px);
        padding: 10px 8px;
        font-size: 13px;
    }

    .logout-link {
        margin-left: 0 !important;
        flex-basis: 100% !important;
    }

    .srisoft-main {
        padding: 1px 15px 15px 15px !important;
    }

    .srisoft-topbar {
        width: calc(100% + 30px);
        margin: 0 -15px 16px -15px;
        border-radius: 0;
        border: 0 !important;
        flex-direction: column;
        align-items: flex-start;
    }

    .srisoft-topbar .topbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .student-learning-shell {
        flex-direction: column;
    }

    .lesson-left-panel {
        width: 100%;
        height: auto;
        position: relative;
    }

    .lesson-content-panel {
        margin-left: 0;
        padding: 14px;
    }

    .lesson-topbar {
        flex-direction: column;
        align-items: flex-start;
        border: 0 !important;
    }

    .video-wrapper {
        max-width: 100%;
    }

    .large-video iframe {
        height: 240px;
    }
}

/* ================= GO TO TOP ================= */

.go-top-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 0;
    background: #f58220;
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.22);
    z-index: 9500;
}

.go-top-btn.show {
    display: flex;
}

.go-top-btn:hover {
    background: #0b2c4d;
}


/* ================= COMPACT ADMIN UI ================= */
.form-control,
.form-select {
    min-height: 38px;
    font-size: 14px;
}

.btn {
    font-size: 14px;
}

.btn-sm {
    padding: 4px 9px;
    font-size: 13px;
    line-height: 1.25;
}

.table th,
.table td {
    padding: 7px 9px;
    font-size: 14px;
}

.table-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.table-actions .btn,
.table-actions .badge {
    margin: 0 !important;
}

.compact-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 10px;
}

.compact-stat-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 10px 12px;
    min-height: 66px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #0b2c4d;
}

.compact-stat-card.success { border-left-color: #198754; }
.compact-stat-card.warning { border-left-color: #ffc107; }
.compact-stat-card.danger { border-left-color: #dc3545; }
.compact-stat-card.info { border-left-color: #0dcaf0; }
.compact-stat-card.orange { border-left-color: #f58220; }

.compact-stat-title {
    font-size: 12px;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.compact-stat-value {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.1;
    color: #0b2c4d;
}

.compact-stat-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #6c757d;
}

.ledger-profile-card {
    background: linear-gradient(135deg, #0b2c4d, #123d66);
    color: #ffffff;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(11,44,77,0.16);
}

.ledger-profile-name {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 6px;
}

.ledger-profile-meta {
    display: flex;
    gap: 10px 18px;
    flex-wrap: wrap;
    font-size: 13px;
    color: rgba(255,255,255,0.86);
}

.ledger-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.ledger-live-search {
    max-width: 420px;
}

.progress.compact-progress {
    height: 18px;
    min-width: 90px;
    background: #e9ecef;
}

.progress.compact-progress .progress-bar {
    font-size: 11px;
    font-weight: 700;
}

.badge {
    font-weight: 700;
}

.ledger-stat {
    min-height: 58px;
    padding: 8px !important;
}

.ledger-stat strong {
    font-size: 12px;
}

.ledger-stat .amount {
    display: inline-block;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
}

body.dark-mode .compact-stat-card {
    background: #1f2937;
    color: #ffffff;
}

body.dark-mode .compact-stat-title,
body.dark-mode .compact-stat-sub {
    color: #cbd5e1;
}

body.dark-mode .compact-stat-value {
    color: #ffffff;
}

/* =========================================================
   SRISOFT LMS - STRONG FORM VISIBILITY ENHANCEMENT
   Put at the END of style.css so it overrides Bootstrap/page styles.
   ========================================================= */

.srisoft-main label,
.dashboard-card label,
.form-label,
label {
    color: #0b2c4d !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    margin-bottom: 5px !important;
    letter-spacing: 0.01em;
}

.srisoft-main .form-control,
.srisoft-main .form-select,
.srisoft-main select,
.srisoft-main textarea,
.srisoft-main input[type="text"],
.srisoft-main input[type="number"],
.srisoft-main input[type="email"],
.srisoft-main input[type="date"],
.srisoft-main input[type="password"],
.srisoft-main input[type="search"],
.srisoft-main input[type="tel"],
.srisoft-main input[type="url"],
.dashboard-card .form-control,
.dashboard-card .form-select,
.dashboard-card select,
.dashboard-card textarea,
.dashboard-card input[type="text"],
.dashboard-card input[type="number"],
.dashboard-card input[type="email"],
.dashboard-card input[type="date"],
.dashboard-card input[type="password"] {
    background-color: #eef6ff !important;
    border: 1px solid #9fb8d4 !important;
    color: #1f2937 !important;
    border-radius: 8px !important;
    min-height: 38px !important;
    box-shadow: inset 0 1px 2px rgba(11, 44, 77, 0.05) !important;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease !important;
}

.srisoft-main .form-control:hover,
.srisoft-main .form-select:hover,
.srisoft-main select:hover,
.srisoft-main textarea:hover,
.srisoft-main input:hover,
.dashboard-card .form-control:hover,
.dashboard-card .form-select:hover,
.dashboard-card select:hover,
.dashboard-card textarea:hover,
.dashboard-card input:hover {
    background-color: #e6f1ff !important;
    border-color: #6f96bf !important;
}

.srisoft-main .form-control:focus,
.srisoft-main .form-select:focus,
.srisoft-main select:focus,
.srisoft-main textarea:focus,
.srisoft-main input:focus,
.dashboard-card .form-control:focus,
.dashboard-card .form-select:focus,
.dashboard-card select:focus,
.dashboard-card textarea:focus,
.dashboard-card input:focus {
    background-color: #fff4d9 !important;
    border-color: #f58220 !important;
    color: #111827 !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(245, 130, 32, 0.24) !important;
}

.srisoft-main .form-control[readonly],
.srisoft-main input[readonly],
.srisoft-main textarea[readonly],
.dashboard-card .form-control[readonly],
.dashboard-card input[readonly],
.dashboard-card textarea[readonly] {
    background-color: #e8edf3 !important;
    border-color: #b8c4d1 !important;
    color: #495057 !important;
}

.srisoft-main .form-control:disabled,
.srisoft-main .form-select:disabled,
.srisoft-main select:disabled,
.srisoft-main input:disabled,
.srisoft-main textarea:disabled,
.dashboard-card .form-control:disabled,
.dashboard-card .form-select:disabled,
.dashboard-card select:disabled,
.dashboard-card input:disabled,
.dashboard-card textarea:disabled {
    background-color: #dde3ea !important;
    border-color: #b9c2cc !important;
    color: #6c757d !important;
    opacity: 1 !important;
    cursor: not-allowed !important;
}

.srisoft-main input::placeholder,
.srisoft-main textarea::placeholder,
.dashboard-card input::placeholder,
.dashboard-card textarea::placeholder {
    color: #667085 !important;
    opacity: 1 !important;
}

.input-group-text {
    background-color: #dcecff !important;
    border-color: #9fb8d4 !important;
    color: #0b2c4d !important;
    font-weight: 700 !important;
}

.student-suggestions {
    background-color: #f8fbff !important;
    border: 1px solid #8ea9c5 !important;
}

.student-suggestion-item:hover,
.student-suggestion-item.active {
    background-color: #fff0d9 !important;
}

.dashboard-card h5 {
    color: #0b2c4d !important;
    border-left: 4px solid #f58220 !important;
    padding-left: 10px !important;
}

body.dark-mode .srisoft-main label,
body.dark-mode .dashboard-card label,
body.dark-mode .form-label,
body.dark-mode label {
    color: #ffb566 !important;
}

body.dark-mode .srisoft-main .form-control,
body.dark-mode .srisoft-main .form-select,
body.dark-mode .srisoft-main select,
body.dark-mode .srisoft-main textarea,
body.dark-mode .srisoft-main input,
body.dark-mode .dashboard-card .form-control,
body.dark-mode .dashboard-card .form-select,
body.dark-mode .dashboard-card select,
body.dark-mode .dashboard-card textarea,
body.dark-mode .dashboard-card input {
    background-color: #1b2a3f !important;
    border-color: #52657d !important;
    color: #ffffff !important;
}

body.dark-mode .srisoft-main .form-control:focus,
body.dark-mode .srisoft-main .form-select:focus,
body.dark-mode .srisoft-main select:focus,
body.dark-mode .srisoft-main textarea:focus,
body.dark-mode .srisoft-main input:focus,
body.dark-mode .dashboard-card .form-control:focus,
body.dark-mode .dashboard-card .form-select:focus,
body.dark-mode .dashboard-card select:focus,
body.dark-mode .dashboard-card textarea:focus,
body.dark-mode .dashboard-card input:focus {
    background-color: #332817 !important;
    border-color: #f58220 !important;
    box-shadow: 0 0 0 0.2rem rgba(245, 130, 32, 0.28) !important;
}


/* =========================================================
   SRISOFT LMS - STABLE GROUPED TOP MENU
   Clean replacement for all previous grouped menu patches.
   Requires sidebar_stable.php for delayed hover support.
   ========================================================= */

.srisoft-sidebar.srisoft-top-menu {
    align-items: center !important;
    gap: 14px !important;
    padding: 8px 20px !important;
    overflow: visible !important;
}

.srisoft-sidebar .sidebar-brand {
    flex: 0 0 auto !important;
    min-width: 250px !important;
    max-width: 360px !important;
}

.srisoft-sidebar .srisoft-nav-links.srisoft-grouped-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 5px !important;
    flex: 1 1 auto !important;
    flex-wrap: wrap !important;
    margin-left: auto !important;
    overflow: visible !important;
}

.srisoft-sidebar .srisoft-grouped-nav .nav-group {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}

.srisoft-sidebar .srisoft-grouped-nav > a,
.srisoft-sidebar .srisoft-grouped-nav .nav-group-btn {
    height: 34px !important;
    min-height: 34px !important;
    padding: 7px 12px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 600 !important;
    transform: none !important;
    box-sizing: border-box !important;
    color: #ffffff !important;
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    box-shadow: none !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

.srisoft-sidebar .srisoft-grouped-nav .nav-group-btn {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    outline: 0 !important;
    cursor: pointer !important;
    font-family: Arial, sans-serif !important;
}

/* Hover effect without size or font-weight jump */
.srisoft-sidebar .srisoft-grouped-nav > a:hover,
.srisoft-sidebar .srisoft-grouped-nav .nav-group:hover > .nav-group-btn,
.srisoft-sidebar .srisoft-grouped-nav .nav-group.menu-open > .nav-group-btn {
    background: rgba(245,130,32,0.22) !important;
    border-color: rgba(245,130,32,0.72) !important;
    box-shadow: inset 0 -3px 0 #f58220 !important;
    font-weight: 600 !important;
    transform: none !important;
}

.srisoft-sidebar .srisoft-grouped-nav > a.active-menu,
.srisoft-sidebar .srisoft-grouped-nav .nav-group.active-group > .nav-group-btn {
    background: #f58220 !important;
    border-color: #f58220 !important;
    box-shadow: none !important;
    font-weight: 700 !important;
}

.srisoft-sidebar .srisoft-grouped-nav .nav-group-btn:focus,
.srisoft-sidebar .srisoft-grouped-nav .nav-group-btn:active,
.srisoft-sidebar .srisoft-grouped-nav > a:focus,
.srisoft-sidebar .srisoft-grouped-nav > a:active {
    outline: 0 !important;
    transform: none !important;
}

/* Dropdown is controlled by JS class .menu-open, with CSS hover as backup. */
.srisoft-sidebar .srisoft-grouped-nav .nav-dropdown {
    display: block !important;
    position: absolute !important;
    top: 34px !important;
    left: 0 !important;
    min-width: 225px !important;
    width: 225px !important;
    background: #0b2c4d !important;
    border: 1px solid rgba(255,255,255,0.14) !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.28) !important;
    z-index: 99999 !important;
    padding: 6px !important;
    margin: 0 !important;
    border-radius: 0 0 8px 8px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(0) !important;
    transition: opacity .10s ease, visibility .10s ease !important;
}

/* Invisible bridge: makes the hover area continuous between button and dropdown. */
.srisoft-sidebar .srisoft-grouped-nav .nav-dropdown::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
    background: transparent;
}

.srisoft-sidebar .srisoft-grouped-nav .nav-group:hover > .nav-dropdown,
.srisoft-sidebar .srisoft-grouped-nav .nav-group:focus-within > .nav-dropdown,
.srisoft-sidebar .srisoft-grouped-nav .nav-group.menu-open > .nav-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.srisoft-sidebar .srisoft-grouped-nav .nav-dropdown a {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    height: auto !important;
    min-height: 34px !important;
    box-sizing: border-box !important;
    margin: 0 0 4px 0 !important;
    padding: 8px 10px !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    background: rgba(255,255,255,0.07) !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

.srisoft-sidebar .srisoft-grouped-nav .nav-dropdown a:last-child {
    margin-bottom: 0 !important;
}

.srisoft-sidebar .srisoft-grouped-nav .nav-dropdown a:hover {
    background: rgba(245,130,32,0.24) !important;
    border-color: rgba(245,130,32,0.55) !important;
    box-shadow: none !important;
    font-weight: 600 !important;
}

.srisoft-sidebar .srisoft-grouped-nav .nav-dropdown a.active-menu {
    background: #f58220 !important;
    border-color: #f58220 !important;
    font-weight: 700 !important;
}

.srisoft-sidebar .srisoft-grouped-nav .logout-link {
    margin-left: 8px !important;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
    box-shadow: none !important;
}

.srisoft-sidebar .srisoft-grouped-nav .logout-link:hover {
    background: #bb2d3b !important;
    border-color: #bb2d3b !important;
    box-shadow: inset 0 -3px 0 rgba(255,255,255,0.35) !important;
}

@media (max-width: 768px) {
    .srisoft-sidebar .srisoft-nav-links.srisoft-grouped-nav {
        justify-content: flex-start !important;
        width: 100% !important;
        gap: 6px !important;
    }

    .srisoft-sidebar .srisoft-grouped-nav .nav-group {
        flex: 1 1 calc(50% - 6px) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .srisoft-sidebar .srisoft-grouped-nav > a,
    .srisoft-sidebar .srisoft-grouped-nav .nav-group-btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .srisoft-sidebar .srisoft-grouped-nav .nav-dropdown {
        position: static !important;
        width: 100% !important;
        min-width: 100% !important;
        margin-top: 4px !important;
        border-radius: 6px !important;
    }

    .srisoft-sidebar .srisoft-grouped-nav .logout-link {
        margin-left: 0 !important;
        flex-basis: 100% !important;
    }
}

/* =========================================================
   SRISOFT LMS + IMS — UNIFIED LIGHT / DARK THEME FRAMEWORK
   Deliverable #1. Keep this block at the end of style.css.
   ========================================================= */
:root {
    color-scheme: light;
    --sr-page-bg: #eef4fb;
    --sr-page-bg-alt: #f7faff;
    --sr-surface: #ffffff;
    --sr-surface-soft: #f7faff;
    --sr-surface-raised: #ffffff;
    --sr-text: #1f2937;
    --sr-heading: #0b2c4d;
    --sr-muted: #617184;
    --sr-border: #d9e4ef;
    --sr-border-strong: #b7cadc;
    --sr-table-head: #eaf2fa;
    --sr-table-stripe: #f8fbfe;
    --sr-hover: #fff2e6;
    --sr-input-bg: #eef6ff;
    --sr-input-focus: #fff4d9;
    --sr-input-text: #1f2937;
    --sr-placeholder: #667085;
    --sr-shadow: 0 5px 18px rgba(11, 44, 77, .07);
}

html[data-theme="dark"],
html[data-admin-theme="dark"] {
    color-scheme: dark;
}

body {
    background: var(--sr-page-bg) !important;
    color: var(--sr-text) !important;
}

body.dark-mode,
body.admin-dark-mode {
    --sr-page-bg: #0e1722;
    --sr-page-bg-alt: #111d2a;
    --sr-surface: #172434;
    --sr-surface-soft: #1b2a3c;
    --sr-surface-raised: #1d2d40;
    --sr-text: #edf4ff;
    --sr-heading: #f7fbff;
    --sr-muted: #b8c6d6;
    --sr-border: #33465b;
    --sr-border-strong: #50657b;
    --sr-table-head: #24374b;
    --sr-table-stripe: #19283a;
    --sr-hover: #2a394b;
    --sr-input-bg: #18283a;
    --sr-input-focus: #332817;
    --sr-input-text: #ffffff;
    --sr-placeholder: #aebed1;
    --sr-shadow: 0 7px 24px rgba(0, 0, 0, .28);
    background: var(--sr-page-bg) !important;
    color: var(--sr-text) !important;
}

.srisoft-main,
.srisoft-page-content,
.admin-content-pad {
    background: transparent;
    color: var(--sr-text);
}

.dashboard-card,
.card,
.modal-content,
.dropdown-menu,
.list-group-item,
.accordion-item,
.offcanvas,
.ui-page-header,
.ui-action-bar,
.ui-section,
.ui-stat-card,
.ui-mobile-card,
.ui-welcome-chip,
.compact-stat-card,
.lesson-extra-box,
.locked-lesson-box {
    background-color: var(--sr-surface) !important;
    border-color: var(--sr-border) !important;
    color: var(--sr-text) !important;
}

.card-header,
.card-footer,
.modal-header,
.modal-footer,
.accordion-button,
.list-group-item-action {
    background-color: var(--sr-surface-soft) !important;
    border-color: var(--sr-border) !important;
    color: var(--sr-text) !important;
}

h1, h2, h3, h4, h5, h6,
.card-title,
.modal-title,
.dashboard-card h5,
.dashboard-card h6,
.ui-page-header h3,
.ui-action-bar h5,
.ui-section-head h5,
.ui-stat-value,
.compact-stat-value {
    color: var(--sr-heading) !important;
}

p,
label,
.form-label,
.form-check-label,
.table,
.table td,
.table th,
.dropdown-item,
.list-group-item,
.accordion-body,
.modal-body {
    color: var(--sr-text);
}

.text-muted,
.text-secondary,
small,
.form-text,
.ui-page-subtitle,
.ui-action-subtitle,
.ui-stat-title,
.ui-stat-note,
.ui-theme-text,
.compact-stat-title,
.compact-stat-sub,
.student-suggestion-item small {
    color: var(--sr-muted) !important;
}

.table {
    --bs-table-color: var(--sr-text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--sr-border);
    --bs-table-striped-color: var(--sr-text);
    --bs-table-striped-bg: var(--sr-table-stripe);
    --bs-table-hover-color: var(--sr-text);
    --bs-table-hover-bg: var(--sr-hover);
    color: var(--sr-text) !important;
    border-color: var(--sr-border) !important;
}

.table thead,
.table thead th,
.table > :not(caption) > * > th {
    background: var(--sr-table-head) !important;
    color: var(--sr-heading) !important;
    border-color: var(--sr-border) !important;
}

.table tbody td,
.table tbody th,
.table > :not(caption) > * > td {
    background-color: transparent !important;
    color: var(--sr-text) !important;
    border-color: var(--sr-border) !important;
}

.form-control,
.form-select,
.ui-input,
textarea,
select,
input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    background-color: var(--sr-input-bg) !important;
    border-color: var(--sr-border-strong) !important;
    color: var(--sr-input-text) !important;
}

.form-control:focus,
.form-select:focus,
.ui-input:focus,
textarea:focus,
select:focus,
input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus {
    background-color: var(--sr-input-focus) !important;
    border-color: #f58220 !important;
    color: var(--sr-input-text) !important;
    box-shadow: 0 0 0 .2rem rgba(245, 130, 32, .22) !important;
}

.form-control::placeholder,
textarea::placeholder,
input::placeholder {
    color: var(--sr-placeholder) !important;
    opacity: 1 !important;
}

.input-group-text,
.dropdown-menu,
.student-suggestions {
    background-color: var(--sr-surface-soft) !important;
    border-color: var(--sr-border) !important;
    color: var(--sr-text) !important;
}

.dropdown-item:hover,
.dropdown-item:focus,
.list-group-item-action:hover,
.student-suggestion-item:hover,
.student-suggestion-item.active {
    background-color: var(--sr-hover) !important;
    color: var(--sr-heading) !important;
}

.alert {
    color: inherit;
    border-color: color-mix(in srgb, currentColor 25%, transparent);
}

body.dark-mode a:not(.btn):not(.srisoft-sidebar a):not(.srisoft-mainnav a):not(.srisoft-admin-footer a),
body.admin-dark-mode a:not(.btn):not(.srisoft-sidebar a):not(.srisoft-mainnav a):not(.srisoft-admin-footer a) {
    color: #8fc8ff;
}

body.dark-mode .badge.bg-light,
body.admin-dark-mode .badge.bg-light {
    background: #31445a !important;
    color: #f3f7fc !important;
}

body.dark-mode .btn-close,
body.admin-dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

@media print {
    body,
    body.dark-mode,
    body.admin-dark-mode {
        background: #ffffff !important;
        color: #000000 !important;
    }
}
