:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --dark: #343a40;
    --light: #f8f9fa;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 60px;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: #212529;
    background: #f4f6f9;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark);
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-title small {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--secondary);
}

.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

.content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar-collapsed .content-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

.content {
    flex: 1;
    padding: 1.25rem;
}

footer.main-footer {
    background: #fff;
    padding: 15px 20px;
    font-size: 0.8rem;
    color: var(--secondary);
    border-top: 1px solid #e9ecef;
    text-align: center;
    flex-shrink: 0;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 1.25rem;
    background: #fff;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: #fff;
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    border-radius: 0 0 12px 12px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0;
}

.stat-card {
    border-radius: 12px;
    padding: 1.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 110px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.2;
    position: absolute;
    right: 15px;
    bottom: 10px;
}

.table {
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
    padding: 0.75rem 0.875rem;
}

.table thead th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--secondary);
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background-color: rgba(26,115,232,0.04);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02);
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 20px;
    padding: 6px 15px;
    border: 1px solid #ced4da;
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26,115,232,0.15);
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 4px 8px;
}

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-top: 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px;
    padding: 6px 14px;
    margin: 0 1px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #6c757d;
    font-size: 13px;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e9ecef;
    border-color: #ced4da;
    color: #495057;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb, 13, 110, 253), 0.3);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next {
    font-weight: 500;
}

.dataTables_wrapper .dataTables_info {
    padding-top: 14px;
    font-size: 13px;
    color: #6c757d;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    font-size: 13px;
    color: #6c757d;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 13, 110, 253), 0.15);
}

table.dataTable thead .sorting:before,
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_desc:after {
    opacity: 0.5;
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 0.4rem;
}

.form-control {
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    border: 1.5px solid #e0e0e0;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26,115,232,0.12);
    outline: none;
}

.form-control-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.form-select {
    border-radius: 8px;
    border: 1.5px solid #e0e0e0;
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26,115,232,0.12);
}

.input-group-text {
    border-radius: 8px;
    border: 1.5px solid #e0e0e0;
    font-size: 0.875rem;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-control.is-invalid, .was-validated .form-control:invalid {
    border-color: var(--danger);
}

.form-control.is-valid, .was-validated .form-control:valid {
    border-color: var(--success);
}

.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn:focus {
    box-shadow: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,115,232,0.3);
}

.btn-secondary {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
    color: #fff;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
    color: #fff;
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    color: #fff;
    box-shadow: 0 4px 12px rgba(220,53,69,0.3);
}

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    border-color: #d39e00;
}

.btn-info {
    background: var(--info);
    border-color: var(--info);
    color: #fff;
}

.btn-info:hover {
    background: #138496;
    border-color: #117a8b;
}

.btn-light {
    background: var(--light);
    border-color: #e9ecef;
    color: #212529;
}

.btn-light:hover {
    background: #e2e6ea;
    border-color: #dae0e5;
}

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

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

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
}

.btn-link {
    text-decoration: none;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3em 0.6em;
    border-radius: 6px;
}

.badge-draft { background: #e9ecef; color: #495057; }
.badge-sent { background: #cce5ff; color: #004085; }
.badge-validated { background: #d4edda; color: #155724; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-approved { background: #d4edda; color: #155724; }

.modal-content {
    border: none;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.1rem 1.25rem;
    border-radius: 14px 14px 0 0;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    border-radius: 0 0 14px 14px;
}

.modal-backdrop.show {
    opacity: 0.5;
}

.btn-close:focus {
    box-shadow: none;
}

.select2-container--bootstrap-5 .select2-selection {
    border-radius: 8px;
    border: 1.5px solid #e0e0e0;
    min-height: 38px;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26,115,232,0.12);
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
}

.toastr-message {
    font-size: 0.85rem;
}

#toast-container > .toast {
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-logo {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    margin: 0 auto 15px;
    animation: pulseLogo 1.5s ease-in-out infinite;
}

.preloader-text {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

@keyframes pulseLogo {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.12);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 0;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.dropdown-header {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary);
}

.dropdown-divider {
    margin: 0.3rem 0;
    border-color: #e9ecef;
}

.profile-photo-frame {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    margin: 0 auto;
}

.profile-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
}

.profile-info-card {
    border: none;
    border-radius: 12px;
    background: #fff;
}

.profile-info-card .info-label {
    font-size: 0.8rem;
    color: var(--secondary);
    margin-bottom: 2px;
}

.profile-info-card .info-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dark);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    background: linear-gradient(135deg, var(--primary), #3a0ca3);
    padding: 30px;
    text-align: center;
    color: #fff;
}

