

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --text-primary: #000000;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --hover-bg: #f0f2f1;
    --active-bg: #dee2e6;
    --theme-color: #2c372d;
    --accent: #2c372d;
    --shadow: rgba(0, 0, 0, 0.1);
    --btn-bg: #2c372d;
    --btn-hover: #f0f2f1;
    --btn-active: #1f2a20;
    --focus-color: #4c5f4d;
    --olive-green: #2c372d;
    --olive-green-light: #4c5f4d;
    --olive-green-hover: #f0f2f1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 0;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, transform 0.3s ease;
    box-shadow: 2px 0 8px var(--shadow);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 20px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
    box-sizing: border-box;
    height: 80px;
    flex-shrink: 0;
}

.sidebar-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--theme-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-header h3 {
    justify-content: center;
}

.sidebar.collapsed .sidebar-header h3 .icon {
    margin: 0;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
}

.sidebar-toggle-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.sidebar-toggle-btn i {
    display: block;
    line-height: 1;
    font-weight: 700;
}

.sidebar-toggle-btn .expand-icon {
    font-size:22px;
}

.sidebar.collapsed .sidebar-toggle-btn .collapse-icon {
    display: none;
}

.sidebar.collapsed .sidebar-toggle-btn .expand-icon {
    display: block !important;
}

.sidebar:not(.collapsed) .sidebar-toggle-btn .expand-icon {
    display: none !important;
}

.txt-black {
    color: #000!important;
}

/* Attendance Load Students Button - Theme Color */
#loadStudentsBtn {
    background-color: var(--theme-color) !important;
    border-color: var(--theme-color) !important;
    color: #fff !important;
}

#loadStudentsBtn:hover:not(:disabled) {
    background-color: var(--theme-color) !important;
    border-color: var(--theme-color) !important;
    color: #fff !important;
    opacity: 0.9;
}

#loadStudentsBtn:focus,
#loadStudentsBtn:active,
#loadStudentsBtn.active {
    background-color: var(--theme-color) !important;
    border-color: var(--theme-color) !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(44, 55, 45, 0.25) !important;
}

.sidebar-header .icon {
    font-size: 24px;
    color: var(--theme-color);
}

.sidebar-nav {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    justify-content: flex-start;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 8px;
}

.nav-link span {
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    position: absolute;
}

.nav-link:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: var(--theme-color);
    color: var(--bg-primary);
    font-weight: 600;
}

.nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    flex-shrink: 0;
    margin-top: auto;
}

.sidebar.collapsed .sidebar-footer {
    padding: 20px 10px;
}

.sidebar-footer .user-details,
.sidebar-footer .logout-btn span {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-footer .user-details,
.sidebar.collapsed .sidebar-footer .logout-btn span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    position: absolute;
}

.sidebar.collapsed .user-info {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .logout-btn {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.user-info .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--theme-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--bg-primary);
}

.user-info .user-details {
    flex: 1;
}

.user-info .user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-info .user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.logout-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background-color: var(--btn-bg);
    border: 1px solid var(--btn-bg);
    color: var(--bg-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-btn span {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .logout-btn {
    padding: 10px;
    justify-content: center;
}

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

.logout-btn:focus,
.logout-btn:active,
.logout-btn:focus-visible {
    background-color: var(--btn-active) !important;
    border-color: var(--btn-active) !important;
    color: var(--bg-primary) !important;
    box-shadow: 0 0 0 3px rgba(44, 55, 45, 0.3) !important;
    outline: none !important;
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    background-color: var(--bg-primary);
    padding: 0;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

.content-header {
    background-color: var(--bg-primary);
    border-bottom: 2px solid var(--theme-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.institute-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    padding: 14px 30px;
    min-height: 65px;
}

.institute-header > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.institute-logo {
    max-height: 35px;
    max-width: 200px;
    object-fit: contain;
    height: auto;
    width: auto;
}

.institute-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.institute-address {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* Marksheet Modal - Width */
#marksheetModal .modal-dialog {
    max-width: 900px;
}

.page-header-ribbon {
    padding: 3px 30px 3px 40px;
    background-color: #ffffff;
    border-bottom: 2px solid var(--theme-color);
    min-height: 18px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 4px;
}

.page-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-title i {
    font-size: 16px;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.content-body {
    padding: 32px;
    background-color: #f9f9f7;
    min-height: calc(100vh - 83px);
}

/* Dashboard specific - no scrolling */
body.dashboard-page {
    overflow: auto;
}

body.dashboard-page .main-content {
    display: flex;
    flex-direction: column;
}

body.dashboard-page .content-header {
    flex-shrink: 0;
}

body.dashboard-page .content-body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Cards */
.card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px var(--shadow);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    margin-bottom: 16px;
}

.card-header h5 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Tables */
.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Custom scrollbar for table-responsive */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Ensure tables inside responsive container don't shrink below content */
.table-responsive > .table {
    min-width: 100%;
}

/* Prevent header text from wrapping to maintain column alignment */
.table-responsive > .table thead th {
    white-space: nowrap;
}

.table {
    margin: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.table thead {
    background-color: var(--bg-secondary);
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    padding: 10px 12px;
    font-size: 0.8125rem; /* 13px / 16px = 0.8125rem - scales with font size multiplier */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

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

.table tbody td {
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: 0.8125rem; /* 13px / 16px = 0.8125rem - scales with font size multiplier */
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-primary:focus-visible {
    background-color: var(--theme-color) !important;
    color: var(--bg-primary) !important;
    box-shadow: 0 0 0 3px rgba(44, 55, 45, 0.3) !important;
    outline: none !important;
    border-color: var(--theme-color) !important;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:focus,
.btn-secondary:active,
.btn-secondary.active {
    background-color: var(--hover-bg);
    border-color: var(--olive-green-light);
    box-shadow: 0 0 0 3px rgba(44, 55, 45, 0.2);
    outline: none;
}

.btn-danger {
    background-color: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background-color: transparent;
    color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:focus,
.btn-danger:active,
.btn-danger:focus-visible {
    background-color: #dc3545 !important;
    color: var(--bg-primary) !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3) !important;
    outline: none !important;
    border-color: #dc3545 !important;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Forms */
.form-control,
.form-select {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

/* Search boxes - smaller height */
#studentSearchBox,
#teacherSearchBox,
#classSearchBox,
#marksSearchBox {
    height: 32px;
    padding: 5px 12px;
    font-size: 13px;
}

/* Class filter dropdown */
#studentClassFilter {
    height: 32px;
    padding: 5px 12px;
    font-size: 13px;
}

/* Dropdown filters - */
#feeStructureClassFilter {
    height: 32px;
    padding: 5px 10px;
    font-size: 13px;
}

.input-group-text {
    height: 32px;
    padding: 5px 12px;
    font-size: 13px;
}

/* Student dropdown for marksheet */
#marksheetStudentSelect {
    height: 32px;
    padding: 5px 12px;
    font-size: 13px;
}

/* Generate button  */
#generateMarksheetBtn {
    height: 32px;
    padding: 5px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Close/Clear buttons */
#clearSearchBtn,
#clearStudentSearchBtn,
#clearTeacherSearchBtn,
#clearClassSearchBtn,
#closeMarksheetBtn {
    height: 32px;
    padding: 5px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search box info text */
.form-text {
    font-size: 11px;
    margin-top: 4px;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-primary);
    border-color: var(--olive-green-light);
    color: var(--text-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 55, 45, 0.2);
}

.form-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Modals */
.modal-dialog {
    max-width: 500px;
}

.modal-content {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
}

.modal-title {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

/* Event Modal - Similar to other modals */
#eventModal .modal-dialog {
    max-width: 500px;
}

#eventModal .modal-header {
    padding: 12px 16px;
}

#eventModal .modal-title {
    font-size: 16px;
    font-weight: 600;
}

#eventModal .modal-body {
    padding: 16px;
    font-size: 13px;
}

#eventModal .modal-footer {
    padding: 12px 16px;
}

#eventModal .form-label {
    font-size: 12px;
    margin-bottom: 5px;
}

