/**
 * Car Parking Management System
 * Mobile-First Responsive Styles
 */

/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    /* Content area unified palette (navbar unchanged) */
    --app-primary: #0d6efd;
    --app-primary-light: #3b82f6;
    --app-primary-soft: rgba(13, 110, 253, 0.12);
    --app-secondary: #60a5fa;
    --app-secondary-light: #93c5fd;
    --app-secondary-soft: rgba(96, 165, 250, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Dashboard container styling */
.container-fluid.dashboard-container {
    background-color: #fff;
    border-radius: 12px;
    margin: 1rem auto;
    padding: 1.5rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-width: 1200px;
}

@media (max-width: 575.98px) {
    .container-fluid.dashboard-container {
        margin: 0.5rem;
        padding: 1rem !important;
        border-radius: 8px;
    }
}

/* Desktop container: defined in "Large devices" section below (single source of truth) */

@media (max-width: 991.98px) {
    .container-fluid {
        margin-top: 1rem;
    }
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.login-page .card {
    border-radius: 15px;
    overflow: hidden;
    max-width: 320px;
    margin: 0 auto;
}

.login-page .card-body {
    padding: 1.25rem;
}

/* Navigation - Legacy navbar styles (kept for backward compatibility) */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: none; /* Hidden as we're using sidebar now */
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

/* Export to Excel button - Excel theme green */
.btn-excel {
    background-color: #217346;
    border-color: #217346;
    color: #fff;
}
.btn-excel:hover:not(.disabled):not(:disabled) {
    background-color: #1a5c38;
    border-color: #1a5c38;
    color: #fff;
}
.btn-excel.disabled,
.btn-excel:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    opacity: 0.65;
}

/* SweetAlert2 Custom Styling */
.swal2-popup {
    border-radius: 15px !important;
    padding: 2rem !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
}

.swal2-title {
    font-size: 1.75rem !important;
    font-weight: 600 !important;
    color: #333 !important;
}

.swal2-html-container {
    font-size: 1.1rem !important;
    color: #666 !important;
}

.swal2-icon {
    margin: 1rem auto !important;
}

.swal2-actions {
    gap: 1rem !important;
    margin-top: 1.5rem !important;
}

.swal2-confirm,
.swal2-cancel {
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    padding: 0.75rem 2rem !important;
    transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
}

.swal2-confirm:hover,
.swal2-cancel:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.swal2-confirm:focus,
.swal2-cancel:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25) !important;
}

/* SweetAlert2 Responsive Buttons */
@media (max-width: 576px) {
    .swal2-popup {
        padding: 1.5rem !important;
        width: 90% !important;
        max-width: 340px !important;
    }
    
    .swal2-title {
        font-size: 1.4rem !important;
    }
    
    .swal2-html-container {
        font-size: 1rem !important;
    }
    
    .swal2-icon {
        width: 60px !important;
        height: 60px !important;
        margin: 0.5rem auto !important;
    }
    
    .swal2-actions {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.75rem !important;
        margin-top: 1rem !important;
    }
    
    .swal2-confirm,
    .swal2-cancel {
        width: 100% !important;
        margin: 0 !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem !important;
    }
}

/* Medium screens (tablets) */
@media (min-width: 577px) and (max-width: 768px) {
    .swal2-popup {
        width: 80% !important;
        max-width: 450px !important;
    }
    
    .swal2-confirm,
    .swal2-cancel {
        padding: 0.75rem 1.5rem !important;
    }
}

