/* Global Styles */
:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
    --navbar-color: #054064;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

* {
    transition: all 0.2s ease;
}

body {
    background: var(--bg-gradient);
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Main Container Spacing */
.container-fluid {
    padding: 5px 40px 30px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 20px 15px;
    }
}

/* Card Styles */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 25px;
    background: white;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e3e6f0;
    padding: 18px 24px;
    font-weight: 700;
    border-radius: 16px 16px 0 0;
}

.card-body {
    padding: 28px;
}

/* Page Headers */
.d-sm-flex.align-items-center {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e3e6f0;
}

.h3 {
    color: var(--dark-color);
    font-weight: 700;
}

/* Dashboard Menu Styles */
.dashboard-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #054064;
    text-decoration: none;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-height: 140px;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.menu-item:hover::before {
    transform: scaleX(1);
}

.menu-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    color: #054064;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.menu-item i {
    font-size: 2.8rem;
    margin-bottom: 14px;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

.menu-item span {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

/* Colored Icons */
.icon-blue {
    color: #3b82f6;
}

.icon-purple {
    color: #8b5cf6;
}

.icon-green {
    color: #10b981;
}

.icon-teal {
    color: #14b8a6;
}

.icon-success {
    color: #22c55e;
}

.icon-orange {
    color: #f97316;
}

.icon-pink {
    color: #ec4899;
}

.icon-indigo {
    color: #6366f1;
}

.icon-cyan {
    color: #06b6d4;
}

.icon-violet {
    color: #a855f7;
}

.icon-gray {
    color: #6b7280;
}

.icon-red {
    color: #ef4444;
}

/* Stat Cards */
.border-left-primary {
    border-left: 5px solid var(--primary-color) !important;
    border-radius: 16px;
}

.border-left-success {
    border-left: 5px solid var(--success-color) !important;
    border-radius: 16px;
}

.border-left-warning {
    border-left: 5px solid var(--warning-color) !important;
    border-radius: 16px;
}

.border-left-info {
    border-left: 5px solid var(--info-color) !important;
    border-radius: 16px;
}

.border-left-danger {
    border-left: 5px solid var(--danger-color) !important;
    border-radius: 16px;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.form-control,
.form-select {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(78, 115, 223, 0.1);
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background: linear-gradient(135deg, #4e73df 0%, #3b5fc7 100%);
    border-color: var(--primary-color);
    padding: 12px 28px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b5fc7 0%, #2e59d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(78, 115, 223, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #1cc88a 0%, #17a673 100%);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(28, 200, 138, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #e74a3b 0%, #d63426 100%);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 74, 59, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: 10px;
}

/* Navbar */
.navbar {
    padding: 15px 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem !important;
    background-color: #054064 !important;
    border-radius: 0 !important;
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: #e0e0e0 !important;
    transform: scale(1.05);
}

.navbar-dark .navbar-nav .nav-link {
    color: #ffffff !important;
    transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #e0e0e0 !important;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: #ffffff;
    border-color: #ffffff;
    border-radius: 10px;
}

.btn-outline-primary:hover {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #054064;
    transform: translateY(-2px);
}

.btn-outline-danger {
    color: #ffffff;
    border-color: #dc3545;
    background-color: #dc3545;
    border-radius: 10px;
}

.btn-outline-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-2px);
}

/* Tables */
.table-responsive {
    margin-top: 10px;
    border-radius: 12px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid #e3e6f0;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--dark-color);
    padding: 16px;
}

.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
}

.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 16px 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Badges */
.badge {
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 600;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

/* Motion Particles */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: float-particle linear infinite;
    bottom: -100px;
}

.particle:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-duration: 20s;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 60px;
    height: 60px;
    left: 20%;
    animation-duration: 25s;
    animation-delay: 2s;
}

.particle:nth-child(3) {
    width: 100px;
    height: 100px;
    left: 30%;
    animation-duration: 18s;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    width: 40px;
    height: 40px;
    left: 40%;
    animation-duration: 22s;
    animation-delay: 1s;
}