#eventModal .form-control,
#eventModal .form-select {
    font-size: 13px;
    padding: 5px 10px;
    height: 32px;
}

#eventModal .form-control:focus,
#eventModal .form-select:focus {
    font-size: 13px;
}

#eventModal textarea.form-control {
    font-size: 13px;
    padding: 5px 10px;
    min-height: 70px;
}

#eventModal .form-check-label {
    font-size: 12px;
}

#eventModal .mb-3 {
    margin-bottom: 12px !important;
}

#eventModal .btn {
    font-size: 13px;
    padding: 6px 12px;
}

/* Event Options Modal - Similar to other modals */
#eventOptionsModal .modal-dialog {
    max-width: 500px;
}

#eventOptionsModal .modal-header {
    padding: 12px 16px;
}

#eventOptionsModal .modal-title {
    font-size: 16px;
    font-weight: 600;
}

#eventOptionsModal .modal-body {
    padding: 16px;
    font-size: 13px;
}

#eventOptionsModal .modal-footer {
    padding: 12px 16px;
}

#eventOptionsModal .list-group-item {
    padding: 10px 12px;
    font-size: 13px;
}

#eventOptionsModal .list-group-item h6 {
    font-size: 14px;
    margin-bottom: 4px;
}

#eventOptionsModal .list-group-item p {
    font-size: 12px;
    margin-bottom: 2px;
}

#eventOptionsModal .btn-sm {
    font-size: 12px;
    padding: 4px 10px;
}

.btn-close {
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 16px;
    font-size: 13px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
}

.modal-body .form-label {
    font-size: 12px;
    margin-bottom: 5px;
}

.modal-body .form-control,
.modal-body .form-select {
    font-size: 13px;
    padding: 5px 10px;
    height: 32px;
}

.modal-body textarea.form-control {
    font-size: 13px;
    padding: 5px 10px;
    min-height: 70px;
}

.modal-body .form-check-label {
    font-size: 12px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
    color: #2e7d32;
}

.alert-error,
.alert-danger {
    background-color: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.3);
    color: #c62828;
}

.alert-info {
    background-color: rgba(44, 55, 45, 0.1);
    border-color: rgba(44, 55, 45, 0.3);
    color: #1f2a20;
}

/* Stats Cards */
.stats-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.stats-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 12px 0;
}

.stats-card .stat-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-card .stat-icon {
    font-size: 32px;
    color: var(--theme-color);
    margin-bottom: 12px;
}

.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-card:hover {
    background-color: var(--hover-bg);
}

.event-item {
    background-color: var(--bg-secondary);
    transition: all 0.2s ease;
}

.event-item:hover {
    background-color: var(--hover-bg);
    transform: translateX(4px);
}

.event-item.clickable-event:hover {
    background-color: var(--hover-bg);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: var(--olive-green);
}

.event-item h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.event-item.holiday-event {
    background-color: rgba(255, 200, 200, 0.2);
    border-color: rgba(255, 100, 100, 0.3);
}

.event-item.custom-event {
    background-color: rgba(43, 61, 78, 0.05);
}

.event-item.exam-event {
    background-color: var(--bg-secondary);
}

/* Event items within a ribbon (multiple events per day) */
.event-item .event-in-ribbon {
    margin-bottom: 0;
}

.event-item .event-in-ribbon:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.event-item .event-in-ribbon h6 {
    margin-bottom: 4px;
}

.event-item .event-in-ribbon p {
    margin-bottom: 0;
}

/* Dashboard cards height */
body.dashboard-page .content-body .row:first-of-type {
    margin-bottom: 16px;
    flex-shrink: 0;
}

body.dashboard-page .content-body .row:first-of-type .col-md-3 {
    padding-left: 8px;
    padding-right: 8px;
}

body.dashboard-page .content-body .row:first-of-type .col-md-3:first-child {
    padding-left: 0;
}

body.dashboard-page .content-body .row:first-of-type .col-md-3:last-child {
    padding-right: 0;
}

body.dashboard-page .content-body .row:first-of-type .stats-card {
    padding: 16px;
    margin-bottom: 0;
}

body.dashboard-page .content-body .row:first-of-type .stats-card .stat-value {
    font-size: 28px;
    margin: 8px 0;
}

body.dashboard-page .content-body .row:first-of-type .stats-card .stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

body.dashboard-page .content-body .row:first-of-type .stats-card .stat-label {
    font-size: 12px;
}

body.dashboard-page .content-body .row:last-of-type {
    margin-bottom: 0;
    display: flex;
    flex: 1;
    min-height: 0;
    align-items: stretch; /* Ensure columns stretch to same height */
}

body.dashboard-page .content-body .row:last-of-type .col-md-6 {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-left: 8px;
    padding-right: 8px;
    height: 100%;
}

body.dashboard-page .content-body .row:last-of-type .col-md-6:first-child {
    padding-left: 0;
    padding-right: 12px;
}

body.dashboard-page .content-body .row:last-of-type .col-md-6:last-child {
    padding-right: 0;
    padding-left: 12px;
}

body.dashboard-page .content-body .row:last-of-type .col-md-6 .card {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    flex: 1;
    min-height: 0;
    height: 100%;
    align-items: stretch; /* Ensure card content stretches */
}

body.dashboard-page .content-body .row:last-of-type .col-md-6 .card .card-header {
    flex-shrink: 0;
    padding: 12px 16px;
}

body.dashboard-page .content-body .row:last-of-type .col-md-6 .card .card-header h5 {
    font-size: 16px;
    margin: 0;
}

body.dashboard-page .content-body .row:last-of-type .col-md-6 .card .card-body {
    display: flex;
    flex-direction: column;
    padding: 12px;
    min-height: 0;
    overflow: hidden;
}

#upcomingEvents {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: 260px;
    padding-right: 8px;
    margin-right: -4px;
}

body.dashboard-page #upcomingEvents .event-item {
    padding: 6px; 
    margin-bottom: 6px; 
    min-height: 60px;
    box-sizing: border-box;
    overflow: visible; 
}

body.dashboard-page #upcomingEvents .event-item h6 {
    font-size: 14px;
    margin-bottom: 4px;
}

body.dashboard-page #upcomingEvents .event-item p {
    font-size: 12px;
    margin-bottom: 0;
}

body.dashboard-page #upcomingEvents .event-item.nepali-holiday {
    background-color: #fff3cd;
    border-color: #ffc107;
}

body.dashboard-page #upcomingEvents .event-item.nepali-holiday h6 {
    color: #856404;
    font-weight: 600;
}

#upcomingEvents::-webkit-scrollbar {
    width: 8px;
}

#upcomingEvents::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#upcomingEvents::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#upcomingEvents::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox scrollbar */
#upcomingEvents {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Chart container */
body.dashboard-page #chartTabContent {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-top: 8px;
    height: 100%; /* Match the height of upcoming events container */
}

body.dashboard-page #chartTabContent .tab-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 8px;
}