/* Large screens */
@media (min-width: 769px) {
    .swal2-popup {
        max-width: 500px !important;
    }
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Customers list card view - consistent with app card styling */
.customer-card {
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.customer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.customer-card .card-title,
.customer-card-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.customer-card-body {
    padding: 1rem 1.25rem;
}

.customer-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
}

.customer-card-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    column-gap: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.customer-card-label {
    flex: 0 0 145px;
    color: #111827;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

@media (max-width: 400px) {
    .customer-card-label {
        flex: 0 0 120px;
    }
}

.customer-card-label i {
    margin-right: 0.25rem;
    opacity: 0.9;
}

.customer-card-value {
    flex: 1;
    width: 100%;
    min-width: 0;
    color: #374151;
}

/* Subtle separation between customer card rows to make fields identifiable */
.customer-card-row + .customer-card-row {
    border-top: 1px dashed #e5e7eb;
    padding-top: 0.35rem;
    margin-top: 0.35rem;
}

.customer-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.customer-card-actions .btn {
    flex: 1 1 0;
    max-width: 50%;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    min-width: 0;
    white-space: nowrap;
    text-align: center;
}

/* Extra-small devices: slightly smaller buttons to avoid any overlap */
@media (max-width: 360px) {
    .customer-card-actions .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
}

.stat-card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #fff;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(20px);
}

.stat-card.animate-card {
    animation: slideUpFadeIn 0.6s ease-out forwards;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Dashboard card animation */
@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card .card-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
}

.stat-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .stat-card .card-body {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        justify-content: center;
    }
    
    .stat-card-icon {
        margin-right: 0;
        margin-bottom: 0.75rem;
        margin-left: auto;
        margin-right: auto;
    }
    
    .stat-card-content {
        width: 100%;
        align-items: center;
    }
    
    .stat-card h3,
    .stat-card h4 {
        text-align: center;
    }
    
    .stat-card small {
        text-align: center;
    }
}

.stat-card-icon i {
    font-size: 1.75rem;
}

.stat-card-content {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.stat-card h3,
.stat-card h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #1f2937;
    text-align: center;
    width: 100%;
}

.stat-card small {
    font-size: 0.875rem;
    color: #4b5563;
    display: block;
    margin-top: 0.25rem;
    font-weight: 500;
    text-align: center;
    width: 100%;
}

/* Icon colors for stat cards - colored icons with light backgrounds */
.stat-card-icon {
    background: rgba(13, 110, 253, 0.1);
    border: 2px solid rgba(13, 110, 253, 0.2);
}

.stat-card-icon.icon-primary {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-card-icon.icon-primary i {
    color: #3b82f6;
}

.stat-card-icon.icon-secondary {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.3);
}

.stat-card-icon.icon-secondary i {
    color: #60a5fa;
}

.stat-card-icon.icon-primary-light {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-card-icon.icon-primary-light i {
    color: #10b981;
}

.stat-card-icon.icon-secondary-light {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

.stat-card-icon.icon-secondary-light i {
    color: #f59e0b;
}

/* Specific colored icons for each stat card - vibrant colors */
.stat-card-icon.icon-primary i.bi-people-fill {
    color: #3b82f6;
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.3));
}

.stat-card-icon.icon-secondary i.bi-car-front-fill {
    color: #60a5fa;
    filter: drop-shadow(0 2px 4px rgba(96, 165, 250, 0.3));
}

.stat-card-icon.icon-primary-light i.bi-currency-dollar {
    color: #10b981;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.3));
}

.stat-card-icon.icon-secondary-light i.bi-exclamation-triangle-fill {
    color: #f59e0b;
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3));
}

@media (min-width: 768px) {
    .stat-card h3,
    .stat-card h4 {
        font-size: 1.75rem;
    }
    
    .stat-card-icon {
        width: 70px;
        height: 70px;
    }
    
    .stat-card-icon i {
        font-size: 2rem;
    }
}

/* History Cards */
.history-card {
    transition: all 0.3s;
}

.history-card:hover {
    border-left: 4px solid var(--app-primary);
}

/* Forms */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.container-fluid .form-control:focus,
.container-fluid .form-select:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.2);
}

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

