* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f6fb;
    color: #1f2937;
}

.loginBody {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pageWrap {
    width: min(1200px, 94%);
    margin: 24px auto;
}

.topBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.topBar h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.topBar p {
    margin: 0;
    color: #5b6575;
}

.topNav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topNav a,
.buttonPrimary,
.buttonSecondary {
    text-decoration: none;
    border-radius: 8px;
    padding: 10px 16px;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 15px;
}

.topNav a,
.buttonPrimary {
    background: #1d4ed8;
    color: #ffffff;
}

.buttonPrimary {
    padding: 5px 10px !important;
    font-size: 12px !important;
    border-radius: 8px;
}

a[href*="sync-zoho"] {
    background: white !important;
    color: #1d4ed8 !important;
    border: 1px solid #1d4ed8 !important;
}


.buttonSecondary {
    background: #e5e7eb;
    color: #111827;
}

.card,
.loginCard {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.loginCard {
    width: min(460px, 100%);
}

.cardsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.kpiCard h2 {
    margin-top: 0;
    font-size: 18px;
}

.kpiNumber {
    font-size: 40px;
    font-weight: bold;
    color: #0f172a;
}

.sectionHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.tableWrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    padding: 12px 10px;
    font-size: 14px;
}

th {
    background: #f8fafc;
}

.formBlock,
.formGrid {
    display: grid;
    gap: 14px;
}

.formGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fieldFull {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
}

textarea {
    resize: vertical;
}

.checkboxLine {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.checkboxLine label {
    font-weight: normal;
}

.checkboxLine input {
    width: auto;
    margin-right: 8px;
}

.actionRow {
    display: flex;
    gap: 10px;
    align-items: center;
}

.alertError,
.alertSuccess,
.loginHint,
.back-menu {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.alertError {
    background: #fee2e2;
    color: #991b1b;
}

.alertSuccess {
    background: #dcfce7;
    color: #166534;
}

.loginHint,
.back-menu {
    background: #eff6ff;
    color: #1e40af;
}

.back-menu a {
    color: #1e40af;
    text-decoration: none;
}

@media (max-width: 800px) {
    .topBar {
        flex-direction: column;
        align-items: flex-start;
    }

    .formGrid {
        grid-template-columns: 1fr;
    }

    .actionRow {
        flex-direction: column;
        align-items: stretch;
    }
}


/* estilos reporte extra Pegar este bloque al final de estilos.css */

.actions-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}

.sync-status-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sync-meta {
    font-size: 12px;
    color: #5f6f8d;
}

.btn-zoho {
    background: #0ea5a4;
    color: #ffffff;
}

.btn-success-soft {
    background: #e7f8ec;
    color: #166534;
}

.btn-zoho:hover,
.btn-success-soft:hover {
    opacity: 0.92;
}

@media (max-width: 900px) {
    .actions-stack {
        min-width: auto;
    }
}


/* Pegar al final de estilos.css */

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.sync-meta {
    margin-top: 6px;
    font-size: 12px;
    color: #5f6f8d;
}

.actions-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 90px;
}

.btn-zoho {
    background: #0ea5a4;
    color: #ffffff;
}


/* ZohoBridge branding patch - pegar al final de estilos.css */

:root{
    --zb-primary: #1d4ed8;
    --zb-primary-dark: #143caa;
    --zb-accent: #0ea5a4;
    --zb-accent-dark: #0f766e;
    --zb-ink: #14315c;
    --zb-bg: #eef5fb;
    --zb-card: #ffffff;
    --zb-muted: #5b6985;
    --zb-line: #d9e5f2;
    --zb-soft: #e8f7f6;
}

body{
    background: linear-gradient(180deg, #f4f8fc 0%, #eef5fb 100%);
    color: var(--zb-ink);
}

.topBar,
.page-header{
    background: linear-gradient(90deg, rgba(29,78,216,.06) 0%, rgba(14,165,164,.10) 100%);
    border: 1px solid var(--zb-line);
    border-radius: 18px;
    padding: 20px 22px;
    margin-bottom: 18px;
}

.topBar h1,
.page-header h1{
    margin-bottom: 6px;
    color: var(--zb-ink);
}

.topBar p,
.subtitle{
    color: var(--zb-muted);
}

.card,
.sysCard{
    background: var(--zb-card);
    border: 1px solid var(--zb-line);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(20,49,92,.06);
}

.topNav a,
.buttonPrimary,
.btn.btn-primary,
.btn.btn-secondary,
.btn.btn-zoho,
.sysPrimary{
    background: var(--zb-primary);
    color: #fff;
    border-radius: 12px;
    border: none;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(29,78,216,.18);
}

.topNav a:hover,
.buttonPrimary:hover,
.btn.btn-primary:hover,
.btn.btn-secondary:hover,
.btn.btn-zoho:hover,
.sysPrimary:hover{
    background: var(--zb-primary-dark);
}

.btn.btn-zoho{
    background: var(--zb-accent);
    box-shadow: 0 6px 18px rgba(14,165,164,.18);
}

.btn.btn-zoho:hover{
    background: var(--zb-accent-dark);
}

.kpiCard{
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.kpiCard::after{
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    right: -35px;
    top: -35px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(29,78,216,.14) 0%, rgba(14,165,164,.05) 70%, transparent 72%);
}

.kpiNumber{
   color: var(--zb-ink);
    font-size: 52px;
    font-weight: 700;
 
}

table thead th,
.crm-table thead th,
.sysTable thead th{
    background: #f3f8fd;
    color: var(--zb-ink);
 
}

table tbody tr:hover,
.crm-table tbody tr:hover,
.sysTable tbody tr:hover{
    background: #f8fbff;
}

.badge,
.pill{
    border-radius: 999px;
    font-weight: 700;
}

.badge-synced{
    background: #e8f7f0;
    color: #166534;
}

.badge-pending{
    background: #fff8db;
    color: #854d0e;
}

.badge-error{
    background: #fde7e7;
    color: #b42318;
}

.back-menu a{
    color: var(--zb-primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.zbBrand{
    display:flex;
    align-items:center;
    gap:16px;
}

.zbBrand img{
    height: 52px;
    width: auto;
}

.zbBrandSmall img{
    height: 36px;
    width: auto;
}

.zbBrandText{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.zbBrandText .zbName{
    font-size: 30px;
    font-weight: 800;
    color: var(--zb-ink);
    line-height: 1.1;
}

.zbBrandText .zbTag{
    color: var(--zb-muted);
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 800px){
    .zbBrand{
        flex-direction: column;
        align-items:flex-start;
    }

    .zbBrand img{
        height: 44px;
    }

    .zbBrandText .zbName{
        font-size: 24px;
    }
}
/* === Zoho Sync Status === */

.sync-box {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid #e3edf7;
    margin-top: 10px;
}

.sync-ok {
    background: #e8f7f0;
    border-color: #b7e4c7;
}

.sync-pending {
    background: #fff8db;
    border-color: #fde68a;
}

.sync-error {
    background: #fde7e7;
    border-color: #f5c2c7;
}

.sync-status {
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 999px;
    display: inline-block;
}

.sync-status.ok {
    background: #22c55e;
    color: white;
}

.sync-status.pending {
    background: #f59e0b;
    color: white;
}

.sync-status.error {
    background: #ef4444;
    color: white;
}

.zbUserLine{
    color: var(--zb-muted);
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

/* ===== ZohoBridge Login ===== */

.zbLoginCard {
    margin-top: 60px;
    padding: 34px 34px 30px;
}

.zbLoginBrand {
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: flex-start;
    margin-bottom: 26px;
}

.zbLoginLogo {
    height: 74px;
    width: auto;
    display: block;
}

.zbLoginBrandText {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.zbLoginMini {
    font-size: 18px;
    font-weight: 800;
    color: var(--zb-ink);
    line-height: 1.1;
}

.zbLoginMini2 {
    font-size: 12px;
    font-weight: 600;
    color: var(--zb-muted);
    line-height: 1.3;
}

.zbLoginTitle {
    margin-top: 0;
    margin-bottom: 12px;
    text-align: center;
    color: var(--zb-ink);
    font-size: 28px;
}

.zbLoginSubtitle {
    text-align: center;
    margin-bottom: 28px;
}

.zbLoginError {
    background: #fde7e7;
    color: #b42318;
    padding: 12px 14px;
    border-radius: 12px;
    margin: 0 0 22px 0;
}

.zbLoginForm .form-group {
    margin-bottom: 8px;
}

.zbLoginForm .form-group label {
    margin-bottom: 8px;
    display: inline-block;
    font-weight: 700;
    color: var(--zb-ink);
}

.zbLoginForm input[type="text"],
.zbLoginForm input[type="password"] {
    width: 100%;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid #ccd9ea;
    background: #f8fbff;
}

.zbLoginForm input[type="text"]:focus,
.zbLoginForm input[type="password"]:focus {
    outline: none;
    border-color: var(--zb-primary);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.10);
}

.zbLoginActions {
    justify-content: center;
    margin-top: 22px;
}

.zbLoginButton {
    min-width: 180px;
    padding: 12px 22px;
    font-weight: 800;
    border-radius: 12px;
}

@media (max-width: 640px) {
    .zbLoginCard {
        padding: 26px 20px 24px;
    }

    .zbLoginBrand {
        gap: 14px;
        margin-bottom: 22px;
    }

    .zbLoginLogo {
        height: 90px;
    }

    .zbLoginMini {
        font-size: 16px;
    }

    .zbLoginMini2 {
        font-size: 11px;
    }

    .zbLoginTitle {
        font-size: 24px;
    }
}  
  
/* =========================================
   TEMA REAL POR ROL
========================================= */

/* ---------- ADMIN ---------- */

/* =========================================
   ADMIN - versión más clara y consistente
========================================= */

body.rol-admin {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e3a8a;
}

body.rol-admin .pageWrap {
    min-height: 100vh;
}

body.rol-admin .topBar {
    background: linear-gradient(90deg, #eff6ff, #dbeafe);
    border-bottom: 3px solid #2563eb;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

body.rol-admin .zbUserLine,
body.rol-admin .zbUserLine strong,
body.rol-admin .zbBrandText {
    color: #1e3a8a;
}

body.rol-admin .topNav a {
    background: #1d4ed8;
    color: #ffffff;
    border: 1px solid #60a5fa;
}

body.rol-admin .topNav a:hover,
body.rol-admin .topNav a:focus {
    background: #ffffff;
    color: #1d4ed8;
    border: 1px solid #1d4ed8;
}

body.rol-admin .card {
    //background: guinda;
    background: #763b3b;
    //color: #1e3a8a;
  color: #ffffff;
  
    //border: 1px solid #93c5fd;
  border: 1px solid #2a2a2a;}
  
  
body.rol-admin .card h1,
body.rol-admin .card h2,
body.rol-admin .card h3,
body.rol-admin .card p,
body.rol-admin .card strong,
body.rol-admin .card a {
    color: #ffffff;
  }
  
  
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

body.rol-admin .kpiCard h2,
body.rol-admin .sectionHeader h2 {
    //color: #1d4ed8;
  color: #32a41f
}

body.rol-admin .kpiNumber {
    //color: #1e3a8a;
  color: #33E413;
}

body.rol-admin th {
    background: #dbeafe;
    color: #1e3a8a;
}

body.rol-admin table,
body.rol-admin .tableWrap {
    background: #ffffff;
}

body.rol-admin tr:nth-child(odd) td {
  background: #763b3b;
  
}

body.rol-admin tr:nth-child(even) td {
    background: #4b6e9b;
}



body.rol-admin .buttonPrimary {
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #60a5fa;
}

body.rol-admin .buttonPrimary:hover,
body.rol-admin .buttonPrimary:focus {
    background: #ffffff;
    color: #1d4ed8;
    border: 1px solid #1d4ed8;
}





/* ---------- AGENTE ---------- */
body.rol-agente {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    color: #1e293b;
}

body.rol-agente .topBar {
    background: #ffffff;
    border-bottom: 3px solid #10b981;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

body.rol-agente .zbUserLine,
body.rol-agente .zbUserLine strong,
body.rol-agente .zbBrandText {
    color: #1e293b;
}

body.rol-agente .topNav a {
    background: #10b981;
    color: #ffffff;
    border: 1px solid #34d399;
}

body.rol-agente .topNav a:hover {
    background: #059669;
}

body.rol-agente .card {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #dbe4ee;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body.rol-agente .kpiCard h2,
body.rol-agente .sectionHeader h2 {
    color: #047857;
}

body.rol-agente .kpiNumber {
    color: #111827;
}

body.rol-agente th {
    background: #ecfdf5;
    color: #065f46;
}

body.rol-agente td {
    border-color: #e5e7eb;
}

body.rol-agente tr:nth-child(even) td {
    background: #f8fafc;
}

body.rol-agente .buttonPrimary {
    background: #10b981;
    color: #ffffff;
    border: 1px solid #34d399;
}

body.rol-agente .buttonPrimary:hover {
    background: #059669;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}