body.dashboard-page #chartTabContent .tab-pane canvas {
    max-width: 100%;
    width: 100% !important;
}

body.dashboard-page #chartTabContent #students-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0;
    flex: 0 0 auto; /* Don't grow, use fixed size */
    height: 240px; 
    max-height: 240px;
    overflow: hidden;
}

body.dashboard-page #chartTabContent #students-chart canvas {
    max-height: 240px !important;
    height: 240px !important;
    width: 100% !important;
}

body.dashboard-page #chartTabContent #exam-type-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0;
    height: 200px;
    overflow: hidden;
}

body.dashboard-page #chartTabContent #exam-type-chart canvas {
    max-height: 200px !important;
    height: 200px !important;
    flex-shrink: 0;
}

body.dashboard-page .nav-tabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

body.dashboard-page .nav-tabs .nav-link {
    padding: 8px 12px;
    font-size: 13px;
}

/* Calendar Styles */
.calendar-view {
    padding: 2px; 
}

.calendar-header {
    text-align: center;
    margin-bottom: 1px; 
}

.calendar-header h4,
.calendar-header h5 {
    font-size: 16px;
    margin: 0;
}

.calendar-grid {
    margin-top: 2px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px;
    font-size: 11px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    min-height: 85px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 4px;
    background-color: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-size: 11px;
}

.calendar-day:hover {
    background-color: var(--hover-bg);
    transform: translateY(-1px);
    box-shadow: 0 1px 4px var(--shadow);
}

.calendar-day.empty {
    background-color: var(--bg-secondary);
    cursor: default;
}

.calendar-day.empty:hover {
    background-color: var(--bg-secondary);
    transform: none;
    box-shadow: none;
}

.calendar-day.today {
    border: 1px solid #888888; /* Very thin grayish border for today */
    background-color: rgba(200, 220, 255, 0.3); /* Slight bluish background for today */
}


.calendar-view.has-selected .calendar-day.today:not(.selected-day) {
    border: 1px solid #b4adad; 
}

/* When today is the selected date, show appropriate border color */
.calendar-day.today.selected-day {
    border: 3px solid #0d6efd !important; /* Blue border for manually selected today (default) */
    background-color: rgba(13, 110, 253, 0.1);
}

.calendar-day.today.selected-day.selected-holiday {
    border: 3px solid #dc3545 !important; /* Red border for manually selected holiday today */
    background-color: rgba(220, 53, 69, 0.1);
}

.calendar-day.today.selected-day.selected-from-dashboard {
    border: 3px solid #0d6efd !important; /* Blue border for dashboard-selected today (default) */
    background-color: rgba(13, 110, 253, 0.1);
}

.calendar-day.today.selected-day.selected-from-dashboard.selected-holiday {
    border: 3px solid #dc3545 !important; /* Red border for dashboard-selected holiday today */
    background-color: rgba(220, 53, 69, 0.1);
}

.calendar-day.holiday {
    background-color: rgba(255, 200, 200, 0.3);
}

.calendar-day.saturday {
    background-color: rgba(255, 150, 150, 0.2);
}

.calendar-day.saturday.holiday {
    background-color: rgba(255, 120, 120, 0.4);
}

.calendar-day.selected-day {
    border: 3px solid #0d6efd; /* Blue border for selected date (manual click - default) */
    background-color: rgba(13, 110, 253, 0.1);
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.4);
    font-weight: 700;
}

/* Red border when selected day is a holiday */
.calendar-day.selected-day.selected-holiday {
    border: 3px solid #dc3545; /* Red border for holiday selected date */
    background-color: rgba(220, 53, 69, 0.1);
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.4);
}

/* Blue border when selected from dashboard ribbon */
.calendar-day.selected-day.selected-from-dashboard {
    border: 3px solid #0d6efd; /* Blue border for dashboard-selected date (default) */
    background-color: rgba(13, 110, 253, 0.1);
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.4);
}

/* Red border when dashboard-selected day is a holiday */
.calendar-day.selected-day.selected-from-dashboard.selected-holiday {
    border: 3px solid #dc3545; /* Red border for dashboard-selected holiday */
    background-color: rgba(220, 53, 69, 0.1);
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.4);
}

.calendar-day.selected-day.selected-from-dashboard .day-number {
    color: #0d6efd; /* Blue color for dashboard-selected day number */
    font-size: 13px;
}

.calendar-day.selected-day.selected-from-dashboard.selected-holiday .day-number {
    color: #dc3545; /* Red color for dashboard-selected holiday day number */
    font-size: 13px;
}

.calendar-day.selected-day .day-number {
    color: #0d6efd; /* Blue color for selected day number (manual click - default) */
    font-size: 13px;
}

.calendar-day.selected-day.selected-holiday .day-number {
    color: #dc3545; /* Red color for selected holiday day number */
    font-size: 13px;
}

.day-number {
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 2px;
    color: var(--text-primary);
}

/* Event indicators for calendar days */
.event-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 2px;
}

.event-indicator,
.holiday-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.event-indicator {
    background-color: var(--theme-color, #007bff);
}

.holiday-indicator {
    background-color: #dc3545;
}

.more-events {
    font-size: 8px;
    color: var(--text-muted);
}

.day-events {
    margin-top: 2px;
    max-height: 65px;
    overflow: hidden;
}

.day-event {
    font-size: 9px;
    padding: 1px 3px;
    margin-bottom: 2px;
    border-radius: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.3;
}

.day-event-more {
    font-size: 8px;
    color: var(--text-muted);
    padding: 1px 2px;
}

.event-holiday {
    background-color: rgba(220, 53, 69, 0.2);
    color: #8b0000;
    font-weight: 600;
    border-left: 2px solid #dc3545;
}

.event-custom {
    background-color: rgba(13, 110, 253, 0.15);
    color: var(--text-primary);
    border-left: 2px solid var(--theme-color, #0d6efd);
}

.calendar-day .day-event-more {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    margin-top: 2px;
}

/* Login/Signup Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 2px 8px var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--theme-color);
    margin-bottom: 8px;
}

.auth-header h1 i {
    color: var(--theme-color);
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-left:10px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .btn-submit {
    width: 100%;
    padding: 12px;
    background-color: var(--btn-bg);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.auth-form .btn-submit:hover {
    background-color: var(--btn-bg);
    color: var(--bg-primary);
}

.auth-form .btn-submit:focus,
.auth-form .btn-submit:active,
.auth-form .btn-submit:focus-visible,
.auth-form .btn-submit:not(:disabled):not(.disabled):active {
    background-color: var(--btn-bg) !important;
    color: var(--bg-primary) !important;
    box-shadow: 0 0 0 3px rgba(44, 55, 45, 0.3) !important;
    outline: none !important;
    border-color: var(--btn-bg) !important;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.auth-footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        min-width: 70px;
    }
    
    .sidebar:not(.collapsed) {
        width: 260px;
        min-width: 260px;
    }
    
    /* Ensure text is visible when expanded on small devices */
    .sidebar:not(.collapsed) .nav-link span {
        opacity: 1 !important;
        width: auto !important;
        overflow: visible !important;
        position: relative !important;
    }
    
    .sidebar:not(.collapsed) .sidebar-footer .user-details,
    .sidebar:not(.collapsed) .sidebar-footer .logout-btn span {
        opacity: 1 !important;
        width: auto !important;
        overflow: visible !important;
        position: relative !important;
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: 70px;
    }
    
    .sidebar:not(.collapsed) ~ .main-content {
        margin-left: 260px;
    }
    
    .main-content {
        margin-left: 70px;
        transition: margin-left 0.3s ease;
    }
    
    .content-body {
        padding: 20px;
    }
    
    .mobile-menu-btn {
        display: block;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        padding: 10px;
        border-radius: 6px;
        cursor: pointer;
    }
}

.mobile-menu-btn {
    display: none;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Utility Classes */
.text-muted {
    color: var(--text-muted);
}

.mb-4 {
    margin-bottom: 24px;
}

.mt-4 {
    margin-top: 24px;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* Override Bootstrap default blue focus colors */
.btn:focus,
.btn:active,
.btn:focus-visible,
button:focus,
button:active,
button:focus-visible {
    outline: none !important;
}

*:focus {
    outline: none;
}

/* Remove any blue focus rings from Bootstrap and override active states */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible {
    box-shadow: 0 0 0 3px rgba(44, 55, 45, 0.3) !important;
}

/* Override Bootstrap's blue active state - this prevents the blue flash on click */
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
    background-color: var(--theme-color) !important;
    border-color: var(--theme-color) !important;
    color: var(--bg-primary) !important;
}

.btn-secondary:not(:disabled):not(.disabled):active,
.btn-secondary:not(:disabled):not(.disabled).active,
.show > .btn-secondary.dropdown-toggle {
    background-color: var(--hover-bg) !important;
    border-color: var(--olive-green-light) !important;
    color: var(--text-primary) !important;
}

/* Remove Bootstrap's blue focus ring completely */
.btn:focus,
.btn.focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 55, 45, 0.25) !important;
}

