/* Wspolna gorna belka wszystkich dashboardow (LTIP jest wzorcem).
 * Zrodlo prawdy dla wygladu belki; style.css importuje ten plik, a strony bez
 * style.css (CHS, handover, support, FRT, churn, SEO panel) dostaja go przez
 * web/topbar.py. Menu "Aplikacje" wypelnia /static/topbar.js z /static/apps.json. */

.dlv-topbar, .dlv-topbar * { box-sizing: border-box; }
.top-nav {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px; line-height: 1.6; color: #1e293b;
}
.top-nav a { text-decoration: none; }
.top-nav-brand img { height: 24px; display: block; }

/* ── Top Nav (pixel-perfect with Hub/SDR) ── */
.top-nav {
    position: sticky; top: 0; left: 0; right: 0; height: 60px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,.07);
    display: flex; align-items: center; padding: 0 24px; gap: 0; z-index: 200;
}
.top-nav-brand {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
    font-size: 15px; font-weight: 700; color: #111827; letter-spacing: -.3px;
    padding-right: 28px; border-right: 1px solid rgba(0,0,0,.07);
    min-width: 200px; position: relative;
}
.brand-subtitle {
    font-weight: 400; color: #6B7280; font-size: 13px;
}
.top-nav-links {
    display: flex; align-items: center; gap: 2px; margin-left: 20px; margin-right: auto;
}
.top-nav-links a {
    color: #6B7280; text-decoration: none; font-weight: 500; font-size: 13px;
    padding: 7px 14px; border-radius: 8px; transition: all .18s;
    font-family: 'Inter', sans-serif; display: flex; align-items: center; gap: 7px;
}
.top-nav-links a i { font-size: 12px; }
.top-nav-links a:hover { color: #111827; background: rgba(0,0,0,.04); text-decoration: none; }
.top-nav-links a.active { color: #5CC8E3; background: #E0F4FA; text-decoration: none; }
.top-nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Brand dropdown */
.brand-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0;
    background: white; border: 1px solid rgba(0,0,0,.07); border-radius: 12px;
    box-shadow: 0 10px 25px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    min-width: 220px; z-index: 600; overflow: hidden; display: none;
}
.brand-dropdown.open { display: block; }
.brand-dropdown-label {
    padding: 10px 16px 6px; font-size: 11px; font-weight: 600; color: #6B7280;
    text-transform: uppercase; letter-spacing: .5px;
}
.brand-dropdown a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px; font-size: 13px; color: #374151;
    text-decoration: none; transition: background .12s;
}
.brand-dropdown a:hover { background: #F8FAFC; }
.brand-dropdown a i { width: 16px; color: #6B7280; text-align: center; font-size: 12px; }
.brand-dropdown a.active-app { color: #5CC8E3; font-weight: 600; }
.brand-dropdown a.active-app i { color: #5CC8E3; }

/* User menu */
.user-menu-wrap { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: 9px;
    background: none; border: none; cursor: pointer; padding: 5px 8px;
    border-radius: 8px; transition: background .15s; font-family: 'Inter', sans-serif;
}
.user-btn:hover { background: rgba(0,0,0,.04); }
.user-btn-name { font-size: 13px; font-weight: 500; color: #374151; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #F59E0B, #EF4444);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 12px; font-weight: 600;
}
.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: white; border: 1px solid rgba(0,0,0,.07); border-radius: 12px;
    box-shadow: 0 10px 25px -3px rgba(0,0,0,.1); min-width: 200px;
    z-index: 600; overflow: hidden; display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown-header { padding: 14px 16px 12px; border-bottom: 1px solid rgba(0,0,0,.07); }
.user-dropdown-name { font-size: 14px; font-weight: 600; color: #111827; }
.user-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; font-size: 13px; color: #374151;
    cursor: pointer; transition: background .12s; text-decoration: none;
}
.user-dropdown-item:hover { background: #F8FAFC; text-decoration: none; }
.user-dropdown-item.danger { color: #DC2626; }
.user-dropdown-item.danger i { color: #DC2626; }

/* Belka wstrzykiwana do stron z wlasnym layoutem (web/topbar.py): nie przykleja sie,
 * zeby nie nachodzic na ich wlasne sticky naglowki; siedzi w paddingu body jak karta. */
.top-nav--injected {
    position: static; margin: 0 0 20px; border-radius: 12px;
    border: 1px solid rgba(0,0,0,.07); background: #fff;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
.top-nav--injected .brand-dropdown { z-index: 10001; }
.top-nav--injected .user-dropdown { z-index: 10001; }
