:root {
    --primary: #111827;
    --primary-soft: #1f2937;
    --accent: #16a34a;
    --accent-dark: #15803d;
    --accent-soft: #dcfce7;
    --secondary: #f97316;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --line: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --shadow-sm: 0 8px 20px rgba(17, 24, 39, 0.06);
    --shadow-md: 0 18px 45px rgba(17, 24, 39, 0.12);
    --radius-sm: 14px;
    --radius: 20px;
    --radius-lg: 28px;
    --transition: 0.25s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f9fbfa 0%, #ffffff 100%);
    line-height: 1.6;
    overflow-x: clip;
}

body.menu-open,
body.app-drawer-open {
    overflow: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select {
    font-family: inherit;
}

.container {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    max-width: 100%;
}

/* TOPBAR */
.topbar {
    background: #0f172a;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.topbar .container {
    min-height: 42px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
}

.topbar-left,
.topbar-right {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
}

.topbar-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.topbar-chip i {
    color: #86efac;
}

.topbar-mobile-note {
    display: none;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-align: center;
    font-weight: 800;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.95);
}

/* HEADER */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(229,231,235,0.95);
    max-width: 100vw;
}

.header-inner {
    min-height: 82px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.header-brand-slot {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-shrink: 0;
}

.logo-mark {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.logo-mark::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.22), transparent 50%);
}

.logo-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--primary);
}

.logo-title span {
    color: var(--accent-dark);
}

.logo-subtitle {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 700;
    margin-top: 3px;
}

.logo-hide-when-account-drawer {
    display: none !important;
}

/* NAV */
.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.nav a {
    padding: 10px 13px;
    border-radius: 999px;
    font-weight: 800;
    color: var(--muted);
    transition: var(--transition);
    white-space: nowrap;
    font-size: 0.94rem;
}

.nav a:hover,
.nav a.active {
    background: var(--accent-soft);
    color: var(--primary);
}

/* ACTIONS */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.language-switcher {
    position: relative;
    flex-shrink: 0;
}

.language-switcher::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--muted);
    font-size: 0.84rem;
}

