/* =========================
   GLOBAL
========================= */

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background: #f5f6fa;
}

.container {
    padding: 20px;
}


/* =========================
   HEADER LAYOUT
========================= */

header {
    background: #2f3640;
    height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-sizing: border-box;
}

.header-brand {
    font-size: 15px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.2px;
    flex-shrink: 0;
}

.header-brand:hover {
    opacity: 0.85;
}

.header-center {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}


/* =========================
   NAV
========================= */

.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.nav-link {
    color: #c8cdd6;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.nav-link:hover,
.dropdown:hover > .nav-link {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.nav-link.active {
    background: #00a8ff;
    color: white;
    font-weight: 600;
}

.dropdown-toggle::after {
    content: '▾';
    font-size: 10px;
    opacity: 0.6;
}


/* =========================
   DROPDOWNS NAV
========================= */

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    padding-top: 8px;
    background: transparent;
    min-width: 190px;
    z-index: 200;
}

.dropdown-menu::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: -1;
}

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

.dropdown-menu a {
    display: block;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.1s;
}

.dropdown-menu a:hover {
    background: #f5f6fa;
    color: #2f3640;
}


/* =========================
   SEARCH BAR
========================= */

.search-bar {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 11px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0.45;
}

.search-bar input {
    width: 100%;
    padding: 8px 14px 8px 34px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 13px;
    box-sizing: border-box;
    outline: none;
    transition: background 0.2s;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.search-bar input:focus {
    background: rgba(255, 255, 255, 0.16);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
}

.search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    color: #2f3640;
    font-size: 13px;
    transition: background 0.1s;
}

.search-item:hover {
    background: #f5f6fa;
}

.search-item mark {
    background: #fff3a3;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

.search-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
}

.search-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-badge--reference { background: #d6eeff; color: #005fa3; }
.search-badge--produit   { background: #d4f5e2; color: #1a6b3a; }
.search-badge--kit       { background: #ede0ff; color: #5c2d91; }
.search-badge--dm        { background: #fde0d8; color: #c0330a; }

.search-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 8px;
    flex-shrink: 0;
}

.search-thumb-placeholder {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f3f8;
    border-radius: 5px;
    margin-right: 8px;
    font-size: 16px;
    flex-shrink: 0;
}


/* =========================
   SCAN BUTTON
========================= */

.btn-scan {
    background: #00a8ff;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(0, 168, 255, 0.35);
}

.btn-scan:hover {
    background: #0097e6;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 168, 255, 0.45);
}

.btn-scan.active {
    background: #273c75;
    box-shadow: none;
}


/* =========================
   USER MENU
========================= */

.user-dropdown {
    position: relative;
    flex-shrink: 0;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.15s;
    user-select: none;
}

.user-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
}

.badge-role {
    background: #273c75;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}

.badge-company {
    background: #2980b9;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    padding-top: 8px;
    background: transparent;
    min-width: 190px;
    z-index: 200;
}

.dropdown-content::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: -1;
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-company {
    padding: 12px 14px;
    font-weight: 700;
    font-size: 13px;
    color: #2f3640;
    background: #f5f6fa;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
}

.dropdown-content a {
    display: block;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.1s;
}

.dropdown-content a:hover {
    background: #f5f6fa;
}

.dropdown-logout {
    color: #c0392b !important;
    font-weight: 500;
}


/* =========================
   LOGIN BUTTON
========================= */

.login-btn {
    background: #00a8ff;
    color: white;
    padding: 7px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}

.login-btn:hover {
    background: #0097e6;
}