.btn-primary:focus,
.btn-primary.focus {
    box-shadow: 0 0 0 3px rgba(44, 55, 45, 0.3) !important;
}

/* Dropdown selected option - olive green */
.form-select option:checked,
.form-select option[selected],
select option:checked,
select option[selected] {
    background-color: var(--olive-green) !important;
    color: var(--bg-primary) !important;
}

/* Dropdown option hover - light olive green */
.form-select option:hover,
select option:hover {
    background-color: var(--hover-bg) !important;
    color: var(--bg-primary) !important;
}

/* Checkbox checked state - olive green */
.form-check-input:checked {
    background-color: var(--olive-green) !important;
    border-color: var(--olive-green) !important;
}

.form-check-input:focus {
    border-color: var(--olive-green-light) !important;
    box-shadow: 0 0 0 0.25rem rgba(44, 55, 45, 0.25) !important;
}

.form-check-input:checked:focus {
    box-shadow: 0 0 0 0.25rem rgba(44, 55, 45, 0.25) !important;
}

/* Radio button checked state - olive green */
.form-check-input[type="radio"]:checked {
    background-color: var(--olive-green) !important;
    border-color: var(--olive-green) !important;
}

.form-check-input[type="radio"]:checked:focus {
    box-shadow: 0 0 0 0.25rem rgba(44, 55, 45, 0.25) !important;
}

/* Login screen radio button selected */
.auth-form .form-check-input[type="radio"]:checked {
    background-color: var(--olive-green) !important;
    border-color: var(--olive-green) !important;
}

.auth-form .form-check-input[type="radio"]:checked + .form-check-label {
    color: var(--olive-green);
    font-weight: 600;
}

/* Login screen button group - olive green */
.btn-outline-primary {
    border-color: var(--olive-green) !important;
    color: var(--olive-green) !important;
}

.btn-outline-primary:hover {
    background-color: transparent !important;
    border-color: var(--olive-green) !important;
    color: var(--olive-green) !important;
}

.btn-check:checked + .btn-outline-primary {
    background-color: var(--theme-color) !important;
    border-color: var(--theme-color) !important;
    color: #fff !important;
}

.btn-check:active + .btn-outline-primary,
.btn-check:checked + .btn-outline-primary:focus {
    background-color: var(--theme-color) !important;
    border-color: var(--theme-color) !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--theme-color-rgb, 44, 55, 45), 0.25) !important;
}

/* Nav tabs active state - olive green */
.nav-tabs .nav-link.active {
    background-color: var(--olive-green) !important;
    color: var(--bg-primary) !important;
    border-color: var(--olive-green) var(--olive-green) var(--bg-primary) !important;
}

.nav-tabs .nav-link:hover {
    border-color: var(--olive-green-light) var(--olive-green-light) var(--border-color);
    color: var(--olive-green);
}

/* Bootstrap override for selected options in dropdown */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--olive-green) !important;
    color: var(--bg-primary) !important;
}

.dropdown-item:hover {
    background-color: var(--hover-bg) !important;
    color: #000 !important;
}

/* Table row active/hover with olive green accent */
.table-hover tbody tr:hover {
    background-color: rgba(240, 242, 241, 0.5);
}

/* Table info (used for class headers in fee structure) */
.table-info {
    background-color: rgba(44, 55, 45, 0.1) !important;
    color: var(--olive-green) !important;
    font-weight: 600;
}

/* Focus states with olive green */
.form-control:focus,
.form-select:focus {
    border-color: var(--olive-green-light) !important;
    box-shadow: 0 0 0 3px rgba(44, 55, 45, 0.2) !important;
}

/* Marksheet Print Styles */
.marksheet-print {
    padding: 20px;
    font-family: 'Times New Roman', serif;
}

.marksheet-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #000;
    padding-bottom: 20px;
}

.marksheet-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.marksheet-student-info {
    text-align: left;
    margin-top: 15px;
}

.marksheet-student-info p {
    margin: 8px 0;
    font-size: 14px;
}

.marksheet-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.75rem; /* 12px / 16px = 0.75rem - scales with font size multiplier */
}

.marksheet-table thead {
    background-color: #f0f0f0;
}

.marksheet-table th,
.marksheet-table td {
    border: 1px solid #000;
    padding: 10px;
    text-align: left;
}

.marksheet-table th {
    font-weight: bold;
    background-color: #e0e0e0;
    text-align: center;
}

.marksheet-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.marksheet-statistics {
    margin-top: 30px;
    padding: 20px;
    border: 2px solid #000;
    background-color: #f5f5f5;
}

.marksheet-statistics h4 {
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

.stats-row {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #000;
}

.content-body {
    padding-bottom:0px!important;
    padding-top:10px!important;
}

/* Print Styles */
@media print {
    @page {
        size: A4;
        margin: 1.5cm;
    }
    
    body * {
        visibility: hidden;
    }
    
    .marksheet-print,
    .marksheet-print * {
        visibility: visible;
    }
    
    .marksheet-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
    }
    
    .marksheet-print-only {
        padding: 20px;
    }
    
    .marksheet-table {
        page-break-inside: avoid;
    }
    
    .marksheet-table thead {
        display: table-header-group;
    }
    
    .marksheet-table tbody tr {
        page-break-inside: avoid;
    }
    
    .marksheet-statistics {
        page-break-inside: avoid;
    }
    
    /* Hide buttons and modal elements when printing */
    .modal-header,
    .modal-footer,
    .btn,
    button {
        display: none !important;
    }
    
    /* Ensure proper spacing */
    .marksheet-header {
        margin-bottom: 25px;
    }
    
    .marksheet-table {
        font-size: 11px;
    }
    
    .marksheet-table th,
    .marksheet-table td {
        padding: 8px;
    }
}

/* Class Cards Styling */
.class-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #dee2e6;
}

.class-card-body {
    cursor: pointer;
}


