/* Clientes styles */
#pageClientes .prov-tabla thead tr th:first-child { border-radius: 6px 0 0 0; }
#pageClientes .prov-tabla thead tr th:last-child { border-radius: 0 6px 0 0; }

/* ---- Detalle (doble click) ---- */
.cli-detalle {
    font-family: 'Plus Jakarta Sans', sans-serif;
    padding: 4px 0;
}

.cli-detalle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cli-detalle-campo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cli-detalle-campo-full {
    grid-column: 1 / -1;
}

.cli-detalle-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--gris-400);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cli-detalle-valor {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gris-800);
}

.cli-detalle-separador {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 8px 0;
}

.cli-detalle-separador::before,
.cli-detalle-separador::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gris-200);
}

.cli-detalle-separador span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gris-400);
    white-space: nowrap;
}

/* ---- Badges de estado ---- */
.cli-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.cli-badge-activo {
    background: rgba(16,185,129,0.08);
    color: #059669;
    border: 1px solid rgba(16,185,129,0.15);
}

.cli-badge-inactivo {
    background: rgba(239,68,68,0.06);
    color: #DC2626;
    border: 1px solid rgba(239,68,68,0.12);
}

.cli-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.cli-badge-activo .cli-badge-dot {
    background: #10B981;
    box-shadow: 0 0 6px rgba(16,185,129,0.4);
}

.cli-badge-inactivo .cli-badge-dot {
    background: #EF4444;
}

/* ---- Formulario grid ---- */
.cli-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.cli-field,
.cli-field-full,
.cli-field-dos,
.cli-tercio {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cli-field-full {
    grid-column: 1 / -1;
}

.cli-field-dos {
    grid-column: span 2;
}

.cli-tercio {
    grid-column: span 1;
}

.cli-field label,
.cli-field-full label,
.cli-field-dos label,
.cli-tercio label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gris-600);
    letter-spacing: 0.2px;
}

.cli-field label .requerido,
.cli-field-full label .requerido,
.cli-field-dos label .requerido,
.cli-tercio label .requerido {
    color: var(--danger);
    margin-left: 1px;
}

.cli-field input,
.cli-field select,
.cli-field textarea,
.cli-field-full input,
.cli-field-full select,
.cli-field-dos input,
.cli-field-dos select,
.cli-tercio input,
.cli-tercio select {
    padding: 11px 14px;
    border: 1.5px solid var(--gris-200);
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--gris-800);
    outline: none;
    transition: all 0.2s ease;
    background: var(--blanco);
    width: 100%;
    text-transform: uppercase;
    box-sizing: border-box;
}

.cli-field select,
.cli-field-full select,
.cli-field-dos select,
.cli-tercio select {
    text-transform: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.cli-field input::placeholder,
.cli-field-full input::placeholder,
.cli-field-dos input::placeholder,
.cli-tercio input::placeholder {
    text-transform: none;
}

.cli-field input:focus,
.cli-field select:focus,
.cli-field-full input:focus,
.cli-field-full select:focus,
.cli-field-dos input:focus,
.cli-field-dos select:focus,
.cli-tercio input:focus,
.cli-tercio select:focus {
    border-color: var(--azul-400);
    box-shadow: 0 0 0 3px rgba(37,99,160,0.12);
}

.cli-field textarea,
.cli-field-full textarea,
.cli-field-dos textarea {
    padding: 11px 14px;
    border: 1.5px solid var(--gris-200);
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--gris-800);
    outline: none;
    transition: all 0.2s ease;
    background: var(--blanco);
    width: 100%;
    resize: vertical;
    min-height: 70px;
    line-height: 1.5;
}

.cli-field textarea:focus,
.cli-field-full textarea:focus,
.cli-field-dos textarea:focus {
    border-color: var(--azul-400);
    box-shadow: 0 0 0 3px rgba(37,99,160,0.12);
}

/* ---- Input group (input + SUNAT button) ---- */
.cli-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cli-input-group input {
    flex: 1;
}

.btn-cli-sunat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    min-width: 34px;
    height: 40px;
    border: 1.5px solid var(--azul-400);
    border-radius: 8px;
    background: var(--azul-400);
    color: var(--blanco);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-cli-sunat:hover {
    background: var(--azul-500);
    border-color: var(--azul-500);
}

.btn-cli-sunat.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ---- Separador visual ---- */
.cli-separador {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0 2px 0;
}

.cli-separador::before,
.cli-separador::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gris-200);
}

.cli-separador span {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gris-400);
    white-space: nowrap;
}

/* ---- Error text ---- */
.cli-error-text {
    font-size: 0.65rem;
    color: var(--danger);
    display: none;
    margin-top: 2px;
    font-weight: 500;
}

.cli-error-text.visible {
    display: block;
}

/* ---- Ubigeo search/typeahead ---- */
.cli-ubigeo-search {
    position: relative;
}

.cli-ubigeo-search input {
    padding: 8px 12px;
    border: 1.5px solid var(--gris-200);
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.7rem;
    color: var(--gris-800);
    outline: none;
    transition: all 0.2s ease;
    background: var(--blanco);
    width: 100%;
}

.cli-ubigeo-search input:focus {
    border-color: var(--azul-400);
    box-shadow: 0 0 0 3px rgba(37,99,160,0.12);
}

.cli-ubigeo-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: var(--blanco);
    border: 1.5px solid var(--gris-200);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.cli-ubigeo-dropdown.visible {
    display: block;
}

.cli-ubigeo-dd-item {
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    transition: background 0.1s ease;
    border-bottom: 1px solid var(--gris-100);
    color: var(--gris-700);
}

.cli-ubigeo-dd-item:last-child {
    border-bottom: none;
}

.cli-ubigeo-dd-item:hover {
    background: var(--gris-50);
}

.cli-ubigeo-dd-empty {
    padding: 10px;
    text-align: center;
    font-size: 0.7rem;
    color: var(--gris-400);
}

/* ---- Toggle switch (Retención/Percepción) ---- */
.cli-field-full .prov-toggle-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.cli-field-full .prov-toggle-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1.5px solid var(--gris-200);
    border-radius: 8px;
    background: var(--blanco);
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.cli-field-full .prov-toggle-item:hover {
    border-color: var(--azul-300);
    background: var(--azul-50);
}

.cli-field-full .prov-toggle-item label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gris-700);
    cursor: pointer;
    white-space: nowrap;
}