.particle:nth-child(5) {
    width: 70px;
    height: 70px;
    left: 50%;
    animation-duration: 28s;
    animation-delay: 3s;
}

.particle:nth-child(6) {
    width: 50px;
    height: 50px;
    left: 60%;
    animation-duration: 24s;
    animation-delay: 5s;
}

.particle:nth-child(7) {
    width: 90px;
    height: 90px;
    left: 70%;
    animation-duration: 19s;
    animation-delay: 2s;
}

.particle:nth-child(8) {
    width: 35px;
    height: 35px;
    left: 80%;
    animation-duration: 26s;
    animation-delay: 4s;
}

.particle:nth-child(9) {
    width: 65px;
    height: 65px;
    left: 90%;
    animation-duration: 21s;
    animation-delay: 1s;
}

.particle:nth-child(10) {
    width: 45px;
    height: 45px;
    left: 5%;
    animation-duration: 23s;
    animation-delay: 6s;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    margin: 20px;
    border-radius: 20px;
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease;
    position: relative;
    z-index: 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.shadow {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

/* Chart Area */
.chart-area {
    position: relative;
    height: 300px;
    padding: 10px;
}

/* ============================================
   COMPACT RESPONSIVE DESIGN
   Optimized for all screen sizes with scrollbars
   ============================================ */

/* Global Compact Styles */
.container-fluid {
    padding: 8px 12px;
    max-width: 100%;
    overflow-x: hidden;
}

.card {
    margin-bottom: 12px;
}

.card-header {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.card-body {
    padding: 12px;
}

/* Compact Form Elements */
.form-control, .form-select {
    padding: 6px 10px;
    font-size: 14px;
    min-height: 36px;
}

.form-label {
    font-size: 0.8rem;
    margin-bottom: 4px;
}

/* Compact Buttons */
.btn {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Compact Tables */
.table thead th,
.table tbody td {
    padding: 6px 8px;
    font-size: 0.8rem;
}

/* Table Responsive with Scrollbar */
.table-responsive {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #e3e6f0;
}

/* Custom Scrollbar */
.table-responsive::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.card-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.card-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.card-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Compact Dashboard Menu */
.dashboard-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    padding: 5px 0;
}

.menu-item {
    padding: 12px 8px;
    min-height: 80px;
    border-radius: 10px;
}

.menu-item i {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.menu-item span {
    font-size: 0.7rem;
}

/* Compact Typography */
h1, .h1 { font-size: 1.25rem; }
h2, .h2 { font-size: 1.1rem; }
h3, .h3 { font-size: 1rem; }
h4, .h4 { font-size: 0.9rem; }
h5, .h5 { font-size: 0.85rem; }
h6, .h6 { font-size: 0.8rem; }

p, .p { font-size: 0.85rem; margin-bottom: 0.5rem; }

/* Compact Navbar */
.navbar {
    padding: 8px 12px;
    min-height: 50px;
}

.navbar-brand {
    font-size: 0.9rem;
}

.navbar-brand img {
    height: 24px !important;
}

/* Extra Small Devices (iPhone SE, older phones) - up to 375px */
@media (max-width: 375px) {
    .container-fluid {
        padding: 6px 8px;
    }
    
    .dashboard-menu {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .menu-item {
        padding: 10px 4px;
        min-height: 70px;
    }
    
    .menu-item i {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }
    
    .menu-item span {
        font-size: 0.65rem;
    }
    
    .card-header {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .card-body {
        padding: 10px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

/* Small Devices (iPhone 6/7/8/X/11/12/13/14, Android phones) - 376px to 576px */
@media (min-width: 376px) and (max-width: 576px) {
    .container-fluid {
        padding: 8px 10px;
    }
    
    .dashboard-menu {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .menu-item {
        padding: 12px 6px;
        min-height: 75px;
    }
    
    .menu-item i {
        font-size: 1.4rem;
    }
    
    .menu-item span {
        font-size: 0.7rem;
    }
    
    .form-control, .form-select {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

/* Medium Devices (Large phones, small tablets) - 577px to 767px */
@media (min-width: 577px) and (max-width: 767px) {
    .dashboard-menu {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .menu-item {
        padding: 14px 8px;
        min-height: 85px;
    }
    
    .menu-item i {
        font-size: 1.6rem;
    }
}

/* Tablets (iPad Mini, iPad, iPad Air portrait) - 768px to 991px */
@media (min-width: 768px) and (max-width: 991px) {
    .container-fluid {
        padding: 12px 16px;
    }
    
    .dashboard-menu {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    
    .menu-item {
        padding: 16px 10px;
        min-height: 90px;
    }
    
    .menu-item i {
        font-size: 1.8rem;
    }
    
    .menu-item span {
        font-size: 0.8rem;
    }
    
    .card-header {
        padding: 10px 14px;
    }
    
    .card-body {
        padding: 14px;
    }
}

/* Large Tablets (iPad Pro 11", iPad Air landscape) - 992px to 1199px */
@media (min-width: 992px) and (max-width: 1199px) {
    .container-fluid {
        padding: 16px 20px;
    }
    
    .dashboard-menu {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
    }
    
    .menu-item {
        padding: 18px 12px;
        min-height: 95px;
    }
}

/* Extra Large Devices (Desktops, iPad Pro 12.9" landscape) - 1200px and up */
@media (min-width: 1200px) {
    .container-fluid {
        padding: 16px 24px;
    }
    
    .dashboard-menu {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    /* CSS specific to iOS devices */
    .form-control,
    .form-select,
    input,
    textarea,
    select {
        -webkit-appearance: none;
        border-radius: 12px;
    }
    
    .btn {
        -webkit-appearance: none;
    }
    
    /* Fix for iOS momentum scrolling */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

/* Touch Target Optimization - Compact but accessible */
@media (pointer: coarse) {
    .btn,
    .nav-link,
    .navbar-toggler,
    .form-check-input,
    .page-link,
    .dropdown-item,
    .menu-item {
        min-height: 40px;
        min-width: 40px;
    }
    
    .navbar-nav .nav-link {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .btn-sm {
        min-height: 32px;
        min-width: 32px;
    }
    
    .form-control,
    .form-select {
        min-height: 40px;
    }
    
    /* Increase spacing between touch targets */
    .table tbody td .btn {
        margin: 1px;
    }
}

/* Table Responsive Enhancements - Compact with Scrollbars */
.table-responsive {
    max-height: 50vh;
    overflow: auto;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    background: white;
}

.table-responsive .table {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .table-responsive {
        max-height: 45vh;
        font-size: 0.75rem;
    }
    
    .table-responsive .table {
        min-width: 500px; /* Forces horizontal scroll */
    }
    
    .table thead th,
    .table tbody td {
        padding: 4px 6px;
        white-space: nowrap;
    }
}

/* Navbar Mobile Optimization - Compact */
@media (max-width: 991px) {
    .navbar {
        padding: 6px 10px;
        min-height: 45px;
    }
    
    .navbar-collapse {
        background: rgba(5, 64, 100, 0.98);
        margin: 6px -10px -6px;
        padding: 10px;
        border-radius: 0 0 8px 8px;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .navbar-nav {
        padding: 5px 0;
    }
    
    .navbar-nav .nav-item {
        margin: 3px 0;
    }
    
    .navbar-nav .nav-link,
    .navbar-nav .btn {
        width: 100%;
        text-align: left;
        margin: 3px 0 !important;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .navbar-toggler {
        padding: 6px 10px;
        border: 2px solid rgba(255,255,255,0.3);
        border-radius: 6px;
    }
}

/* Form Mobile Optimization - Compact */
@media (max-width: 768px) {
    .form-label {
        font-size: 0.75rem;
        margin-bottom: 3px;
    }
    
    .form-control,
    .form-select {
        font-size: 16px; /* Critical: Prevents iOS zoom on input focus */
        padding: 8px 10px;
        min-height: 38px;
    }
    
    /* Stack form buttons on mobile */
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .form-actions .btn {
        width: 100%;
        padding: 8px;
    }
    
    /* Reduce card padding on mobile */
    .card {
        margin-bottom: 10px;
    }
    
    .card-header {
        padding: 8px 12px;
    }
    
    .card-body {
        padding: 10px;
    }
}

/* Landscape Mode Optimization - Compact */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        padding: 5px 10px;
        min-height: 40px;
    }
    
    .dashboard-menu {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .menu-item {
        padding: 10px 8px;
        min-height: 70px;
    }
    
    .menu-item i {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }
    
    .table-responsive {
        max-height: 40vh;
    }
}

/* High DPI / Retina Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card,
    .btn,
    .form-control,
    .form-select,
    .menu-item {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Dark Mode Support (optional, for future) */
@media (prefers-color-scheme: dark) {
    /* Placeholder for dark mode styles */
}

/* Reduced Motion (Accessibility) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   COMPACT COMPONENT STYLES
   ============================================ */

/* Compact Modals */
.modal-header {
    padding: 10px 15px;
}

.modal-body {
    padding: 15px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 10px 15px;
}

.modal-title {
    font-size: 1rem;
}

/* Modal fullscreen on small screens */
@media (max-width: 576px) {
    .modal-fullscreen-sm-down {
        padding: 0 !important;
    }
    
    .modal-fullscreen-sm-down .modal-dialog {
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
    }
    
    .modal-fullscreen-sm-down .modal-content {
        height: 100%;
        border: 0;
        border-radius: 0;
    }
    
    .modal-fullscreen-sm-down .modal-body {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* Compact Alerts */
.alert {
    padding: 10px 15px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

/* Compact Badges */
.badge {
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Compact Pagination */
.pagination {
    margin-bottom: 0;
}

.page-link {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Compact Input Groups */
.input-group-text {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* Compact List Groups */
.list-group-item {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* Compact Dropdowns */
.dropdown-menu {
    font-size: 0.85rem;
    max-height: 50vh;
    overflow-y: auto;
}

.dropdown-item {
    padding: 6px 12px;
}

/* Compact Tooltips and Popovers */
.tooltip {
    font-size: 0.75rem;
}

.popover {
    font-size: 0.85rem;
    max-width: 250px;
}

.popover-header {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.popover-body {
    padding: 10px 12px;
}

/* Compact Progress Bars */
.progress {
    height: 0.75rem;
}

/* Compact Spinners */
.spinner-border,
.spinner-grow {
    width: 1.5rem;
    height: 1.5rem;
}

.spinner-border-sm,
.spinner-grow-sm {
    width: 1rem;
    height: 1rem;
}

/* Compact Close Button */
.btn-close {
    width: 0.75em;
    height: 0.75em;
    padding: 0.25em;
}

/* Compact Cards with Scrollable Content */
.card-scrollable {
    max-height: 300px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .card-scrollable {
        max-height: 250px;
    }
}

/* Compact Stat Cards */
.border-left-primary,
.border-left-success,
.border-left-warning,
.border-left-info,
.border-left-danger {
    border-left-width: 3px !important;
}

/* Compact Charts */
.chart-container {
    position: relative;
    height: 200px;
    width: 100%;
}

@media (max-width: 768px) {
    .chart-container {
        height: 150px;
    }
}

/* Ensure all scrollable areas have visible scrollbars */
.scrollable {
    overflow: auto;
    max-height: 300px;
}

.scrollable-x {
    overflow-x: auto;
    white-space: nowrap;
}

.scrollable-y {
    overflow-y: auto;
    max-height: 300px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Print Optimization */
@media print {

    .navbar,
    .d-print-none,
    .btn,
    .card-header,
    .alert,
    form,
    #sidebar {
        display: none !important;
    }

    body {
        background: white !important;
        margin: 0;
        padding: 0;
    }

    .container-fluid {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .card {
        box-shadow: none !important;
        border: none !important;
        margin-bottom: 0 !important;
    }

    .card-body {
        padding: 0 !important;
    }

    .table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .table th,
    .table td {
        padding: 8px !important;
        border: 1px solid #dee2e6 !important;
    }

    .table thead th {
        background: #f8f9fc !important;
        color: black !important;
    }
}