/* ============================================ */
/*      APP HEADER â€” SINGLE ROW (REFINED)       */
/* ============================================ */
body {
    background-color: #f0f4f8 !important;
}


.app-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* ---- Single row layout ---- */
.app-header-row {
    max-width: 100%;
    padding: 0 24px;
    height: 58px;
    display: grid;
    grid-template-columns: minmax(130px, auto) minmax(0, 1fr) minmax(auto, max-content);
    align-items: center;
    gap: 12px;
}

.app-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
    flex-shrink: 0;
    max-width: 200px;
}
.app-header-brand:hover { opacity: 0.9; }

.app-header-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.app-header-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    overflow: hidden;
}

.app-header-company {
    font-size: 12px;
    font-weight: 800;
    color: #c81e1e;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.app-header-sub {
    font-size: 10px;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header-user-name {
    font-weight: 700;
    color: #0071bc;
}

/* ---- Nav pills (center, fit-content) ---- */
.app-header-nav {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: #f1f5f9;
    border: 1px solid #e8edf3;
    border-radius: 10px;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}
.app-header-nav::-webkit-scrollbar { display: none; }

.tab-btn-pill {
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    padding: 6px 10px;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    line-height: 1;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}
.tab-btn-pill i {
    font-size: 11px;
    min-width: 14px;
    width: 14px;
    flex-shrink: 0;
    text-align: center;
    opacity: 0.65;
    transition: opacity 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.tab-btn-pill:hover {
    color: #0071bc;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 4px rgba(0, 113, 188, 0.08);
    transform: translateY(-1px);
}
.tab-btn-pill:hover i {
    opacity: 1;
    color: #0071bc;
    transform: scale(1.08);
}
.tab-btn-pill:active {
    transform: translateY(0);
}

.tab-btn-pill.active {
    background: #ffffff;
    color: #0071bc;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.tab-btn-pill.active:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 113, 188, 0.12);
}
.tab-btn-pill.active i {
    opacity: 1;
    color: #0071bc;
}

/* ---- Actions (right) ---- */
.app-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    justify-self: end;
}

.app-header-select {
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.app-header-select:hover { border-color: #cbd5e1; }
.app-header-select:focus {
    border-color: #0071bc;
    box-shadow: 0 0 0 2px rgba(0, 113, 188, 0.1);
}

.app-header-scope {
    min-width: 120px;
    max-width: 140px;
}

.app-header-lang {
    min-width: 68px;
    width: auto;
    padding-left: 10px !important;
    padding-right: 28px !important;
    text-align: left;
}

.app-header-mobile .lang-select-ui {
    min-width: 62px;
    padding-left: 8px !important;
    padding-right: 26px !important;
}

.app-header-icon-btn {
    height: 32px;
    min-width: 32px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.app-header-icon-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}
.app-header-icon-btn i { font-size: 11px; }

.app-header-icon-btn-icon-only {
    width: 32px;
    padding: 0;
}

.app-header-mobile-mute {
    flex-shrink: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-header-icon-btn-danger:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.app-header-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 140px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    padding: 4px;
    z-index: 60;
}
.app-header-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.app-header-dropdown button:hover {
    background: #f8fafc;
    color: #0071bc;
}

.app-header-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
    flex-shrink: 0;
}

.app-header-menu-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
}
.app-header-menu-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* ---- Mobile menu ---- */
.app-mobile-menu {
    border-top: 1px solid #f1f5f9;
    background: #fff;
    padding: 12px 16px 16px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    animation: fadeIn 0.2s ease-out;
}

.app-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.app-mobile-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.app-mobile-nav-btn i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: #64748b;
}
.app-mobile-nav-btn:hover {
    background: #f8fafc;
}

.app-mobile-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.app-mobile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.app-mobile-action-btn:hover { background: #f1f5f9; }
.app-mobile-action-btn i { font-size: 11px; }

.app-mobile-action-danger:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

@media (max-width: 1500px) {
    .app-header-brand { max-width: 160px; }
    .app-header-icon-btn span { display: none; }
    .app-header-scope { min-width: 100px; max-width: 110px; }
    .tab-btn-pill {
        font-size: 11px;
        padding: 6px 8px;
        gap: 4px;
    }
}

@media (max-width: 1200px) {
    .tab-btn-pill span { display: none; }
    .tab-btn-pill i { font-size: 12px; width: auto; opacity: 0.8; }
    .tab-btn-pill.active i { opacity: 1; }
}

@media (max-width: 767px) {
    .app-header-row {
        padding: 0 12px;
        height: 52px;
        gap: 10px;
        grid-template-columns: 1fr auto;
    }
    .app-header-company { font-size: 11px; }
    .app-header-sub { font-size: 9px; }
    .app-header-logo { width: 28px; height: 28px; }
    .app-header-brand { max-width: 140px; }
}

/* Quick Stats Bar (legacy) */
.ov-quick-stats-bar {
    background-color: #eff6ff !important;
    border: 1px solid #dbeafe !important;
    border-radius: 1rem !important;
}
.ov-quick-stats-divider {
    border-color: #dbeafe !important;
}

/* Dropdown styling for Excel/JSON export */
.relative.group:hover .absolute {
    display: block;
}
.relative.group .absolute {
    transition: opacity 0.15s ease;
}

