/* Cabecera compacta VoucherPRO */
:root { --site-bar-h: 44px; --vp-bg: #f0f2f5; --vp-accent: #0056b3; }

.site-header {
    margin: -20px -20px 8px -20px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 15000;
    overflow: visible;
}
.page-panel .site-header,
.page-inventario .site-header,
.page-scan .site-header { margin-bottom: 0; }

.site-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--site-bar-h);
    padding: 0 10px;
    max-width: 100%;
    overflow: visible;
}
.site-logo img { height: 26px; width: auto; display: block; }
.site-event-switch { display: flex; align-items: center; flex: 0 1 240px; min-width: 160px; position: relative; z-index: 3; }
.site-event-switch select,
.site-event-badge {
    width: 100%;
    max-width: 240px;
    min-width: 160px;
    height: 32px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    background: #e8f0fe;
    color: #1e3a8a;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0 8px;
    pointer-events: auto;
}
.site-event-switch select { cursor: pointer; }
.site-event-badge {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-logo-event { height: 28px; max-width: 72px; object-fit: contain; }

/* Zona logo + título (no interactiva como la botonera) */
.site-topbar-context {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 0;
    max-width: none;
}
.site-topbar-divider {
    width: 1px;
    height: 24px;
    background: #d1d5db;
    flex-shrink: 0;
    margin: 0 2px;
}

/* Título de página — tipografía de encabezado, no botón */
.site-page-label {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0;
    min-width: 0;
    padding: 0 0 0 10px;
    border-left: 3px solid var(--vp-accent);
    background: transparent;
    border-radius: 0;
    cursor: default;
    user-select: none;
    pointer-events: none;
    line-height: 1.2;
}
.site-page-label-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.site-header-event .site-page-label {
    max-width: min(420px, 38vw);
}
.site-page-label-event {
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}
.site-page-label-event::before {
    content: '·';
    margin: 0 5px;
    color: #cbd5e1;
    font-weight: 400;
}
@media (min-width: 900px) {
    .site-page-label-text { font-size: 0.9375rem; }
}
@media (max-width: 768px) {
    .site-topbar-context { max-width: min(280px, 62vw); gap: 8px; }
    .site-event-switch select, .site-event-badge { max-width: 36vw; font-size: 0.72rem; }
    .site-page-label { padding-left: 8px; border-left-width: 2px; }
    .site-page-label-text { font-size: 0.8125rem; }
    .site-page-label-event { display: none; }
    .site-topbar-divider { display: none; }
}

.site-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: 1px solid #ddd; border-radius: 6px;
    background: #fff; color: #333; cursor: pointer; flex-shrink: 0; font-size: 1rem;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow: visible;
    padding-left: 8px;
}
.site-nav-link, .site-nav-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 6px;
    font-size: 0.78rem; font-weight: 600; color: #374151;
    text-decoration: none; white-space: nowrap;
    border: 1px solid transparent; background: transparent; cursor: pointer;
    list-style: none; flex-shrink: 0;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.site-nav-link:hover, .site-nav-btn:hover {
    background: #f3f4f6;
    color: var(--vp-accent);
    border-color: #e5e7eb;
}
.site-nav-link.active, .site-nav-item.active > .site-nav-btn {
    background: #e8f0fe;
    color: var(--vp-accent);
    border-color: #bfdbfe;
}
.site-nav-link i, .site-nav-btn i:first-child { width: 14px; text-align: center; font-size: 0.85rem; }
.site-nav-btn .site-chevron { font-size: 0.6rem; opacity: 0.55; margin-left: 2px; transition: transform 0.15s; }

.site-nav-item { position: relative; flex-shrink: 0; }
.site-nav-item > summary { display: inline-flex; align-items: center; list-style: none; }
.site-nav-item > summary::-webkit-details-marker { display: none; }
.site-nav-item[open] > summary .site-chevron { transform: rotate(180deg); }

