/* CRM Comercial · Hoja centralizada de estilos
   Fuente: estilos de los módulos PHP existentes (octubre de 2026).
   Cada módulo está aislado por sus elementos HTML, sin requerir clases nuevas en <body>.
   Navegadores modernos: utiliza :has() para evitar colisiones entre módulos.
*/
:root { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }


/* ========= index.php ========= */
body:has(.login) * { box-sizing: border-box; }
body:has(.login) {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf2f7;
    font-family: Arial, sans-serif;
}
body:has(.login) .login {
    background: #fff;
    padding: 35px;
    width: 100%;
    max-width: 400px;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,.08);
}
body:has(.login) h1 {
    text-align: center;
    font-size: 24px;
    color: #17365d;
    margin: 0 0 8px;
}
body:has(.login) .subtitulo {
    text-align: center;
    color: #64748b;
    margin-bottom: 28px;
}
body:has(.login) label {
    display: block;
    margin: 16px 0 7px;
    font-weight: bold;
    font-size: 14px;
}
body:has(.login) input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 15px;
}
body:has(.login) button {
    width: 100%;
    margin-top: 25px;
    padding: 13px;
    border: 0;
    border-radius: 8px;
    background: #17365d;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}
body:has(.login) button:hover {
    background: #245487;
}
body:has(.login) .error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 7px;
    margin-bottom: 18px;
    font-size: 14px;
}
body:has(.login) .password-container {
    position: relative;
}
body:has(.login) .password-container input {
    padding-right: 52px;
}
body:has(.login) .toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
}
body:has(.login) .toggle-password:hover {
    background: transparent;
    color: #17365d;
}

