/* ============================================================
   TopoApp — barra superior pro: buscador, campanita, menú de usuario
   y modal «Reportar problema». Se carga después de topoapp.css.
   ============================================================ */

/* ── Barra ─────────────────────────────────────────────────── */
.app-topbar {
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(28, 29, 34, .07);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 6px 24px -18px rgba(28, 29, 34, .35);
    gap: 10px;
}
.app-topbar .topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: #4B5260;
    transition: background .15s, color .15s, border-color .15s;
}
.app-topbar .topbar-btn:hover,
.app-topbar .topbar-btn[aria-expanded="true"] {
    background: #F3F3F5;
    border-color: #E9E9EC;
    color: #1C1D22;
    transform: none;
}
.app-topbar .topbar-btn:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

/* ── Buscador ──────────────────────────────────────────────── */
.app-topbar .topbar-search-input {
    height: 40px;
    border-radius: 12px;
    background: #F3F3F5;
    border: 1px solid transparent;
    padding-right: 38px;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.app-topbar .topbar-search-input:hover { background: #EEEEF1; }
.app-topbar .topbar-search-input:focus {
    background: #fff;
    border-color: rgba(217, 106, 43, .55);
    box-shadow: 0 0 0 4px rgba(217, 106, 43, .12);
}
.topbar-search-kbd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #E3E3E6;
    box-shadow: 0 1px 0 #E3E3E6;
    color: #8A8F98;
    font: 600 .72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    pointer-events: none;
    transition: opacity .15s;
}
.topbar-search:focus-within .topbar-search-kbd { opacity: 0; }
.app-topbar .topbar-search-panel {
    border-radius: 16px;
    border: 1px solid #ECECEF;
    box-shadow: 0 24px 48px -18px rgba(28, 29, 34, .28), 0 2px 6px rgba(28, 29, 34, .05);
}

/* ── Campanita ─────────────────────────────────────────────── */
.app-topbar #topbarUnreadDot { display: none !important; }
.topbar-notif-count {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #E5484D;
    color: #fff;
    font-size: .66rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
    animation: tpPulso .4s ease-out;
}
.topbar-notif-count[hidden] { display: none; }
@keyframes tpPulso { from { transform: scale(.4); } to { transform: scale(1); } }
#topbarNotificationsBtn:has(.topbar-notif-count:not([hidden])) .bi-bell { animation: tpCampana 1.2s ease-in-out 1; transform-origin: 50% 10%; }
@keyframes tpCampana { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .topbar-notif-count, #topbarNotificationsBtn .bi-bell { animation: none !important; } }

.app-topbar .topbar-notifications-panel {
    width: 380px;
    max-width: calc(100vw - 24px);
    padding: 0;
    border-radius: 18px;
    border: 1px solid #ECECEF;
    background: #fff;
    box-shadow: 0 28px 56px -20px rgba(28, 29, 34, .32), 0 2px 8px rgba(28, 29, 34, .05);
    overflow: hidden;
    animation: tpAparece .16s ease-out;
}
@keyframes tpAparece { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.app-topbar .topbar-notifications-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #F1F1F3;
}
.app-topbar .topbar-notifications-head strong { font-size: .98rem; font-weight: 800; color: #1C1D22; letter-spacing: -.01em; }
.app-topbar .topbar-notifications-subtitle { font-size: .76rem; color: #8A8F98; margin-top: 1px; }
.topbar-notifications-all {
    border: 0;
    background: #F3F3F5;
    color: #4B5260;
    font-size: .74rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 5px 10px;
    white-space: nowrap;
    cursor: pointer;
}
.topbar-notifications-all:hover { background: #E9E9EC; color: #1C1D22; }
.topbar-notifications-all[hidden] { display: none; }
.app-topbar .topbar-notifications-list { padding: 6px; max-height: min(420px, 60vh); overflow-y: auto; display: grid; gap: 2px; }
.app-topbar .topbar-notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    text-decoration: none;
    color: inherit;
    transition: background .12s;
}
.app-topbar a.topbar-notification-item:hover { background: #F6F6F8; }
.app-topbar .topbar-notification-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    background: #EEF4FF;
    color: #2563EB;
}
.app-topbar .tone-warning .topbar-notification-icon { background: #FFF4E5; color: #D97706; }
.app-topbar .tone-success .topbar-notification-icon { background: #E8F8EF; color: #16A34A; }
.app-topbar .tone-danger .topbar-notification-icon  { background: #FDECEC; color: #DC2626; }
.app-topbar .topbar-notification-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.app-topbar .topbar-notification-copy strong { font-size: .84rem; font-weight: 700; color: #1C1D22; line-height: 1.3; }
.app-topbar .topbar-notification-copy span { font-size: .76rem; color: #8A8F98; line-height: 1.3; }
.topbar-notification-go { color: #C4C6CC; font-size: .8rem; transition: transform .15s, color .15s; }
.app-topbar a.topbar-notification-item:hover .topbar-notification-go { color: #4B5260; transform: translateX(2px); }
.app-topbar .topbar-notification-item.is-empty { flex-direction: column; text-align: center; padding: 26px 16px; gap: 6px; }
.app-topbar .topbar-notification-item.is-empty .topbar-notification-copy { align-items: center; }
.topbar-notifications-foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #F1F1F3;
    background: #FAFAFB;
}
.topbar-notifications-foot a { font-size: .78rem; font-weight: 700; color: #4B5260; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.topbar-notifications-foot a:hover { color: var(--brand-primary); }

/* ── Menú de usuario ───────────────────────────────────────── */
.app-topbar .topbar-user-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 4px 10px 4px 4px;
    gap: 9px;
    transition: background .15s, border-color .15s;
}
.app-topbar .topbar-user-btn:hover,
.app-topbar .topbar-user-btn[aria-expanded="true"] { background: #F3F3F5; border-color: #E9E9EC; transform: none; }
.app-topbar .topbar-user-avatar { width: 34px; height: 34px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(217, 106, 43, .35); }
.app-topbar .topbar-user-name { font-weight: 700; font-size: .83rem; }
.app-topbar .topbar-user-panel {
    min-width: 260px;
    padding: 6px;
    border-radius: 18px;
    border: 1px solid #ECECEF;
    box-shadow: 0 28px 56px -20px rgba(28, 29, 34, .32), 0 2px 8px rgba(28, 29, 34, .05);
    animation: tpAparece .16s ease-out;
}
.app-topbar .topbar-user-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid #F1F1F3;
}
.topbar-user-panel-avatar {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--brand-primary);
    color: #fff;
    font-weight: 800;
}
.topbar-user-panel-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-user-panel-who { min-width: 0; }
.app-topbar .topbar-user-panel-name { font-size: .9rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar .topbar-user-panel-biz { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar .topbar-user-panel-item { border-radius: 10px; padding: 9px 10px; font-weight: 600; font-size: .84rem; gap: 10px; }
.app-topbar .topbar-user-panel-item i { width: 18px; text-align: center; color: #8A8F98; font-size: 1rem; }
.app-topbar .topbar-user-panel-item:hover { background: #F6F6F8; }
.app-topbar .topbar-user-panel-item:hover i { color: var(--brand-primary); }
.app-topbar .topbar-user-panel-logout,
.app-topbar .topbar-user-panel-logout i { color: #DC2626; }
.app-topbar .topbar-user-panel-logout:hover { background: #FEF2F2; }

@media (max-width: 767px) {
    .app-topbar .topbar-notifications-panel {
        position: fixed;
        top: calc(env(safe-area-inset-top, 0px) + var(--topbar-h) + 6px);
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }
}

/* ── Modal «Reportar problema» ─────────────────────────────── */
.rp-modal .modal-dialog { max-width: 520px; }
.rp-modal .modal-content { border: 0; border-radius: 22px; overflow: hidden; box-shadow: 0 40px 80px -24px rgba(28, 29, 34, .45); }
.rp-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 6px; position: relative; }
.rp-head-ico {
    flex: 0 0 46px; width: 46px; height: 46px; border-radius: 14px;
    display: grid; place-items: center; font-size: 1.35rem;
    background: linear-gradient(135deg, #FFF1E6, #FDE4D1); color: var(--brand-primary);
}
.rp-title { margin: 0; font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; color: #1C1D22; }
.rp-sub { margin: 2px 0 0; font-size: .8rem; color: #8A8F98; }
.rp-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: #8A8F98; }
.rp-close:hover { background: #F3F3F5; color: #1C1D22; }
.rp-body { padding: 14px 20px 6px; }
.rp-tipos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.rp-tipo { position: relative; cursor: pointer; margin: 0; }
.rp-tipo input { position: absolute; opacity: 0; pointer-events: none; }
.rp-tipo > span {
    display: flex; flex-direction: column; gap: 3px; height: 100%;
    padding: 12px 10px; border-radius: 14px; border: 1.5px solid #ECECEF; background: #fff;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.rp-tipo i { font-size: 1.15rem; color: #8A8F98; }
.rp-tipo b { font-size: .82rem; color: #1C1D22; }
.rp-tipo small { font-size: .7rem; color: #8A8F98; line-height: 1.3; }
.rp-tipo:hover > span { border-color: #D9D9DE; }
.rp-tipo input:focus-visible + span { box-shadow: 0 0 0 4px rgba(217, 106, 43, .15); }
.rp-tipo--bug input:checked + span  { border-color: #EF4444; background: #FEF2F2; }
.rp-tipo--bug input:checked + span i { color: #DC2626; }
.rp-tipo--preg input:checked + span { border-color: #3B82F6; background: #EFF6FF; }
.rp-tipo--preg input:checked + span i { color: #2563EB; }
.rp-tipo--idea input:checked + span { border-color: #F59E0B; background: #FFFBEB; }
.rp-tipo--idea input:checked + span i { color: #D97706; }
.rp-campo { margin-bottom: 12px; }
.rp-campo label { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; color: #1C1D22; margin-bottom: 5px; }
.rp-campo label small { font-weight: 600; color: #A8ACB3; }
.rp-campo input, .rp-campo textarea {
    width: 100%; border: 1.5px solid #ECECEF; border-radius: 12px; background: #FAFAFB;
    padding: 10px 12px; font-size: .9rem; color: #1C1D22; outline: none; resize: vertical;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.rp-campo input:focus, .rp-campo textarea:focus { background: #fff; border-color: rgba(217, 106, 43, .55); box-shadow: 0 0 0 4px rgba(217, 106, 43, .12); }
.rp-contexto { font-size: .74rem; color: #8A8F98; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.rp-contexto code { font-size: .72rem; color: #4B5260; background: #F3F3F5; border-radius: 6px; padding: 1px 6px; word-break: break-all; }
.rp-error { margin-top: 10px; padding: 9px 12px; border-radius: 10px; background: #FEF2F2; color: #B91C1C; font-size: .82rem; }
.rp-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px 18px; }
.rp-wa { margin-right: auto; font-size: .82rem; font-weight: 700; color: #16A34A; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.rp-wa:hover { color: #15803D; }
.rp-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 18px;
    border-radius: 12px; border: 0; background: var(--brand-primary); color: #fff; font-weight: 800; font-size: .88rem; cursor: pointer;
    box-shadow: 0 10px 20px -10px rgba(217, 106, 43, .7);
}
.rp-btn:hover { background: var(--brand-primary-deep); }
.rp-btn:disabled { opacity: .7; }
.rp-btn--sec { background: #F3F3F5; color: #4B5260; box-shadow: none; }
.rp-btn--sec:hover { background: #E9E9EC; color: #1C1D22; }
.rp-ok { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 24px 10px 30px; }
.rp-ok-ico { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: #E8F8EF; color: #16A34A; font-size: 1.8rem; animation: tpPulso .35s ease-out; }
.rp-ok b { font-size: 1.05rem; color: #1C1D22; }
.rp-ok span { font-size: .84rem; color: #8A8F98; }
@media (max-width: 480px) {
    .rp-tipos { grid-template-columns: 1fr; }
    .rp-tipo > span { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
    .rp-tipo small { display: none; }
    .rp-modal .modal-dialog { margin: auto 10px; }
}