.invalid-feedback {
    display: block;
    font-size: 0.875rem;
    color: var(--danger-color);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

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

.btn:active {
    transform: translateY(0);
}

/* Button alignment for all pages */
.btn-group,
.btn-group-vertical {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Full width buttons on mobile */
@media (max-width: 575.98px) {
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Button groups stack vertically on mobile */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Multiple buttons in a row should stack */
    .col-12 .btn + .btn {
        margin-top: 0.5rem;
    }
    
    /* Form buttons alignment */
    form .btn {
        width: 100%;
    }
    
    /* Ensure buttons with icons are properly aligned */
    .btn i {
        margin-right: 0.5rem;
        vertical-align: middle;
    }

    /* Customers page: keep Edit/Delete side by side inside card */
    .customer-card-actions .btn {
        width: auto;
        flex: 1 1 0;
        max-width: 50%;
        margin-bottom: 0;
        padding: 0.35rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Quick Actions Card */
.quick-actions-card {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

.quick-actions-card .card-body {
    padding: 1.25rem;
}

.quick-actions-card h5 {
    color: #1f2937;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Quick Action Buttons */
.btn-quick-action {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: none;
    text-align: center;
    gap: 0.5rem;
}

.btn-quick-action span {
    display: inline-block;
}

.btn-quick-action i {
    font-size: 1.25rem;
    display: inline-block;
    vertical-align: middle;
}

.btn-quick-primary {
    background: var(--app-primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

.btn-quick-primary:hover {
    background: var(--app-primary-light);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.btn-quick-secondary {
    background: #6b7280;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-quick-secondary:hover {
    background: #4b5563;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Colored Icons for Quick Actions */
.quick-icon-primary {
    color: #1e3a8a !important; /* Dark Blue */
}

.quick-icon-calendar {
    color: #f97316 !important; /* Orange - Calendar icon */
}

.quick-icon-excel {
    color: #10b981 !important; /* Green - Excel icon */
}

@media (max-width: 575.98px) {
    .quick-actions-card .card-body {
        padding: 1rem;
    }
    
    .btn-quick-action {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        gap: 0.4rem;
    }
    
    .btn-quick-action i {
        font-size: 1.1rem;
    }
}

/* Content area: unified primary/secondary buttons (navbar unchanged) */
.container-fluid .btn-primary {
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-light) 100%);
    border: none;
    color: #fff;
}

.container-fluid .btn-primary:hover {
    background: linear-gradient(135deg, var(--app-primary-light) 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.4);
}

.container-fluid .btn-secondary {
    background: #6b7280;
    border: none;
    color: #ffffff;
}

.container-fluid .btn-secondary:hover {
    background: #4b5563;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.container-fluid .alert.alert-primary,
.container-fluid .alert.alert-info {
    background: var(--app-primary-soft);
    color: var(--app-primary);
    border: 1px solid rgba(30, 64, 175, 0.2);
}

.container-fluid .btn-outline-secondary {
    border-color: var(--app-secondary);
    color: var(--app-secondary);
    background: transparent;
}

.container-fluid .btn-outline-secondary:hover {
    background: linear-gradient(135deg, var(--app-secondary) 0%, var(--app-secondary-light) 100%);
    border-color: var(--app-secondary);
    color: #fff;
}

/* Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 6px;
}

/* Content area: unified badge styles (Paid = primary, Pending = secondary) */
.container-fluid .badge.bg-primary,
.container-fluid .badge.bg-success {
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-light) 100%) !important;
    border: none;
}

.container-fluid .badge.bg-secondary,
.container-fluid .badge.bg-warning {
    background: linear-gradient(135deg, var(--app-secondary) 0%, var(--app-secondary-light) 100%) !important;
    border: none;
    color: #fff;
}

/* Colored icons for buttons */
.btn i {
    vertical-align: middle;
}

.btn-primary i {
    color: #fff;
}

.btn-secondary i {
    color: #fff;
}

.btn-outline-secondary i {
    color: var(--app-secondary);
}

.btn-outline-secondary:hover i {
    color: #fff;
}

/* Back to Dashboard button styling */
.btn-back-dashboard {
    background: #6b7280;
    border: none;
    color: #ffffff !important;
}

.btn-back-dashboard,
.btn-back-dashboard span,
.btn-back-dashboard * {
    color: #ffffff !important;
}

.btn-back-dashboard i {
    color: #ffffff !important;
}

.btn-back-dashboard:hover {
    background: #4b5563;
    color: #ffffff !important;
}

.btn-back-dashboard:hover i,
.btn-back-dashboard:hover span,
.btn-back-dashboard:hover * {
    color: #ffffff !important;
}

/* Pagination */
.pagination {
    margin-top: 2rem;
}

.page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: var(--primary-color);
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.container-fluid .page-link {
    color: var(--app-primary);
}

.container-fluid .page-link:hover {
    background-color: var(--app-primary);
    color: #fff;
    border-color: var(--app-primary);
}

.container-fluid .page-item.active .page-link {
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-light) 100%);
    border-color: var(--app-primary);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert i {
    margin-right: 0.5rem;
}

/* Mobile-First Responsive Design */
@media (max-width: 575.98px) {
    body {
        font-size: 14px;
    }
    
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stat-card h3,
    .stat-card h4 {
        font-size: 1.25rem;
    }
    
    .stat-card-icon {
        width: 50px !important;
        height: 50px !important;
    }
    
    .stat-card-icon i {
        font-size: 1.5rem !important;
    }
    
    .stat-card .card-body {
        padding: 0.875rem 1rem !important;
    }
    
    .stat-card small {
        font-size: 0.8rem;
        color: #4b5563;
    }
    
    /* Ensure cards are centered on mobile */
    .row.justify-content-center .col-12 {
        max-width: 100%;
    }
    
    .btn-lg {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .btn-lg i {
        font-size: 1.1rem !important;
        margin-right: 0.5rem;
    }
    
    /* Ensure all buttons are full width and properly aligned on mobile */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-outline-secondary {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    /* Multiple buttons should stack */
    .btn + .btn {
        margin-top: 0.5rem;
        margin-left: 0;
    }
    /* Customers page: override stacked margin so Edit/Delete stay aligned */
    .customer-card-actions .btn + .btn {
        margin-top: 0;
    }
    
    /* Flex gap for button groups */
    .d-flex.gap-2 .btn {
        margin-bottom: 0;
    }
    
    .d-flex.flex-column .btn {
        width: 100%;
    }
    
    /* Ensure proper spacing for button containers */
    .d-flex.flex-column.flex-md-row {
        flex-direction: column;
    }
    
    .d-flex.flex-column.flex-md-row .btn {
        width: 100%;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .form-control,
    .form-select {
        padding: 0.625rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h5 {
        font-size: 1rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .stat-card h3 {
        font-size: 1.75rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* Buttons can be inline on tablets and up */
    .d-flex.flex-column.flex-md-row {
        flex-direction: row;
    }
    
    .d-flex.flex-column.flex-md-row .btn {
        width: auto;
        flex: 0 0 auto;
    }
}

/* Large devices (desktops, 992px and up) - laptop/desktop alignment only */
@media (min-width: 992px) {
    .container-fluid {
        max-width: min(1200px, calc(100vw - 260px - 2rem));
        margin-left: auto;
        margin-right: auto;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Extra large desktops - slightly more room, no change to mobile/tablet */
@media (min-width: 1400px) {
    .container-fluid {
        max-width: min(1320px, calc(100vw - 260px - 3rem));
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
}

/* Touch-friendly spacing */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none;
    }
    
    .card {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for keyboard navigation */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Table Styles */
.table {
    margin-bottom: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #ffffff;
    border-bottom: 2px solid #0a58ca;
    font-weight: 600;
    padding: 1rem 0.75rem;
    white-space: nowrap;
    text-align: left;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table thead th:first-child {
    border-top-left-radius: 8px;
}

.table thead th:last-child {
    border-top-right-radius: 8px;
}

.table thead th i {
    margin-right: 0.5rem;
    opacity: 0.95;
}

.table tbody td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table .btn-group {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
}

.table .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    font-weight: 500;
}

.table tbody td:first-child {
    font-weight: 600;
    color: #6c757d;
}

.table tbody td strong {
    font-weight: 600;
}

.table tbody td.text-end {
    text-align: right;
}

.table tbody td.text-center {
    text-align: center;
}

/* Responsive table on mobile */
@media (max-width: 767.98px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 0.875rem;
        min-width: 1000px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.625rem 0.5rem;
    }
    
    .table thead th {
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .table .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .table thead th i {
        margin-right: 0.25rem;
    }
}