.class-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.class-card-body:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.class-card .card-title {
    color: var(--theme-color, #2c372d);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.class-card .card-footer {
    padding: 0.5rem 1rem;
}

.class-card .card-footer .btn {
    margin: 0 2px;
}

/* Teacher Assignment Cards */
.teacher-assignment-card,
.class-assignment-card {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subject-checkboxes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subject-checkboxes-container .form-check {
    margin: 0;
    min-width: 150px;
}

.teacher-assignment-card .card,
.class-assignment-card .card {
    transition: box-shadow 0.2s;
}

.teacher-assignment-card .card:hover,
.class-assignment-card .card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Teacher Subject View Cards */
.teacher-subject-card {
    border-left: 4px solid var(--theme-color, #2c372d);
}

.teacher-subject-card .card-header {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6;
}

.subject-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subject-tags .badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

.subject-badge {
    background-color: var(--theme-color, #2c372d) !important;
    color: #ffffff;
}

/* Responsive Class Modal */
.class-modal-dialog,
.teacher-modal-dialog {
    max-width: 90%;
}

@media (min-width: 576px) {
    .class-modal-dialog,
    .teacher-modal-dialog {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .class-modal-dialog,
    .teacher-modal-dialog {
        max-width: 650px;
    }
}

@media (min-width: 992px) {
    .class-modal-dialog,
    .teacher-modal-dialog {
        max-width: 750px;
    }
}

@media (min-width: 1200px) {
    .class-modal-dialog,
    .teacher-modal-dialog {
        max-width: 850px;
    }
}

@media (min-width: 1400px) {
    .class-modal-dialog,
    .teacher-modal-dialog {
        max-width: 950px;
    }
}

/* Class Detail Modal - Wider */
.class-detail-modal-dialog {
    max-width: 90%;
}

@media (min-width: 576px) {
    .class-detail-modal-dialog {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .class-detail-modal-dialog {
        max-width: 600px;
    }
}

@media (min-width: 992px) {
    .class-detail-modal-dialog {
        max-width: 750px;
    }
}

@media (min-width: 1200px) {
    .class-detail-modal-dialog {
        max-width: 850px;
    }
}

@media (min-width: 1400px) {
    .class-detail-modal-dialog {
        max-width: 950px;
    }
}

/* Class Table Row Hover */
.class-table-row:hover {
    background-color: var(--hover-bg, #f0f2f1) !important;
}

/* Class View Tabs */
#classViewTabs .nav-link,
#teacherViewTabs .nav-link,
#studentViewTabs .nav-link {
    color: #6c757d;
    border-color: transparent;
    transition: all 0.2s;
}

#classViewTabs .nav-link:hover,
#teacherViewTabs .nav-link:hover,
#studentViewTabs .nav-link:hover {
    color: var(--theme-color, #2c372d);
    border-color: transparent;
    background-color: rgba(44, 55, 45, 0.05);
}

#classViewTabs .nav-link.active,
#teacherViewTabs .nav-link.active,
#studentViewTabs .nav-link.active {
    background-color: var(--theme-color, #2c372d) !important;
    color: #ffffff !important;
    border-color: var(--theme-color, #2c372d) !important;
}

#classViewTabs .nav-link.active:hover,
#teacherViewTabs .nav-link.active:hover,
#studentViewTabs .nav-link.active:hover {
    background-color: var(--theme-color, #2c372d) !important;
    color: #ffffff !important;
}

/* Teacher Card Styles */
.teacher-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #dee2e6;
    margin-bottom:10px!important;
}

.teacher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.teacher-card-body {
    cursor: pointer;
}

.teacher-card-body:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.teacher-avatar {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Student cards - similar to teacher cards */
.student-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #dee2e6;
    margin-bottom: 11px;
}

.student-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.student-card-body {
    cursor: pointer;
}

.student-card-body:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.student-avatar {
    display: flex;
    justify-content: center;
    align-items: center;
}

.student-avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #818585;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    margin: 0 auto;
    text-transform: uppercase;
}

.teacher-avatar-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #818585;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    margin: 0 auto;
    text-transform: uppercase;
}

/* Marks filter styles */
#filterContainer {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

#studentDropdownContainer {
    position: relative;
}

#filterStudentBtn {
    text-align: left;
    cursor: pointer;
    position: relative;
}

#filterStudentBtn::after {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

#filterStudentDropdown {
    padding: 0;
    margin-top: 4px;
}

#filterStudentSearch {
    margin: 8px;
    width: calc(100% - 16px);
}

#filterStudentOptions {
    max-height: 250px;
    overflow-y: auto;
}

#filterStudentOptions li {
    list-style: none;
}

#filterStudentOptions .dropdown-item {
    padding: 8px 16px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#filterStudentOptions .dropdown-item:hover {
    background-color: #f8f9fa;
}

#filterStudentOptions .dropdown-item.active {
    background-color: var(--theme-color);
    color: #ffffff;
}

/* Marks row clickable styles */
.marks-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.marks-row-clickable:hover {
    background-color: #f0f0f0 !important;
}

.student-exam-marks-content {
    font-size: 14px;
}

.student-exam-marks-content table {
    font-size: 0.8125rem; /* 13px / 16px = 0.8125rem - scales with font size multiplier */
}

.student-exam-marks-content .badge {
    font-size: 0.9em;
}

/* Edit Marks Modal */
#editMarksModal .modal-dialog {
    max-width: 850px;
    width: 70%;
}

@media (min-width: 1400px) {
    #editMarksModal .modal-dialog {
        max-width: 850px;
        width: 850px;
    }
}

/* Invoice month dropdown and search box height matching */
#invoiceMonth {
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.25rem 2.25rem 0.25rem 0.5rem;
    line-height: 1.5;
}

/* Ensure search input in input-group matches dropdown height */
#invoiceStudentSearch {
    height: calc(1.5em + 0.75rem + 2px);
}

/* Make search icon and clear button match search input height */
/* The search icon comes before the input, so we target the first input-group-text in the same input-group */
div.input-group:has(#invoiceStudentSearch) .input-group-text:first-child {
    height: calc(1.5em + 0.75rem + 2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    line-height: 1;
}

/* Fallback for browsers without :has() support - target by parent structure */
.col-md-8 .input-group .input-group-text:first-child {
    height: calc(1.5em + 0.75rem + 2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    line-height: 1;
}

/* Target the clear button */
#clearInvoiceSearchBtn {
    height: calc(1.5em + 0.75rem + 2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    line-height: 1;
}

/* Invoice Preview Modal - Wider */
#invoicePreviewModal .modal-dialog {
    max-width: 70%;
    width: 70%;
}

@media (min-width: 1400px) {
    #invoicePreviewModal .modal-dialog {
        max-width: 900px;
        width: 900px;
    }
}

/* Marksheet modal styles - smaller width */
#marksheetModal .modal-dialog {
    max-width: 900px;
    width: 90%;
}

@media (min-width: 1400px) {
    #marksheetModal .modal-dialog {
        max-width: 900px;
        width: 900px;
    }
}

@media (max-width: 991px) {
    #marksheetModal .modal-dialog {
        max-width: 95%;
        width: 95%;
        margin: 1rem auto;
    }
}

/* Student Exam Marks modal wider styles */
#studentExamMarksModal .modal-dialog {
    max-width: 95%;
    width: 95%;
}

@media (min-width: 1400px) {
    #studentExamMarksModal .modal-dialog {
        max-width: 1400px;
        width: 1400px;
    }
}

@media (max-width: 991px) {
    #studentExamMarksModal .modal-dialog {
        max-width: 95%;
        width: 95%;
        margin: 1rem auto;
    }
}

