:root{--crm-bg:#fffaf4;--crm-card:#fff;--crm-black:#101010;--crm-muted:#71675c;--crm-line:#ead8bd;--crm-gold:#d4a43a;--crm-gold2:#b78318;--crm-red:#cf1f32;--crm-green:#10884b;--crm-blue:#3156d4}
body.crm-body{background:var(--crm-bg);color:#151515;margin:0}.crm-shell{min-height:100vh;display:grid;grid-template-columns:282px minmax(0,1fr)}.crm-sidebar{background:#101010;color:#fff;padding:26px 22px;position:sticky;top:0;height:100vh;box-sizing:border-box;overflow:auto}.crm-brand{margin-bottom:24px}.crm-brand strong{font-family:Georgia,serif;font-size:39px;line-height:.92;color:var(--crm-gold);display:block}.crm-brand span{display:block;color:#cfc6b9;margin-top:10px;font-size:13px}.crm-user{border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.045);border-radius:18px;padding:14px;margin-bottom:20px}.crm-user b{display:block}.crm-user small{color:#cfc6b9}.crm-nav{display:grid;gap:7px}.crm-nav a{color:#fff;text-decoration:none;display:flex;align-items:center;gap:10px;padding:12px 13px;border-radius:14px;font-weight:800;border:1px solid transparent}.crm-nav a:hover,.crm-nav a.active{background:rgba(212,164,58,.14);border-color:rgba(212,164,58,.34);color:#ffdb7a}.crm-main{padding:32px;min-width:0}.crm-top{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:24px}.crm-title h1{font-family:Georgia,serif;font-size:clamp(46px,6vw,86px);line-height:.9;margin:0}.crm-title p{color:var(--crm-muted);font-size:17px;margin:14px 0 0}.crm-actions{display:flex;gap:10px;flex-wrap:wrap}.crm-card{background:#fff;border:1px solid var(--crm-line);border-radius:24px;padding:22px;box-shadow:0 18px 50px rgba(87,55,15,.06)}.crm-grid{display:grid;gap:16px}.crm-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.crm-stat{background:#fff;border:1px solid var(--crm-line);border-radius:22px;padding:20px;position:relative;overflow:hidden}.crm-stat:after{content:"";position:absolute;width:120px;height:120px;border-radius:50%;right:-60px;top:-60px;background:rgba(212,164,58,.12)}.crm-stat span{display:block;color:var(--crm-muted);font-weight:800;font-size:14px}.crm-stat strong{display:block;font-size:34px;margin-top:8px}.crm-stat small{display:block;color:var(--crm-muted);margin-top:6px}.crm-two{display:grid;grid-template-columns:1.1fr .9fr;gap:18px;margin-top:18px}.crm-section-title{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px}.crm-section-title h2{font-family:Georgia,serif;margin:0;font-size:34px}.crm-table-wrap{overflow:auto}.crm-table{width:100%;border-collapse:separate;border-spacing:0 10px}.crm-table th{text-align:left;color:var(--crm-muted);font-size:13px;padding:0 12px}.crm-table td{background:#fff;border-top:1px solid var(--crm-line);border-bottom:1px solid var(--crm-line);padding:14px 12px;vertical-align:middle}.crm-table td:first-child{border-left:1px solid var(--crm-line);border-radius:16px 0 0 16px}.crm-table td:last-child{border-right:1px solid var(--crm-line);border-radius:0 16px 16px 0}.crm-thumb{width:64px;height:64px;object-fit:cover;border-radius:14px;background:#f5eadc}.crm-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:900}.crm-badge.green{background:#e9f9ef;color:#08783b}.crm-badge.red{background:#ffecef;color:#b11224}.crm-badge.gold{background:#fff5da;color:#9a6b00}.crm-badge.gray{background:#f4f1ec;color:#6b6258}.crm-badge.blue{background:#edf1ff;color:#3156d4}.crm-form{display:grid;gap:16px}.crm-form-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.crm-form label{font-weight:900;display:block;margin-bottom:7px}.crm-form input,.crm-form select,.crm-form textarea{width:100%;box-sizing:border-box;border:1px solid var(--crm-line);border-radius:16px;padding:13px 14px;background:#fff;font:inherit}.crm-form textarea{min-height:130px;resize:vertical}.crm-help{font-size:13px;color:var(--crm-muted);margin-top:6px}.crm-btn{appearance:none;border:0;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:999px;padding:12px 18px;font-weight:900;cursor:pointer;font:inherit}.crm-btn.gold{background:linear-gradient(135deg,#e3c15d,#c9972b);color:#111}.crm-btn.black{background:#111;color:#fff}.crm-btn.light{background:#fff;color:#111;border:1px solid var(--crm-line)}.crm-btn.red{background:#d21f32;color:#fff}.crm-btn.small{padding:8px 12px;font-size:13px}.crm-inline-actions{display:flex;gap:8px;flex-wrap:wrap}.crm-alert{padding:14px 16px;border-radius:16px;margin:14px 0;font-weight:800}.crm-alert.success{background:#e9f9ef;color:#08783b;border:1px solid #bde9cd}.crm-alert.error{background:#ffecef;color:#b11224;border:1px solid #ffc4cc}.crm-bars{display:grid;gap:10px}.crm-bar{display:grid;grid-template-columns:96px 1fr 50px;align-items:center;gap:10px;font-size:13px}.crm-bar-track{height:12px;border-radius:999px;background:#f2e5d1;overflow:hidden}.crm-bar-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,#d4a43a,#111)}.crm-empty{padding:22px;border:1px dashed var(--crm-line);color:var(--crm-muted);text-align:center;border-radius:18px;background:#fffaf4;font-weight:800}.crm-login{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at top left,rgba(212,164,58,.15),transparent 35%),var(--crm-bg)}.crm-login-card{width:min(520px,100%);background:#fff;border:1px solid var(--crm-line);border-radius:30px;padding:34px;box-shadow:0 28px 80px rgba(0,0,0,.08)}.crm-login-card h1{font-family:Georgia,serif;font-size:64px;line-height:.9;margin:0 0 12px}.muted{color:var(--crm-muted)}.crm-metric-list{display:grid;gap:10px}.crm-metric-item{display:flex;justify-content:space-between;gap:14px;padding:13px 0;border-bottom:1px solid #f0e3d2}.crm-metric-item:last-child{border-bottom:0}.crm-json{font-size:12px;color:#71675c;white-space:pre-wrap;max-width:360px}@media(max-width:1100px){.crm-shell{grid-template-columns:1fr}.crm-sidebar{height:auto;position:relative}.crm-nav{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-two{grid-template-columns:1fr}}@media(max-width:720px){.crm-main{padding:20px}.crm-nav{grid-template-columns:1fr}.crm-stats,.crm-form-row{grid-template-columns:1fr}.crm-top{display:grid}.crm-title h1{font-size:48px}}


/* === Fix categorías y medición activa === */
.crm-status-pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border-radius:999px;
    padding:12px 16px;
    font-weight:900;
    line-height:1;
    border:1px solid transparent;
    white-space:nowrap;
}
.crm-status-pill.green{
    background:#e9f9ef;
    color:#08783b;
    border-color:#bde9cd;
}
.crm-category-list{
    display:grid;
    gap:12px;
}
.crm-category-item{
    background:#fff;
    border:1px solid var(--crm-line);
    border-radius:18px;
    padding:14px;
}
.crm-category-form{
    gap:10px;
}
.crm-category-actions{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
}
.crm-category-actions .crm-badge input{
    margin-right:5px;
}
@media(max-width:720px){
    .crm-status-pill{
        width:100%;
    }
    .crm-category-actions{
        display:grid;
        grid-template-columns:1fr;
    }
}


/* === Fix definitivo: no mostrar botón Activar medición === */
.crm-status-pill{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:8px !important;
    border-radius:999px !important;
    padding:12px 16px !important;
    font-weight:900 !important;
    line-height:1 !important;
    border:1px solid transparent !important;
    white-space:nowrap !important;
}
.crm-status-pill.green{
    background:#e9f9ef !important;
    color:#08783b !important;
    border-color:#bde9cd !important;
}

/* Por seguridad: si algún link viejo queda en caché, no se verá como botón negro */
a[href$="actualizar_admin_crm.php"]{
    display:none !important;
}


/* === Estado Activo: botón verde elegante === */
.crm-status-pill,
.crm-status-pill.green{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:8px !important;
    min-height:48px !important;
    padding:0 28px !important;
    border-radius:999px !important;
    background:linear-gradient(135deg,#22c55e,#16a34a) !important;
    color:#fff !important;
    border:1px solid #149447 !important;
    box-shadow:0 12px 26px rgba(22,163,74,.22) !important;
    font-size:17px !important;
    font-weight:900 !important;
    line-height:1 !important;
    white-space:nowrap !important;
}

.crm-status-pill.green::before{
    content:"✓" !important;
    width:22px !important;
    height:22px !important;
    border-radius:50% !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    background:rgba(255,255,255,.22) !important;
    color:#fff !important;
    font-size:14px !important;
    font-weight:900 !important;
}

@media(max-width:720px){
    .crm-status-pill,
    .crm-status-pill.green{
        width:auto !important;
        min-height:44px !important;
        padding:0 22px !important;
        font-size:15px !important;
    }
}


/* === Estado de medición como botón verde estilo Nuevo producto === */
.crm-status-pill,
.crm-status-pill.green{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-height:58px !important;
    padding:0 34px !important;
    border-radius:999px !important;
    background:linear-gradient(135deg,#29c96b,#159947) !important;
    color:#fff !important;
    border:1px solid #12833e !important;
    box-shadow:0 12px 26px rgba(21,153,71,.22) !important;
    font-size:18px !important;
    font-weight:900 !important;
    line-height:1 !important;
    white-space:nowrap !important;
}

/* Sin ícono, solo texto */
.crm-status-pill.green::before,
.crm-status-pill::before{
    content:none !important;
    display:none !important;
}

@media(max-width:720px){
    .crm-status-pill,
    .crm-status-pill.green{
        min-height:52px !important;
        padding:0 26px !important;
        font-size:16px !important;
    }
}


/* === FINAL: botón verde Activado medición estilo Nuevo producto === */
.crm-actions .crm-status-pill.green,
.crm-status-pill.green{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-height:58px !important;
    height:58px !important;
    padding:0 34px !important;
    border-radius:999px !important;
    background:linear-gradient(135deg,#29c96b,#159947) !important;
    color:#fff !important;
    border:1px solid #12833e !important;
    box-shadow:0 12px 26px rgba(21,153,71,.22) !important;
    font-size:18px !important;
    font-weight:900 !important;
    line-height:1 !important;
    white-space:nowrap !important;
    text-decoration:none !important;
}

/* Quitar cualquier icono automático anterior */
.crm-actions .crm-status-pill.green::before,
.crm-status-pill.green::before,
.crm-status-pill::before{
    content:none !important;
    display:none !important;
}

/* Si por caché todavía aparece como texto normal en la fila de acciones */
.crm-actions > span.crm-status-pill.green{
    min-width:220px !important;
}

@media(max-width:720px){
    .crm-actions .crm-status-pill.green,
    .crm-status-pill.green{
        min-height:52px !important;
        height:52px !important;
        padding:0 26px !important;
        font-size:16px !important;
    }
}


/* === Botón real verde: Activado medición === */
.crm-btn-medicion-activa{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    height:58px !important;
    min-height:58px !important;
    padding:0 34px !important;
    border-radius:999px !important;
    background:linear-gradient(135deg,#29c96b,#159947) !important;
    color:#fff !important;
    border:1px solid #12833e !important;
    box-shadow:0 12px 26px rgba(21,153,71,.22) !important;
    font-size:18px !important;
    font-weight:900 !important;
    line-height:1 !important;
    white-space:nowrap !important;
    text-decoration:none !important;
    cursor:default !important;
}

.crm-btn-medicion-activa:hover{
    transform:none !important;
    filter:none !important;
}

@media(max-width:720px){
    .crm-btn-medicion-activa{
        height:52px !important;
        min-height:52px !important;
        padding:0 26px !important;
        font-size:16px !important;
    }
}


/* === Eliminado estado de medición del admin === */
.crm-status-pill,
.crm-btn-medicion-activa,
a[href$="actualizar_admin_crm.php"]{
    display:none !important;
}
