/* ============================================================
   Tecnico Calendar & Work Requests
   ============================================================ */
.tecnico-calendar-container {
    max-width: 1000px;
}
.tecnico-calendar-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #6b7280;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot {
    width: 12px; height: 12px; border-radius: 50%; display: inline-block;
}
.legend-pending { background: #f59e0b; }
.legend-accepted { background: #10b981; }
.legend-rejected { background: #ef4444; }

#tecnicoCalendar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}
#tecnicoCalendar .fc-toolbar-title { font-size: 18px !important; }
#tecnicoCalendar .fc-button { font-size: 13px; }
#tecnicoCalendar .fc-event { cursor: pointer; border-radius: 4px; padding: 2px 6px; font-size: 12px; }

/* Work Request Detail */
.wr-status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin: 8px 0 16px;
}
.wr-status-pending { background: #fef3c7; color: #92400e; }
.wr-status-accepted { background: #d1fae5; color: #065f46; }
.wr-status-rejected { background: #fee2e2; color: #991b1b; }

.wr-detail-grid {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}
.wr-detail-field {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}
.wr-detail-field label { color: #6b7280; font-weight: 500; }
.wr-detail-field span { color: #1a1a2e; }

.wr-detail-section { margin-bottom: 16px; }
.wr-detail-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: .5px;
    margin: 0 0 6px;
}
.wr-detail-section p { font-size: 14px; color: #374151; line-height: 1.5; margin: 0; }

.wr-response-section {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}
.wr-response-section h3 {
    font-size: 14px;
    margin: 0 0 8px;
    color: #065f46;
}
.wr-response-section textarea {
    width: 100%;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 8px;
    font-size: 13px;
    resize: vertical;
    min-height: 50px;
}

/* ============================================================
   Productora Calendar / Agenda
   ============================================================ */

/* Nav badge for new events */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    margin-left: 6px;
    line-height: 1;
}
.mobile-nav-item .nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
}
.mobile-nav-item { position: relative; }

/* Stats cards */
.prod-cal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.prod-cal-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.prod-cal-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.prod-cal-stat-icon.total { background: #ede9fe; }
.prod-cal-stat-icon.pending { background: #fef3c7; }
.prod-cal-stat-icon.accepted { background: #d1fae5; }
.prod-cal-stat-icon.rejected { background: #fee2e2; }
.prod-cal-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
}
.prod-cal-stat-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* Calendar container */
#productoraCalendar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}
#productoraCalendar .fc-toolbar-title { font-size: 18px !important; }
#productoraCalendar .fc-button { font-size: 13px; }
#productoraCalendar .fc-event {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
}

/* List filters */
.prod-cal-list-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.prod-cal-list-filters select,
.prod-cal-list-filters input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
}
.prod-cal-list-filters input { flex: 1; min-width: 180px; }

/* List cards */
.prod-cal-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.prod-cal-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all .2s;
    display: grid;
    grid-template-columns: 4px 1fr auto;
    gap: 16px;
    align-items: center;
}
.prod-cal-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(-1px);
}
.prod-cal-card-stripe {
    width: 4px;
    height: 100%;
    min-height: 40px;
    border-radius: 2px;
}
.prod-cal-card-stripe.pending { background: #f59e0b; }
.prod-cal-card-stripe.accepted { background: #10b981; }
.prod-cal-card-stripe.rejected { background: #ef4444; }

.prod-cal-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.prod-cal-card-title {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}
.prod-cal-card-title .prod-cal-new-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    flex-shrink: 0;
}
.prod-cal-card-tecnico {
    font-size: 13px;
    color: #6b7280;
}
.prod-cal-card-dates {
    font-size: 13px;
    color: #374151;
}
.prod-cal-card-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.prod-cal-card-rate {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a2e;
}
.prod-cal-card-sent {
    font-size: 11px;
    color: #9ca3af;
}

/* Detail modal timeline */
.prod-wr-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 16px 0;
    position: relative;
    padding-left: 24px;
}
.prod-wr-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #e5e7eb;
}
.prod-wr-timeline-item {
    position: relative;
    padding: 8px 0;
}
.prod-wr-timeline-dot {
    position: absolute;
    left: -21px;
    top: 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #d1d5db;
}
.prod-wr-timeline-dot.sent { background: #3b82f6; box-shadow: 0 0 0 2px #93c5fd; }
.prod-wr-timeline-dot.responded { background: #10b981; box-shadow: 0 0 0 2px #6ee7b7; }
.prod-wr-timeline-dot.pending { background: #f59e0b; box-shadow: 0 0 0 2px #fcd34d; }
.prod-wr-timeline-dot.rejected { background: #ef4444; box-shadow: 0 0 0 2px #fca5a5; }
.prod-wr-timeline-label {
    font-size: 12px;
    color: #6b7280;
}
.prod-wr-timeline-date {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
}

/* Project color block in detail */
.prod-wr-project-banner {
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}
.prod-wr-project-banner h2 {
    margin: 0;
    font-size: 18px;
    color: #fff;
}
.prod-wr-project-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .prod-cal-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .prod-cal-card {
        grid-template-columns: 4px 1fr;
    }
    .prod-cal-card-meta {
        grid-column: 2;
        text-align: left;
        align-items: flex-start;
        flex-direction: row;
        gap: 12px;
    }
}

/* ============================================================
   Cancelled Work Request Styles
   ============================================================ */
.wr-status-cancelled { background: #f3f4f6; color: #6b7280; }
.legend-cancelled { background: #6b7280; }
.prod-cal-card-stripe.cancelled { background: #6b7280; }
.prod-cal-card-cancelled { opacity: 0.7; }
.prod-cal-card-cancelled:hover { opacity: 0.85; }
.cancelled-text { text-decoration: line-through; }

.prod-wr-timeline-dot.cancelled {
    background: #6b7280;
    box-shadow: 0 0 0 2px #d1d5db;
}

/* Email link in work request detail */
.wr-email-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}
.wr-email-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* Cancel Work Request Modal */
.cancel-wr-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.cancel-wr-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1a1a2e;
}
.cancel-wr-icon {
    font-size: 28px;
    color: #f59e0b;
}
.cancel-wr-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px;
    line-height: 1.5;
}

/* Cancel Button */
.btn-cancel-wr {
    background: #fff;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}
.btn-cancel-wr:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

@media (max-width: 768px) {
    .cancel-wr-modal-header h2 {
        font-size: 16px;
    }
}

/* Tecnico profile new fields */
.tecnico-field-hint {
    font-size: 11px;
    color: #9ca3af;
    margin: 8px 0 0;
    font-style: italic;
}
.tecnico-tarifa-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.tecnico-tarifa-row input[type="range"] { flex: 1; }
.tecnico-tarifa-row select { width: 110px; }

.tecnico-historico-placeholder {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: #9ca3af;
}
.tecnico-historico-empty { color: #9ca3af; font-style: italic; }
.tecnico-historico-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    gap: 12px;
}
.tecnico-historico-item:last-child { border-bottom: none; }
.historico-project { font-weight: 600; color: #1a1a2e; flex: 1; }
.historico-dates { color: #6b7280; font-size: 12px; }
.historico-productora { color: #3b82f6; font-size: 12px; }

/* el botón de borrar del calendario usa el estilo común de .btn-danger (acceso.css) */


/* En el móvil el título va en su propia fila y los botones debajo, sin salirse */
@media (max-width: 768px) {
    #slCalendarView .fc-header-toolbar, #tecnicoCalendar .fc-header-toolbar { flex-wrap: wrap; gap: 8px; }
    #slCalendarView .fc-toolbar-chunk:nth-child(2), #tecnicoCalendar .fc-toolbar-chunk:nth-child(2) { order: -1; flex-basis: 100%; text-align: center; }
    #slCalendarView .fc-toolbar-title, #tecnicoCalendar .fc-toolbar-title { font-size: 18px !important; }
    #slCalendarView .fc-button, #tecnicoCalendar .fc-button { padding: 4px 8px; font-size: 13px; }
}

/* Técnicos asignados en el detalle de un evento del calendario */
.cal-tecnico-fila { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.cal-tecnico-fila:hover { background: var(--bg-hover); }
.cal-tecnico-inicial { width: 32px; height: 32px; border-radius: 50%; color: #fff; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.82rem; flex-shrink: 0; }
.cal-tecnico-datos { flex: 1; min-width: 0; }
.cal-tecnico-nombre { font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-tecnico-estado { padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
