/* =========================================
   COMPONENTE: TAB BUTTON
========================================= */
.tab-btn {
    all: unset;
    cursor: pointer;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .15s ease, color .15s ease;
}

.tab-btn:hover {
    background: #f1f5f9;
}

.tab-btn.active {
    background: var(--azul);
    color: #fff;
}


/* =========================================
   COMPONENTE: TIMELINE
========================================= */
.procesos-timeline {
    position: relative;
    padding-left: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.procesos-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #c7d2fe;
}

.timeline-item {
    display: flex;
    gap: 14px;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    background: var(--azul);
    border-radius: 50%;
    margin-top: 10px;
    box-shadow: 0 0 0 4px #e0e7ff;
}

.timeline-content {
    background: #fff;
    padding: 18px;
    border-radius: 16px;
    box-shadow: var(--sombra);
    width: 100%;
}

.timeline-content h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.timeline-fecha {
    font-size: 13px;
    color: #64748b;
    display: block;
    margin-bottom: 10px;
}


/* =========================================
   COMPONENTE: ACCIONES
========================================= */
.proceso-acciones,
.documento-acciones {
    display: flex;
    gap: 10px;
}

.proceso-acciones a,
.documento-acciones a {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: var(--azul);
    color: #fff;
    transition: background .15s ease;
}

.proceso-acciones a:last-child,
.documento-acciones a:last-child {
    background: #e5e7eb;
    color: #1f2937;
}

.proceso-acciones a:hover,
.documento-acciones a:hover {
    background: var(--azul-hover);
}


/* =========================================
   COMPONENTE: DOCUMENTO CARD
========================================= */
.documento-card {
    background: #ffffff;
    padding: 18px 20px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.documento-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 4px;
    background: var(--azul);
    border-radius: 4px;
    opacity: .15;
}

.documento-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--texto);
}

.documento-descripcion {
    font-size: 14px;
    color: #475569;
    line-height: 1.4;
}

.documento-fecha {
    font-size: 12px;
    color: #64748b;
}


/* =========================================
   COMPONENTE: CONTACTO CARD
========================================= */
.contacto-card {
    background: #ffffff;
    padding: 18px 20px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.contacto-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 4px;
    background: var(--azul);
    border-radius: 4px;
    opacity: .1;
}

.contacto-badge {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
}

.contacto-fecha {
    font-size: 12px;
    color: #64748b;
}

.contacto-comentario {
    font-size: 15px;
    color: var(--texto);
    line-height: 1.5;
}

.contacto-autor {
    font-size: 12px;
    color: #64748b;
}


/* =========================================
   COMPONENTE: FORM BOX – FINAL PRO
========================================= */

.form-box {
    background: #ffffff;
    padding: 22px; /* antes 28px */
    border-radius: 16px; /* antes 18px */
    box-shadow: 0 10px 26px rgba(0,0,0,.06); /* un poco más suave */
    display: flex;
    flex-direction: column;
    gap: 14px; /* antes 16px */
    max-width: 480px; /* NUEVO - limita el ancho */
}


/* Título */
.form-box h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--texto);
    margin-bottom: 10px;
}

.form-box h3::before {
    content: '+';
    margin-right: 8px;
    color: var(--azul);
}

/* Labels */
.form-box label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

/* Inputs */
.form-box input[type="text"],
.form-box input[type="datetime-local"],
.form-box textarea {
    padding: 10px 12px; /* antes 12px 14px */
    border-radius: 10px;
    font-size: 14px;
}


/* Hover */
.form-box input:hover,
.form-box textarea:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

/* Focus */
.form-box input:focus,
.form-box textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* Textarea */
.form-box textarea {
    min-height: 120px;
    resize: vertical;
}

/* File input mejora visual */
.form-box input[type="file"] {
    font-size: 14px;
}

/* Botón */
.form-box button {
    margin-top: 8px;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--azul) 0%, var(--azul-hover) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform .1s ease, box-shadow .15s ease;
}

.form-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37,99,235,.35);
}

.form-box button:active {
    transform: translateY(0);
}

.convenio-ciudad,
.querella-ciudad {
    font-size: 13px;
    color: #64748b;
    margin: -6px 0 4px;
}

#resultados-convenios,
#resultados-querellas {
    transition: opacity .2s ease;
}

.is-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity .3s ease;
}

.vd-new-item {
    animation: vdFadeIn .4s ease forwards;
}

@keyframes vdFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==============================
   Spinner botón
============================== */

.vd-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff60;
    border-top: 2px solid #fff;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: vd-spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes vd-spin {
    to { transform: rotate(360deg); }
}

/* ==============================
   Nuevo elemento resaltado
============================== */

.vd-nuevo-item {
    animation: vd-highlight 2s ease;
}

@keyframes vd-highlight {
    0%   { background-color: #d4f5dd; }
    100% { background-color: transparent; }
}

/* ==============================
   Mensajes
============================== */

.form-mensaje {
    margin-top: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-mensaje.exito {
    color: #0f7b36;
}

.form-mensaje.error {
    color: #c0392b;
}

.estado-mensaje{
    font-size:12px;
    margin-top:6px;
}

.estado-mensaje.guardando{
    color:#666;
}

.estado-mensaje.exito{
    color:#2e7d32;
}

.estado-mensaje.error{
    color:#c62828;
}