/* Header actions (notifications and settings) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding-right: 30px;
}

/* License warning banner in header */
.license-warning-banner {
    margin-right: 0.5rem;
    max-width: 220px;
    flex-shrink: 1;
}

.license-warning-banner .alert {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    margin-bottom: 0;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.2;
    padding-right: 1.4rem;
}

.license-warning-banner .alert i {
    flex-shrink: 0;
    font-size: 0.7rem;
}

.license-warning-banner .alert strong {
    margin-right: 0.15rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.license-warning-banner .btn-close {
    font-size: 0.4rem;
    padding: 0.2rem;
    width: 0.5rem;
    height: 0.5rem;
    opacity: 0.7;
    color: black !important;
    background-color: #e6dddd;
    border-radius: 50px;
    margin-top: 0.3rem;
    margin-right: 0.2rem;
}

.license-warning-banner .btn-close:hover {
    opacity: 1;
    color: #000000;
}

/* License warning on login page */
.license-warning {
    margin-bottom: 0.75rem;
}

.license-warning .alert {
    padding: 0.4rem 0.6rem;
    padding-right: 3rem;
    font-size: 0.75rem;
    line-height: 1.3;
    position: relative;
}

.license-warning .alert i {
    font-size: 0.75rem;
}

.license-warning .alert strong {
    font-size: 0.75rem;
    font-weight: 600;
}

.license-warning .btn-close {
    position: absolute;
    top: 12px;
    right: 0;
    padding: 0.5rem 1rem;
    opacity: 0.5;
}

.license-warning .btn-close:hover {
    opacity: 0.75;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background-color: var(--hover-bg);
    color: var(--theme-color);
}

.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.notification-dropdown-menu {
    min-width: 350px;
    max-width: 400px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

.notification-item {
    padding: 0 !important;
    border-bottom: 1px solid #f0f0f0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    width: 100%;
    display: block;
    white-space: normal !important;
    overflow: hidden;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.notification-unread {
    background-color: #f8f9fa;
}

.notification-item:hover {
    background-color: #e9ecef;
}

.notification-item:hover .fw-bold {
    color: #000 !important;
}

.notification-item .d-flex {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.notification-item .fw-bold {
    font-size: 14px;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.notification-item .small {
    font-size: 12px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.notification-item .flex-grow-1 {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    flex: 1 1 0%;
}

#markAllReadBtn:hover {
    color: #000 !important;
}

/* New teacher block styling - light blue background */
.teacher-assignment-card.new-teacher-block .card {
    background-color: #e7f3ff !important;
    border-color: #b3d9ff !important;
}

.teacher-assignment-card.new-teacher-block .card-body {
    background-color: #e7f3ff !important;
}

/* New class block styling - light blue background */
.class-assignment-card.new-class-block .card {
    background-color: #e7f3ff !important;
    border-color: #b3d9ff !important;
}

.class-assignment-card.new-class-block .card-body {
    background-color: #e7f3ff !important;
}

/* User Menu Dropdown Styles */
.menu-btn {
    /* Inherit styles from .btn-icon */
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background-color: var(--hover-bg);
    color: var(--theme-color);
}

.user-menu-dropdown {
    min-width: 250px;
    padding: 0;
    margin-top: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.user-menu-item {
    padding: 12px 16px;
    cursor: default;
}

.user-info-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-menu {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--theme-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--bg-primary);
    font-size: 16px;
    flex-shrink: 0;
}

.user-details-menu {
    flex: 1;
    min-width: 0;
}

.user-name-menu {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 2px;
}

.user-role-menu {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-menu-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    transition: background-color 0.2s ease;
}

.user-menu-dropdown .dropdown-item:hover {
    background-color: var(--hover-bg);
    color: #000!important;
}

.user-menu-dropdown .dropdown-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.logout-menu-item {
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    transition: background-color 0.2s ease;
}

.logout-menu-item:hover {
    background-color: var(--hover-bg);
    color: #000;
}

.logout-menu-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Leave filter buttons - use theme color instead of blue */
.filter-btn.btn-outline-primary.active,
.filter-btn.btn-outline-primary:active,
.filter-btn.btn-outline-primary:focus {
    background-color: var(--theme-color) !important;
    border-color: var(--theme-color) !important;
    color: #fff !important;
}

.filter-btn.btn-outline-primary:hover {
    background-color: var(--theme-color);
    border-color: var(--theme-color);
    color: #fff;
}

@media (max-width: 700px) {
    .header-actions {
        padding-right: 15px;
    }
    
    .license-warning-banner {
        max-width: 200px;
        margin-right: 0.25rem;
    }
    
    .license-warning-banner .alert {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
    }

    .notification-dropdown-menu {
        min-width: 280px;
        max-width: 320px;
    }

    /* Make institute name smaller on mobile */
    .institute-name,
    .content-header h1.institute-name {
        font-size: 0.6rem !important;
    }

    .institute-address {
        font-size: 0.55rem;
    }

    .institute-header {
        padding: 10px 15px;
        min-height: 50px;
    }

    .institute-logo {
        max-height: 28px;
        max-width: 150px;
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .institute-name,
    .content-header h1.institute-name {
        font-size: 0.625rem !important; /* 10px */
    }
}

/* Small devices (phones, 400px and down) */
@media (max-width: 400px) {
    .institute-name,
    .content-header h1.institute-name {
        font-size: 0.625rem !important; /* 10px */
    }
}

/* Smallest devices (phones, 360px and down) */
@media (max-width: 360px) {
    .institute-name,
    .content-header h1.institute-name {
        font-size: 0.625rem !important; /* 10px (0.625rem * 16px = 10px) */
    }
}

/* Nepali Calendar Font Styles */
.nepali-font {
    font-family: 'Noto Sans Devanagari', 'Mangal', 'Arial Unicode MS', 'Preeti', sans-serif;
}

/* Nepali calendar month/year header */
#currentMonthYear.nepali-calendar {
    font-family: 'Noto Sans Devanagari', 'Mangal', 'Arial Unicode MS', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

/* Nepali calendar weekday headers */
.calendar-weekdays.nepali-font .calendar-weekday {
    font-family: 'Noto Sans Devanagari', 'Mangal', 'Arial Unicode MS', sans-serif;
    font-size: 12px;
    font-weight: 600;
}

/* Nepali calendar day numbers */
.calendar-days.nepali-font .day-number {
    font-family: 'Noto Sans Devanagari', 'Mangal', 'Arial Unicode MS', sans-serif;
    font-size: 13px;
    font-weight: 600;
}

/* Nepali calendar event more indicator */
.calendar-days.nepali-font .day-event-more {
    font-family: 'Noto Sans Devanagari', 'Mangal', 'Arial Unicode MS', sans-serif;
}

/* Saturday header in Nepali calendar */
.calendar-weekdays.nepali-font .saturday-header {
    color: #dc3545;
    font-weight: 700;
}

/* Nepali date picker form controls */
#nepaliDateContainer .form-select.nepali-font {
    font-family: 'Noto Sans Devanagari', 'Mangal', 'Arial Unicode MS', sans-serif;
    font-size: 14px;
}

#nepaliDateContainer .form-label.nepali-font {
    font-family: 'Noto Sans Devanagari', 'Mangal', 'Arial Unicode MS', sans-serif;
    font-size: 14px;
}

/* Add Marks Modal - Form Field Styling */
#marksModal #marksClass,
#marksModal #examType {
    font-size: 0.95rem;
    padding: 0.45rem 0.75rem;
    height: auto;
}

#marksModal #marksExamDate {
    font-size: 1.05rem;
    padding: 0.55rem 0.85rem;
    height: auto;
}

#marksModal #marksStudentSearch {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    height: auto;
}

#marksModal #marksStudentDropdown {
    font-size: 1rem;
}