.login-header .school-logo {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 30px;
}

.login-header .school-logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.login-header h4 {
    font-weight: 700;
    margin-bottom: 4px;
    color: #fff;
}

.login-header p {
    font-size: 0.85rem;
    opacity: 0.85;
    margin: 0;
}

.login-body {
    padding: 30px;
}

.login-body .form-control {
    border-radius: 10px;
    padding: 0.65rem 1rem;
    border: 2px solid #e9ecef;
}

.login-body .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26,115,232,0.15);
}

.login-body .input-group-text {
    border-radius: 10px 0 0 10px;
    border: 2px solid #e9ecef;
}

.login-body .btn-primary {
    border-radius: 10px;
    padding: 0.7rem;
    font-weight: 600;
}

.raport-print {
    font-family: 'Times New Roman', Times, serif;
}

@media print {
    .main-sidebar,
    .main-header,
    .main-footer,
    #loader-wrapper,
    #preloader,
    .btn,
    .no-print { display: none !important; }

    .content-wrapper {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .content {
        padding: 0 !important;
    }

    body {
        background: #fff !important;
        font-size: 12pt;
    }

    @page {
        margin: 1.5cm;
        size: A4;
    }

    .raport-print {
        page-break-after: always;
    }

    .raport-print:last-child {
        page-break-after: avoid;
    }
}

.skeleton-loader {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}

.empty-state h5 {
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.85rem;
    max-width: 300px;
    margin: 0 auto;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in {
    animation: slideIn 0.3s ease;
}

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

@media (max-width: 1199.98px) {
    .stat-card { min-height: 100px; }
    .stat-card .stat-value { font-size: 1.5rem; }
}

@media (max-width: 991.98px) {
    .content-wrapper { margin-left: 0 !important; }
    .sidebar-collapsed .content-wrapper { margin-left: 0 !important; }
    .content { padding: 1rem; }
}

@media (max-width: 767.98px) {
    .page-title { font-size: 1.15rem; }
    .content { padding: 0.85rem; }
    .card-body { padding: 0.85rem; }
    .table > :not(caption) > * > * { padding: 0.5rem 0.6rem; font-size: 0.8rem; }
    .stat-card { min-height: 90px; }
    .stat-card .stat-value { font-size: 1.3rem; }
    .stat-card .stat-icon { font-size: 2.2rem; }
    .dataTables_wrapper .dataTables_filter { text-align: left; margin-bottom: 0.5rem; }
}

@media (max-width: 575.98px) {
    .content { padding: 0.75rem; }
    .card { border-radius: 8px; }
    .card-header { padding: 0.75rem; font-size: 0.85rem; }
    .card-body { padding: 0.75rem; }
    .btn { font-size: 0.8rem; padding: 0.4rem 0.7rem; }
    .form-control { font-size: 0.8rem; padding: 0.4rem 0.7rem; }
}

.dashboard-chart {
    position: relative;
    height: 280px;
}

.chart-container {
    position: relative;
    width: 100%;
}

.alert {
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-danger { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-info { background: #d1ecf1; color: #0c5460; }

.nav-tabs .nav-link {
    border: none;
    color: var(--secondary);
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: transparent;
    border-bottom: 2px solid var(--primary);
}

.list-group-item {
    border: 1px solid #e9ecef;
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
}

.list-group-item:first-child { border-radius: 8px 8px 0 0; }
.list-group-item:last-child { border-radius: 0 0 8px 8px; }

.progress {
    border-radius: 10px;
    height: 8px;
    background: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.img-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
    margin-top: 8px;
}

.timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 18px;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-left: 45px;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #e9ecef;
}

.timeline-item .timeline-time {
    font-size: 0.75rem;
    color: var(--secondary);
}

.timeline-item .timeline-content {
    font-size: 0.875rem;
}