.site-dropdown {
    display: none !important;
    position: absolute; top: calc(100% + 4px); left: 0;
    min-width: 240px; max-width: min(320px, 86vw); background: #fff;
    border: 1px solid #e5e7eb; border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 4px; z-index: 15002;
}
.site-dropdown a {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; color: #374151 !important;
    text-decoration: none; font-size: 0.8rem; border-radius: 6px; white-space: normal; line-height: 1.25;
}
.site-dropdown a:hover { background: #f3f4f6; color: var(--vp-accent) !important; }
.site-dropdown a.active { background: #e8f0fe; color: var(--vp-accent) !important; font-weight: 600; }
.site-dropdown a i { width: 16px; text-align: center; color: #64748b; font-size: 0.85rem; }

.site-topbar-end {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid #e5e7eb;
}
.site-user {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px; border-radius: 6px;
    font-size: 0.72rem; color: #64748b; max-width: 120px;
}
.site-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-logout {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border: 1px solid #e5e7eb; border-radius: 6px;
    color: #64748b; text-decoration: none; font-size: 0.8rem; flex-shrink: 0;
}
.site-logout:hover { background: #fee2e2; color: #dc2626; border-color: #fecaca; }

/* Arriba: sistema. Abajo: selector y botones del evento. */
.site-nav-system,
.site-nav-event { justify-content: flex-start; flex-wrap: wrap; }
.site-eventbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 8px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}
.site-eventbar .site-nav { padding-left: 4px; }
.site-eventbar .site-nav-link,
.site-eventbar .site-nav-btn {
    background: #fff;
    border-color: #e5e7eb;
}
.site-eventbar .site-logo-event { margin-left: auto; }

@media (min-width: 769px) {
    .site-nav-item:hover .site-dropdown,
    .site-nav-item[open] .site-dropdown { display: block !important; }
    .site-nav-item::after {
        content: ''; position: absolute; top: 100%; left: 0; width: 100%; height: 10px;
    }
}
@media (max-width: 768px) {
    .site-header { margin: -20px -20px 8px -20px; }
    .site-topbar-context { max-width: none; }
    .site-menu-toggle { display: inline-flex; }
    .site-logo img { height: 22px; }
    .site-user { display: none; }
    .site-nav,
    .site-eventbar { display: none; }
    .site-header.nav-open {
        position: fixed;
        inset: 0;
        overflow: auto;
        background: #f8fafc;
        z-index: 15000;
    }
    .site-header.nav-open .site-topbar {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 2;
    }
    .site-header.nav-open .site-nav,
    .site-header.nav-open .site-eventbar {
        display: flex;
        position: static;
        flex-direction: column;
        align-items: stretch;
        width: auto;
        gap: 6px;
        padding: 10px;
        border: 0;
        background: transparent;
    }
    .site-header.nav-open .site-eventbar { border-top: 1px solid #e5e7eb; }
    .site-header.nav-open .site-event-switch,
    .site-header.nav-open .site-event-switch select,
    .site-header.nav-open .site-event-badge { width: 100%; max-width: none; min-width: 0; }
    .site-header.nav-open .site-nav-link,
    .site-header.nav-open .site-nav-btn {
        width: 100%; justify-content: flex-start;
        padding: 10px 12px; font-size: 0.85rem;
        background: #fff; border: 1px solid #e5e7eb;
    }
    .site-header.nav-open .site-nav-item { width: 100%; }
    .site-header.nav-open .site-nav-item > summary { width: 100%; display: flex; }
    .site-header.nav-open .site-dropdown {
        position: static; display: none !important;
        box-shadow: none; border: none; padding: 0 0 0 8px;
        margin-top: 4px; background: transparent; min-width: 0;
    }
    .site-header.nav-open .site-nav-item[open] .site-dropdown { display: block !important; }
    .site-header.nav-open .site-dropdown a { background: #fff; border: 1px solid #e5e7eb; margin-bottom: 4px; }
}
