/* == LISTADO DE PARTES ================================== */

.partes-page {
    padding: 0;
}

.partes-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.partes-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.35rem 0;
}

.partes-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    max-width: 700px;
    margin: 0;
}

.btn-exportar-partes {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
    display: flex;
    align-items: center;
}

.btn-exportar-partes:hover {
    background: #f3f4f6;
}

/* Tarjetas resumen */
.partes-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.parte-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.parte-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.parte-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.parte-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.parte-card-icon {
    font-size: 1.6rem;
    color: #d1d5db;
}

/* Filtros */
.partes-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.partes-select {
    padding: 0.5rem 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.partes-limpiar {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.55rem 0.95rem;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    transition: background-color 0.15s, border-color 0.15s;
}

.partes-limpiar:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* Selector de periodo */
.partes-periodo-wrapper {
    position: relative;
}

.partes-filter-btn {
    padding: 0.55rem 0.95rem;
    border: 1.5px solid #e02020;
    border-radius: 10px;
    font-size: 0.875rem;
    background: #fff;
    cursor: pointer;
    color: #e02020;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.partes-filter-btn:hover {
    background: #fef2f2;
}

.partes-filter-btn i {
    font-size: 0.95rem;
}

.partes-filter-active {
    background: #fef2f2;
    color: #e02020;
    font-weight: 600;
}

.partes-periodo-popup {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 1000;
    width: 520px;
    padding: 1rem;
}

.partes-periodo-main {
    display: flex;
    gap: 1rem;
}

.partes-periodo-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 140px;
}

.partes-periodo-item {
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
}

.partes-periodo-item:hover {
    background: #f3f4f6;
}

.partes-periodo-item-active {
    background: #fef2f2;
    color: #e02020;
    font-weight: 600;
}

.partes-calendario {
    flex: 1;
}

.partes-calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: capitalize;
}

.partes-calendario-nav {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 1rem;
    padding: 0.25rem;
}

.partes-calendario-nav:hover {
    color: #1a1a1a;
}

.partes-calendario-semana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.35rem;
}

.partes-calendario-dias {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.partes-calendario-dia {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #374151;
    border-radius: 50%;
    cursor: pointer;
}

.partes-calendario-dia:hover {
    background: #f3f4f6;
}

.partes-calendario-dia-vacio {
    cursor: default;
    pointer-events: none;
}

.partes-calendario-dia-hoy {
    background: #e02020;
    color: #fff;
    font-weight: 700;
}

.partes-calendario-dia-seleccionado {
    background: #fef2f2;
    color: #e02020;
    font-weight: 700;
}

.partes-calendario-dia-rango {
    background: #fee2e2;
    color: #e02020;
}

.partes-calendario-dia-pasado {
    opacity: 0.5;
}

.partes-periodo-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.partes-periodo-limpiar {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.partes-periodo-limpiar:hover {
    color: #1a1a1a;
}

.partes-periodo-aplicar {
    background: #e02020;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.partes-periodo-aplicar:hover {
    background: #c01a1a;
}

/* Tabla */
.partes-table-wrapper {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.partes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.partes-table thead tr {
    border-bottom: 1px solid #e5e7eb;
}

.partes-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.partes-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    white-space: nowrap;
}

.partes-table tbody tr:last-child td {
    border-bottom: none;
}

.partes-table tbody tr:hover {
    background-color: #f9fafb;
}

.partes-acciones-header {
    text-align: right;
}

.partes-acciones-cell {
    text-align: right;
    position: relative;
}

.partes-boton-acciones {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #6b7280;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.partes-boton-acciones:hover {
    background-color: #f3f4f6;
    color: #1a1a1a;
}

.partes-acciones-wrapper {
    position: relative;
    display: inline-block;
}

.partes-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 100;
    min-width: 160px;
    text-align: left;
}

.partes-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: none;
    background: none;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    text-align: left;
}

.partes-menu-item:hover {
    background-color: #f3f4f6;
}

.parte-licencia {
    display: inline-flex;
    align-items: center;
    background-color: #fff;
    color: #1a1a1a;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.35rem;
}

.partes-empty {
    text-align: center;
    color: #6b7280;
    padding: 1.5rem 1rem;
}

.matricula-badge {
    display: inline-flex;
    align-items: center;
    background-color: #f3f4f6;
    color: #1a1a1a;
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.sin-asignar {
    color: #9ca3af;
}

/* Filtros desplegables de vehículo y conductor */
.partes-filtro-vehiculo-wrapper,
.partes-filtro-conductor-wrapper {
    position: relative;
}

.partes-filtro-vehiculo-popup,
.partes-filtro-conductor-popup {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 1000;
    width: 280px;
    padding: 0.75rem;
}

.partes-filtro-vehiculo-busqueda,
.partes-filtro-conductor-busqueda {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.5rem;
}

.partes-filtro-vehiculo-busqueda i,
.partes-filtro-conductor-busqueda i {
    color: #6b7280;
    font-size: 0.9rem;
}

.partes-filtro-vehiculo-input,
.partes-filtro-conductor-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.875rem;
    color: #374151;
    width: 100%;
    font-family: inherit;
}

.partes-filtro-vehiculo-input::placeholder,
.partes-filtro-conductor-input::placeholder {
    color: #9ca3af;
}

.partes-filtro-vehiculo-lista,
.partes-filtro-conductor-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.partes-filtro-vehiculo-item,
.partes-filtro-conductor-item {
    padding: 0.55rem 0.65rem;
    font-size: 0.875rem;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.partes-filtro-vehiculo-item:hover,
.partes-filtro-conductor-item:hover {
    background: #f3f4f6;
}

.partes-filtro-vehiculo-item-active,
.partes-filtro-conductor-item-active {
    background: #fef2f2;
    color: #e02020;
    font-weight: 600;
}

.parte-estado-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.parte-estado-borrador {
    background-color: #fef3c7;
    color: #92400e;
}

.parte-estado-enviado {
    background-color: #d1fae5;
    color: #065f46;
}

/* Responsive */
@media (max-width: 991px) {
    .partes-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .partes-cards {
        grid-template-columns: 1fr;
    }

    .partes-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .partes-table-wrapper {
        overflow-x: auto;
    }

    .partes-table {
        min-width: 720px;
    }
}

@media (max-width: 768px) {
    .partes-periodo-popup {
        width: calc(100vw - 3rem);
        max-width: 360px;
        left: 0;
        right: auto;
        flex-direction: column;
    }

    .partes-periodo-main {
        flex-direction: column;
    }
}
