/* ========================================
   WARRANTY & VISIT TRACKER STYLES
   ======================================== */

/* ========================================
   WARRANTY ALERTS
   ======================================== */

.warranty-alerts-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.alert-stat {
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.alert-stat.critical {
    background: #fee2e2;
}

.alert-stat.warning {
    background: #fef3c7;
}

.alert-stat.attention {
    background: #fef9c3;
}

.alert-stat .stat-number {
    font-size: 32px;
    font-weight: 700;
}

.alert-stat .stat-label {
    font-size: 14px;
    color: #4b5563;
}

/* Warranty Cards */
.warranty-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.warranty-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border-left: 5px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
}

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

.warranty-card.urgency-expired,
.warranty-card.urgency-critical {
    border-left-color: #dc2626;
    background: linear-gradient(135deg, #fff 0%, #fee2e2 100%);
}

.warranty-card.urgency-warning {
    border-left-color: #d97706;
    background: linear-gradient(135deg, #fff 0%, #fef3c7 100%);
}

.warranty-card.urgency-attention {
    border-left-color: #ca8a04;
    background: linear-gradient(135deg, #fff 0%, #fef9c3 100%);
}

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

.warranty-icon {
    font-size: 24px;
}

.warranty-days {
    font-weight: 700;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 20px;
}

.warranty-days.expired,
.warranty-days.critical {
    background: #dc2626;
    color: white;
}

.warranty-days.warning {
    background: #d97706;
    color: white;
}

.warranty-days.attention {
    background: #ca8a04;
    color: white;
}

.warranty-model {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.warranty-serial {
    font-size: 13px;
    color: #6b7280;
    font-family: monospace;
}

.warranty-customer {
    font-size: 14px;
    color: #4b5563;
    margin-top: 8px;
}

.warranty-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.warranty-expiry {
    font-size: 12px;
    color: #6b7280;
}

/* ========================================
   WARRANTY DETAIL MODAL
   ======================================== */

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #1f2937;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.detail-item {
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.detail-item label {
    display: block;
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.detail-item value {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

/* Warranty Coverage Grid */
.warranty-coverage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.warranty-coverage-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    border: 2px solid #e5e7eb;
}

.warranty-coverage-item.active {
    border-color: #059669;
    background: #d1fae5;
}

.warranty-coverage-item.expiring {
    border-color: #d97706;
    background: #fef3c7;
}

.warranty-coverage-item.expired {
    border-color: #dc2626;
    background: #fee2e2;
}

.coverage-type {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.coverage-period {
    font-size: 13px;
    color: #6b7280;
}

.coverage-expiry {
    font-size: 12px;
    color: #6b7280;
    margin: 8px 0;
}

.coverage-status {
    font-weight: 600;
    font-size: 14px;
}

/* Claims List */
.claims-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.claim-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    border-left: 4px solid #e5e7eb;
}

.claim-item.status-pending {
    border-left-color: #d97706;
}

.claim-item.status-submitted {
    border-left-color: #3b82f6;
}

.claim-item.status-approved {
    border-left-color: #059669;
}

.claim-item.status-rejected {
    border-left-color: #dc2626;
}

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

.claim-number {
    font-weight: 600;
    color: #1f2937;
}

.claim-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.claim-status.pending {
    background: #fef3c7;
    color: #d97706;
}

.claim-status.submitted {
    background: #dbeafe;
    color: #2563eb;
}

.claim-status.approved {
    background: #d1fae5;
    color: #059669;
}

.claim-status.rejected {
    background: #fee2e2;
    color: #dc2626;
}

.claim-type {
    font-weight: 500;
    margin-bottom: 4px;
}

.claim-desc {
    font-size: 13px;
    color: #6b7280;
}

.claim-date {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

.no-data {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Claim Equipment Summary */
.claim-equipment-summary {
    background: #f0f9ff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid #bae6fd;
}

.claim-equipment-summary div {
    margin: 4px 0;
    font-size: 14px;
}

/* ========================================
   AMC VISIT TRACKER
   ======================================== */

.visit-tracker {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.tracker-title h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
}

.contract-number {
    font-size: 13px;
    color: #6b7280;
    font-family: monospace;
}

.tracker-progress {
    text-align: center;
}

.progress-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(
        #059669 0% var(--progress),
        #e5e7eb var(--progress) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    width: 64px;
    height: 64px;
    background: white;
    border-radius: 50%;
    position: absolute;
}

.progress-text {
    position: relative;
    z-index: 1;
    font-size: 18px;
    font-weight: 700;
    color: #059669;
}

.progress-label {
    font-size: 12px;
    color: #6b7280;
    display: block;
    margin-top: 8px;
}

.tracker-period {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #4b5563;
}

.visit-type-badge {
    background: #dbeafe;
    color: #2563eb;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Visit Timeline */
.visit-timeline {
    position: relative;
    padding-left: 40px;
}

.visit-timeline-item {
    display: flex;
    position: relative;
    margin-bottom: 24px;
}

.visit-timeline-item:last-child {
    margin-bottom: 0;
}

.visit-timeline-item:last-child .marker-line {
    display: none;
}

.timeline-marker {
    position: absolute;
    left: -40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.marker-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 1;
}

.visit-timeline-item.completed .marker-icon {
    background: #d1fae5;
}

.visit-timeline-item.scheduled .marker-icon {
    background: #dbeafe;
}

.visit-timeline-item.overdue .marker-icon {
    background: #fee2e2;
}

.marker-line {
    width: 2px;
    flex: 1;
    min-height: 40px;
    background: #e5e7eb;
    margin-top: 4px;
}

.timeline-content {
    flex: 1;
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}

.visit-timeline-item.completed .timeline-content {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.visit-timeline-item.scheduled .timeline-content {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.visit-timeline-item.overdue .timeline-content {
    background: #fef2f2;
    border-color: #fecaca;
}

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

.visit-number {
    font-weight: 700;
    font-size: 15px;
}

.visit-type {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 12px;
}

.visit-type.wet {
    background: #dbeafe;
    color: #2563eb;
}

.visit-type.dry {
    background: #fef3c7;
    color: #d97706;
}

.visit-details {
    font-size: 14px;
    color: #4b5563;
}

.visit-date,
.visit-tech,
.visit-proof {
    margin: 4px 0;
}

.visit-proof {
    color: #059669;
    font-size: 12px;
    font-weight: 500;
}

.visit-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.tracker-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.no-schedule {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.no-schedule p {
    margin: 0 0 16px 0;
}

/* ========================================
   COMPLETE VISIT MODAL STYLES
   ======================================== */

.complete-visit-info {
    background: #f0fdf4;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid #bbf7d0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 14px;
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #1f2937;
}

/* Checklist */
.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.checklist-item:hover {
    background: #f3f4f6;
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #059669;
}

.checklist-item .item-label {
    font-size: 14px;
}

/* Photo Upload */
.photo-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.photo-upload-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.photo-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.photo-dropzone:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.dropzone-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.dropzone-text {
    font-size: 13px;
    color: #6b7280;
}

.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.photo-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
}

/* Readings Grid */
.readings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.readings-grid .form-group label {
    font-size: 12px;
    color: #6b7280;
}

/* Signature */
.signature-container {
    position: relative;
}

#signatureCanvas {
    width: 100%;
    max-width: 500px;
    height: 150px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: white;
    cursor: crosshair;
    touch-action: none;
}

.signature-container .btn-small {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Large Checkbox */
.checkbox-label.large {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    cursor: pointer;
}

.checkbox-label.large input[type="checkbox"] {
    width: 24px;
    height: 24px;
}

/* Schedule AMC Info */
.schedule-amc-info {
    background: #eff6ff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid #bfdbfe;
}

.schedule-amc-info div {
    margin: 4px 0;
    font-size: 14px;
}

/* ========================================
   STATUS BADGES
   ======================================== */

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.scheduled {
    background: #dbeafe;
    color: #2563eb;
}

.status-badge.completed {
    background: #d1fae5;
    color: #059669;
}

.status-badge.active {
    background: #d1fae5;
    color: #059669;
}

.status-badge.expired {
    background: #fee2e2;
    color: #dc2626;
}

.status-badge.submitted {
    background: #e0e7ff;
    color: #4f46e5;
}

.status-badge.approved {
    background: #d1fae5;
    color: #059669;
}

.status-badge.rejected {
    background: #fee2e2;
    color: #dc2626;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .warranty-alerts-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .warranty-list {
        grid-template-columns: 1fr;
    }
    
    .tracker-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .tracker-progress {
        align-self: center;
    }
    
    .tracker-period {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .photo-upload-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .checklist-grid {
        grid-template-columns: 1fr;
    }
    
    .readings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .visit-timeline {
        padding-left: 32px;
    }
    
    .timeline-marker {
        left: -32px;
    }
    
    .marker-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}