.language-select {
    appearance: none;
    min-height: 44px;
    padding: 0 40px 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: var(--text);
    font-weight: 800;
    font-size: 0.94rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.language-select:hover,
.language-select:focus {
    border-color: #bbf7d0;
    outline: none;
    box-shadow: 0 0 0 4px rgba(22,163,74,0.10);
}

/* BUTTONS */
.btn {
    border: none;
    cursor: pointer;
    border-radius: 14px;
    font-weight: 800;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    white-space: nowrap;
    min-height: 44px;
    flex-shrink: 0;
    text-decoration: none;
    padding: 0 16px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: #f8fafc;
    border-color: var(--line);
}

.btn-outline {
    background: white;
    border: 1px solid var(--line);
    color: var(--text);
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-app {
    background: linear-gradient(135deg, #0f172a, #1f2937);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* ACCOUNT MENU */
.account-menu {
    position: relative;
}

.account-menu-btn {
    min-height: 48px;
    border: 1px solid var(--line);
    background: white;
    border-radius: 18px;
    padding: 6px 12px 6px 6px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.account-menu-btn:hover,
.account-menu.open .account-menu-btn {
    border-color: #bbf7d0;
    box-shadow: 0 0 0 4px rgba(22,163,74,0.10);
}

.account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    font-weight: 900;
    flex-shrink: 0;
}

.account-avatar.large {
    width: 48px;
    height: 48px;
    border-radius: 17px;
}

.account-btn-text {
    display: grid;
    text-align: left;
    line-height: 1.15;
}

.account-btn-text strong {
    font-size: 0.92rem;
    color: var(--text);
}

.account-btn-text small {
    font-size: 0.74rem;
    color: var(--accent-dark);
    font-weight: 900;
}

.account-menu-btn i {
    color: var(--muted);
    font-size: 0.82rem;
    transition: var(--transition);
}

.account-menu.open .account-menu-btn i {
    transform: rotate(180deg);
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 300px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    padding: 10px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: var(--transition);
    z-index: 700;
}

.account-menu.open .account-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.account-dropdown-head,
.drawer-account-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid var(--line);
    margin-bottom: 8px;
}

.account-dropdown a,
.account-dropdown button {
    width: 100%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    font-size: 0.94rem;
}

.account-dropdown a i,
.account-dropdown button i {
    width: 18px;
    color: var(--accent-dark);
    text-align: center;
}

.account-dropdown a:hover,
.account-dropdown button:hover {
    background: #f8fafc;
}

.account-dropdown-divider {
    height: 1px;
    background: var(--line);
    margin: 8px 4px;
}

.account-dropdown-head > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account-dropdown-head strong,
.account-dropdown-head small {
    display: block;
    line-height: 1.2;
}

.account-dropdown-head small {
    color: var(--muted);
    font-weight: 700;
}

/* HEADER DRAWER BUTTONS */
.mobile-header-buttons {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.app-account-toggle {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #ffffff;
    box-shadow: var(--shadow-sm);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
}

.menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: white;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
}

/* APP DRAWER LEFT */
.app-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 3998;
}

.app-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(370px, 88vw);
    max-width: 88vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.16);
    visibility: hidden;
    transform: translateX(-100%);
    pointer-events: none;
    transition: var(--transition);
    z-index: 3999;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

body.app-drawer-open .app-drawer-backdrop {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

body.app-drawer-open .app-drawer {
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

/* MOBILE DRAWER RIGHT */
.mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 3000;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(370px, 88vw);
    max-width: 88vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.16);
    visibility: hidden;
    transform: translateX(100%);
    pointer-events: none;
    transition: var(--transition);
    z-index: 3001;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

body.menu-open .header {
    z-index: 2999;
}

body.menu-open .mobile-drawer-backdrop {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

body.menu-open .mobile-drawer {
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

/* DRAWER CONTENT */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.drawer-close {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: white;
    color: var(--text);
    cursor: pointer;
}

.drawer-body {
    padding: 20px;
    overflow-y: auto;
    display: grid;
    gap: 22px;
}

.drawer-section {
    display: grid;
    gap: 12px;
}

.drawer-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 900;
}

.drawer-nav,
.drawer-actions,
.drawer-chips {
    display: grid;
    gap: 10px;
}

.drawer-nav a,
.drawer-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid var(--line);
    font-weight: 800;
    color: var(--text);
}

.drawer-nav a i,
.drawer-chip i {
    color: var(--accent-dark);
    width: 18px;
    text-align: center;
}

.drawer-actions .btn,
.drawer-language .language-select {
    width: 100%;
    justify-content: flex-start;
}

/* MOBILE BOTTOM NAV */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid var(--line);
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    z-index: 999;
    box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 12px;
    font-weight: 800;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.1rem;
}

.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:hover {
    color: var(--accent-dark);
}

.mobile-bottom-nav .nav-cta {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white !important;
    transform: translateY(-12px);
    border-radius: 16px;
    padding: 10px 6px;
    box-shadow: 0 10px 20px rgba(22,163,74,0.35);
}

/* RESPONSIVE */
@media (max-width: 1080px) {
    .nav a {
        padding: 10px 10px;
        font-size: 0.91rem;
    }

    .header-actions .language-switcher {
        display: none;
    }
}

@media (min-width: 941px) {
    .header-inner {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
    }

    .menu-toggle {
        display: none !important;
    }

    .app-account-toggle {
        display: inline-flex !important;
    }
}

@media (max-width: 940px) {
    .nav,
    .header-actions {
        display: none;
    }

    .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        overflow: hidden;
    }

    .header-brand-slot {
        flex-shrink: 0;
    }

    .mobile-header-buttons {
        margin-left: auto;
    }

    .menu-toggle {
        display: inline-flex !important;
    }

    .app-account-toggle {
        display: inline-flex !important;
    }

    .logo {
        flex: 1;
        overflow: hidden;
    }

    .logo-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }

    .topbar-left,
    .topbar-right {
        display: none;
    }

    .topbar-mobile-note {
        display: inline-flex;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    body {
        padding-bottom: 80px;
    }
}

@media (max-width: 520px) {
    .container {
        width: calc(100% - 20px);
    }

    .logo-mark {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .logo-title {
        font-size: 1.15rem;
        max-width: 150px;
    }

    .logo-subtitle {
        display: none;
    }

    .app-account-toggle {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }
}

/* Hide topbar + main header on mobile, keep drawers and bottom nav working */
@media (max-width: 940px) {
    .topbar,
    .header {
        display: none !important;
    }

    body.menu-open .header,
    body.app-drawer-open .header {
        display: none !important;
    }

    .mobile-bottom-nav {
        display: flex !important;
    }

    .app-drawer-backdrop,
    .app-drawer,
    .mobile-drawer-backdrop,
    .mobile-drawer {
        display: flex;
    }
}

/* APP DRAWER CONTENT */
.app-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.app-drawer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.app-drawer-logo {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #ffffff;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.app-drawer-brand strong {
    display: block;
    font-weight: 900;
    color: var(--text);
    line-height: 1.1;
}

.app-drawer-brand span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 700;
    margin-top: 2px;
}

.app-drawer-close {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}

.app-drawer-body {
    padding: 20px;
    overflow-y: auto;
    display: grid;
    gap: 20px;
}

.app-drawer-section {
    display: grid;
    gap: 10px;
}

.app-drawer-section-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 900;
}

.app-drawer-link {
    width: 100%;
    border: 1px solid var(--line);
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    color: var(--text);
    font-weight: 850;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.app-drawer-link i {
    width: 18px;
    text-align: center;
    color: var(--accent-dark);
}

.app-drawer-link:hover {
    background: #ffffff;
    border-color: #bbf7d0;
    box-shadow: 0 0 0 4px rgba(22,163,74,0.08);
}

.app-drawer-link.logout {
    color: #991b1b;
}

.app-drawer-link.logout i {
    color: #dc2626;
}

.app-drawer-link.create-tech-profile {
    background: #ecfdf5;
    border-color: #bbf7d0;
}
