/* Desktop View Template Styles */
/* Statistics Cards */
.stats-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

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

.stats-card .stats-icon {
    font-size: 2rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.stats-card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

/* Filters Card */
.filters-card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

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

.form-label.fw-semibold {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Bulk Operations */
.bulk-operations-alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.2);
}

/* Table Styling */
.modern-table-container {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.modern-table {
    margin: 0;
    border: none;
}

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

.table-header th {
    border: none;
    padding: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #fff !important;
}

.table-row {
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.3s ease;
}

.table-row:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-row td {
    padding: 1rem;
    vertical-align: middle;
    border: none;
}

/* Row Number */
.row-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Image Container */
.image-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.record-image {
    height: 40px;
    width: 40px;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

/* Record Name */
.record-name .fw-medium {
    color: #495057;
    font-size: 0.875rem;
}

/* Status Container */
.status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Action Buttons */
.action-buttons .dropdown-toggle {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.action-buttons .dropdown-toggle:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

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

/* Empty State */
.empty-state,
.auth-message {
    padding: 3rem 1rem;
}

.empty-state i,
.auth-message i {
    display: block;
    margin-bottom: 1rem;
}

/* Pagination */
.pagination-container {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

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

.spin {
    animation: spin 1s linear infinite;
}

/* Form Controls */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-card .card-body {
        padding: 1rem;
    }
    
    .stats-icon {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    .table-responsive {
        border-radius: 8px;
    }
    
    .table-header th {
        padding: 0.75rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .table-row td {
        padding: 0.75rem 0.5rem;
    }
    
    .record-image {
        height: 32px;
        width: 32px;
    }
    
    .row-number {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .stats-card,
    .filters-card,
    .modern-table-container {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .table-row:hover {
        background-color: #4a5568;
    }
    
    .form-control,
    .form-select {
        background-color: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .dropdown-menu {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    .dropdown-item {
        color: #e2e8f0;
    }
    
    .dropdown-item:hover {
        background-color: #4a5568;
    }
}

/* Print Styles */
@media print {
    .filters-card,
    .bulk-operations-alert,
    .action-buttons,
    .pagination-container {
        display: none !important;
    }
    
    .modern-table-container {
        box-shadow: none;
        border: 1px solid #000;
    }
}
.kbw-signature {
            width: 100%;
            height: 200px;
        }

        #sig canvas {
            width: 100% !important;
            height: auto;
        }

        /* Page Loader Styles */
        #global-loader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.9);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }

        .page-loader {
            width: 50px;
            height: 50px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #007bff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Footer Styles */
        .footer {
            background-color: #f8f9fa;
            border-top: 1px solid #e9ecef;
            padding: 1rem 0;
            margin-top: auto;
            position: relative;
            bottom: 0;
            width: 100%;
        }

        .footer p {
            color: #6c757d;
            font-size: 0.875rem;
            margin: 0;
        }

        .footer .container-fluid {
            padding-left: 1.5rem;
            padding-right: 1.5rem;
        }

        /* Font loading optimization */
        .font-loading {
            visibility: hidden;
        }

        .font-loaded {
            visibility: visible;
        }

        /* Ensure Bootstrap Icons are always visible and properly styled */
        .bi, [class^="bi-"], [class*=" bi-"] {
            font-family: 'bootstrap-icons' !important;
            font-style: normal;
            font-variant: normal;
            text-rendering: auto;
            line-height: 1;
            display: inline-block;
            font-weight: normal !important;
            vertical-align: -.125em;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        /* Ensure Font Awesome icons work */
        .fa, .fas, .far, .fab {
            font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', sans-serif !important;
            font-style: normal;
            font-variant: normal;
            text-rendering: auto;
            line-height: 1;
        }

        /* Fix for missing icon fonts */
        .fa-missing:before,
        .fas-missing:before,
        .far-missing:before {
            content: "⚠";
            color: #dc3545;
        }

        /* Bootstrap Icons fallbacks */
        .bi-x-circle:before {
            content: "✖" !important;
            color: #dc3545;
        }

        .bi-check-circle:before {
            content: "✓" !important;
            color: #02b821;
        }

        .bi-plus-circle:before {
            content: "+" !important;
        }

        .bi-calendar-month:before {
            content: "📅" !important;
        }

        .bi-collection:before {
            content: "📋" !important;
        }

        /* Ensure font loads properly */
        @font-face {
            font-display: swap;
            font-family: "bootstrap-icons";
            src: url("fonts/bootstrap-icons.woff2") format("woff2"),
                 url("fonts/bootstrap-icons.woff") format("woff");
        }