#marksModal #marksStudentDropdown .student-dropdown-item {
    padding: 0.5rem 0.9rem;
    transition: background-color 0.15s ease;
}

#marksModal #marksStudentDropdown .student-dropdown-item:hover,
#marksModal #marksStudentDropdown .student-dropdown-item:focus {
    background-color: var(--theme-color);
    color: #ffffff;
}

#marksModal #marksCurrentStudentInfo {
    font-size: 1.15rem;
    font-weight: 500;
}

/* Marks List - Grouped by Student */
.marks-row.marks-group-even {
    background-color: #f8f9fa;
}

.marks-row.marks-group-odd {
    background-color: #ffffff;
}

.marks-row:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
}

/* Exam Classes Checkbox Container */
#examClassesContainer {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6 !important;
    padding: 1rem !important;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

#examClassesContainer .form-check {
    padding: 0.5rem 1rem;
    margin: 0;
    /* background-color: #fff;
    border: 1px solid #e0e0e0; */
    border-radius: 4px;
    flex: 0 0 auto;
    min-width: 150px;
    transition: background-color 0.2s, border-color 0.2s;
}

#examClassesContainer .form-check-input {
    margin-top: 0.35em;
    cursor: pointer;
}

#examClassesContainer .form-check-label {
    cursor: pointer;
    user-select: none;
    margin-left: 0.5rem;
}

#examClassesContainer .form-check-input:checked {
    background-color: var(--theme-color, #0d6efd);
    border-color: var(--theme-color, #0d6efd);
}

#examClassesContainer .form-check-input:focus {
    border-color: var(--theme-color, #0d6efd);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Salary Structure Modal - Wider width */
#salaryStructureModal .modal-dialog {
    max-width: 900px; /* Wider than modal-lg (800px) but not as wide as modal-xl (1140px) */
}

/* Teacher Detail Modal - Match student detail modal width */
#teacherDetailModal .modal-dialog {
    max-width: 800px; /* Same as default modal-lg, matching student detail modal */
}

/* Salary Structure Search Input Group - Match height with month/year dropdowns */
#salaryStructureSearch {
    height: 38px;
    line-height: 1.5;
}

/* Ensure input-group elements align properly for salary structure search */
#clearSalaryStructureSearchBtn {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
}

/* About Modal Styles */
.about-modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.about-modal-header {
    border-bottom: none;
    padding: 1.5rem 1.5rem 0.5rem;
    background: linear-gradient(135deg, var(--theme-color, #2c372d) 0%, var(--olive-green-light, #4c5f4d) 100%);
}

.about-modal-header .btn-close {
    filter: invert(1);
    opacity: 0.9;
}

.about-modal-header .btn-close:hover {
    opacity: 1;
}

.about-modal-body {
    padding: 1.5rem 2rem;
    text-align: center;
    background-color: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.about-logo-container {
    margin-bottom: 1.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.about-logo-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.about-logo {
    width: 40px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.about-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 1px;
}

.about-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

.about-info-section {
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.about-info-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.6rem;
    background-color: var(--bg-secondary);
    border-radius: 10px;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
}

.about-info-item:last-child {
    margin-bottom: 0;
}

.about-info-item:hover {
    background-color: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.about-info-icon {
    font-size: 1.5rem;
    color: var(--theme-color, #2c372d);
    flex-shrink: 0;
}

.about-info-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    flex: 1;
}

.about-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.about-info-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.about-status-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
}

.about-status-badge-30 {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    background-color: var(--theme-color, #2c372d);
    color: #ffffff;
    display: inline-block;
}

.about-message-section {
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: #e7f3ff;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
}

.about-message {
    margin: 0;
    color: #625d51;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    text-align: left;
}

.about-message i {
    font-size: 1.1rem;
    color: #474141;
    flex-shrink: 0;
    margin-right: 0.6rem;
}

.about-contact-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    width: 100%;
    display: flex;
    justify-content: center;
}

.about-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--theme-color, #2c372d);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    background-color: var(--bg-secondary);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.about-contact-link:hover {
    background-color: var(--theme-color, #2c372d);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 55, 45, 0.3);
    border-color: var(--theme-color, #2c372d);
}

.about-contact-link i {
    font-size: 1.2rem;
}

@media (max-width: 576px) {
    .about-modal-body {
        padding: 1.5rem 1.25rem;
    }
    
    .about-title {
        font-size: 1.5rem;
    }
    
    .about-info-item {
        flex-direction: column;
        text-align: center;
    }
    
    .about-info-content {
        align-items: center;
    }
    
    .about-contact-link {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
}

/* Payslip Preview Modal - Custom width */
.payslip-preview-modal {
    max-width: 900px !important;
}

/* ============================================
   Figma-style Teacher Directory Layout
   ============================================ */

/* Teacher Card - Simplified for Grid View */
.teacher-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.teacher-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.teacher-card.active {
    border-color: var(--theme-color, #2c372d);
    box-shadow: 0 2px 12px rgba(44, 55, 45, 0.2);
}

.teacher-card-body {
    padding: 0.75rem;
    padding-bottom:0px;
}

.teacher-avatar {
    position: relative;
}

.teacher-avatar-circle-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--theme-color, #2c372d);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.teacher-card-remove-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 50%;
    background-color: #ff9800;
    border: 2px solid #ffffff;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.teacher-card-remove-btn:hover {
    background-color: #f57c00;
    color: #ffffff;
}

.teacher-card-remove-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 152, 0, 0.25);
}

.teacher-card-info {
    min-width: 0; /* Allows text truncation */
}

.teacher-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.2rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teacher-card-phone {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Teacher Detail Panel - Right Side */
#teacherDetailPanel {
    background: #ffffff;
    overflow-x: hidden;
    overflow-y: auto;
    position: fixed;
    right: 0;
    transform: translate(100%, 0);
    z-index: 1050;
    display: none;
    flex-direction: column;
    padding-left: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

/* Override Bootstrap border-start with theme-colored ribbon */
#teacherDetailPanel.border-start {
    border-left: 4px solid var(--theme-color, #2c372d) !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

#teacherDetailPanel.panel-expanded {
    display: flex;
    opacity: 1;
    transform: translate(0, 0);
    margin-right: 33px;
}

#teacherGridContainer {
    padding-right: 1rem;
    transition: all 0.3s ease-in-out;
}

#teacherGridContainer.panel-expanded {
    flex: 0 0 50% !important;
    max-width: 50% !important;
}

/* Mobile Teacher Detail Panel - Shows below card on small screens */
.mobile-teacher-detail-panel {
    margin-top: 0.5rem;
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--theme-color, #2c372d);
    border-radius: 0.375rem;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 767.98px) {
    #teacherDetailPanel {
        display: none !important;
    }
}

@media (min-width: 768px) {
    #teacherDetailPanel {
        width: 50%;
    }
}

@media (min-width: 992px) {
    #teacherDetailPanel {
        width: 50%;
    }
}

.teacher-detail-panel {
    padding: 0.75rem;
    padding-left: calc(0.75rem + 1rem);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
    min-width: 0;
    flex-shrink: 0;
}

#closeTeacherDetailPanelBtn {
    color: #666;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color 0.2s;
}

#closeTeacherDetailPanelBtn:hover {
    color: #000;
    background: transparent;
}

