html,
body {
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    height: 100%;
    font: 15px/22px "Trebuchet MS", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f8f8f8;
    color: #4b4b4b;
}

.header {
    margin: 16px 24px;
    padding: 10px 20px;
    border-radius: 12px;
    background: #fff;
    color: #4b4b4b;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    z-index: 100;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00617b;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}

.brand-link svg {
    height: 28px !important;
    width: 28px !important;
    fill: #00617b;
    display: block;
}

/* Dropdown Components */
.nav-dropdown,
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f7f9;
    color: #00617b;
    border: 1px solid #cce4eb;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.nav-dropdown-btn:hover,
.nav-dropdown-btn:focus {
    background: #e0f0f4;
    border-color: #99cbd7;
}

.nav-dropdown-btn svg {
    height: 16px !important;
    width: 16px !important;
    fill: currentColor;
    display: block;
}

.scanner-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #00617b;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    user-select: none;
}

.scanner-quick-btn:hover {
    background: #bae6fd;
}

.dropdown-menu-list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    min-width: 220px;
    max-width: calc(100vw - 20px);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    padding: 6px 0;
    z-index: 1000;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: #00617b;
}

.dropdown-item.active {
    background: #e0f2fe;
    color: #0284c7;
    font-weight: 600;
}

.dropdown-item-icon {
    font-size: 16px;
    line-height: 1;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 6px 0;
}

.menu-user-header {
    display: none;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
}

.menu-signout-item {
    display: none;
}

/* Language Dropdown */
.lang-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.lang-dropdown-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
}

.lang-dropdown-btn svg {
    height: 14px !important;
    width: 14px !important;
    fill: currentColor;
    display: block;
}

.lang-flag {
    font-size: 15px;
    line-height: 1;
}

.lang-menu-list {
    left: auto;
    right: 0;
    min-width: 170px;
}

.lang-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.lang-item:hover {
    background: #f8fafc;
    color: #00617b;
}

.lang-item.active {
    background: #f0fdf4;
    color: #15803d;
    font-weight: 600;
}

/* User Profile & Auth Buttons */
.user-block {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.user-details {
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-role-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #0284c7;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.btn-signout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #dc3545;
    font-weight: 600;
    padding: 5px 12px;
    border: 1px solid #dc3545;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
    user-select: none;
}

.btn-signout:hover {
    background: #dc3545;
    color: #fff;
}

.btn-signout svg {
    height: 15px !important;
    width: 15px !important;
    fill: currentColor;
    display: block;
}

.btn-signin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #00617b;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 14px;
    border: 1px solid #00617b;
    border-radius: 6px;
    transition: all 0.2s;
    user-select: none;
}

.btn-signin:hover {
    background: #00617b;
    color: #fff;
}

.btn-signin svg {
    height: 15px !important;
    width: 15px !important;
    fill: currentColor;
    display: block;
}

.content {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.content_i {
    flex-grow: 1;
    padding: 24px 5%;
    width: 100%;
    box-sizing: border-box;
}

.content a {
    color: #00617b;
}

.content a:hover {
    color: #1191b3;
}

.footer {
    border-top: 1px solid #e6e8ec;
    margin: 24px 24px 0;
    padding: 24px;
    text-align: center;
}

.footer_copyright a {
    color: #838b99;
    text-decoration: none;
}

.footer_copyright a:hover {
    color: #0b7794;
    text-decoration: underline;
}

.footer_icons {
    padding-top: 16px;
    display: flex;
    justify-content: center;
}

.footer_icons a {
    margin: 0 12px;
    text-decoration: none;
}

.footer_icons svg {
    height: 32px;
    fill: #838b99;
}

.footer_icons a:hover svg {
    fill: #0b7794;
}

.text-center {
    text-align: center;
}

/* ==========================================================================
   Mobile / Phone responsiveness (< 640px)
   ========================================================================== */
@media (max-width: 640px) {
    .header {
        margin: 8px 10px;
        padding: 8px 10px;
    }

    .header-left,
    .header-right {
        gap: 6px;
    }

    /* Hide text labels on phone, keep only icons */
    .brand-title {
        display: none;
    }

    .nav-dropdown-label,
    .nav-chevron {
        display: none;
    }

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

    .lang-btn-label,
    .lang-chevron {
        display: none;
    }

    .user-details {
        display: none;
    }

    .signout-label {
        display: none;
    }

    .signin-label {
        display: none;
    }

    /* Touch-friendly compact icon buttons */
    .nav-dropdown-btn,
    .scanner-quick-btn,
    .lang-dropdown-btn,
    .btn-signout,
    .btn-signin {
        padding: 7px 10px;
        min-height: 36px;
        min-width: 36px;
        box-sizing: border-box;
        justify-content: center;
    }

    .lang-flag {
        font-size: 16px;
    }

    /* Show user info and Sign Out inside the menu on mobile */
    .menu-user-header {
        display: block;
    }

    .menu-signout-item {
        display: flex !important;
    }

    /* Compact content padding */
    .content_i {
        padding: 14px 10px;
    }

    .footer {
        margin: 16px 10px 0;
        padding: 16px 10px;
    }
}