* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.register-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    max-width: 1000px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.8s ease-out;
}

/* Sistema de Abas */
.tabs-container {
    display: flex;
    border-bottom: 2px solid #e1e5e9;
    margin-bottom: 25px;
}

.tab {
    flex: 1;
    padding: 15px 20px;
    text-align: center;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: #666;
    transition: all 0.3s ease;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    margin-right: 2px;
}

.tab:last-child {
    margin-right: 0;
}

.tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-bottom: 2px solid transparent;
}

.tab:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.coming-soon {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.coming-soon h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #495057;
}

/* Campos dinâmicos */
.dynamic-section {
    margin-bottom: 20px;
}

.dynamic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dynamic-item .form-input {
    flex: 1;
}

.add-button {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.add-button:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: scale(1.1);
}

.remove-button {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.remove-button:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: scale(1.1);
}

/* Select styling */
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Botões clínicos */
.clinical-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.clinical-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: #495057;
}

.clinical-btn:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    border-color: #667eea;
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.btn-text {
    font-weight: 600;
    margin-bottom: 4px;
}

.btn-count {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Popup styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-overlay.active {
    display: flex;
}

.popup-container {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    animation: popupSlide 0.3s ease-out;
}

@keyframes popupSlide {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.popup-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.popup-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.popup-list {
    margin-bottom: 20px;
}

.popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.popup-item input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    padding: 5px;
}

.popup-item input:focus {
    outline: none;
    background: white;
    border-radius: 4px;
}

.popup-add-section {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.popup-add-section .form-input {
    flex: 1;
}

.popup-footer {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: #f8f9fa;
    justify-content: flex-end;
}

.popup-save-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.popup-save-btn:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
}

.popup-cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.popup-cancel-btn:hover {
    background: #5a6268;
}

@media (max-width: 768px) {
    .clinical-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .popup-container {
        width: 95%;
        max-height: 90vh;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.register-header {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.register-title {
    font-size: 1.6rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.doctor-name {
    font-size: 1.6rem;
    font-weight: 600;
    color: #e74c3c;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(231, 76, 60, 0.3);
}

.register-subtitle {
    color: #666;
    font-size: 1.1rem;
    font-weight: 400;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: #adb5bd;
}

.phone-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.name-group {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
}

.address-group {
    display: grid;
    grid-template-columns: 3fr 1fr 2fr;
    gap: 15px;
}

/* Botão verde pequeno alinhado à direita - v2 */
.submit-button {
    width: 20% !important;
    padding: 12px 20px !important;
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 10px !important;
    margin-left: auto !important;
    display: block !important;
}

.submit-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3) !important;
    background: linear-gradient(135deg, #218838, #1e7e34) !important;
}

.submit-button:active {
    transform: translateY(0);
}

.privacy-notice {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.privacy-notice a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.privacy-notice a:hover {
    text-decoration: underline;
}

.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape:nth-child(3) {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@media (max-width: 768px) {
    .register-container {
        padding: 30px 20px;
        margin: 10px;
    }

    .register-header {
        flex-direction: column;
        gap: 10px;
    }

    .register-title {
        font-size: 1.5rem;
    }

    .doctor-name {
        font-size: 1.5rem;
    }

    .phone-group,
    .name-group,
    .address-group {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Sistema de Agendamentos */
.schedule-section {
    padding: 20px 0;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.schedule-header h3 {
    color: #333;
    font-size: 1.5rem;
    margin: 0;
}

.add-schedule-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.add-schedule-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(40, 167, 69, 0.4);
}

.schedule-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 15px;
    background: #f8f9fa;
}

.empty-schedule {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

.schedule-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 15px;
    align-items: center;
    border-left: 4px solid #007bff;
    transition: all 0.3s ease;
}

.schedule-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.schedule-item.attended {
    border-left-color: #28a745;
    background: #f8fff9;
}

.schedule-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.schedule-datetime {
    display: flex;
    gap: 10px;
    align-items: center;
}

.schedule-date {
    font-weight: 600;
    color: #333;
}

.schedule-time {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #495057;
}

.schedule-type {
    font-size: 0.9rem;
    color: #666;
    text-transform: capitalize;
}

.schedule-status {
    display: flex;
    align-items: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input[type="checkbox"]:checked+.checkmark {
    background: #28a745;
    border-color: #28a745;
}

.checkbox-container input[type="checkbox"]:checked+.checkmark::after {
    content: "✓";
    position: absolute;
    top: -2px;
    left: 3px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 0.9rem;
    color: #666;
}

.schedule-actions {
    display: flex;
    gap: 8px;
}

.notes-btn,
.edit-btn,
.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.notes-btn:hover {
    background: #e3f2fd;
}

.edit-btn:hover {
    background: #fff3e0;
}

.delete-btn:hover {
    background: #ffebee;
}

/* Textarea para anotações */
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Responsividade para agendamentos */
@media (max-width: 768px) {
    .schedule-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .schedule-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: left;
    }

    .schedule-datetime {
        justify-content: space-between;
    }

    .schedule-actions {
        justify-content: center;
    }
}

/* Funcionalidades de Upload de Imagem */
.notes-popup {
    max-width: 800px;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.upload-btn {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    align-self: flex-start;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(23, 162, 184, 0.4);
}

.upload-info {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.images-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
}

.image-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-container {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-container img:hover {
    transform: scale(1.05);
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-image-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

.image-info {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.image-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-size {
    font-size: 0.7rem;
    color: #666;
}

/* Modal para visualização de imagem em tela cheia */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.image-modal-content {
    background: white;
    border-radius: 10px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.image-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.image-modal-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.image-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.image-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.image-modal-body {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: calc(90vh - 80px);
    overflow: auto;
}

.image-modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Responsividade para upload de imagens */
@media (max-width: 768px) {
    .notes-popup {
        max-width: 95vw;
    }

    .images-preview {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .image-container {
        height: 100px;
    }

    .image-modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .image-modal-header {
        padding: 10px 15px;
    }

    .image-modal-body {
        padding: 15px;
    }
}

/* Aba Histórico */
.history-section {
    padding: 20px 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.history-header h3 {
    color: #333;
    font-size: 1.5rem;
    margin: 0;
}

.history-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.history-controls select {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
}

.global-images-btn {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    white-space: nowrap;
}

.global-images-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(23, 162, 184, 0.4);
}

.history-list {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 15px;
    background: #f8f9fa;
}

.empty-history {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

.history-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #dc3545;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.history-item.attended {
    border-left-color: #28a745;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.history-header-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.history-datetime {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history-date {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.history-time {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #495057;
    text-align: center;
}

.history-type {
    font-size: 1rem;
    color: #666;
    text-transform: capitalize;
    text-align: center;
}

.history-status {
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-align: center;
}

.history-status.attended {
    background: #d4edda;
    color: #155724;
}

.history-status.not-attended {
    background: #f8d7da;
    color: #721c24;
}

.history-content {
    margin-top: 15px;
}

.history-notes-section {
    margin-bottom: 20px;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.notes-header label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.edit-notes-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-notes-btn:hover {
    background: #ffcd39;
    transform: translateY(-1px);
}

.history-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    background: #f8f9fa;
    color: #333;
    resize: none;
    line-height: 1.5;
}

.history-images-section {
    margin-top: 20px;
}

.history-images-section label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.history-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.history-image-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e1e5e9;
}

.history-image-item:hover {
    transform: scale(1.05);
    border-color: #007bff;
}

.history-image-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.history-image-item .image-name {
    display: block;
    padding: 6px 8px;
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #f8f9fa;
}

/* Responsividade para histórico */
@media (max-width: 768px) {
    .history-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .history-controls {
        flex-direction: column;
        gap: 10px;
    }

    .history-header-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }

    .history-datetime {
        align-items: center;
    }

    .history-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .history-image-item img {
        height: 60px;
    }

    .notes-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

/* Botão para gerenciar imagens no histórico */
.images-manager-btn {
    background: linear-gradient(135deg, #6f42c1, #563d7c);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    width: 100%;
    margin-top: 15px;
}

.images-manager-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(111, 66, 193, 0.4);
}

/* Gerenciador de Imagens - Popup em tela cheia */
.images-manager {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}

.images-manager.active {
    display: flex !important;
    opacity: 1;
}

.images-manager-container {
    background: white;
    border-radius: 15px;
    width: 95vw;
    height: 90vh;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.images-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #e1e5e9;
    background: #f8f9fa;
}

.images-manager-header h2 {
    color: #333;
    font-size: 1.5rem;
    margin: 0;
}

.images-manager-content {
    flex: 1;
    padding: 25px 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.images-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    flex: 1;
}

.manager-image-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.manager-image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.manager-image-container {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.manager-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
}

.manager-image-container:hover img {
    transform: scale(1.05);
}

.manager-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    transition: all 0.3s ease;
}

.manager-image-container:hover .manager-image-overlay {
    opacity: 1;
}

.manager-view-btn,
.manager-delete-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.manager-view-btn:hover {
    background: #007bff;
    color: white;
    transform: scale(1.1);
}

.manager-delete-btn:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

.manager-image-info {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.manager-image-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manager-image-size {
    color: #666;
    font-size: 0.8rem;
}

.images-manager-empty {
    flex: 1;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #666;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.empty-icon {
    font-size: 4rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #999;
    margin: 0;
}

.empty-state p {
    font-size: 1rem;
    color: #aaa;
    margin: 0;
}

.images-manager-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-top: 2px solid #e1e5e9;
    background: #f8f9fa;
}

.images-counter {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.images-counter span {
    color: #007bff;
}

/* Responsividade para gerenciador de imagens */
@media (max-width: 768px) {
    .images-manager-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .images-manager-header {
        padding: 15px 20px;
    }

    .images-manager-header h2 {
        font-size: 1.2rem;
    }

    .images-manager-content {
        padding: 20px;
    }

    .images-manager-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .manager-image-container {
        height: 120px;
    }

    .manager-view-btn,
    .manager-delete-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .images-manager-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }

    .empty-icon {
        font-size: 3rem;
    }

    .empty-state h3 {
        font-size: 1.2rem;
    }
}