.panel-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.panel-body {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.panel-body .row {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.panel-body .row > * {
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.panel-body .col-6 {
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* Profile Summary Section */
.panel-profile-summary {
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.panel-avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem !important;
}

.panel-avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--theme-color, #2c372d);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 auto;
    position: relative;
}

.panel-teacher-name {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    margin-bottom: 0.25rem;
}

.panel-teacher-role {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
}

.panel-profile-summary .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
    font-weight: 500;
}

/* Detail Items */
.panel-details {
    margin-bottom: 0.5rem;
    max-width: 100%;
    box-sizing: border-box;
}

.panel-details .row {
    margin-bottom: 0;
    --bs-gutter-y: 0.5rem;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

.panel-details .row > * {
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    margin-top: var(--bs-gutter-y);
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.panel-detail-item {
    margin-bottom: 0.5rem;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.panel-detail-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.15rem;
    display: block;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.panel-detail-value {
    font-size: 0.75rem;
    color: #333;
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    max-width: 100%;
    min-width: 0;
}

.panel-section-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0.75rem 0;
    max-width: 100%;
}

.panel-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Classes List */
.panel-classes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 100%;
    box-sizing: border-box;
}

.panel-class-item {
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 2px solid var(--theme-color, #2c372d);
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.panel-class-item strong {
    font-size: 0.75rem;
    color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
    display: block;
}

.panel-class-item small {
    font-size: 0.7rem;
    color: #666;
    word-break: break-word;
    overflow-wrap: break-word;
    display: block;
}

/* Action Buttons */
.panel-actions {
    margin-top: 0.5rem;
}

.panel-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.panel-actions .btn-outline-primary {
    border-color: var(--theme-color, #2c372d);
    color: var(--theme-color, #2c372d);
}

.panel-actions .btn-outline-primary:hover {
    background-color: var(--theme-color, #2c372d);
    border-color: var(--theme-color, #2c372d);
    color: #ffffff;
}

.panel-actions .btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    #teacherDetailPanel {
        position: relative;
        height: auto;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        margin-top: 1rem;
    }
    
    #teacherGridContainer {
        width: 100%;
    }
}

/* Scrollbar styling for detail panel body */
.panel-body::-webkit-scrollbar {
    width: 6px;
}

.panel-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.panel-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.panel-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Make only teacherViewTabContent scrollable, not the whole page */
/* Prevent body scrolling when on teachers page */
body.teachers-page-scrollable {
    overflow: hidden;
    height: 100vh;
}

/* Ensure card-body doesn't interfere with scrolling */
body.teachers-page-scrollable .card-body {
    overflow: visible;
}

/* Make teacherViewTabContent scrollable with fixed height */
#teacherViewTabContent {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative;
    display: block;
    /* Height will be set dynamically via JavaScript */
}

/* Custom scrollbar for teacherViewTabContent */
#teacherViewTabContent::-webkit-scrollbar {
    width: 8px;
}

#teacherViewTabContent::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#teacherViewTabContent::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#teacherViewTabContent::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Make only studentViewTabContent scrollable, not the whole page */
/* Prevent body scrolling when on students page */
body.students-page-scrollable {
    overflow: hidden;
    height: 100vh;
}

/* Ensure card-body doesn't interfere with scrolling */
body.students-page-scrollable .card-body {
    overflow: visible;
    padding-top: 0px;
}

/* Make studentViewTabContent scrollable with fixed height */
#studentViewTabContent {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative;
    display: block;
    /* Height will be set dynamically via JavaScript */
}

/* Custom scrollbar for studentViewTabContent */
#studentViewTabContent::-webkit-scrollbar {
    width: 8px;
}

#studentViewTabContent::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#studentViewTabContent::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#studentViewTabContent::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Class Card Styles */
.class-card {
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.class-card.active {
    border: 2px solid var(--theme-color, #2c372d);
    box-shadow: 0 4px 12px rgba(44, 55, 45, 0.3);
}

.class-card-body {
    padding: 1rem;
}

.class-icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--theme-color, #2c372d) 0%, #4a5d4b 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.class-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #2c372d;
}

.class-card-details {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* Class Detail Panel - Right Side */
#classDetailPanel {
    background: #ffffff;
    overflow-x: hidden;
    overflow-y: auto;
    position: fixed;
    right: 0;
    transform: translate(100%, 0);
    z-index: 1050;
    display: none;
    flex-direction: column;
    padding-left: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

/* Override Bootstrap border-start with theme-colored ribbon */
#classDetailPanel.border-start {
    border-left: 4px solid var(--theme-color, #2c372d) !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

#classDetailPanel.panel-expanded {
    display: flex;
    opacity: 1;
    transform: translate(0, 0);
    margin-right: 33px;
}

/* Class detail panel styles */
.class-detail-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
}

.class-detail-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.class-detail-panel .panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.class-detail-panel .panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.panel-icon-container {
    display: flex;
    justify-content: center;
}

.panel-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--theme-color, #2c372d) 0%, #4a5d4b 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.panel-class-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c372d;
}

.panel-class-grade,
.panel-class-section {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.panel-teacher-item {
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.25rem;
    border-left: 3px solid var(--theme-color, #2c372d);
}

.panel-teacher-item strong {
    color: #2c372d;
    font-size: 0.9rem;
}

/* Mobile class detail panel */
.mobile-class-detail-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Make only classViewTabContent scrollable, not the whole page */
body.classes-page-scrollable {
    overflow: hidden;
    height: 100vh;
}

body.classes-page-scrollable .card-body {
    overflow: visible;
}

#classViewTabContent {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative;
    display: block;
}

#classViewTabContent::-webkit-scrollbar {
    width: 8px;
}

#classViewTabContent::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#classViewTabContent::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#classViewTabContent::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Student Detail Panel - Right Side */
#studentDetailPanel {
    background: #ffffff;
    overflow-x: hidden;
    overflow-y: auto;
    position: fixed;
    right: 0;
    transform: translate(100%, 0);
    z-index: 1050;
    display: none;
    flex-direction: column;
    padding-left: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

/* Override Bootstrap border-start with theme-colored ribbon */
#studentDetailPanel.border-start {
    border-left: 4px solid var(--theme-color, #2c372d) !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

#studentDetailPanel.panel-expanded {
    display: flex;
    opacity: 1;
    transform: translate(0, 0);
    margin-right: 33px;
}

/* Student detail panel styles - reuse teacher panel styles */
.student-detail-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
}

.student-detail-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.student-detail-panel .panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.student-detail-panel .panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Mobile student detail panel */
.mobile-student-detail-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Student card styles - match teacher card */
.student-card {
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.student-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.student-card.active {
    border: 2px solid var(--theme-color, #2c372d);
    box-shadow: 0 4px 12px rgba(44, 55, 45, 0.3);
}

.student-card-body {
    padding: 1rem;
    padding-bottom: 0px;
}

.student-avatar-circle-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--theme-color, #2c372d);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.student-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.student-card-class,
.student-card-phone {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* Loading Overlay Styles */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    border-radius: inherit;
}

.loading-overlay .spinner-border {
    width: 2rem;
    height: 2rem;
    color: var(--theme-color, #2c372d) !important;
}

.loading {
    position: relative;
    pointer-events: none;
}

/* Full page loading overlay */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.page-loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #fff !important;
}

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading .spinner-border {
    position: absolute;
    width: 1rem;
    height: 1rem;
}

/* Modal title white color for custom fees */
#customFeesModal .modal-title {
    color: white !important;
}

/* Spin animation for loading icons */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

