/* ═══════════════════════════════════════════════════════════════
   APP HEADER — MODERN TOPBAR
   ═══════════════════════════════════════════════════════════════ */

.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid #e8eaed;
    box-shadow: 0 1px 0 #e8eaed;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
}

.hdr-separator {
    width: 1px;
    height: 22px;
    background: #e8eaed;
    flex-shrink: 0;
    margin: 0 0.25rem;
}

.app-header-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 56px;
    padding: 0 1.25rem;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    text-decoration: none;
    margin-right: 0.5rem;
}

.app-logo i {
    color: #6366f1;
    font-size: 1.2rem;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.hdr-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.85rem;
    border-radius: 8px;
    border: 1.5px solid transparent;
    background: transparent;
    color: #555;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.13s, color 0.13s, border-color 0.13s;
    white-space: nowrap;
}

.hdr-btn:hover {
    background: #f3f4f6;
    color: #1a1a2e;
}

.hdr-btn.active {
    background: #ebe9ff;
    color: #4f46e5;
    border-color: #c7d2fe;
}

.hdr-btn-primary {
    background: #6366f1;
    color: #fff !important;
    border-color: #6366f1;
}

.hdr-btn-primary:hover {
    background: #4f46e5 !important;
    color: #fff !important;
    border-color: #4f46e5;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.hdr-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.hdr-search-icon {
    position: absolute;
    left: 0.6rem;
    color: #aaa;
    font-size: 0.8rem;
    pointer-events: none;
}

.hdr-search {
    padding: 0.38rem 0.75rem 0.38rem 1.9rem;
    border: 1.5px solid #e0e3ea;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #f7f8fa;
    color: #1a1a2e;
    width: 200px;
    transition: border-color 0.15s, box-shadow 0.15s, width 0.2s;
    outline: none;
}

.hdr-search:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    width: 260px;
}

.hdr-my-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background 0.13s;
}

.hdr-my-toggle:hover {
    background: #f3f4f6;
}

.hdr-my-toggle input {
    display: none;
}

.hdr-my-track {
    position: relative;
    width: 32px;
    height: 18px;
    background: #d1d5db;
    border-radius: 9px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.hdr-my-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.hdr-my-toggle input:checked ~ .hdr-my-track {
    background: #6366f1;
}

.hdr-my-toggle input:checked ~ .hdr-my-track .hdr-my-thumb {
    transform: translateX(14px);
}

.hdr-my-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    transition: color 0.15s;
}

.hdr-my-toggle:has(input:checked) .hdr-my-label {
    color: #4f46e5;
}

.hdr-separator-v {
    width: 1px;
    height: 28px;
    background: #e5e7eb;
    margin: 0 4px;
    flex-shrink: 0;
}

.hdr-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 10px;
    cursor: default;
    transition: background 0.13s;
}

.hdr-profile:hover {
    background: #f3f4f6;
}

.hdr-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0;
    text-transform: uppercase;
    overflow: hidden;
}

.hdr-avatar.has-image {
    background: #e2e8f0;
    color: transparent;
}

.hdr-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hdr-profile-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1;
}

.hdr-profile-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hdr-profile-role {
    font-size: 0.67rem;
    color: #94a3b8;
    white-space: nowrap;
}

.hdr-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    background: transparent;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.13s, color 0.13s, border-color 0.13s;
    flex-shrink: 0;
}

.hdr-icon-btn:hover {
    background: #f3f4f6;
    color: #1a1a2e;
    border-color: #e0e3ea;
}

.hdr-icon-btn--danger:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.hdr-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 32px;
    padding: 0 0.75rem;
    border-radius: 8px;
    border: 1.5px solid #ddd6fe;
    background: #f5f3ff;
    color: #6D28D9;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}

.hdr-support-btn:hover {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #4C1D95;
}

.hdr-support-btn i { font-size: 0.85rem; }

@media (max-width: 900px) {
    .hdr-profile-info {
        display: none;
    }
    .hdr-profile {
        padding: 4px;
    }
    .hdr-separator-v {
        display: none;
    }
    .hdr-my-label {
        display: block;
        font-size: .67rem;
        line-height: 1.05;
        white-space: normal;
    }
    .hdr-my-toggle {
        padding: 4px;
        gap: 6px;
    }
    .hdr-btn span {
        display: none;
    }
    .hdr-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
        border-radius: 8px;
    }
    .hdr-btn-primary {
        width: auto;
        padding: 0.38rem 0.75rem;
    }
    .hdr-btn-primary span {
        display: none;
    }
    .hdr-btn-primary {
        width: 36px;
        padding: 0;
        justify-content: center;
    }
    .hdr-search {
        width: 140px;
    }
    .hdr-search:focus {
        width: 180px;
    }
}

@media (max-width: 600px) {
    .app-header-inner {
        padding: 0 0.75rem;
        gap: 0.25rem;
    }
}

body > .container-fluid,
body .container-fluid:not(.modal .container-fluid) {
    padding-top: 1.75rem;
}

.ws-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 6px;
}

.ws-dot {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 2px solid transparent;
    background: #f0f1f5;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .13s, border-color .13s, box-shadow .13s;
    padding: 0;
    flex-shrink: 0;
}

.ws-dot:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(124,58,237,.2);
}

.ws-dot--active {
    border-color: #7C3AED;
    box-shadow: 0 0 0 2px rgba(124,58,237,.2);
    cursor: default;
}

.ws-dot--active:hover {
    transform: none;
}

.ws-dot--add {
    background: #f5f3ff;
    border-color: #e9e4fb;
    border-style: dashed;
}

.ws-dot--add:hover {
    background: #ede9fe;
    border-color: #7C3AED;
}
