/* Estilos idénticos al original */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        margin: 1.6cm;
        width: 21cm;
        height: 29.7cm;
    }

    .no-print {
        display: none !important;
    }

    .logo-upload-container {
        border: none !important;
        background: transparent !important;
    }

    header,
    footer {
        display: none !important;
    }

    .container {
        box-shadow: none;
        border: none;
    }
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 20px;
    background-color: #f5f7f9;
    color: #333;
    line-height: 1.6;
}

/* Micro-interactions */
button,
input,
select,
textarea,
.nav-btn,
.action-btn {
    transition: all 0.2s ease-in-out;
}

table tr {
    transition: background-color 0.1s ease;
}

tbody tr:hover {
    background-color: #f1f8e9;
    /* Light green hover matching theme */
}

/* Scrollbar beautification */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

.container {
    max-width: 21cm;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background-color: white;
    border-radius: 8px;
}

.header-info {
    text-align: left;
}

.logo-upload-container {
    width: 1.5in;
    height: 1.5in;
    border: 1px dashed #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    background-color: #f9f9f9;
    border-radius: 4px;
    overflow: hidden;
}

.logo-upload-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-upload-text {
    text-align: center;
    padding: 10px;
    color: #666;
}

#logo-upload {
    display: none;
}

.info-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 20px;
}

.client-info,
.invoice-info {
    width: 48%;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
}

.client-info p,
.invoice-info p,
.header-info p {
    margin: 5px 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th,
td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

th {
    background-color: #4CAF50;
    color: white;
}

.totals {
    text-align: right;
    margin-bottom: 20px;
    font-size: 1.1em;
    padding: 15px;
    background-color: #f0f7f0;
    border-radius: 6px;
    border: 1px solid #4CAF50;
}

.form-actions {
    margin-top: 20px;
    text-align: center;
}

button {
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    margin: 0 10px;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.required:after {
    content: " *";
    color: red;
}

/* Base form field styling - enhanced version at bottom of file */
select,
input,
textarea {
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fff;
}

select:focus,
input:focus,
textarea:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    outline: none;
}

textarea {
    min-height: 60px;
    line-height: 1.6;
    resize: vertical;
}

.delete-btn {
    background-color: #f44336;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 3px;
}

.delete-btn:hover {
    background-color: #d32f2f;
}

h2 {
    color: #2c3e50;
    margin-bottom: 5px;
}

h3 {
    color: #4CAF50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
}

.notification.error {
    background-color: #f44336;
}

.pdf-btn {
    background-color: #e74c3c;
}

.pdf-btn:hover {
    background-color: #c0392b;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    margin: 30px auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.close-modal:hover {
    color: #000;
}

/* Layout Styles */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid #34495e;
    text-align: center;
}

.sidebar-header h3 {
    margin: 0;
    color: #ecf0f1;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    background-color: transparent;
    border: 1px solid transparent;
    color: #bdc3c7;
    text-align: left;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 6px;
    margin: 0;
}

.nav-btn:hover {
    background-color: #34495e;
    color: white;
    transform: translateX(5px);
}

.main-content {
    flex-grow: 1;
    padding: 20px;
    background-color: #f5f7f9;
}

.container {
    max-width: 21cm;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background-color: white;
    border-radius: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.form-grid label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.full-width {
    grid-column: span 2;
}

/* Print Styles Adjustment */
@media print {
    .app-layout {
        display: block;
    }

    .sidebar {
        display: none !important;
    }

    .main-content {
        padding: 0;
        margin: 0;
    }
}

/* ===== VISUAL IMPROVEMENTS ===== */

/* Visual Improvement #1: Loading Spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

button.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

button.loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Visual Improvement #2: Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Appointment Status Colors */
.status-badge.scheduled {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #90caf9;
}

.status-badge.confirmed {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

.status-badge.completed {
    background-color: #f5f5f5;
    color: #616161;
    border: 1px solid #bdbdbd;
}

.status-badge.cancelled {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Invoice/Payment Status Colors */
.status-badge.in_transit,
.status-badge.pending {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
}

.status-badge.paid {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

.status-badge.denied {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Visual Improvement #3: Enhanced Form Fields */
select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="file"],
textarea {
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
}

select:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
textarea:hover {
    border-color: #bdbdbd;
}

select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="file"]:focus,
textarea:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    outline: none;
    background-color: #fafffe;
}

/* Enhanced Required Field Indicator */
label.required {
    position: relative;
    font-weight: 500;
}

label.required::after {
    content: " *";
    color: #e74c3c;
    font-weight: bold;
    margin-left: 2px;
}

/* Improved Form Grid Spacing */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.form-grid label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

/* Better Textarea Styling */
textarea {
    min-height: 60px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
}

textarea::-webkit-scrollbar {
    width: 6px;
}

textarea::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 3px;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: #9e9e9e;
}

/* Input Validation States */
input.error,
select.error,
textarea.error {
    border-color: #e74c3c;
    background-color: #fff5f5;
}

input.success,
select.success,
textarea.success {
    border-color: #4CAF50;
    background-color: #f0fff4;
}

/* Disabled State Improvements */
input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* Action Button Enhancements */
.action-btn {
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.action-btn.edit-btn {
    background-color: #3498db;
    color: white;
}

.action-btn.edit-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.action-btn.delete-btn {
    background-color: #e74c3c;
    color: white;
}

.action-btn.delete-btn:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.action-btn.view-btn {
    background-color: #9b59b6;
    color: white;
}

.action-btn.view-btn:hover {
    background-color: #8e44ad;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(155, 89, 182, 0.3);
}