/* ========= panel_nuevo.php ========= */
body:has(.tarjeta) * { box-sizing: border-box; }
body:has(.tarjeta) { margin: 0; background: #f1f5f9; color: #243247; font-family: Arial, sans-serif; }
body:has(.tarjeta) .cabecera { background: #17365d; color: white; }
body:has(.tarjeta) .cabecera-interior { max-width: 1100px; margin: auto; padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
body:has(.tarjeta) .marca { font-size: 22px; font-weight: bold; }
body:has(.tarjeta) .marca small { display: block; margin-top: 5px; font-size: 12px; font-weight: normal; color: #cbd9e9; }
body:has(.tarjeta) .salir { border: 1px solid rgba(255,255,255,.5); background: transparent; color: white; padding: 10px 15px; border-radius: 8px; cursor: pointer; font-size: 14px; }
body:has(.tarjeta) .salir:hover { background: rgba(255,255,255,.12); }
body:has(.tarjeta) .contenedor { max-width: 1100px; margin: 36px auto; padding: 0 24px; }
body:has(.tarjeta) h1 { margin: 0 0 8px; font-size: 27px; color: #17365d; }
body:has(.tarjeta) .intro { margin: 0 0 30px; color: #64748b; line-height: 1.5; }
body:has(.tarjeta) .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body:has(.tarjeta) .tarjeta { background: white; padding: 27px; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 4px 14px rgba(23,54,93,.04); }
body:has(.tarjeta) .icono { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: #eaf1fa; color: #17365d; margin-bottom: 14px; }
body:has(.tarjeta) .icono svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body:has(.tarjeta) h2 { font-size: 19px; margin: 0 0 9px; color: #17365d; }
body:has(.tarjeta) .tarjeta p { font-size: 14px; color: #64748b; line-height: 1.55; margin: 0 0 20px; min-height: 43px; }
body:has(.tarjeta) .estado { display: inline-block; background: #f1f5f9; color: #64748b; border-radius: 6px; padding: 8px 12px; font-size: 13px; }


@media  (max-width: 650px) {body:has(.tarjeta) .grid { grid-template-columns: 1fr; }
body:has(.tarjeta) .cabecera-interior { padding: 16px; }
body:has(.tarjeta) .contenedor { margin: 25px auto; padding: 0 16px; }
body:has(.tarjeta) .tarjeta { padding: 22px; }
body:has(.tarjeta) .marca { font-size: 19px; }}

/* ========= casas.php ========= */
body:has(form[action="/modulos/representantes/casas.php"]) * {box-sizing:border-box}
body:has(form[action="/modulos/representantes/casas.php"]) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(form[action="/modulos/representantes/casas.php"]) .cabecera {background:#17365d;color:#fff}
body:has(form[action="/modulos/representantes/casas.php"]) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(form[action="/modulos/representantes/casas.php"]) .marca {font-size:22px;font-weight:bold}
body:has(form[action="/modulos/representantes/casas.php"]) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(form[action="/modulos/representantes/casas.php"]) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:#fff;padding:10px 15px;border-radius:8px;cursor:pointer;font-size:14px}
body:has(form[action="/modulos/representantes/casas.php"]) .salir:hover {background:rgba(255,255,255,.12)}
body:has(form[action="/modulos/representantes/casas.php"]) .contenedor {max-width:1100px;margin:36px auto;padding:0 24px}
body:has(form[action="/modulos/representantes/casas.php"]) .volver {display:inline-block;color:#17365d;text-decoration:none;font-size:14px;margin-bottom:22px}
body:has(form[action="/modulos/representantes/casas.php"]) .volver:hover {text-decoration:underline}
body:has(form[action="/modulos/representantes/casas.php"]) h1 {margin:0 0 8px;font-size:27px;color:#17365d}
body:has(form[action="/modulos/representantes/casas.php"]) .intro {margin:0 0 24px;color:#64748b;line-height:1.5}
body:has(form[action="/modulos/representantes/casas.php"]) .panel {background:white;border:1px solid #e2e8f0;border-radius:14px;padding:24px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(form[action="/modulos/representantes/casas.php"]) .herramientas {display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:20px;flex-wrap:wrap}
body:has(form[action="/modulos/representantes/casas.php"]) .busqueda {display:flex;gap:8px;flex:1;max-width:600px}
body:has(form[action="/modulos/representantes/casas.php"]) .busqueda input {flex:1;min-width:0;border:1px solid #cbd5e1;border-radius:8px;padding:11px;font-size:15px}
body:has(form[action="/modulos/representantes/casas.php"]) .btn {display:inline-block;background:#17365d;color:#fff;text-decoration:none;border:0;border-radius:8px;padding:11px 15px;font-size:14px;cursor:pointer}
body:has(form[action="/modulos/representantes/casas.php"]) .btn:hover {background:#245487}
body:has(form[action="/modulos/representantes/casas.php"]) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(form[action="/modulos/representantes/casas.php"]) .btn-claro:hover {background:#dbe8f7}
body:has(form[action="/modulos/representantes/casas.php"]) .btn-inactivo {background:#e2e8f0;color:#64748b;cursor:default}
/* Acciones Ver y Editar del listado de casas comerciales */
body:has(form[action="/modulos/representantes/casas.php"]) .acciones-casa {display:flex;gap:7px;flex-wrap:wrap}
body:has(form[action="/modulos/representantes/casas.php"]) .ver {display:inline-block;padding:8px 12px;border-radius:7px;background:#17365d;color:#fff;text-decoration:none;font-weight:bold}
body:has(form[action="/modulos/representantes/casas.php"]) .ver:hover {background:#245487;color:#fff}
body:has(form[action="/modulos/representantes/casas.php"]) .editar {display:inline-block;padding:8px 12px;border-radius:7px;background:#eaf1fa;color:#17365d;text-decoration:none;font-weight:bold}
body:has(form[action="/modulos/representantes/casas.php"]) .editar:hover {background:#dbe8f7;color:#17365d}
body:has(form[action="/modulos/representantes/casas.php"]) .contador {color:#64748b;font-size:14px;margin-bottom:14px}
body:has(form[action="/modulos/representantes/casas.php"]) .tabla-scroll {overflow-x:auto}
body:has(form[action="/modulos/representantes/casas.php"]) table {width:100%;border-collapse:collapse;text-align:left}
body:has(form[action="/modulos/representantes/casas.php"]) th, body:has(form[action="/modulos/representantes/casas.php"]) td {padding:15px 12px;border-bottom:1px solid #e2e8f0;font-size:14px;vertical-align:middle}
body:has(form[action="/modulos/representantes/casas.php"]) th {color:#64748b;font-size:13px;background:#f8fafc}
body:has(form[action="/modulos/representantes/casas.php"]) tr:last-child td {border-bottom:0}
body:has(form[action="/modulos/representantes/casas.php"]) .nombre {font-weight:bold;color:#17365d}
body:has(form[action="/modulos/representantes/casas.php"]) .secundario {color:#64748b;font-size:12px;margin-top:5px}
body:has(form[action="/modulos/representantes/casas.php"]) .estado {display:inline-block;border-radius:6px;padding:6px 9px;background:#e8f5ec;color:#23613b;font-size:12px}
body:has(form[action="/modulos/representantes/casas.php"]) .estado.no {background:#f1f5f9;color:#64748b}
body:has(form[action="/modulos/representantes/casas.php"]) .vacio {padding:30px 10px;text-align:center;color:#64748b}


@media (max-width:700px){body:has(form[action="/modulos/representantes/casas.php"]) .cabecera-interior {padding:16px}
body:has(form[action="/modulos/representantes/casas.php"]) .marca {font-size:19px}
body:has(form[action="/modulos/representantes/casas.php"]) .contenedor {margin:25px auto;padding:0 16px}
body:has(form[action="/modulos/representantes/casas.php"]) .panel {padding:16px}
body:has(form[action="/modulos/representantes/casas.php"]) .herramientas, body:has(form[action="/modulos/representantes/casas.php"]) .busqueda {width:100%;max-width:none}
body:has(form[action="/modulos/representantes/casas.php"]) .busqueda input {width:100%}
body:has(form[action="/modulos/representantes/casas.php"]) table, body:has(form[action="/modulos/representantes/casas.php"]) thead, body:has(form[action="/modulos/representantes/casas.php"]) tbody, body:has(form[action="/modulos/representantes/casas.php"]) tr, body:has(form[action="/modulos/representantes/casas.php"]) td {display:block}
body:has(form[action="/modulos/representantes/casas.php"]) thead {display:none}
body:has(form[action="/modulos/representantes/casas.php"]) tr {padding:12px 0;border-bottom:1px solid #e2e8f0}
body:has(form[action="/modulos/representantes/casas.php"]) tr:last-child {border:0}
body:has(form[action="/modulos/representantes/casas.php"]) td {padding:6px 2px;border:0;display:flex;justify-content:space-between;gap:12px;align-items:flex-start;text-align:right}
body:has(form[action="/modulos/representantes/casas.php"]) td:before {content:attr(data-label);font-weight:bold;color:#64748b;text-align:left;flex:0 0 35%}
body:has(form[action="/modulos/representantes/casas.php"]) td:first-child {display:block;text-align:left}
body:has(form[action="/modulos/representantes/casas.php"]) td:first-child:before {display:none}}

/* ========= casas_nueva.php ========= */
body:has(form[action="/modulos/representantes/casas_nueva.php"]) * {box-sizing:border-box}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .cabecera {background:#17365d;color:white}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .marca {font-size:22px;font-weight:bold}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:white;padding:10px 15px;border-radius:8px;cursor:pointer}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .contenedor {max-width:900px;margin:36px auto;padding:0 24px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .volver {color:#17365d;text-decoration:none;font-size:14px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) h1 {font-size:27px;color:#17365d;margin:24px 0 8px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .intro {color:#64748b;margin:0 0 24px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .panel {background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:26px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .campo {min-width:0}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .campo.ancho {grid-column:1/-1}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) label {display:block;font-size:14px;font-weight:bold;color:#17365d;margin-bottom:7px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) input, body:has(form[action="/modulos/representantes/casas_nueva.php"]) textarea {width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:12px;font:15px Arial,sans-serif}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) textarea {min-height:110px;resize:vertical}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .acciones {display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:24px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .btn {background:#17365d;color:#fff;padding:12px 18px;border:0;border-radius:8px;text-decoration:none;cursor:pointer;font-size:14px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .error {background:#fee2e2;color:#991b1b;border-radius:8px;padding:12px 16px;margin-bottom:20px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .nota {font-size:13px;color:#64748b;margin-top:7px;line-height:1.5}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .check {display:flex;align-items:center;gap:10px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .check input {width:auto}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .check label {margin:0}


@media (max-width:650px){body:has(form[action="/modulos/representantes/casas_nueva.php"]) .cabecera-interior {padding:16px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .marca {font-size:19px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .contenedor {margin:24px auto;padding:0 16px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .panel {padding:18px}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .grid {grid-template-columns:1fr}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .campo.ancho {grid-column:auto}
body:has(form[action="/modulos/representantes/casas_nueva.php"]) .acciones .btn {flex:1;text-align:center}}

/* ========= casas_editar.php ========= */
body:has(form[action^="/modulos/representantes/casas_editar.php"]) * {box-sizing:border-box}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .cabecera {background:#17365d;color:white}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .marca {font-size:22px;font-weight:bold}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:white;padding:10px 15px;border-radius:8px;cursor:pointer}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .contenedor {max-width:900px;margin:36px auto;padding:0 24px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .volver {color:#17365d;text-decoration:none;font-size:14px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) h1 {font-size:27px;color:#17365d;margin:24px 0 8px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .intro {color:#64748b;margin:0 0 24px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .panel {background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:26px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .campo {min-width:0}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .campo.ancho {grid-column:1/-1}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) label {display:block;font-size:14px;font-weight:bold;color:#17365d;margin-bottom:7px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) input, body:has(form[action^="/modulos/representantes/casas_editar.php"]) textarea {width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:12px;font:15px Arial,sans-serif}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) textarea {min-height:110px;resize:vertical}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .acciones {display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:24px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .btn {background:#17365d;color:#fff;padding:12px 18px;border:0;border-radius:8px;text-decoration:none;cursor:pointer;font-size:14px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .error {background:#fee2e2;color:#991b1b;border-radius:8px;padding:12px 16px;margin-bottom:20px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .nota {font-size:13px;color:#64748b;margin-top:7px;line-height:1.5}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .check {display:flex;align-items:center;gap:10px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .check input {width:auto}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .check label {margin:0}


@media (max-width:650px){body:has(form[action^="/modulos/representantes/casas_editar.php"]) .cabecera-interior {padding:16px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .marca {font-size:19px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .contenedor {margin:24px auto;padding:0 16px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .panel {padding:18px}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .grid {grid-template-columns:1fr}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .campo.ancho {grid-column:auto}
body:has(form[action^="/modulos/representantes/casas_editar.php"]) .acciones .btn {flex:1;text-align:center}}

/* ========= casas_ver.php ========= */
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) * {box-sizing:border-box}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .cabecera {background:#17365d;color:#fff}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .marca {font-size:22px;font-weight:bold}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:#fff;padding:10px 15px;border-radius:8px;cursor:pointer}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .contenedor {max-width:900px;margin:36px auto;padding:0 24px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .volver {color:#17365d;text-decoration:none;font-size:14px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) h1 {font-size:27px;color:#17365d;margin:24px 0 8px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .intro {color:#64748b;margin:0 0 24px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .panel {background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:26px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .campo {min-width:0;border-bottom:1px solid #edf2f7;padding-bottom:12px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .campo.ancho {grid-column:1/-1}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .etiqueta {display:block;font-size:13px;font-weight:bold;color:#64748b;margin-bottom:7px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .valor {font-size:15px;color:#243247;overflow-wrap:anywhere;white-space:pre-wrap}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .acciones {display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:24px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .btn {background:#17365d;color:#fff;padding:12px 18px;border:0;border-radius:8px;text-decoration:none;cursor:pointer;font-size:14px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .estado {display:inline-block;border-radius:6px;padding:6px 9px;background:#e8f5ec;color:#23613b;font-size:13px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .estado.no {background:#f1f5f9;color:#64748b}


@media (max-width:650px){body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .cabecera-interior {padding:16px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .marca {font-size:19px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .contenedor {margin:24px auto;padding:0 16px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .panel {padding:18px}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .grid {grid-template-columns:1fr}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .campo.ancho {grid-column:auto}
body:has(a[href^="/modulos/representantes/casas_editar.php"]):not(:has(form[action^="/modulos/representantes/casas_editar.php"])):not(:has(form[action="/modulos/representantes/casas.php"])) .acciones .btn {flex:1;text-align:center}}

/* ========= clientes.php ========= */
body:has(form[action="/modulos/representantes/clientes.php"]) * {box-sizing:border-box}
body:has(form[action="/modulos/representantes/clientes.php"]) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(form[action="/modulos/representantes/clientes.php"]) .cabecera {background:#17365d;color:#fff}
body:has(form[action="/modulos/representantes/clientes.php"]) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(form[action="/modulos/representantes/clientes.php"]) .marca {font-size:22px;font-weight:bold}
body:has(form[action="/modulos/representantes/clientes.php"]) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(form[action="/modulos/representantes/clientes.php"]) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:#fff;padding:10px 15px;border-radius:8px;cursor:pointer;font-size:14px}
body:has(form[action="/modulos/representantes/clientes.php"]) .salir:hover {background:rgba(255,255,255,.12)}
body:has(form[action="/modulos/representantes/clientes.php"]) .contenedor {max-width:1100px;margin:36px auto;padding:0 24px}
body:has(form[action="/modulos/representantes/clientes.php"]) .volver {display:inline-block;color:#17365d;text-decoration:none;font-size:14px;margin-bottom:22px}
body:has(form[action="/modulos/representantes/clientes.php"]) .volver:hover {text-decoration:underline}
body:has(form[action="/modulos/representantes/clientes.php"]) h1 {margin:0 0 8px;font-size:27px;color:#17365d}
body:has(form[action="/modulos/representantes/clientes.php"]) .intro {margin:0 0 24px;color:#64748b;line-height:1.5}
body:has(form[action="/modulos/representantes/clientes.php"]) .panel {background:white;border:1px solid #e2e8f0;border-radius:14px;padding:24px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(form[action="/modulos/representantes/clientes.php"]) .herramientas {display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:20px;flex-wrap:wrap}
body:has(form[action="/modulos/representantes/clientes.php"]) .busqueda {display:flex;gap:8px;flex:1;max-width:600px}
body:has(form[action="/modulos/representantes/clientes.php"]) .busqueda input {flex:1;min-width:0;border:1px solid #cbd5e1;border-radius:8px;padding:11px;font-size:15px}
body:has(form[action="/modulos/representantes/clientes.php"]) .btn {display:inline-block;background:#17365d;color:#fff;text-decoration:none;border:0;border-radius:8px;padding:11px 15px;font-size:14px;cursor:pointer}
body:has(form[action="/modulos/representantes/clientes.php"]) .btn:hover {background:#245487}
body:has(form[action="/modulos/representantes/clientes.php"]) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(form[action="/modulos/representantes/clientes.php"]) .btn-claro:hover {background:#dbe8f7}
body:has(form[action="/modulos/representantes/clientes.php"]) .btn-inactivo {background:#e2e8f0;color:#64748b;cursor:default}
body:has(form[action="/modulos/representantes/clientes.php"]) .editar {display:inline-block;padding:8px 12px;border-radius:7px;background:#eaf1fa;color:#17365d;text-decoration:none;font-weight:bold}
body:has(form[action="/modulos/representantes/clientes.php"]) .editar:hover {background:#dbe8f7}
body:has(form[action="/modulos/representantes/clientes.php"]) .acciones-casa {display:flex;gap:7px;flex-wrap:wrap}
body:has(form[action="/modulos/representantes/clientes.php"]) .ver {display:inline-block;padding:8px 12px;border-radius:7px;background:#17365d;color:#fff;text-decoration:none;font-weight:bold}
body:has(form[action="/modulos/representantes/clientes.php"]) .ver:hover {background:#245487}
body:has(form[action="/modulos/representantes/clientes.php"]) .aviso {padding:12px 15px;background:#e8f5ec;color:#23613b;border-radius:8px;margin-bottom:18px}
body:has(form[action="/modulos/representantes/clientes.php"]) .contador {color:#64748b;font-size:14px;margin-bottom:14px}
body:has(form[action="/modulos/representantes/clientes.php"]) .tabla-scroll {overflow-x:auto}
body:has(form[action="/modulos/representantes/clientes.php"]) table {width:100%;border-collapse:collapse;text-align:left}
body:has(form[action="/modulos/representantes/clientes.php"]) th, body:has(form[action="/modulos/representantes/clientes.php"]) td {padding:15px 12px;border-bottom:1px solid #e2e8f0;font-size:14px;vertical-align:middle}
body:has(form[action="/modulos/representantes/clientes.php"]) th {color:#64748b;font-size:13px;background:#f8fafc}
body:has(form[action="/modulos/representantes/clientes.php"]) tr:last-child td {border-bottom:0}
body:has(form[action="/modulos/representantes/clientes.php"]) .nombre {font-weight:bold;color:#17365d}
body:has(form[action="/modulos/representantes/clientes.php"]) .secundario {color:#64748b;font-size:12px;margin-top:5px}
body:has(form[action="/modulos/representantes/clientes.php"]) .estado {display:inline-block;border-radius:6px;padding:6px 9px;background:#e8f5ec;color:#23613b;font-size:12px}
body:has(form[action="/modulos/representantes/clientes.php"]) .estado.no {background:#f1f5f9;color:#64748b}
body:has(form[action="/modulos/representantes/clientes.php"]) .vacio {padding:30px 10px;text-align:center;color:#64748b}


@media (max-width:700px){body:has(form[action="/modulos/representantes/clientes.php"]) .cabecera-interior {padding:16px}
body:has(form[action="/modulos/representantes/clientes.php"]) .marca {font-size:19px}
body:has(form[action="/modulos/representantes/clientes.php"]) .contenedor {margin:25px auto;padding:0 16px}
body:has(form[action="/modulos/representantes/clientes.php"]) .panel {padding:16px}
body:has(form[action="/modulos/representantes/clientes.php"]) .herramientas, body:has(form[action="/modulos/representantes/clientes.php"]) .busqueda {width:100%;max-width:none}
body:has(form[action="/modulos/representantes/clientes.php"]) .busqueda input {width:100%}
body:has(form[action="/modulos/representantes/clientes.php"]) table, body:has(form[action="/modulos/representantes/clientes.php"]) thead, body:has(form[action="/modulos/representantes/clientes.php"]) tbody, body:has(form[action="/modulos/representantes/clientes.php"]) tr, body:has(form[action="/modulos/representantes/clientes.php"]) td {display:block}
body:has(form[action="/modulos/representantes/clientes.php"]) thead {display:none}
body:has(form[action="/modulos/representantes/clientes.php"]) tr {padding:12px 0;border-bottom:1px solid #e2e8f0}
body:has(form[action="/modulos/representantes/clientes.php"]) tr:last-child {border:0}
body:has(form[action="/modulos/representantes/clientes.php"]) td {padding:6px 2px;border:0;display:flex;justify-content:space-between;gap:12px;align-items:flex-start;text-align:right}
body:has(form[action="/modulos/representantes/clientes.php"]) td:before {content:attr(data-label);font-weight:bold;color:#64748b;text-align:left;flex:0 0 35%}
body:has(form[action="/modulos/representantes/clientes.php"]) td:first-child {display:block;text-align:left}
body:has(form[action="/modulos/representantes/clientes.php"]) td:first-child:before {display:none}}

/* ========= clientes_nueva.php ========= */
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) * {box-sizing:border-box}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .cabecera {background:#17365d;color:white}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .marca {font-size:22px;font-weight:bold}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:white;padding:10px 15px;border-radius:8px;cursor:pointer}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .contenedor {max-width:900px;margin:36px auto;padding:0 24px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .volver {color:#17365d;text-decoration:none;font-size:14px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) h1 {font-size:27px;color:#17365d;margin:24px 0 8px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .intro {color:#64748b;margin:0 0 24px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .panel {background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:26px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .campo {min-width:0}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .campo.ancho {grid-column:1/-1}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) label {display:block;font-size:14px;font-weight:bold;color:#17365d;margin-bottom:7px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) input, body:has(form[action="/modulos/representantes/clientes_nueva.php"]) textarea {width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:12px;font:15px Arial,sans-serif}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) textarea {min-height:110px;resize:vertical}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .acciones {display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:24px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .btn {background:#17365d;color:#fff;padding:12px 18px;border:0;border-radius:8px;text-decoration:none;cursor:pointer;font-size:14px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .error {background:#fee2e2;color:#991b1b;border-radius:8px;padding:12px 16px;margin-bottom:20px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .nota {font-size:13px;color:#64748b;margin-top:7px;line-height:1.5}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .check {display:flex;align-items:center;gap:10px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .check input {width:auto}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .check label {margin:0}


@media (max-width:650px){body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .cabecera-interior {padding:16px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .marca {font-size:19px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .contenedor {margin:24px auto;padding:0 16px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .panel {padding:18px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .grid {grid-template-columns:1fr}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .campo.ancho {grid-column:auto}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .acciones .btn {flex:1;text-align:center}}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .grupo {grid-column:1/-1;border:1px solid #e2e8f0;border-radius:12px;padding:18px;background:#f8fafc}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .grupo h2 {font-size:18px;color:#17365d;margin:0 0 18px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .grupo .grid {gap:16px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .grupo.general {background:white;border:0;padding:0}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .grupo.general h2 {margin-top:8px}
body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .campo input:focus, body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .campo textarea:focus {outline:2px solid #9bb9d7;outline-offset:1px}


@media (max-width:650px){body:has(form[action="/modulos/representantes/clientes_nueva.php"]) .grupo {padding:14px}}

/* ========= clientes_editar.php ========= */
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) * {box-sizing:border-box}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .cabecera {background:#17365d;color:white}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .marca {font-size:22px;font-weight:bold}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:white;padding:10px 15px;border-radius:8px;cursor:pointer}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .contenedor {max-width:900px;margin:36px auto;padding:0 24px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .volver {color:#17365d;text-decoration:none;font-size:14px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) h1 {font-size:27px;color:#17365d;margin:24px 0 8px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .intro {color:#64748b;margin:0 0 24px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .panel {background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:26px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .campo {min-width:0}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .campo.ancho {grid-column:1/-1}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) label {display:block;font-size:14px;font-weight:bold;color:#17365d;margin-bottom:7px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) input, body:has(form[action^="/modulos/representantes/clientes_editar.php"]) textarea {width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:12px;font:15px Arial,sans-serif}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) textarea {min-height:110px;resize:vertical}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .acciones {display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:24px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .btn {background:#17365d;color:#fff;padding:12px 18px;border:0;border-radius:8px;text-decoration:none;cursor:pointer;font-size:14px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .error {background:#fee2e2;color:#991b1b;border-radius:8px;padding:12px 16px;margin-bottom:20px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .nota {font-size:13px;color:#64748b;margin-top:7px;line-height:1.5}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .check {display:flex;align-items:center;gap:10px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .check input {width:auto}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .check label {margin:0}


@media (max-width:650px){body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .cabecera-interior {padding:16px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .marca {font-size:19px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .contenedor {margin:24px auto;padding:0 16px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .panel {padding:18px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .grid {grid-template-columns:1fr}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .campo.ancho {grid-column:auto}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .acciones .btn {flex:1;text-align:center}}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .grupo {grid-column:1/-1;border:1px solid #e2e8f0;border-radius:12px;padding:18px;background:#f8fafc}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .grupo h2 {font-size:18px;color:#17365d;margin:0 0 18px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .grupo .grid {gap:16px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .grupo.general {background:white;border:0;padding:0}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .grupo.general h2 {margin-top:8px}
body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .campo input:focus, body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .campo textarea:focus {outline:2px solid #9bb9d7;outline-offset:1px}


@media (max-width:650px){body:has(form[action^="/modulos/representantes/clientes_editar.php"]) .grupo {padding:14px}}

/* ========= clientes_ver.php ========= */
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) * {box-sizing:border-box}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .cabecera {background:#17365d;color:#fff}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .marca {font-size:22px;font-weight:bold}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:#fff;padding:10px 15px;border-radius:8px;cursor:pointer}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .contenedor {max-width:900px;margin:36px auto;padding:0 24px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .volver {color:#17365d;text-decoration:none;font-size:14px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) h1 {font-size:27px;color:#17365d;margin:24px 0 8px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .intro {color:#64748b;margin:0 0 24px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .panel {background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:26px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .campo {min-width:0;border-bottom:1px solid #edf2f7;padding-bottom:12px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .campo.ancho {grid-column:1/-1}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .etiqueta {display:block;font-size:13px;font-weight:bold;color:#64748b;margin-bottom:7px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .valor {font-size:15px;color:#243247;overflow-wrap:anywhere;white-space:pre-wrap}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .acciones {display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:24px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .btn {background:#17365d;color:#fff;padding:12px 18px;border:0;border-radius:8px;text-decoration:none;cursor:pointer;font-size:14px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .estado {display:inline-block;border-radius:6px;padding:6px 9px;background:#e8f5ec;color:#23613b;font-size:13px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .estado.no {background:#f1f5f9;color:#64748b}


@media (max-width:650px){body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .cabecera-interior {padding:16px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .marca {font-size:19px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .contenedor {margin:24px auto;padding:0 16px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .panel {padding:18px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .grid {grid-template-columns:1fr}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .campo.ancho {grid-column:auto}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .acciones .btn {flex:1;text-align:center}}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .grupo {grid-column:1/-1;border:1px solid #e2e8f0;border-radius:12px;padding:18px;background:#f8fafc}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .grupo h2 {font-size:18px;color:#17365d;margin:0 0 18px}
body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .grupo .grid {gap:16px}
@media (max-width:650px){body:has(a[href^="/modulos/representantes/clientes_editar.php"]):not(:has(form[action^="/modulos/representantes/clientes_editar.php"])):not(:has(form[action="/modulos/representantes/clientes.php"])) .grupo {padding:14px}}

/* ========= ventas.php ========= */
body:has(form[action="/modulos/representantes/ventas.php"]) * {box-sizing:border-box}
body:has(form[action="/modulos/representantes/ventas.php"]) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(form[action="/modulos/representantes/ventas.php"]) .cabecera {background:#17365d;color:#fff}
body:has(form[action="/modulos/representantes/ventas.php"]) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(form[action="/modulos/representantes/ventas.php"]) .marca {font-size:22px;font-weight:bold}
body:has(form[action="/modulos/representantes/ventas.php"]) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(form[action="/modulos/representantes/ventas.php"]) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:#fff;padding:10px 15px;border-radius:8px;cursor:pointer;font-size:14px}
body:has(form[action="/modulos/representantes/ventas.php"]) .salir:hover {background:rgba(255,255,255,.12)}
body:has(form[action="/modulos/representantes/ventas.php"]) .contenedor {max-width:1100px;margin:36px auto;padding:0 24px}
body:has(form[action="/modulos/representantes/ventas.php"]) .volver {display:inline-block;color:#17365d;text-decoration:none;font-size:14px;margin-bottom:22px}
body:has(form[action="/modulos/representantes/ventas.php"]) .volver:hover {text-decoration:underline}
body:has(form[action="/modulos/representantes/ventas.php"]) h1 {margin:0 0 8px;font-size:27px;color:#17365d}
body:has(form[action="/modulos/representantes/ventas.php"]) .intro {margin:0 0 24px;color:#64748b;line-height:1.5}
body:has(form[action="/modulos/representantes/ventas.php"]) .panel {background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:24px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(form[action="/modulos/representantes/ventas.php"]) .herramientas {display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:20px;flex-wrap:wrap}
body:has(form[action="/modulos/representantes/ventas.php"]) .filtros {display:flex;gap:10px;flex-wrap:wrap;flex:1;align-items:flex-end}
body:has(form[action="/modulos/representantes/ventas.php"]) .filtro-campo {flex:1 1 145px;min-width:135px}
body:has(form[action="/modulos/representantes/ventas.php"]) .filtro-busqueda {flex:2 1 250px}
body:has(form[action="/modulos/representantes/ventas.php"]) .filtro-campo label {display:block;color:#64748b;font-size:12px;margin-bottom:6px}
body:has(form[action="/modulos/representantes/ventas.php"]) .filtro-campo input, body:has(form[action="/modulos/representantes/ventas.php"]) .filtro-campo select {display:block;width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:11px;font-size:14px;background:#fff;color:#243247;min-width:0;height:42px}
body:has(form[action="/modulos/representantes/ventas.php"]) .filtros .btn {height:42px}
body:has(form[action="/modulos/representantes/ventas.php"]) .nueva-venta {margin-top:18px}
body:has(form[action="/modulos/representantes/ventas.php"]) .btn {display:inline-block;background:#17365d;color:#fff;text-decoration:none;border:0;border-radius:8px;padding:11px 15px;font-size:14px;cursor:pointer;white-space:nowrap}
body:has(form[action="/modulos/representantes/ventas.php"]) .btn:hover {background:#245487}
body:has(form[action="/modulos/representantes/ventas.php"]) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(form[action="/modulos/representantes/ventas.php"]) .btn-claro:hover {background:#dbe8f7}
body:has(form[action="/modulos/representantes/ventas.php"]) .btn-pendiente {background:#e2e8f0;color:#64748b;cursor:default}
body:has(form[action="/modulos/representantes/ventas.php"]) .resumen {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:22px}
body:has(form[action="/modulos/representantes/ventas.php"]) .resumen-item {border:1px solid #e2e8f0;background:#f8fafc;padding:16px;border-radius:10px}
body:has(form[action="/modulos/representantes/ventas.php"]) .resumen-item span {display:block;color:#64748b;font-size:13px;margin-bottom:8px}
body:has(form[action="/modulos/representantes/ventas.php"]) .resumen-item strong {display:block;color:#17365d;font-size:22px}
body:has(form[action="/modulos/representantes/ventas.php"]) .contador {color:#64748b;font-size:14px;margin-bottom:14px}
body:has(form[action="/modulos/representantes/ventas.php"]) .tabla-scroll {overflow-x:auto}
body:has(form[action="/modulos/representantes/ventas.php"]) table {width:100%;border-collapse:collapse;text-align:left}
body:has(form[action="/modulos/representantes/ventas.php"]) th, body:has(form[action="/modulos/representantes/ventas.php"]) td {padding:14px 10px;border-bottom:1px solid #e2e8f0;font-size:14px;vertical-align:middle}
body:has(form[action="/modulos/representantes/ventas.php"]) th {color:#64748b;font-size:13px;background:#f8fafc}
body:has(form[action="/modulos/representantes/ventas.php"]) tr:last-child td {border-bottom:0}
body:has(form[action="/modulos/representantes/ventas.php"]) .nombre {font-weight:bold;color:#17365d}
body:has(form[action="/modulos/representantes/ventas.php"]) .secundario {color:#64748b;font-size:12px;margin-top:5px}
body:has(form[action="/modulos/representantes/ventas.php"]) .importe {white-space:nowrap;text-align:right}
body:has(form[action="/modulos/representantes/ventas.php"]) .comision {font-weight:bold;color:#23613b}
body:has(form[action="/modulos/representantes/ventas.php"]) .buttons {display:flex;gap:6px;flex-wrap:wrap}
body:has(form[action="/modulos/representantes/ventas.php"]) .small {font-size:12px;padding:8px 10px}
body:has(form[action="/modulos/representantes/ventas.php"]) .vacio {padding:30px 10px;text-align:center;color:#64748b}


@media (max-width:750px){body:has(form[action="/modulos/representantes/ventas.php"]) .cabecera-interior {padding:16px}
body:has(form[action="/modulos/representantes/ventas.php"]) .marca {font-size:19px}
body:has(form[action="/modulos/representantes/ventas.php"]) .contenedor {margin:25px auto;padding:0 16px}
body:has(form[action="/modulos/representantes/ventas.php"]) .panel {padding:16px}
body:has(form[action="/modulos/representantes/ventas.php"]) .herramientas, body:has(form[action="/modulos/representantes/ventas.php"]) .filtros {width:100%}
body:has(form[action="/modulos/representantes/ventas.php"]) .filtro-campo, body:has(form[action="/modulos/representantes/ventas.php"]) .filtro-busqueda {flex:1 1 100%;min-width:100%}
body:has(form[action="/modulos/representantes/ventas.php"]) .filtros .btn {flex:1;text-align:center}
body:has(form[action="/modulos/representantes/ventas.php"]) .nueva-venta {margin-top:0;width:100%;text-align:center}
body:has(form[action="/modulos/representantes/ventas.php"]) .resumen {grid-template-columns:1fr;gap:8px}
body:has(form[action="/modulos/representantes/ventas.php"]) .resumen-item {padding:12px 14px}
body:has(form[action="/modulos/representantes/ventas.php"]) .resumen-item strong {font-size:20px}
body:has(form[action="/modulos/representantes/ventas.php"]) table, body:has(form[action="/modulos/representantes/ventas.php"]) thead, body:has(form[action="/modulos/representantes/ventas.php"]) tbody, body:has(form[action="/modulos/representantes/ventas.php"]) tr, body:has(form[action="/modulos/representantes/ventas.php"]) td {display:block}
body:has(form[action="/modulos/representantes/ventas.php"]) thead {display:none}
body:has(form[action="/modulos/representantes/ventas.php"]) tr {padding:12px 0;border-bottom:1px solid #e2e8f0}
body:has(form[action="/modulos/representantes/ventas.php"]) tr:last-child {border:0}
body:has(form[action="/modulos/representantes/ventas.php"]) td {padding:6px 2px;border:0;display:flex;justify-content:space-between;gap:12px;align-items:flex-start;text-align:right}
body:has(form[action="/modulos/representantes/ventas.php"]) td:before {content:attr(data-label);font-weight:bold;color:#64748b;text-align:left;flex:0 0 38%}
body:has(form[action="/modulos/representantes/ventas.php"]) td:first-child {display:block;text-align:left}
body:has(form[action="/modulos/representantes/ventas.php"]) td:first-child:before {display:none}
body:has(form[action="/modulos/representantes/ventas.php"]) .importe {text-align:right}}

/* ========= ventas_nueva.php ========= */
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) * {box-sizing:border-box}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .cabecera {background:#17365d;color:#fff}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .marca {font-size:22px;font-weight:bold}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:#fff;padding:10px 15px;border-radius:8px;cursor:pointer;font-size:14px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .salir:hover {background:rgba(255,255,255,.12)}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .contenedor {max-width:1100px;margin:36px auto;padding:0 24px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .volver {display:inline-block;color:#17365d;text-decoration:none;font-size:14px;margin-bottom:22px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .volver:hover {text-decoration:underline}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) h1 {margin:0 0 8px;font-size:27px;color:#17365d}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .intro {margin:0 0 24px;color:#64748b;line-height:1.5}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .panel {background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:24px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .herramientas {display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:20px;flex-wrap:wrap}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .filtros {display:flex;gap:9px;flex-wrap:wrap;flex:1;align-items:center}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .filtros input, body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .filtros select {border:1px solid #cbd5e1;border-radius:8px;padding:11px;font-size:14px;background:#fff;color:#243247;min-width:0}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .filtros input {flex:1;min-width:160px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .filtros select {max-width:190px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .btn {display:inline-block;background:#17365d;color:#fff;text-decoration:none;border:0;border-radius:8px;padding:11px 15px;font-size:14px;cursor:pointer;white-space:nowrap}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .btn:hover {background:#245487}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .btn-claro:hover {background:#dbe8f7}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .btn-pendiente {background:#e2e8f0;color:#64748b;cursor:default}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .resumen {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:22px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .resumen-item {border:1px solid #e2e8f0;background:#f8fafc;padding:16px;border-radius:10px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .resumen-item span {display:block;color:#64748b;font-size:13px;margin-bottom:8px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .resumen-item strong {display:block;color:#17365d;font-size:22px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .contador {color:#64748b;font-size:14px;margin-bottom:14px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .tabla-scroll {overflow-x:auto}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) table {width:100%;border-collapse:collapse;text-align:left}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) th, body:has(form[action="/modulos/representantes/ventas_nueva.php"]) td {padding:14px 10px;border-bottom:1px solid #e2e8f0;font-size:14px;vertical-align:middle}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) th {color:#64748b;font-size:13px;background:#f8fafc}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) tr:last-child td {border-bottom:0}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .nombre {font-weight:bold;color:#17365d}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .secundario {color:#64748b;font-size:12px;margin-top:5px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .importe {white-space:nowrap;text-align:right}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .comision {font-weight:bold;color:#23613b}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .vacio {padding:30px 10px;text-align:center;color:#64748b}


@media (max-width:750px){body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .cabecera-interior {padding:16px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .marca {font-size:19px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .contenedor {margin:25px auto;padding:0 16px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .panel {padding:16px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .herramientas, body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .filtros {width:100%}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .filtros input, body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .filtros select {width:100%;max-width:none;flex:auto}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .resumen {grid-template-columns:1fr;gap:8px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .resumen-item {padding:12px 14px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .resumen-item strong {font-size:20px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) table, body:has(form[action="/modulos/representantes/ventas_nueva.php"]) thead, body:has(form[action="/modulos/representantes/ventas_nueva.php"]) tbody, body:has(form[action="/modulos/representantes/ventas_nueva.php"]) tr, body:has(form[action="/modulos/representantes/ventas_nueva.php"]) td {display:block}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) thead {display:none}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) tr {padding:12px 0;border-bottom:1px solid #e2e8f0}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) tr:last-child {border:0}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) td {padding:6px 2px;border:0;display:flex;justify-content:space-between;gap:12px;align-items:flex-start;text-align:right}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) td:before {content:attr(data-label);font-weight:bold;color:#64748b;text-align:left;flex:0 0 38%}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) td:first-child {display:block;text-align:left}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) td:first-child:before {display:none}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .importe {text-align:right}}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .formgrid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .field {min-width:0}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .field.full {grid-column:1/-1}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) label {display:block;font-weight:bold;font-size:14px;color:#17365d;margin-bottom:7px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .field input, body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .field select {width:100%;padding:12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#243247;font-size:15px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .hint {font-size:13px;color:#64748b;margin-top:7px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .alert {background:#fee2e2;color:#991b1b;padding:13px 16px;border-radius:8px;margin-bottom:18px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .ok {background:#e8f6ed;color:#176139;padding:13px 16px;border-radius:8px;margin-bottom:18px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .total {padding:18px;border:1px solid #cbd5e1;background:#f8fafc;border-radius:10px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .total strong {font-size:25px;color:#176139}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .actions {display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .detail {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .detail-item {padding:14px;background:#f8fafc;border-radius:8px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .detail-item span {display:block;color:#64748b;font-size:13px;margin-bottom:7px}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .detail-item strong {color:#17365d}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .buttons {display:flex;gap:8px;flex-wrap:wrap}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .small {font-size:12px;padding:8px 10px}


@media (max-width:650px){body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .formgrid, body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .detail {grid-template-columns:1fr}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .field.full {grid-column:auto}
body:has(form[action="/modulos/representantes/ventas_nueva.php"]) .actions .btn {flex:1;text-align:center}}

/* ========= ventas_editar.php ========= */
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) * {box-sizing:border-box}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .cabecera {background:#17365d;color:#fff}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .marca {font-size:22px;font-weight:bold}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:#fff;padding:10px 15px;border-radius:8px;cursor:pointer;font-size:14px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .salir:hover {background:rgba(255,255,255,.12)}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .contenedor {max-width:1100px;margin:36px auto;padding:0 24px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .volver {display:inline-block;color:#17365d;text-decoration:none;font-size:14px;margin-bottom:22px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .volver:hover {text-decoration:underline}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) h1 {margin:0 0 8px;font-size:27px;color:#17365d}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .intro {margin:0 0 24px;color:#64748b;line-height:1.5}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .panel {background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:24px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .herramientas {display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:20px;flex-wrap:wrap}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .filtros {display:flex;gap:9px;flex-wrap:wrap;flex:1;align-items:center}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .filtros input, body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .filtros select {border:1px solid #cbd5e1;border-radius:8px;padding:11px;font-size:14px;background:#fff;color:#243247;min-width:0}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .filtros input {flex:1;min-width:160px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .filtros select {max-width:190px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .btn {display:inline-block;background:#17365d;color:#fff;text-decoration:none;border:0;border-radius:8px;padding:11px 15px;font-size:14px;cursor:pointer;white-space:nowrap}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .btn:hover {background:#245487}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .btn-claro:hover {background:#dbe8f7}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .btn-pendiente {background:#e2e8f0;color:#64748b;cursor:default}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .resumen {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:22px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .resumen-item {border:1px solid #e2e8f0;background:#f8fafc;padding:16px;border-radius:10px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .resumen-item span {display:block;color:#64748b;font-size:13px;margin-bottom:8px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .resumen-item strong {display:block;color:#17365d;font-size:22px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .contador {color:#64748b;font-size:14px;margin-bottom:14px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .tabla-scroll {overflow-x:auto}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) table {width:100%;border-collapse:collapse;text-align:left}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) th, body:has(form[action^="/modulos/representantes/ventas_editar.php"]) td {padding:14px 10px;border-bottom:1px solid #e2e8f0;font-size:14px;vertical-align:middle}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) th {color:#64748b;font-size:13px;background:#f8fafc}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) tr:last-child td {border-bottom:0}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .nombre {font-weight:bold;color:#17365d}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .secundario {color:#64748b;font-size:12px;margin-top:5px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .importe {white-space:nowrap;text-align:right}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .comision {font-weight:bold;color:#23613b}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .vacio {padding:30px 10px;text-align:center;color:#64748b}


@media (max-width:750px){body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .cabecera-interior {padding:16px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .marca {font-size:19px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .contenedor {margin:25px auto;padding:0 16px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .panel {padding:16px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .herramientas, body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .filtros {width:100%}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .filtros input, body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .filtros select {width:100%;max-width:none;flex:auto}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .resumen {grid-template-columns:1fr;gap:8px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .resumen-item {padding:12px 14px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .resumen-item strong {font-size:20px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) table, body:has(form[action^="/modulos/representantes/ventas_editar.php"]) thead, body:has(form[action^="/modulos/representantes/ventas_editar.php"]) tbody, body:has(form[action^="/modulos/representantes/ventas_editar.php"]) tr, body:has(form[action^="/modulos/representantes/ventas_editar.php"]) td {display:block}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) thead {display:none}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) tr {padding:12px 0;border-bottom:1px solid #e2e8f0}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) tr:last-child {border:0}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) td {padding:6px 2px;border:0;display:flex;justify-content:space-between;gap:12px;align-items:flex-start;text-align:right}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) td:before {content:attr(data-label);font-weight:bold;color:#64748b;text-align:left;flex:0 0 38%}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) td:first-child {display:block;text-align:left}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) td:first-child:before {display:none}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .importe {text-align:right}}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .formgrid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .field {min-width:0}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .field.full {grid-column:1/-1}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) label {display:block;font-weight:bold;font-size:14px;color:#17365d;margin-bottom:7px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .field input, body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .field select {width:100%;padding:12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#243247;font-size:15px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .hint {font-size:13px;color:#64748b;margin-top:7px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .alert {background:#fee2e2;color:#991b1b;padding:13px 16px;border-radius:8px;margin-bottom:18px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .ok {background:#e8f6ed;color:#176139;padding:13px 16px;border-radius:8px;margin-bottom:18px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .total {padding:18px;border:1px solid #cbd5e1;background:#f8fafc;border-radius:10px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .total strong {font-size:25px;color:#176139}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .actions {display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .detail {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .detail-item {padding:14px;background:#f8fafc;border-radius:8px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .detail-item span {display:block;color:#64748b;font-size:13px;margin-bottom:7px}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .detail-item strong {color:#17365d}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .buttons {display:flex;gap:8px;flex-wrap:wrap}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .small {font-size:12px;padding:8px 10px}


@media (max-width:650px){body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .formgrid, body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .detail {grid-template-columns:1fr}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .field.full {grid-column:auto}
body:has(form[action^="/modulos/representantes/ventas_editar.php"]) .actions .btn {flex:1;text-align:center}}

/* ========= ventas_ver.php ========= */
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) * {box-sizing:border-box}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .cabecera {background:#17365d;color:#fff}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .marca {font-size:22px;font-weight:bold}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:#fff;padding:10px 15px;border-radius:8px;cursor:pointer;font-size:14px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .salir:hover {background:rgba(255,255,255,.12)}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .contenedor {max-width:1100px;margin:36px auto;padding:0 24px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .volver {display:inline-block;color:#17365d;text-decoration:none;font-size:14px;margin-bottom:22px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .volver:hover {text-decoration:underline}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) h1 {margin:0 0 8px;font-size:27px;color:#17365d}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .intro {margin:0 0 24px;color:#64748b;line-height:1.5}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .panel {background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:24px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .herramientas {display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:20px;flex-wrap:wrap}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .filtros {display:flex;gap:9px;flex-wrap:wrap;flex:1;align-items:center}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .filtros input, body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .filtros select {border:1px solid #cbd5e1;border-radius:8px;padding:11px;font-size:14px;background:#fff;color:#243247;min-width:0}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .filtros input {flex:1;min-width:160px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .filtros select {max-width:190px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .btn {display:inline-block;background:#17365d;color:#fff;text-decoration:none;border:0;border-radius:8px;padding:11px 15px;font-size:14px;cursor:pointer;white-space:nowrap}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .btn:hover {background:#245487}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .btn-claro:hover {background:#dbe8f7}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .btn-pendiente {background:#e2e8f0;color:#64748b;cursor:default}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .resumen {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:22px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .resumen-item {border:1px solid #e2e8f0;background:#f8fafc;padding:16px;border-radius:10px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .resumen-item span {display:block;color:#64748b;font-size:13px;margin-bottom:8px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .resumen-item strong {display:block;color:#17365d;font-size:22px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .contador {color:#64748b;font-size:14px;margin-bottom:14px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .tabla-scroll {overflow-x:auto}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) table {width:100%;border-collapse:collapse;text-align:left}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) th, body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) td {padding:14px 10px;border-bottom:1px solid #e2e8f0;font-size:14px;vertical-align:middle}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) th {color:#64748b;font-size:13px;background:#f8fafc}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) tr:last-child td {border-bottom:0}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .nombre {font-weight:bold;color:#17365d}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .secundario {color:#64748b;font-size:12px;margin-top:5px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .importe {white-space:nowrap;text-align:right}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .comision {font-weight:bold;color:#23613b}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .vacio {padding:30px 10px;text-align:center;color:#64748b}


@media (max-width:750px){body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .cabecera-interior {padding:16px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .marca {font-size:19px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .contenedor {margin:25px auto;padding:0 16px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .panel {padding:16px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .herramientas, body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .filtros {width:100%}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .filtros input, body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .filtros select {width:100%;max-width:none;flex:auto}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .resumen {grid-template-columns:1fr;gap:8px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .resumen-item {padding:12px 14px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .resumen-item strong {font-size:20px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) table, body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) thead, body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) tbody, body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) tr, body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) td {display:block}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) thead {display:none}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) tr {padding:12px 0;border-bottom:1px solid #e2e8f0}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) tr:last-child {border:0}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) td {padding:6px 2px;border:0;display:flex;justify-content:space-between;gap:12px;align-items:flex-start;text-align:right}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) td:before {content:attr(data-label);font-weight:bold;color:#64748b;text-align:left;flex:0 0 38%}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) td:first-child {display:block;text-align:left}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) td:first-child:before {display:none}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .importe {text-align:right}}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .formgrid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .field {min-width:0}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .field.full {grid-column:1/-1}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) label {display:block;font-weight:bold;font-size:14px;color:#17365d;margin-bottom:7px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .field input, body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .field select {width:100%;padding:12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#243247;font-size:15px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .hint {font-size:13px;color:#64748b;margin-top:7px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .alert {background:#fee2e2;color:#991b1b;padding:13px 16px;border-radius:8px;margin-bottom:18px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .ok {background:#e8f6ed;color:#176139;padding:13px 16px;border-radius:8px;margin-bottom:18px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .total {padding:18px;border:1px solid #cbd5e1;background:#f8fafc;border-radius:10px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .total strong {font-size:25px;color:#176139}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .actions {display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .detail {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .detail-item {padding:14px;background:#f8fafc;border-radius:8px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .detail-item span {display:block;color:#64748b;font-size:13px;margin-bottom:7px}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .detail-item strong {color:#17365d}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .buttons {display:flex;gap:8px;flex-wrap:wrap}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .small {font-size:12px;padding:8px 10px}


@media (max-width:650px){body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .formgrid, body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .detail {grid-template-columns:1fr}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .field.full {grid-column:auto}
body:has(.detail):not(:has(form[action^="/modulos/representantes/ventas_editar.php"])) .actions .btn {flex:1;text-align:center}}

/* ========= estadisticas.php ========= */
body:has(form[action="/modulos/representantes/estadisticas.php"]) * {box-sizing:border-box}
body:has(form[action="/modulos/representantes/estadisticas.php"]) {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .cabecera {background:#17365d;color:#fff}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .marca {font-size:22px;font-weight:bold}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .marca small {display:block;margin-top:5px;font-size:12px;font-weight:normal;color:#cbd9e9}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .salir {border:1px solid rgba(255,255,255,.5);background:transparent;color:#fff;padding:10px 15px;border-radius:8px;cursor:pointer;font-size:14px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .contenedor {max-width:1100px;margin:36px auto;padding:0 24px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .volver {display:inline-block;color:#17365d;text-decoration:none;font-size:14px;margin-bottom:22px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) h1 {margin:0 0 8px;font-size:27px;color:#17365d}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .intro {margin:0 0 24px;color:#64748b;line-height:1.5}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .panel {background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:24px;margin-bottom:20px;box-shadow:0 4px 14px rgba(23,54,93,.04)}
body:has(form[action="/modulos/representantes/estadisticas.php"]) h2 {font-size:19px;color:#17365d;margin:0 0 18px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .filtros {display:flex;gap:10px;flex-wrap:wrap;align-items:end}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .campo {flex:1;min-width:155px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .campo label {display:block;font-size:13px;color:#64748b;margin-bottom:7px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .campo select, body:has(form[action="/modulos/representantes/estadisticas.php"]) .campo input {width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:11px;font-size:14px;background:#fff;color:#243247}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .btn {display:inline-block;background:#17365d;color:#fff;text-decoration:none;border:0;border-radius:8px;padding:11px 15px;font-size:14px;cursor:pointer}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .btn:hover {background:#245487}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .btn-claro {background:#eaf1fa;color:#17365d}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .resumen {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:22px 0}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .dato {background:#fff;border:1px solid #e2e8f0;border-radius:13px;padding:22px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .dato span {display:block;font-size:14px;color:#64748b;margin-bottom:10px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .dato strong {font-size:25px;color:#17365d;overflow-wrap:anywhere}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .dato.comision strong {color:#23613b}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .tabla-scroll {overflow-x:auto}
body:has(form[action="/modulos/representantes/estadisticas.php"]) table {width:100%;border-collapse:collapse}
body:has(form[action="/modulos/representantes/estadisticas.php"]) th, body:has(form[action="/modulos/representantes/estadisticas.php"]) td {padding:13px 11px;text-align:left;border-bottom:1px solid #e2e8f0;font-size:14px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) th {background:#f8fafc;color:#64748b;font-size:13px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) td.numero, body:has(form[action="/modulos/representantes/estadisticas.php"]) th.numero {text-align:right;white-space:nowrap}
body:has(form[action="/modulos/representantes/estadisticas.php"]) tr:last-child td {border-bottom:0}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .vacio {color:#64748b;padding:15px 0}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .nota {font-size:13px;color:#64748b;line-height:1.5;margin-top:15px}


@media (max-width:750px){body:has(form[action="/modulos/representantes/estadisticas.php"]) .cabecera-interior {padding:16px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .marca {font-size:19px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .contenedor {margin:25px auto;padding:0 16px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .panel {padding:16px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .resumen {grid-template-columns:1fr;gap:9px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .dato {padding:16px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .dato strong {font-size:22px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .campo {min-width:100%}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .filtros .btn {flex:1;text-align:center}
body:has(form[action="/modulos/representantes/estadisticas.php"]) table, body:has(form[action="/modulos/representantes/estadisticas.php"]) thead, body:has(form[action="/modulos/representantes/estadisticas.php"]) tbody, body:has(form[action="/modulos/representantes/estadisticas.php"]) tr, body:has(form[action="/modulos/representantes/estadisticas.php"]) td {display:block}
body:has(form[action="/modulos/representantes/estadisticas.php"]) thead {display:none}
body:has(form[action="/modulos/representantes/estadisticas.php"]) tr {padding:10px 0;border-bottom:1px solid #e2e8f0}
body:has(form[action="/modulos/representantes/estadisticas.php"]) tr:last-child {border:0}
body:has(form[action="/modulos/representantes/estadisticas.php"]) td {border:0;padding:6px 0;display:flex;justify-content:space-between;gap:12px;text-align:right}
body:has(form[action="/modulos/representantes/estadisticas.php"]) td:before {content:attr(data-label);font-weight:bold;color:#64748b;text-align:left;flex:0 0 40%}
body:has(form[action="/modulos/representantes/estadisticas.php"]) td.numero {text-align:right;white-space:normal}}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .desglose-casa {margin-top:18px;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .desglose-casa summary {padding:15px 17px;background:#f8fafc;cursor:pointer;font-weight:700;color:#17365d}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .desglose-casa[open] summary {border-bottom:1px solid #e2e8f0}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .desglose-contenido {padding:15px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .desglose-anio {margin:8px 0 18px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .desglose-anio h3 {font-size:16px;color:#17365d;margin:0 0 10px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .subtitulo-tabla {font-weight:700;font-size:13px;color:#52647b;margin:16px 0 7px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .comision-destacada {font-weight:700;color:#23613b}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .detalle-nota {font-size:13px;color:#64748b;line-height:1.5;margin:0 0 12px}



@media (max-width:750px){body:has(form[action="/modulos/representantes/estadisticas.php"]) .desglose-contenido {padding:10px}
body:has(form[action="/modulos/representantes/estadisticas.php"]) .desglose-casa summary {padding:14px}}

/* ========= AJUSTES GENERALES SOLICITADOS ========= */
/* Botones de regreso uniformes, también en las fichas y formularios. */
body:not(:has(.login)) a.volver {
    display: inline-block;
    background: #17365d;
    color: #fff;
    padding: 11px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 22px;
    transition: background .2s ease;
}
body:not(:has(.login)) a.volver:hover { background: #245487; color: #fff; text-decoration: none; }
/* Los enlaces del panel se muestran como botones, pero los estados sin enlace permanecen grises. */
body:has(.tarjeta) a.estado {
    display: inline-block;
    background: #17365d;
    color: #fff;
    padding: 12px 18px;
    border-radius: 9px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .2s ease;
}
body:has(.tarjeta) a.estado:hover { background: #245487; color: #fff; }


/* Botones de acciones en los listados */
.acciones {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.acciones a {
    display: inline-block;
    padding: 8px 12px;
    background: #17365d;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.acciones a:hover {
    background: #245487;
    color: #ffffff;
    text-decoration: none;
}

/* CORRECCIÓN DEFINITIVA: botones Volver */
body:not(:has(.login)) a.volver,
body:not(:has(.login)) a.volver:visited,
body:not(:has(.login)) a.volver:hover {
    color: #ffffff !important;
}

/* Color azul del título CRM Comercial */
body .login h1 {
    color: #1769aa !important;
}

/* Franja azul del título en el acceso */
body .login h1 {
    background: #19375c;
    color: #ffffff !important;
    padding: 18px 20px;
    margin: -35px -35px 15px;
    border-radius: 14px 14px 0 0;
    text-align: center;
}
/* GESTIÓN GD: estructura compartida para panel, usuarios y módulos. */
body.gd {margin:0;background:#f1f5f9;color:#243247;font-family:Arial,sans-serif;line-height:1.5}
.gd .cabecera {background:#17365d;color:white}
.gd .cabecera-interior {max-width:1100px;margin:auto;padding:20px 24px;display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap}
.gd .marca {font-size:22px;font-weight:700;line-height:1.25}
.gd .marca small {display:block;font-size:12px;font-weight:400;color:#cbd9e9;margin-top:6px}
.gd nav {display:flex;gap:18px;flex-wrap:wrap}
.gd nav a {color:white;text-decoration:none;font-size:14px}
.gd nav a:hover {text-decoration:underline}
.gd .salir {background:transparent;border:1px solid #b2c5df;color:white;border-radius:8px;padding:10px 15px;cursor:pointer}
.gd .contenedor {max-width:1100px;margin:36px auto;padding:0 24px}
.gd h1,.gd h2 {color:#17365d;line-height:1.25}
.gd h1 {margin:0 0 12px;font-size:28px}
.gd h2 {font-size:20px;margin:0 0 14px}
.gd .intro {color:#64748b;margin:0 0 28px}
.gd .grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.gd .tarjeta,.gd .panel {background:white;border:1px solid #e2e8f0;border-radius:14px;padding:26px;box-shadow:0 4px 14px #17365d0a}
.gd .tarjeta p {color:#64748b;font-size:14px;min-height:44px}
.gd .estado {display:inline-block;background:#f1f5f9;border-radius:6px;padding:8px 12px;color:#64748b;font-size:13px}
.gd a {color:#17365d}
.gd .btn {display:inline-block;background:#17365d;color:#fff;padding:11px 15px;border:0;border-radius:8px;text-decoration:none;font-size:14px;cursor:pointer}
.gd .btn:hover {background:#245487}
.gd .btn-claro {background:#eaf1fa;color:#17365d}
.gd .btn-claro:hover {background:#dbe7f5}
.gd .acciones {display:flex;gap:12px;flex-wrap:wrap;margin-top:22px}
.gd .campo {display:flex;flex-direction:column;gap:7px;min-width:0}
.gd .campo label {font-size:14px;font-weight:700}
.gd .campo input,.gd .campo select,.gd .campo textarea {width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:11px;font:inherit;background:white;color:#243247}
.gd .campo input[type=checkbox] {width:auto}
.gd .campo small {color:#64748b;font-size:12px}
.gd .tabla-scroll {overflow-x:auto}
.gd table {width:100%;border-collapse:collapse;font-size:14px}
.gd th {text-align:left;color:#64748b;background:#f8fafc;font-weight:700}
.gd th,.gd td {padding:13px;border-bottom:1px solid #e2e8f0;vertical-align:top}
.gd .gd-separacion {margin-top:24px}
.gd fieldset {border:1px solid #e2e8f0;border-radius:10px;padding:20px}
.gd legend {padding:0 8px;color:#17365d;font-weight:700}
.gd .error,.gd .alert {background:#fee2e2;color:#991b1b;padding:14px;border-radius:8px;margin-bottom:20px}
.gd .ok {background:#dcfce7;color:#166534;padding:14px;border-radius:8px;margin-bottom:20px}
.gd :focus-visible {outline:3px solid #4a90d9;outline-offset:3px}
.gd .volver {display:inline-block;margin-bottom:20px;text-decoration:none}
body.gd:has(.login) {background:#edf2f7;padding:24px;min-height:100svh}
.gd .login {max-width:420px}
@media(max-width:650px){.gd .grid{grid-template-columns:1fr}.gd .contenedor{padding:0 16px;margin:24px auto}.gd .cabecera-interior{padding:16px}.gd .panel,.gd .tarjeta{padding:20px}.gd h1{font-size:24px}.gd nav{order:3;width:100%}.gd .marca{font-size:19px}}
