/* Admin Tabs Styling */
.admin-tabs {
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

/* Enhanced Modal Animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
}

.modal {
    animation: modalSlideIn 0.3s ease-out;
}

.modal.closing {
    animation: modalSlideOut 0.3s ease-in;
}

/* Enhanced PDF Preview Styling */
.pdf-preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    color: #666;
}

.pdf-preview-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Button Hover Effects */
.modal-close:hover {
    background-color: #e9ecef !important;
    transform: scale(1.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Enhanced Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.page-title h2 {
    margin-bottom: 10px;
    color: #333;
    font-weight: 700;
}

#breadcrumb-path {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* Data Integrity Indicators */
.data-integrity-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.data-integrity-status:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-integrity-status.ok {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.data-integrity-status.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.data-integrity-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Modern Admin Tabs - Horizontal Layout */
.admin-tabs {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    animation: slideInFromTop 0.6s ease-out;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 20px;
    min-height: 70px;
}

.tab-button {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 25px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

.tab-button:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.3);
}

.tab-button.active {
    background: linear-gradient(135deg, #00c851 0%, #007e33 100%);
    color: white;
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 8px 25px rgba(0,200,81,0.3);
    transform: translateY(-1px);
}

.tab-button.active::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #00c851, #007e33, #00c851);
    border-radius: 25px;
    z-index: -1;
    opacity: 0.7;
    filter: blur(8px);
}

.tab-button i {
    font-size: 1rem;
    margin-right: 2px;
}

.tab-button span {
    font-weight: 700;
}

/* Responsive Design for Admin Tabs */
@media (max-width: 768px) {
    .tab-container {
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 15px;
    }
    
    .tab-container::-webkit-scrollbar {
        display: none;
    }
    
    .tab-button {
        min-width: 100px;
        padding: 10px 16px;
        font-size: 0.8rem;
        flex-shrink: 0;
    }
    
    .tab-button span {
        display: none;
    }
    
    .tab-button i {
        margin-right: 0;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .admin-tabs {
        margin: 0 -15px 2rem -15px;
        border-radius: 0;
    }
    
    .tab-container {
        padding: 10px 15px;
    }
    
    .tab-button {
        min-width: 80px;
        padding: 8px 12px;
    }
}

/* Tab Content */
.tab-content-container {
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Breadcrumb */
.breadcrumb {
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

/* PDF Design Specific Styles */
.pdf-config {
    background: var(--card-background);
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.pdf-design-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.design-section {
    background: var(--background-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.design-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.color-input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
}

.margin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Logo Upload */
.logo-upload {
    position: relative;
}

.logo-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.logo-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 120px;
    background: var(--background-color);
}

.logo-preview:hover {
    border-color: var(--primary-color);
    background: var(--hover-color);
}

.logo-preview i {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.logo-preview.has-image {
    border-style: solid;
    border-color: var(--success-color);
}

.logo-preview img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

/* PDF Preview */
.pdf-preview-section {
    margin-top: 2rem;
}

.preview-container {
    background: #f5f5f5;
    padding: 2rem;
    border-radius: 0.5rem;
    display: flex;
    justify-content: center;
}

.pdf-preview {
    background: white;
    width: 210px;
    height: 297px;
    transform: scale(0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 0.25rem;
    position: relative;
    overflow: hidden;
}

.preview-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
}

.preview-logo {
    width: 40px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 auto 0.5rem;
    border-radius: 0.25rem;
}

.preview-title {
    font-size: 0.7rem;
    font-weight: bold;
}

.preview-content {
    padding: 1rem;
    font-size: 0.5rem;
}

.preview-client-info,
.preview-table,
.preview-totals {
    background: #f8f9fa;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.125rem;
}

.preview-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #e9ecef;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.4rem;
}

/* PDF Actions */
.pdf-actions {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* System Status */
.system-status {
    background: var(--card-background);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.status-indicator.online {
    background: var(--success-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.status-info {
    flex: 1;
}

.status-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.status-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Data Management */
.data-management {
    background: var(--card-background);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.data-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.data-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.data-stat i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.data-count {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.data-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.data-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Maintenance */
.maintenance-actions {
    background: var(--card-background);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.maintenance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.maintenance-item:last-child {
    margin-bottom: 0;
}

.maintenance-item.danger {
    border-color: var(--danger-color);
    background: rgba(220, 53, 69, 0.05);
}

.maintenance-info {
    flex: 1;
}

.maintenance-info h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.maintenance-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* Logs */
.logs-container {
    background: var(--card-background);
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

#activity-logs {
    font-family: monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.log-entry {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.log-level {
    font-weight: bold;
    flex-shrink: 0;
    width: 60px;
}

.log-level.info {
    color: var(--info-color);
}

.log-level.success {
    color: var(--success-color);
}

.log-level.warning {
    color: var(--warning-color);
}

.log-level.error {
    color: var(--danger-color);
}

.log-message {
    flex: 1;
    color: var(--text-primary);
}

/* Import/Export Modals */
.import-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.import-option {
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.import-option h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.import-option p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Reset Warning */
.reset-warning {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.reset-warning ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.reset-warning li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.confirmation-input {
    margin-top: 1.5rem;
}

.confirmation-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tab-container {
        overflow-x: auto;
        scrollbar-width: thin;
    }
    
    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .tab-button span {
        display: none;
    }
    
    .pdf-design-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .data-stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .maintenance-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .import-options {
        grid-template-columns: 1fr;
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
    max-width: 400px;
    font-weight: 500;
}

.notification-info {
    background: #3b82f6;
    color: white;
}

.notification-success {
    background: #10b981;
    color: white;
}

.notification-error {
    background: #ef4444;
    color: white;
}

.notification-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

/* Logo Upload Styles */
.logo-upload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.logo-upload:hover {
    border-color: var(--primary-color);
    background: var(--hover-color);
}

.logo-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.logo-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.logo-preview i {
    font-size: 2rem;
    opacity: 0.6;
}

/* Enhanced PDF Preview */
.pdf-preview {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.pdf-preview:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.preview-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.preview-logo-section {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.preview-company-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.preview-company-info p {
    margin: 2px 0;
    font-size: 12px;
    opacity: 0.9;
}

.preview-title {
    font-size: 24px;
    font-weight: bold;
    text-align: right;
}

.preview-content {
    padding: 1rem;
    min-height: 200px;
}

.preview-footer {
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 10px;
    background: #f8f9fa;
}

/* Color Input Enhancements */
.color-input {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    outline: none;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* Switch Styles for Checkboxes */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Enhanced Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-content {
    background: var(--background-color);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Responsive Design for Notifications */
@media (max-width: 768px) {
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
        animation: slideDown 0.3s ease forwards;
    }
    
    @keyframes slideDown {
        to {
            transform: translateY(0);
        }
    }
    
    .logo-upload {
        padding: 1rem;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
}

/* Enhanced PDF Preview Modal */
#pdf-preview-modal .modal-content {
    display: flex;
    flex-direction: column;
}

#pdf-preview-modal .modal-header {
    flex-shrink: 0;
}

#pdf-preview-modal .modal-actions {
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
}

/* Full PDF Preview Styles */
#full-pdf-preview {
    line-height: 1.4;
    letter-spacing: 0.3px;
}

#full-pdf-preview h1, #full-pdf-preview h2, #full-pdf-preview h3 {
    margin-top: 0;
}

#full-pdf-preview table {
    margin: 15px 0;
}

#full-pdf-preview th, #full-pdf-preview td {
    vertical-align: top;
}

/* Logo Preview Enhancements */
.logo-preview img {
    transition: transform 0.2s ease;
}

.logo-preview:hover img {
    transform: scale(1.05);
}

/* Color Input Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Print Styles for PDF Preview */
@media print {
    #pdf-preview-modal .modal-header,
    #pdf-preview-modal .modal-actions {
        display: none !important;
    }
    
    #pdf-preview-modal .modal-content {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        max-height: none !important;
    }
    
    #full-pdf-preview {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 20px !important;
        max-width: none !important;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sección simplificada de plantilla PDF */
.simplified-template-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border-radius: 12px;
    border: 1px solid #28a745;
}

.simplified-template-section h4 {
    color: #155724;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.template-info-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    border: 2px solid #28a745;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.1);
}

.template-info-card .template-header h5 {
    color: #155724;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.template-info-card .template-header p {
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.template-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.template-features li {
    padding: 0.5rem 0;
    color: #495057;
    font-size: 0.9rem;
}

.template-features .fas {
    margin-right: 0.5rem;
    width: 16px;
}

/* PDF Templates Section - Eliminada pero mantenemos algunos estilos base */

.section-description {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.template-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.template-card.selected {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.2);
}

.template-preview {
    height: 200px;
    padding: 1rem;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

/* Template Headers */
.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    height: 40px;
}

.professional-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.corporate-header {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%);
    color: white;
}

.modern-header {
    background: linear-gradient(135deg, #e83e8c 0%, #fd7e14 100%);
    color: white;
}

.gonzurq-green-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.eco-fresh-header {
    background: linear-gradient(135deg, #6f9c37 0%, #8bc34a 100%);
    color: white;
}

.tech-green-header {
    background: linear-gradient(135deg, #00c851 0%, #007e33 100%);
    color: white;
}

.template-logo {
    width: 24px;
    height: 16px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.template-title {
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Template Content */
.template-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 120px;
}

.template-section {
    height: 20px;
    background: #e9ecef;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.template-table {
    height: 60px;
    border-radius: 6px;
    position: relative;
}

.professional-table {
    background: linear-gradient(to bottom, #cfe2ff 0%, #f8f9fa 100%);
    border: 1px solid #b6d7ff;
}

.corporate-table {
    background: linear-gradient(to bottom, #e2e3e5 0%, #f8f9fa 100%);
    border: 1px solid #ced4da;
}

.modern-table {
    background: linear-gradient(to bottom, #fce4ec 0%, #f8f9fa 100%);
    border: 1px solid #f8bbd9;
}

.gonzurq-green-table {
    background: linear-gradient(to bottom, #d4edda 0%, #f8f9fa 100%);
    border: 1px solid #a3d5a8;
}

.eco-fresh-table {
    background: linear-gradient(to bottom, #e8f5e8 0%, #f8f9fa 100%);
    border: 1px solid #c3e6cb;
}

.tech-green-table {
    background: linear-gradient(to bottom, #ccf2e8 0%, #f8f9fa 100%);
    border: 1px solid #7dcea0;
}

.template-table::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    height: 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.template-table::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.template-totals {
    height: 24px;
    background: #f1f3f5;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-left: auto;
    width: 60%;
}

/* Template Info */
.template-info {
    padding: 1.2rem;
}

.template-info h5 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.template-info p {
    margin: 0 0 1rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.template-select {
    width: 100%;
    justify-content: center;
    transition: all 0.3s ease;
}

.template-select:hover {
    transform: translateY(-1px);
}

.template-card.selected .template-select {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.template-card.selected .template-select:hover {
    background: var(--primary-color-dark);
}

/* Responsive Templates */
@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .template-preview {
        height: 160px;
    }
    
    .template-content {
        height: 100px;
    }
}

/* Template Animation */
@keyframes templateSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.template-card.applying {
    animation: templateSelect 0.6s ease-in-out;
}

/* Template Reset Section */
.template-reset-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #f39c12;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2);
}

.reset-info h4 {
    color: #d68910;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.reset-info p {
    color: #7d6608;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.reset-template-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.reset-template-btn:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.reset-template-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(243, 156, 18, 0.3);
}

/* Reset Button Animation */
@keyframes resetPulse {
    0% { box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3); }
    50% { box-shadow: 0 6px 25px rgba(243, 156, 18, 0.5); }
    100% { box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3); }
}

.reset-template-btn.highlighted {
    animation: resetPulse 2s infinite;
}

/* Activity Logs Styling */
.logs-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.log-entry:hover {
    background-color: #f8f9fa;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.sistema {
    border-left: 4px solid #007bff;
}

.log-entry.usuario {
    border-left: 4px solid #28a745;
}

.log-time {
    font-size: 0.875rem;
    color: #6c757d;
    min-width: 150px;
    font-family: 'Courier New', monospace;
}

.log-action {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
}

.log-source {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 70px;
    text-align: center;
}

.log-entry.sistema .log-source {
    background-color: #e3f2fd;
    color: #1976d2;
}

.log-entry.usuario .log-source {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.no-logs {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px;
}

.no-logs i {
    margin-right: 8px;
    font-size: 1.2em;
}

/* System Status Improvements */
.system-status .status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.status-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #28a745;
}

.status-indicator.online {
    background-color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

.status-info {
    flex: 1;
}

.status-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.status-value {
    font-weight: 600;
    color: #333;
}
