/* Reseteo general */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

/* Estilos para la página de login */
.login-body {
    background-color: #e9ecef;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-form {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
}

.login-form h1 {
    color: #007bff;
    margin-bottom: 10px;
}

.login-form h2 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #0069d9;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Estilos para el dashboard */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #343a40;
    color: #fff;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    transition: all 0.3s;
}

.sidebar-header {
    padding: 20px;
    background-color: #2c3136;
    text-align: center;
}

.user-info {
    padding: 20px;
    border-bottom: 1px solid #454d55;
    display: flex;
    align-items: center;
}

.user-avatar {
    margin-right: 10px;
}

.user-avatar i {
    font-size: 2rem;
}

.user-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.user-role {
    font-size: 0.8rem;
    color: #adb5bd;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: block;
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-menu a:hover {
    background-color: #2c3136;
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    transition: all 0.3s;
}

.main-header {
    background-color: #fff;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    margin-right: 15px;
    cursor: pointer;
    font-size: 1.2rem;
}

.header-title h2 {
    font-size: 1.5rem;
    color: #343a40;
}

.content {
    padding: 20px;
}

.main-footer {
    background-color: #fff;
    padding: 15px 20px;
    text-align: center;
    margin-left: 250px;
    border-top: 1px solid #ddd;
}

/* Tarjetas para dashboard */
.card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-title {
    font-size: 1.2rem;
    color: #343a40;
    margin-bottom: 5px;
}

/* Grid para dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Tablas */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

table tr:hover {
    background-color: #f5f5f5;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
    border: none;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Formularios */
.form-card {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* Estilos para pantallas pequeñas */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        transform: translateX(-250px);
    }
    
    .main-content, .main-footer {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .sidebar.active {
        width: 250px;
        transform: translateX(0);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Estilos específicos para módulos */

/* Radiografías */
.radiografia-preview {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 5px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.upload-area:hover {
    border-color: #007bff;
}

.upload-icon {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 15px;
}

/* Canvas para dibujar sobre radiografías */
.drawing-canvas {
    border: 1px solid #ddd;
    cursor: crosshair;
}

.drawing-controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

/* Calendario de citas */
.calendar {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.calendar-header {
    background-color: #007bff;
    color: white;
    padding: 15px;
    text-align: center;
}

.calendar-body {
    padding: 15px;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 5px;
}

.calendar-day {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.calendar-day.has-event {
    background-color: #e6f7ff;
    cursor: pointer;
}

.calendar-day.today {
    background-color: #f0f8ff;
    font-weight: bold;
}

/* Botones de contacto */
.contact-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    font-weight: bold;
}

.contact-btn.phone {
    background-color: #28a745;
}

.contact-btn.whatsapp {
    background-color: #25d366;
}

/* Progreso del tratamiento */
.progress-container {
    background-color: #e9ecef;
    border-radius: 5px;
    height: 25px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #007bff;
    text-align: center;
    color: white;
    line-height: 25px;
    transition: width 0.3s ease;
}

/* Estilos para el formulario de subida múltiple */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-group-half {
    flex: 0 0 calc(50% - 20px);
    margin: 0 10px;
}

.radiografia-item {
    margin-bottom: 25px;
    padding-bottom: 15px;
}

.divider {
    border: 0;
    border-top: 1px dashed #ddd;
    margin: 20px 0;
}

.required {
    color: #dc3545;
    margin-left: 3px;
}

/* Mensaje de notificación */
.notification {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 5px;
    position: relative;
}

.notification-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notification-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.notification-close {
    position: absolute;
    right: 10px;
    top: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
}

.notification.fade-out {
    opacity: 0;
    transition: opacity 0.5s;
}

@media (max-width: 768px) {
    .form-group-half {
        flex: 0 0 100%;
        margin: 0 0 20px 0;
    }
}

/* Estilos para la sección de reportes */
.reports-container {
    max-width: 1200px;
    margin: 0 auto;
}

.reports-header {
    background: linear-gradient(135deg, #3f51b5 0%, #00bcd4 100%);
    padding: 30px;
    border-radius: 15px;
    color: white;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.reports-header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.reports-header p {
    font-size: 1.1em;
    opacity: 0.9;
    max-width: 80%;
}

.report-filters {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.report-filters h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #3f51b5;
    font-size: 1.3em;
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.filter-group select,
.filter-group input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-generate {
    background: #3f51b5;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-generate:hover {
    background: #303f9f;
    transform: translateY(-2px);
}

.btn-generate i {
    margin-right: 8px;
}

.report-preview {
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    overflow: hidden;
}

.report-preview-header {
    background-color: #3f51b5;
    color: white;
    padding: 15px 20px;
    font-size: 1.2em;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.export-options {
    display: flex;
    gap: 10px;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    color: white;
    font-size: 0.8em;
    transition: background 0.3s;
}

.export-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.export-btn i {
    margin-right: 5px;
}

.report-preview-body {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th {
    background-color: #f5f6fa;
    color: #3f51b5;
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.report-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.report-table tr:hover {
    background-color: #f8f9fa;
}

.report-table tr:last-child td {
    border-bottom: none;
}

.report-summary {
    background-color: #f5f6fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.report-summary h3 {
    color: #3f51b5;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.report-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.report-summary li {
    margin-bottom: 5px;
}

.report-summary ul ul {
    padding-left: 20px;
    margin-top: 5px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #777;
}

.empty-state i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

@media print {
    .sidebar, .main-header, .main-footer, .report-filters, .export-options, .filter-actions {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .report-preview {
        box-shadow: none !important;
    }
    
    .report-preview-body {
        max-height: none !important;
    }
    
    .report-table th {
        background-color: #f5f6fa !important;
        color: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    body {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .reports-header {
        background: none !important;
        color: #333 !important;
        padding: 0 !important;
        margin-bottom: 20px !important;
        box-shadow: none !important;
    }
    
    .reports-header h1 {
        font-size: 1.8em !important;
    }
    
    .reports-header p {
        display: none !important;
    }
    
    .report-preview-header {
        background-color: transparent !important;
        color: #333 !important;
        border-bottom: 2px solid #333 !important;
    }
}