* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

.header {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.greeting {
    display: flex;
    flex-direction: column;
}

.greeting h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.date {
    font-size: 0.875rem;
    opacity: 0.9;
}

.profile-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quick-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: rgba(255,255,255,0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-number {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.hoje { color: #0f766e; }
.proximas { color: #ea580c; }
.concluidas { color: #16a34a; }

.main-content {
    padding: 0 1rem 6rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.view-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0.25rem;
}

.toggle-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.toggle-btn.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #0f766e;
    font-weight: 500;
}

.filter-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #e2e8f0;
}

.weekly-view {
    display: none;
    background: white;
    border-radius: 16px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.weekly-view.active {
    display: block !important;
}

.week-header {
    background: #f8fafc;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.week-navigation {
    display: flex;
    gap: 0.5rem;
}

.week-nav-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    color: #64748b;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.day-column {
    border-right: 1px solid #e2e8f0;
    min-height: 200px;
}

.day-column:last-child {
    border-right: none;
}

.day-header {
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}

.day-header.today {
    background: #0f766e;
    color: white;
}

.day-visits {
    padding: 0.5rem 0.25rem;
}

.mini-visit {
    background: #dcfdf7;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    padding: 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.625rem;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-visit:hover {
    background: #a7f3d0;
}

.mini-visit.priority-high {
    background: #fee2e2;
    border-color: #fca5a5;
}

.mini-visit.priority-urgent {
    background: #fef3c7;
    border-color: #fcd34d;
    animation: pulse 2s infinite;
}

.visit-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    position: relative;
}

.visit-card.completed {
    opacity: 0.7;
    border-left: 4px solid #16a34a;
}

.visit-card.cancelled {
    opacity: 0.5;
    border-left: 4px solid #dc2626;
}

.visit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.time-badge {
    background: #0f766e;
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: fit-content;
}

.priority-high .time-badge { 
    background: #dc2626; 
}

.priority-urgent .time-badge { 
    background: #ea580c; 
    animation: pulse 2s infinite; 
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.4); }
    50% { box-shadow: 0 0 0 5px rgba(234, 88, 12, 0); }
}

.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.client-info {
    flex: 1;
    margin-right: 1rem;
}

.client-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.visit-type {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.visit-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.detail-icon {
    width: 16px;
    color: #64748b;
    flex-shrink: 0;
    text-align: center;
}

.detail-text {
    flex: 1;
    color: #374151;
}

.problem-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: auto;
}

.problem-normal {
    background: #f0f9ff;
    color: #0369a1;
}

.problem-high {
    background: #fef3c7;
    color: #92400e;
}

.problem-urgent {
    background: #fee2e2;
    color: #991b1b;
}

.actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.actions-row.extended {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-maps {
    background: #dcfdf7;
    color: #0f766e;
    border: 1px solid #a7f3d0;
}

.btn-call {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.btn-report {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.btn-cancel {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.btn-reschedule {
    background: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.floating-actions {
    position: fixed;
    bottom: 80px;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 50;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s;
    border: none;
}

.fab:hover {
    transform: scale(1.1);
}

.fab-primary {
    background: #0f766e;
}

.fab-secondary {
    background: #7c3aed;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s;
}

.nav-item.active {
    color: #0f766e;
}

.nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    font-size: 0.875rem;
    color: #64748b;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
}

.form-input:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-primary {
    background: #0f766e;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-primary:hover {
    background: #0d5c58;
}

.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.route-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

.route-icon {
    color: #0369a1;
    font-size: 1.125rem;
}

.route-text {
    flex: 1;
    font-size: 0.875rem;
    color: #0369a1;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notification badge for quick actions */
.quick-action-btn .notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Enhanced form validation */
.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group .error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.form-group.has-error .error-message {
    display: block;
}

/* Loading states */
.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Week view enhancements */
.day-header .visit-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 12px;
    font-size: 0.625rem;
    margin-left: 0.25rem;
}

.day-header.today .visit-count {
    background: rgba(255, 255, 255, 0.3);
}

.loading-spinner {
    border: 4px solid #e2e8f0;
    border-top: 4px solid #0f766e;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: #0f766e;
}

/* Next Visit Preview - Modern Beautiful Design */
.next-visit-preview {
    margin-bottom: 1rem;
}

/* Header Section */
.next-visit-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px 16px 0 0;
    border: 1px solid #e2e8f0;
}

.status-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.status-icon.relaxed {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.status-text h3 {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.status-text p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

/* Next Visit Card */
.next-visit-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 16px 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.next-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visit-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    color: #0f766e;
    font-weight: 600;
    font-size: 1.125rem;
}

/* Date Display */
.visit-date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #bae6fd;
}

.day-name {
    color: #0369a1;
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: capitalize;
}

.date-number {
    color: #0f766e;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    min-width: 48px;
    text-align: center;
}

.month-name {
    color: #0369a1;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Client Section */
.client-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.client-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.client-details {
    flex: 1;
}

.client-name {
    color: #1e293b;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.client-address {
    color: #64748b;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.client-address i {
    color: #ef4444;
    font-size: 0.75rem;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn-navigate {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: white;
    border: none;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-navigate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 118, 110, 0.4);
    filter: brightness(1.1);
}

.btn-view-all {
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-view-all:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    color: #475569;
}

/* No Visits Card */
.no-visits-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 16px 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.relaxed-message {
    margin-bottom: 2rem;
}

.relaxed-message i {
    font-size: 2.5rem;
    color: #f59e0b;
    margin-bottom: 1rem;
}

.relaxed-message h4 {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.relaxed-message p {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
}

.btn-add-visit {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    border: none;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-add-visit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
    filter: brightness(1.1);
}

/* Profile Dashboard Styles */
.profile-dashboard {
    min-height: 100vh;
    background: #f8fafc;
    padding-bottom: 2rem;
}

.profile-header {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: white;
    padding: 2rem 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.profile-header .header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    backdrop-filter: blur(10px);
}

.user-info h1 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.user-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: auto;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.profile-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: grid;
    gap: 2rem;
}

.profile-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h2 {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header h2 i {
    color: #0f766e;
}

.card-header p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.card-body {
    padding: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-note {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-note i {
    color: #3b82f6;
    margin-right: 0.25rem;
}

.calendar-status {
    margin: 1rem 0;
}

.status-connected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #16a34a;
    font-weight: 500;
}

.status-connected i {
    color: #22c55e;
}

.status-disconnected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #dc2626;
    font-weight: 500;
}

.status-disconnected i {
    color: #ef4444;
}

.security-info {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.info-label {
    font-weight: 500;
    color: #64748b;
}

.info-value {
    color: #1e293b;
    font-weight: 500;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-logout {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Password strength indicator */
.password-strength {
    margin-top: 0.5rem;
}

.strength-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s;
    border-radius: 2px;
}

.strength-indicator.weak .strength-fill {
    background: #ef4444;
}

.strength-indicator.medium .strength-fill {
    background: #f59e0b;
}

.strength-indicator.strong .strength-fill {
    background: #22c55e;
}

.strength-text {
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 80px;
}

.strength-feedback {
    margin-top: 0.25rem;
}

.strength-feedback small {
    color: #64748b;
    font-size: 0.75rem;
}

/* Message system */
#message-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s;
}

.message.show {
    transform: translateX(0);
    opacity: 1;
}

.message-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.message-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.message-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.message-info {
    background: linear-gradient(135deg, #0369a1, #0284c7);
}

.message-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.message-close:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .view-controls {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .days-grid {
        grid-template-columns: 1fr;
    }

    .day-column {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .actions-row.extended {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Next Visit Preview - Mobile */
    .next-visit-header {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .status-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .status-text h3 {
        font-size: 1.125rem;
    }
    
    .next-visit-card,
    .no-visits-card {
        padding: 1.25rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .visit-date {
        padding: 1.25rem;
        gap: 0.5rem;
    }
    
    .date-number {
        font-size: 1.75rem;
    }
    
    .client-section {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .client-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .client-name {
        font-size: 1rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .actions-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .action-btn {
        font-size: 0.75rem;
        padding: 0.625rem 0.5rem;
    }
    
    .btn-report {
        grid-column: span 2;
    }

    .modal-content {
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: none;
    }
}

/* ===== VISIT MANAGEMENT MODALS ===== */

.visit-modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    overflow-y: auto;
}

.visit-modal .modal-content {
    background: white;
    border-radius: 20px;
    max-width: 520px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.visit-modal .modal-header {
    padding: 30px 30px 25px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc, #fff);
    border-radius: 20px 20px 0 0;
}

.visit-modal .modal-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.visit-modal .modal-close {
    background: #f1f5f9;
    border: none;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    color: #64748b;
    font-size: 1.2rem;
    transition: all 0.3s;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.visit-modal .modal-close:hover {
    background: #e2e8f0;
    color: #334155;
    transform: rotate(90deg);
}

.visit-modal .modal-body {
    padding: 30px;
}

/* Visit Info Section */
.visit-info {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 28px;
    border: 1px solid #e2e8f0;
    position: relative;
}

.visit-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00637c, #0891b2);
    border-radius: 16px 16px 0 0;
}

.visit-info p {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.visit-info p:last-child {
    margin-bottom: 0;
}

.visit-info strong {
    color: #1e293b;
    font-weight: 700;
    min-width: 120px;
}

/* Delay Options */
.delay-options h4,
.cancel-reason h4,
.contact-options h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 15px;
}

.delay-buttons,
.reason-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.delay-time-btn,
.reason-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 16px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.delay-time-btn:hover,
.reason-btn:hover {
    border-color: #00637c;
    background: #f0fdfa;
    color: #00637c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 99, 124, 0.15);
}

.delay-time-btn.active,
.reason-btn.active {
    background: linear-gradient(135deg, #00637c, #0891b2);
    border-color: #00637c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 99, 124, 0.25);
}

.delay-time-btn.active::before,
.reason-btn.active::before {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Contact Buttons */
.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-buttons.large {
    gap: 15px;
}

.contact-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 20px 24px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.contact-btn:hover {
    border-color: #00637c;
    background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 99, 124, 0.15);
}

.contact-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 99, 124, 0.2);
}

.contact-btn i {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.contact-btn.btn-call i {
    color: #059669;
}

.contact-btn.btn-whatsapp i {
    color: #25d366;
}

.contact-btn.btn-sms i {
    color: #3b82f6;
}

.contact-btn span {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
}

.contact-btn small {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 2px;
}

/* Message Preview */
.message-preview {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #00637c;
}

.message-preview h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.message-text {
    background: white;
    padding: 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Cancel Warning */
.cancel-warning {
    background: #fef3cd;
    border: 1px solid #f59e0b;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cancel-warning i {
    color: #f59e0b;
    font-size: 1.2rem;
    margin-top: 2px;
}

.cancel-warning p {
    color: #92400e;
    font-size: 0.95rem;
    margin: 0;
}

/* Cancel Actions */
.cancel-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cancel-actions .action-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.cancel-actions .btn-sms {
    background: #3b82f6;
    color: white;
}

.cancel-actions .btn-whatsapp {
    background: #25d366;
    color: white;
}

.cancel-actions .btn-confirm-cancel {
    background: #ef4444;
    color: white;
}

.cancel-actions .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Action Buttons in Visit Cards */
.actions-row.primary {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.actions-row.secondary {
    display: flex;
    gap: 8px;
    opacity: 0.9;
    margin-top: 8px;
}

.actions-row.primary .action-btn {
    flex: 1;
    background: linear-gradient(135deg, #00637c, #0891b2);
    color: white;
    border: none;
    padding: 14px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 70px;
    box-shadow: 0 2px 8px rgba(0, 99, 124, 0.2);
}

.actions-row.primary .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 99, 124, 0.3);
}

.actions-row.primary .action-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 99, 124, 0.4);
}

.actions-row.primary .action-btn i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.actions-row.primary .action-btn span {
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.2;
}

.actions-row.primary .btn-delay {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.actions-row.primary .btn-delay:hover {
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.actions-row.primary .btn-contact {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.actions-row.primary .btn-contact:hover {
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
}

.actions-row.primary .btn-cancel {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.actions-row.primary .btn-cancel:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

/* Floating Success Message */
.floating-message {
    position: fixed;
    top: 80px;
    left: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-out;
}

.floating-message.success {
    border-left: 4px solid #10b981;
}

.floating-message.success i {
    color: #10b981;
    font-size: 1.2rem;
}

.floating-message.show {
    opacity: 1;
    transform: translateY(0);
}

.floating-message span {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
}

/* Color Utilities */
.text-warning {
    color: #f59e0b;
}

.text-primary {
    color: #00637c;
}

.text-danger {
    color: #ef4444;
}

/* Zone Badges */
.zone-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 8px;
    color: white;
}

.zone-badge.zone-lisboa {
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

.zone-badge.zone-setubal {
    background: linear-gradient(135deg, #059669, #047857);
}

.zone-badge.zone-unknown {
    background: linear-gradient(135deg, #64748b, #475569);
}

.zone-badge i {
    font-size: 0.7rem;
}

/* Problem Description */
.problem-description {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 12px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
    color: #92400e;
    line-height: 1.4;
}

.problem-description i {
    color: #d97706;
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.problem-description span {
    font-weight: 500;
}

/* Detail Actions */
.detail-action {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    margin-left: 8px;
    font-size: 0.85rem;
}

.detail-action:hover {
    background: #f1f5f9;
    color: #0891b2;
    transform: scale(1.1);
}

/* Enhanced Detail Rows */
.detail-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-text {
    flex: 1;
    margin-left: 8px;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.4;
}

.detail-icon {
    width: 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* Client Name Enhancements */
.client-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Enhanced Visit Cards */
.visit-card {
    position: relative;
    overflow: hidden;
}

.visit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #0891b2, #059669);
    z-index: 1;
}

/* Mobile Optimizations for New Features */
@media (max-width: 768px) {
    .zone-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
        margin-left: 4px;
    }
    
    .zone-badge i {
        font-size: 0.6rem;
    }
    
    .problem-description {
        font-size: 0.85rem;
        padding: 10px 12px;
        margin: 8px 0;
    }
    
    .detail-action {
        padding: 6px;
        font-size: 0.9rem;
    }
    
    .client-name {
        font-size: 1.1rem;
        line-height: 1.3;
    }
}

/* Responsive Design for Modals */
@media (min-width: 768px) {
    .delay-buttons,
    .reason-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .contact-buttons:not(.large) {
        flex-direction: row;
    }
    
    .cancel-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .cancel-actions .action-btn {
        flex: none;
        min-width: 140px;
    }
    
    .floating-message {
        left: auto;
        right: 20px;
        max-width: 400px;
    }
    
    .actions-row.primary .action-btn,
    .actions-row.secondary .action-btn {
        flex-direction: row;
        gap: 6px;
        padding: 8px 12px;
    }
    
    .actions-row.primary .action-btn span,
    .actions-row.secondary .action-btn span {
        font-size: 0.85rem;
    }
    
    .zone-badge {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
    
    .problem-description {
        font-size: 0.95rem;
        padding: 14px 18px;
    }
}
}