:root {
    --mw-bg: #f4f1ea;
    --mw-surface: #ffffff;
    --mw-surface-soft: #f8f6f1;
    --mw-border: #d9d2c7;
    --mw-border-strong: #bdb3a4;
    --mw-text: #1f2a30;
    --mw-muted: #65737c;
    --mw-green: #2f9f42;
    --mw-green-dark: #1f6e2e;
    --mw-black: #1d1f21;
    --mw-danger: #c94f4f;
    --mw-shadow: 0 16px 40px rgba(30, 35, 39, 0.08);
    --mw-radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #f7f4ee 0%, #f1ece3 100%);
    color: var(--mw-text);
    font-family: "Inter", sans-serif;
    overflow-x: hidden;
}

a {
    color: var(--mw-green-dark);
}

img,
svg,
canvas,
video,
iframe {
    max-width: 100%;
}

.hrms-navbar {
    background: linear-gradient(135deg, #1f2428, #2b3136);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.hrms-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.hrms-brand:hover {
    color: #fff;
}

.hrms-brand-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--mw-green), #43bf59);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.hrms-brand-text {
    font-size: 0.98rem;
    letter-spacing: 0.02em;
}

.hrms-user-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.hrms-user-nav .dropdown {
    position: relative;
}

.hrms-user-nav .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: auto;
    right: 0;
}

.hrms-user-nav .nav-link,
.hrms-user-nav .btn,
.mobile-sidebar-toggle {
    color: #fff;
}

.hrms-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.85rem;
    font-weight: 700;
    margin-right: 10px;
}

.hrms-user-name {
    font-size: 0.92rem;
    color: #fff;
}

.hrms-dropdown-menu {
    border: 1px solid var(--mw-border);
    border-radius: 14px;
    box-shadow: var(--mw-shadow);
    padding: 8px;
    max-width: min(92vw, 360px);
}

.hrms-dropdown-menu .dropdown-item {
    border-radius: 10px;
    font-size: 0.92rem;
}

.hrms-dropdown-menu .dropdown-item.active,
.hrms-dropdown-menu .dropdown-item:active {
    background: rgba(47, 159, 66, 0.12);
    color: var(--mw-green-dark);
}

.mobile-sidebar-toggle {
    border: 0;
    background: transparent;
    font-size: 1.3rem;
    margin-right: 10px;
    display: none;
}

.django-message-data {
    display: none;
}

.auth-container {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-card {
    width: min(460px, 100%);
    background: var(--mw-surface);
    border: 1px solid var(--mw-border);
    border-radius: 24px;
    box-shadow: var(--mw-shadow);
    padding: 28px 24px;
}

.auth-icon {
    font-size: 2rem;
    color: var(--mw-green-dark);
}

.auth-card .form-control,
.auth-card .form-select {
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid var(--mw-border-strong);
}

.auth-card .btn-primary {
    background: linear-gradient(135deg, var(--mw-green), var(--mw-green-dark));
    border-color: var(--mw-green-dark);
    border-radius: 12px;
}

main.flex-grow-1 {
    min-height: calc(100vh - 72px);
}

@media (max-width: 900px) {
    .hrms-navbar .container-fluid {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    body.has-sidebar .mobile-sidebar-toggle,
    body.dashboard-body .mobile-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin-right: 0;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
    }

    .hrms-brand {
        min-width: 0;
        gap: 8px;
        flex: 1 1 auto;
    }

    .hrms-brand-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .hrms-brand-text {
        font-size: 0.88rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hrms-user-nav {
        gap: 2px;
        flex: 1 1 100%;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
        margin-left: 0;
        padding-top: 6px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .hrms-user-nav > .nav-item {
        flex: 0 0 auto;
    }

    .hrms-user-nav .nav-link,
    .hrms-user-nav .btn,
    .hrms-user-nav .dropdown-toggle {
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    .hrms-user-avatar {
        width: 32px;
        height: 32px;
        margin-right: 0;
        font-size: 0.78rem;
    }

    #notificationBell {
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    #notiBadge {
        left: 20px !important;
    }

    .hrms-user-name {
        display: inline;
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 640px) {
    #languageDropdown,
    #notificationBell {
        display: none;
    }

    .hrms-user-nav > .nav-item:nth-child(1),
    .hrms-user-nav > .nav-item:nth-child(2) {
        display: none;
    }

    .hrms-navbar .container-fluid {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        justify-content: space-between;
    }

    .mobile-sidebar-toggle {
        flex: 0 0 auto;
    }

    .hrms-brand {
        flex: 1 1 auto;
        min-width: 0;
        align-items: center;
    }

    .hrms-user-nav {
        width: auto;
        flex: 0 0 auto;
        justify-content: flex-end;
        align-items: center;
        padding-top: 0;
        border-top: 0;
        flex-wrap: nowrap;
        margin-left: 0;
        gap: 4px;
        overflow: visible;
    }

    .hrms-user-nav > .nav-item {
        flex: 0 0 auto;
    }

    .hrms-user-nav .nav-item.dropdown.me-2 {
        margin-right: 0 !important;
    }

    .hrms-dropdown-menu {
        min-width: 220px;
    }

    #notificationBell + .dropdown-menu,
    .hrms-user-nav .dropdown-menu {
        width: min(92vw, 320px) !important;
        max-width: min(92vw, 320px);
        right: 0;
        left: auto;
    }

    .hrms-user-nav .nav-link,
    .hrms-user-nav .btn,
    .hrms-user-nav .dropdown-toggle {
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
        white-space: nowrap;
    }

    #languageDropdown .me-1 {
        margin-right: 0 !important;
    }

    #languageDropdown {
        font-size: 0;
    }

    #languageDropdown i,
    #languageDropdown::after {
        font-size: 1rem;
    }

    .hrms-brand-text {
        font-size: 0.86rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hrms-user-name {
        display: none;
    }

    .hrms-user-nav > .nav-item:last-child {
        margin-left: 0;
    }

    .hrms-user-nav .dropdown-menu {
        top: calc(100% + 6px);
        right: 0;
        left: auto;
    }
}
