/* ============================================
   cho.css - Estilos específicos de Conductores
   Basado en Fluent + Material Design
   ============================================ */

/* Tarjetas de estadísticas (pequeñas mejoras) */
.small-box {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}
.small-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.small-box .icon {
    transition: transform 0.3s;
}
.small-box:hover .icon {
    transform: scale(1.1) rotate(5deg);
}

/* Botones de acción */
.btn-group .btn {
    border-radius: 20px !important;
    margin-right: 6px;
    padding: 8px 18px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Tabla */
.table thead th {
    background-color: #f8f9fc;
    border-bottom: 2px solid #408cbc;
    color: #2b2d42;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}
.table tbody tr {
    transition: background-color 0.15s;
}
.table tbody tr:hover {
    background-color: #f1f5f9 !important;
}

/* Dropdown de acciones */
.dropdown-toggle.btn-outline-secondary {
    border-color: #dee2e6;
    background: white;
}
.dropdown-toggle.btn-outline-secondary:hover {
    background: #e9ecef;
}
.dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: none;
    padding: 8px 0;
}
.dropdown-item {
    padding: 8px 20px;
    font-size: 0.9rem;
    transition: background 0.1s;
}
.dropdown-item i {
    width: 20px;
    text-align: center;
}
.dropdown-item:hover {
    background-color: #f0f2f5;
}

/* Modal */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.modal-header {
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    padding: 1.2rem 1.5rem;
}
.modal-header.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}
.modal-header.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}
.modal-footer {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 16px 16px;
    background: #f8f9fa;
}
.modal-body legend {
    font-size: 1rem;
    font-weight: 600;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 6px;
    margin-bottom: 16px;
}

/* Campos de solo lectura */
input[readonly] {
    background-color: #f8f9fc;
    cursor: default;
}

/* Spinner de carga */
#carCho i {
    color: white;
}
.hide {
    display: none !important;
}

.estado-licencia.vigente .fecha {
    color: #28a745;
    font-weight: 600;
}
.estado-licencia.por-vencer .fecha {
    color: #ffc107;
    font-weight: 600;
}
.estado-licencia.vencida .fecha {
    color: #dc3545;
    font-weight: 600;
}
.estado-licencia.sin-fecha .fecha {
    color: #6c757d;
    font-weight: 600;
}
.estado-licencia small.dias {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
}

/* Modal MDA Choferes */
.cho-mda-shell {
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
}

.cho-mda-header {
    background: linear-gradient(135deg, #1d4f91 0%, #0f766e 100%);
    color: #fff;
    align-items: center;
    border-bottom: 0;
}

.cho-mda-header .modal-title {
    font-weight: 700;
    letter-spacing: 0;
}

.cho-mda-subtitle {
    color: rgba(255, 255, 255, 0.82);
    display: block;
    margin-top: 2px;
}

.cho-mda-body {
    background: #f6f8fb;
}

.cho-fieldset {
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    margin-bottom: 18px;
    padding: 20px 22px 12px;
    position: relative;
}

.cho-fieldset::before {
    background: linear-gradient(90deg, #2563eb, #14b8a6);
    border-radius: 10px 10px 0 0;
    content: "";
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.cho-fieldset-search {
    border-color: #b9d7ff;
}

.cho-legend {
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    color: #1e3a8a;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-left: 8px;
    padding: 6px 14px;
    text-transform: uppercase;
    width: auto;
}

.cho-legend i {
    color: #0f766e;
    margin-right: 8px;
}

.cho-search-group .btn {
    min-width: 112px;
}

.cho-api-state {
    align-items: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #1e3a8a;
    display: flex;
    gap: 10px;
    min-height: 50px;
    padding: 8px 12px;
}

.cho-api-state i {
    background: #dbeafe;
    border-radius: 8px;
    color: #2563eb;
    font-size: 1.05rem;
    padding: 9px;
}

.cho-api-state strong,
.cho-api-state span {
    display: block;
    line-height: 1.2;
}

.cho-api-state span {
    color: #475569;
    font-size: 0.82rem;
}

.cho-api-state.is-loading {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.cho-api-state.is-loading i {
    background: #ffedd5;
    color: #ea580c;
}

.cho-api-state.is-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.cho-api-state.is-success i {
    background: #d1fae5;
    color: #059669;
}

.cho-api-state.is-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.cho-api-state.is-warning i {
    background: #fef3c7;
    color: #d97706;
}

.cho-api-state.is-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.cho-api-state.is-error i {
    background: #fee2e2;
    color: #dc2626;
}

.cho-modal .form-control {
    border-color: #d7dee8;
    border-radius: 6px;
}

.cho-modal .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.16rem rgba(37, 99, 235, 0.18);
}

.cho-modal input[readonly] {
    background: #f8fafc;
}

.cho-auto-filled {
    background: #f0fdf4 !important;
    border-color: #22c55e !important;
    box-shadow: inset 4px 0 0 #22c55e;
}

.cho-field-warning {
    background: #fffbeb !important;
    border-color: #f59e0b !important;
    box-shadow: inset 4px 0 0 #f59e0b;
}

.cho-field-error {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    box-shadow: inset 4px 0 0 #ef4444;
}

.cho-mda-footer {
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
    .cho-fieldset {
        padding: 16px 14px 8px;
    }

    .cho-legend {
        font-size: 0.84rem;
        margin-left: 0;
        padding: 5px 10px;
    }

    .cho-search-group {
        display: block;
    }

    .cho-search-group .form-control,
    .cho-search-group .input-group-append,
    .cho-search-group .btn {
        display: block;
        width: 100%;
    }

    .cho-search-group .btn {
        margin-top: 8px;
    }
}
