/* ============================================================
   Limpiezas Extremas | Panel AT interno
   Scope: solo se activa cuando JS añade body.jkg-at-ready
   ============================================================ */

body.jkg-at-ready {
    background:
        radial-gradient(circle at top left, rgba(250,204,21,.08), transparent 22rem),
        radial-gradient(circle at bottom right, rgba(34,197,94,.06), transparent 24rem),
        #030712 !important;
    color: #e5e7eb !important;
}

/* Ocultar cabeceras/menús originales */
body.jkg-at-ready nav.navbar,
body.jkg-at-ready .navbar,
body.jkg-at-ready header.navbar,
body.jkg-at-ready .main-header {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* Cabecera propia */
.jkg-client-header {
    width: 100% !important;
    background: linear-gradient(135deg, #020617, #0f172a) !important;
    border-bottom: 1px solid rgba(250,204,21,.35) !important;
    padding: 1.25rem 1.6rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.28) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 99990 !important;
}

.jkg-client-brand-title {
    color: #ffffff !important;
    font-size: 1.35rem !important;
    font-weight: 950 !important;
    line-height: 1.1 !important;
    letter-spacing: -.02em !important;
}

.jkg-client-brand-subtitle {
    color: #facc15 !important;
    font-size: .9rem !important;
    font-weight: 800 !important;
    margin-top: .18rem !important;
}

.jkg-client-actions {
    display: flex !important;
    align-items: center !important;
    gap: .7rem !important;
}

.jkg-client-status {
    color: #bfdbfe !important;
    background: rgba(15,23,42,.9) !important;
    border: 1px solid rgba(148,163,184,.35) !important;
    border-radius: 999px !important;
    padding: .48rem .9rem !important;
    font-size: .85rem !important;
    font-weight: 700 !important;
}

.jkg-logout-btn {
    color: #ffffff !important;
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
    border: 1px solid rgba(248,113,113,.75) !important;
    border-radius: 999px !important;
    padding: .55rem 1rem !important;
    font-size: .9rem !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    box-shadow: 0 10px 22px rgba(220,38,38,.18) !important;
}

.jkg-logout-btn:hover {
    color: #ffffff !important;
    background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
    text-decoration: none !important;
}

/* Navegación AT */
.jkg-at-quicknav {
    background: rgba(15,23,42,.96) !important;
    border: 1px solid rgba(250,204,21,.35) !important;
    border-radius: 18px !important;
    margin: 1.1rem .9rem 1.2rem .9rem !important;
    padding: .85rem 1rem !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: .65rem !important;
    box-shadow: 0 16px 38px rgba(0,0,0,.28) !important;
    position: sticky !important;
    top: 88px !important;
    z-index: 99980 !important;
}

.jkg-at-quicknav .jkg-title {
    color: #facc15 !important;
    font-weight: 950 !important;
    margin-right: .55rem !important;
}

.jkg-at-quicknav a {
    color: #f8fafc !important;
    background: rgba(15,23,42,.85) !important;
    border: 1px solid rgba(148,163,184,.35) !important;
    border-radius: 999px !important;
    padding: .48rem .9rem !important;
    text-decoration: none !important;
    font-weight: 750 !important;
}

.jkg-at-quicknav a:hover,
.jkg-at-quicknav a.jkg-active {
    color: #111827 !important;
    background: linear-gradient(135deg, #facc15, #eab308) !important;
    border-color: #facc15 !important;
}

/* Zona de contenido */
body.jkg-at-ready .container,
body.jkg-at-ready .container-fluid,
body.jkg-at-ready main,
body.jkg-at-ready .page-wrapper,
body.jkg-at-ready .content-wrapper {
    background: transparent !important;
}

/* Títulos */
body.jkg-at-ready h1,
body.jkg-at-ready h2,
body.jkg-at-ready h3,
body.jkg-at-ready .h1,
body.jkg-at-ready .h2,
body.jkg-at-ready .h3 {
    color: #f8fafc !important;
    font-weight: 900 !important;
}

/* Cards/listados */
body.jkg-at-ready .card,
body.jkg-at-ready .list-group,
body.jkg-at-ready .table-responsive {
    background: rgba(15,23,42,.92) !important;
    border: 1px solid rgba(148,163,184,.22) !important;
    border-radius: 16px !important;
    box-shadow: 0 18px 44px rgba(0,0,0,.22) !important;
}

body.jkg-at-ready .card-header,
body.jkg-at-ready .card-footer {
    background: rgba(2,6,23,.65) !important;
    border-color: rgba(148,163,184,.18) !important;
}

/* Tablas */
body.jkg-at-ready table {
    color: #e5e7eb !important;
}

body.jkg-at-ready table thead,
body.jkg-at-ready .table thead th {
    background: #020617 !important;
    color: #facc15 !important;
    border-color: rgba(148,163,184,.22) !important;
}

body.jkg-at-ready table tbody tr {
    background: rgba(15,23,42,.78) !important;
}

body.jkg-at-ready table tbody tr:hover {
    background: rgba(30,41,59,.92) !important;
}

body.jkg-at-ready .table td,
body.jkg-at-ready .table th {
    border-color: rgba(148,163,184,.18) !important;
}

/* Formularios */
body.jkg-at-ready input,
body.jkg-at-ready select,
body.jkg-at-ready textarea,
body.jkg-at-ready .form-control,
body.jkg-at-ready .form-select {
    background: #0b1220 !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
    border-radius: 10px !important;
}

body.jkg-at-ready input:focus,
body.jkg-at-ready select:focus,
body.jkg-at-ready textarea:focus,
body.jkg-at-ready .form-control:focus,
body.jkg-at-ready .form-select:focus {
    border-color: #facc15 !important;
    box-shadow: 0 0 0 .18rem rgba(250,204,21,.16) !important;
}

/* Botones */
body.jkg-at-ready .btn-primary,
body.jkg-at-ready .btn-success {
    background: linear-gradient(135deg, #22c55e, #15803d) !important;
    border-color: #22c55e !important;
    color: #ffffff !important;
    font-weight: 850 !important;
    border-radius: 10px !important;
}

body.jkg-at-ready .btn-warning,
body.jkg-at-ready button[name*="codigo" i],
body.jkg-at-ready a[href*="generar" i] {
    background: linear-gradient(135deg, #facc15, #eab308) !important;
    border-color: #facc15 !important;
    color: #111827 !important;
    font-weight: 900 !important;
    border-radius: 10px !important;
}

body.jkg-at-ready .btn-danger {
    border-radius: 10px !important;
    font-weight: 800 !important;
}

/* Ocultar ruido técnico */
body.jkg-at-ready footer,
body.jkg-at-ready .footer,
body.jkg-at-ready a[href*="facturascripts.com"],
body.jkg-at-ready .breadcrumb,
body.jkg-at-ready .breadcrumbs,
body.jkg-at-ready .nav-tabs,
body.jkg-at-ready ul.nav-tabs,
body.jkg-at-ready .card-header-tabs {
    display: none !important;
    visibility: hidden !important;
}

/* Mensajes */
body.jkg-at-ready .alert {
    border-radius: 14px !important;
    border-width: 1px !important;
    font-weight: 700 !important;
}

/* Responsive */
@media (max-width: 800px) {
    .jkg-client-header {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .jkg-client-actions {
        width: 100% !important;
        justify-content: space-between !important;
    }

    .jkg-at-quicknav {
        top: 130px !important;
    }
}
