body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    overflow-x: hidden;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
}

.sidebar .nav-link:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.sidebar .nav-link i {
    margin-right: 8px;
}

.badge-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.card {
    margin-bottom: 1.5rem;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stage-progress {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.stage-item {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 10px 5px;
    position: relative;
}

.stage-item.active {
    background-color: #e7f3ff;
    border-radius: 5px;
}

.stage-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #6c757d;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 5px;
}

.stage-item.active .stage-number {
    background-color: #007bff;
}

.stage-item.completed .stage-number {
    background-color: #28a745;
}

.navbar-brand {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 1rem;

}

.navbar .navbar-toggler {
    top: 0.25rem;
    right: 1rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.display-6 {
    word-break: break-word;
}

.btn-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.level-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.progress-ring {
    width: 60px;
    height: 60px;
}

@media (max-width: 575.98px) {
    body {
        font-size: 13px;
    }
    
    .sidebar {
        position: static;
        padding-top: 0;
        height: auto;
    }
    
    .sidebar-sticky {
        height: auto;
        padding-bottom: 1rem;
    }
    
    .navbar-brand {
        font-size: 0.9rem;
        max-width: 60%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    main {
        padding: 0 0.75rem !important;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 0.9rem;
    }
    
    h1, .h1 {
        font-size: 1.5rem;
    }
    
    h2, .h2 {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-height: 44px;
    }
    
    .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-height: 38px;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.25rem;
    }
    
    .alert {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .stage-item {
        min-width: 60px;
        padding: 5px 2px;
    }
    
    .stage-number {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .stage-item span:last-child {
        font-size: 0.7rem;
    }
    
    .badge-icon {
        font-size: 2rem;
    }
    
    .progress-ring {
        width: 40px;
        height: 40px;
    }
    
    .game-card {
        margin-bottom: 1rem;
    }
    
    .level-dot {
        width: 8px;
        height: 8px;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    .form-control, .form-select {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        position: static;
        padding-top: 0;
    }
    
    .sidebar-sticky {
        height: auto;
    }
    
    main.col-md-9, main.col-lg-10 {
        margin-left: 0 !important;
        padding: 0 1rem !important;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .d-flex.justify-content-between > * {
        width: 100%;
        text-align: left;
    }
    
    .btn-toolbar {
        justify-content: flex-start !important;
    }
    
    .col-md-3, .col-md-4, .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .row.mb-4 > [class*="col-"] {
        margin-bottom: 0.75rem;
    }
    
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        width: 200px;
    }
    
    main.col-md-9 {
        width: calc(100% - 200px);
        margin-left: 200px !important;
    }
    
    .navbar-brand {
        width: 200px;
    }
    
    .display-6 {
        font-size: 1.75rem;
    }
    
    .card-title {
        font-size: 0.95rem;
    }
}

@media (min-width: 992px) {
    .sidebar {
        width: 16.6667%;
    }
    
    main.col-lg-10 {
        width: 83.3333%;
    }
}

@media (min-width: 1200px) {
    .container-fluid {
        max-width: 1400px;
    }
}

@media print {
    .sidebar,
    #sidebarMenu,
    .navbar,
    nav.navbar,
    .btn-toolbar,
    .no-print,
    .alert,
    .toast,
    .toast-container,
    .modal-backdrop,
    .offcanvas,
    .offcanvas-backdrop,
    .tooltip,
    .popover,
    .dropdown-menu,
    .breadcrumb,
    footer,
    .footer,
    .notification-bell,
    .notification-dropdown,
    .guided-tour-overlay,
    .tour-tooltip,
    .btn-group.no-print,
    .category-filter,
    .scroll-to-top,
    .chat-widget {
        display: none !important;
    }

    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-outline-primary,
    .btn-outline-secondary,
    .btn-outline-success,
    .btn-outline-danger,
    .btn-outline-info,
    .btn-outline-warning,
    .btn-outline-light,
    .btn-outline-dark,
    .btn-sm,
    .btn-lg,
    .btn-toolbar,
    .card-footer,
    .pagination,
    .page-link {
        display: none !important;
    }

    .btn.print-visible,
    .btn-print-visible {
        display: inline-block !important;
    }

    body {
        font-size: 11pt !important;
        color: #000 !important;
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    main,
    main.col-md-9,
    main.col-lg-10,
    .col-md-9,
    .col-lg-10 {
        margin: 0 !important;
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .container-fluid,
    .container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    .row {
        margin: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .card-header {
        background: #f8f9fa !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="email"],
    input[type="tel"],
    input[type="month"],
    input[type="url"],
    textarea,
    select,
    .form-control,
    .form-select {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        resize: none;
        overflow: visible;
        height: auto !important;
        min-height: unset !important;
        border-bottom: 1px solid #999 !important;
        border-radius: 0 !important;
        font-size: 11pt !important;
        color: #000 !important;
    }

    textarea.form-control {
        white-space: pre-wrap;
    }

    select.form-select {
        background-image: none !important;
    }

    .form-check-input {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .form-check-input:checked {
        background-color: #0d6efd !important;
        border-color: #0d6efd !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .badge {
        border: 1px solid #333 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    a[href]:after {
        content: none !important;
    }

    a {
        color: #000 !important;
        text-decoration: none !important;
    }

    .table {
        border-collapse: collapse !important;
        width: 100% !important;
    }

    .table th,
    .table td {
        border: 1px solid #dee2e6 !important;
        padding: 4px 8px !important;
        color: #000 !important;
        background: transparent !important;
    }

    .table thead th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .table-striped tbody tr:nth-of-type(odd) {
        background: transparent !important;
    }

    .progress {
        border: 1px solid #ccc !important;
        background: #eee !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .progress-bar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .bg-primary, .bg-success, .bg-info, .bg-warning, .bg-danger,
    .bg-secondary, .bg-dark, .bg-light {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .stat-card,
    .dashboard-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .chart-container,
    canvas {
        max-height: 300px !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-only {
        display: block !important;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        break-after: avoid;
        color: #000 !important;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    @page {
        margin: 0.5in;
        size: auto;
    }

    .border-bottom {
        border-bottom: 1px solid #dee2e6 !important;
    }

    .text-muted {
        color: #555 !important;
    }

    .text-primary,
    .text-success,
    .text-info,
    .text-warning,
    .text-danger {
        color: #000 !important;
    }

    .signature-line {
        border-bottom: 1px solid #333 !important;
        min-width: 200px;
        display: inline-block;
    }

    .modal {
        position: static !important;
        display: block !important;
        overflow: visible !important;
    }

    .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
    }

    .modal-content {
        border: none !important;
        box-shadow: none !important;
    }

    .modal-header .btn-close,
    .modal-footer {
        display: none !important;
    }
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aspect-ratio-16x9 {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.touch-action-pan-y {
    touch-action: pan-y;
}

.min-touch-target {
    min-width: 44px;
    min-height: 44px;
}

.stat-card {
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: scale(1.02);
}

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

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

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

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

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

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

.sticky-top-nav {
    position: sticky;
    top: 48px;
    z-index: 99;
    background: white;
}

.mobile-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 576px) {
    .mobile-stack {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.responsive-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.responsive-flex > * {
    flex: 1 1 300px;
    min-width: 0;
}

@media (max-width: 575.98px) {
    .responsive-flex > * {
        flex: 1 1 100%;
    }
}

.game-container {
    max-width: 100%;
    overflow-x: hidden;
}

.game-timer, .game-score {
    font-size: clamp(0.9rem, 2.5vw, 1.25rem);
}

.game-btn {
    padding: clamp(0.5rem, 2vw, 1rem) clamp(1rem, 3vw, 2rem);
    font-size: clamp(0.85rem, 2vw, 1rem);
}

canvas.game-canvas {
    max-width: 100%;
    height: auto;
    touch-action: none;
}

.drag-item {
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.drag-item:active {
    cursor: grabbing;
}

.drop-zone {
    min-height: 60px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.vlc-card {
    border-radius: 12px;
    overflow: hidden;
}

.leaderboard-row {
    transition: background-color 0.2s ease;
}

.leaderboard-row:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.ppst-domain {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.survey-question {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
}

@media (max-width: 575.98px) {
    .survey-question {
        padding: 0.75rem;
    }
    
    .rating-scale {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .rating-scale label {
        width: 100%;
        text-align: left;
        padding: 0.75rem;
        border: 1px solid #dee2e6;
        border-radius: 4px;
    }
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 575.98px) {
    .chart-container {
        height: 250px !important;
        min-height: 250px;
    }
}

@media (min-width: 576px) {
    .chart-container {
        height: 300px;
        min-height: 300px;
    }
}

.safe-area-inset {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

@supports (-webkit-touch-callout: none) {
    .ios-fix {
        min-height: -webkit-fill-available;
    }
}
