/* T@Care – Header (clean & minimalist) */

.main-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 52px;
    max-width: 1400px;
    margin: 0 auto;
    gap: 1.5rem;
}

/* ── Brand ── */
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}

.header-brand:hover { text-decoration: none; }

.logo-icon {
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.project-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.project-slogan {
    font-size: 0.625rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ── Navigation ── */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.125rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-item { position: relative; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.12s;
}

.nav-link:hover {
    color: var(--text);
    text-decoration: none;
}

.nav-link.active,
.nav-item.active .nav-link {
    color: var(--accent);
    background: var(--accent-light);
}

.nav-icon { font-size: 0.8125rem; opacity: 0.7; }
.nav-text  { font-size: 0.8125rem; }

/* ── Nav dropdown (Gestion admin) ── */
.nav-dropdown-parent { position: relative; }

.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    min-width: 180px;
    z-index: 200;
    list-style: none;
    margin: 0;
    padding: 0.25rem;
}

.nav-dropdown.show { display: block; }

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.1s, color 0.1s;
}

.nav-dropdown-item:hover {
    background: var(--accent-light);
    color: var(--accent);
    text-decoration: none;
}

.nav-dropdown-item i { font-size: 0.8125rem; width: 14px; text-align: center; }

/* ── Header right section ── */
.header-user-section {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

/* ── Notification badge ── */
.badge-notification {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    font-size: 0.625rem;
    font-weight: 700;
    background: var(--danger);
    color: #fff;
    border-radius: 8px;
    line-height: 1;
}

/* ── Dropdown ── */
.dropdown { position: relative; }

.btn-notification,
.btn-user {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.5rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    position: relative;
    font-family: inherit;
}

.btn-notification:hover,
.btn-user:hover {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Dropdown menu ── */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    z-index: 200;
    overflow: hidden;
}

.dropdown-menu.show { display: block; }

.dropdown-header {
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--border);
}

.dropdown-header strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}

.dropdown-header small {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.1s;
}

.dropdown-item:hover {
    background: var(--bg);
    text-decoration: none;
    color: var(--text);
}

.dropdown-item i {
    color: var(--text-muted);
    width: 14px;
    text-align: center;
    font-size: 0.75rem;
}

/* ── Login buttons (unauthenticated) ── */
.login-buttons {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-muted);
    background: transparent;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
    white-space: nowrap;
}

.btn-login:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

/* Admin button : filled accent */
.btn-login-admin {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-login-admin:hover {
    filter: brightness(1.08);
    color: #fff;
    border-color: var(--accent);
}

/* ── Mobile hamburger ── */
.mobile-menu-button {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3125rem 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
    cursor: pointer;
    align-items: center;
    font-family: inherit;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .main-nav { display: none; }
    .mobile-menu-button { display: flex; }

    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 0.625rem 1rem;
        gap: 0.75rem;
    }

    .main-nav.show {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 0.375rem;
        z-index: 99;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-link { justify-content: flex-start; }

    .login-buttons { gap: 0.25rem; }

    .btn-login .btn-label { display: none; }

    .project-slogan { display: none; }
}

@media (max-width: 640px) {
    .user-name { display: none; }
}
