/* Control de Servicios - Custom CSS */

/* Variables CSS para temas */
:root {
    --bs-primary: #0d6efd;
    --bs-success: #198754;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-info: #0dcaf0;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Dark theme variables */
[data-bs-theme="dark"] {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #e9ecef;
    --bs-card-bg: #2d2d2d;
    --bs-border-color: #404040;
}

/* Mobile-first responsive design */
body {
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

.btn-sm {
    min-height: 36px;
    min-width: 36px;
}

.btn-lg {
    min-height: 52px;
    padding: 0.75rem 1.5rem;
}

/* Cards with better shadows */
.card {
    border: none;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
}

/* Avatar styles */
.avatar-sm {
    width: 40px;
    height: 40px;
}

.avatar-md {
    width: 60px;
    height: 60px;
}

.avatar-lg {
    width: 80px;
    height: 80px;
}

/* Status badges */
.badge-status-pending {
    background-color: var(--bs-warning);
    color: #000;
}

.badge-status-in-progress {
    background-color: var(--bs-info);
    color: #000;
}

.badge-status-completed {
    background-color: var(--bs-success);
    color: #fff;
}

.badge-status-cancelled {
    background-color: var(--bs-danger);
    color: #fff;
}

/* Priority badges */
.badge-priority-low {
    background-color: var(--bs-success);
    color: #fff;
}

.badge-priority-normal {
    background-color: var(--bs-info);
    color: #000;
}

.badge-priority-high {
    background-color: var(--bs-warning);
    color: #000;
}

.badge-priority-urgent {
    background-color: var(--bs-danger);
    color: #fff;
}

/* TPV/Receipt styles */
.tpv-container {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    border: 2px dashed #dee2e6;
    padding: 20px;
    font-family: 'Courier New', monospace;
}

.tpv-header {
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.tpv-total {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    margin: 20px 0;
}

.tpv-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 5px;
}

.tpv-footer {
    text-align: center;
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
    margin-top: 20px;
    font-size: 0.9rem;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--bs-primary);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form improvements */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Required field indicator */
.form-label.required::after {
    content: ' *';
    color: var(--bs-danger);
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.5rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    /* Hide less important columns on mobile */
    .d-none-mobile {
        display: none !important;
    }
    
    /* Stack form elements vertically */
    .row.g-3 > * {
        margin-bottom: 1rem;
    }
}

/* Tablet improvements */
@media (min-width: 768px) and (max-width: 992px) {
    .col-md-auto {
        flex: 0 0 auto;
        width: auto;
    }
}

/* Desktop improvements */
@media (min-width: 992px) {
    .d-none-mobile {
        display: table-cell !important;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .tpv-container {
        border: 1px solid #000;
        max-width: 100%;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Utility classes */
.cursor-pointer {
    cursor: pointer;
}

.text-decoration-none:hover {
    text-decoration: none !important;
}

.border-dashed {
    border-style: dashed !important;
}

.rounded-xl {
    border-radius: 1rem !important;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PWA specific styles */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
    margin: 0 auto;
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1060;
    max-width: 300px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Dark theme scrollbar */
[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #2d2d2d;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #555;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #777;
}