/* =========================================================================
   Palmier ToP – base styles: tokens, navbar, login, shared widgets
   ========================================================================= */
:root {
    --brand: #2C5530;
    --brand-dark: #1B2E16;
    --brand-light: #F2E7D3;
    --orange: #2C5530;
    --orange-dark: #243D1D;
    --text: #1A1A1A;
    --text-muted: #516381;
    --border: #E2D8C6;
    --white: #FFFFFF;
    --danger: #C0392B;
    --success: #27AE60;
    --highlight: #F3E6CC;
    --highlight-border: #C9A66B;
    --nav-bg: #243D1D;
    --sand: #ECD8BD;
    --navy: #081C3A;
    --shadow: 0 2px 12px rgba(0, 0, 0, .08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .12);
    --radius: 8px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Montserrat', Arial, sans-serif;
    color: var(--text);
    font-size: 13px;
    min-height: 100vh;
    background: #fff;
}

a { color: inherit; }
button { font-family: inherit; }

/* --------------------------------------------------------------- navbar */
.navbar {
    position: sticky; top: 0; z-index: 1000;
    display: flex; align-items: center; gap: 18px;
    background: var(--nav-bg);
    padding: 0 16px;
    height: 48px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}
.topheader-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.nav-logo { height: 30px; width: auto; display: block; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 10px; flex: 1; }
.dropdown { position: relative; }
.dropdown-toggle {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 14px 10px; cursor: pointer; user-select: none;
    font-size: 13.5px; font-weight: 600; color: rgba(255, 255, 255, .88); letter-spacing: .3px;
}
.dropdown-toggle::after {
    content: ''; width: 0; height: 0; margin-left: 2px;
    border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 4px solid rgba(255, 255, 255, .55);
}
.dropdown:hover .dropdown-toggle { color: var(--sand); }

.dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; min-width: 210px;
    background: #fff; border-radius: 8px; padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15); border: 1px solid #e5e7eb;
}
.dropdown:hover > .dropdown-menu { display: block; }
.dropdown-item-2 {
    display: block; padding: 9px 12px; border-radius: 6px; text-decoration: none;
    font-size: 13px; font-weight: 600; color: #374151;
}
.dropdown-item-2:hover { background: #F4ECDA; color: var(--orange-dark); }

.navbar-left-items { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.navbar-left-items .dropdown-menu { left: auto; right: 0; }
.user-name-btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .3); border-radius: 6px; padding: 7px 10px;
    font-size: 13px; color: #fff;
}
.user-avatar-mobile {
    display: none; width: 26px; height: 26px; border-radius: 50%;
    background: var(--sand); color: #243D1D; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
}
.user-name-btn i { color: rgba(255, 255, 255, .6); font-size: 12px; }
.logout {
    width: 30px; height: 30px; border: none; border-radius: 6px; cursor: pointer;
    background: var(--sand); color: #243D1D; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
}
.logout:hover { background: #fff; }

.hamburger {
    display: none; width: 36px; height: 34px; cursor: pointer; user-select: none;
    border: 1.5px solid var(--sand); border-radius: 6px; background: transparent;
    color: var(--sand); font-size: 19px; align-items: center; justify-content: center;
}
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 900; }
.mobile-overlay.active { display: block; }

@media (max-width: 900px) {
    .navbar { height: 56px; gap: 10px; }
    .hamburger { display: inline-flex; }
    .nav-logo { height: 26px; }
    .user-fullname-text, .user-name-btn i { display: none; }
    .user-name-btn { padding: 4px; background: transparent; border-color: var(--sand); }
    .user-avatar-mobile { display: inline-flex; background: var(--sand); color: #243D1D; border-radius: 6px; width: 30px; height: 28px; }
    .logout { width: 40px; height: 36px; font-size: 16px; }
    .nav-links {
        position: fixed; top: 56px; left: 0; bottom: 0; width: 270px; background: #fff;
        flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 8px 0;
        transform: translateX(-100%); transition: transform .25s; z-index: 950; overflow-y: auto;
        box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
    }
    .nav-links.active { transform: translateX(0); }
    .nav-links .dropdown-toggle { width: 100%; padding: 14px 18px; border-bottom: 1px solid #f1f1f1; justify-content: space-between; color: #243D1D; }
    .nav-links .dropdown-toggle::after { border-top-color: #8a919c; }
    .dropdown:hover .dropdown-toggle { color: #243D1D; }
    .nav-links .dropdown:hover > .dropdown-menu { display: none; }
    .dropdown-menu { position: static; box-shadow: none; border: none; background: #fafafa; padding: 0; border-radius: 0; }
    .nav-links .dropdown-menu.mobile-open { display: block; }
    .dropdown-item-2 { padding: 12px 28px; }
    .navbar-left-items .dropdown:hover > .dropdown-menu { display: none; }
    .navbar-left-items .dropdown-menu { position: absolute; right: 0; left: auto; background: #fff; border: 1px solid #e5e7eb; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
    .navbar-left-items .dropdown-menu.mobile-open { display: block; }
}

/* ---------------------------------------------------------------- login */
body.login-body {
    background: linear-gradient(135deg, #fbfaf6 0%, #f1ede2 100%);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
    width: 100%; max-width: 780px; min-height: 420px; display: flex; overflow: hidden;
    background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(30, 30, 60, .12);
}
.login-hero {
    position: relative; flex: 1; color: #fff; overflow: hidden;
    background: linear-gradient(160deg, #3E6B43 0%, #2C5530 45%, #243D1D 100%);
    display: flex; flex-direction: column; padding: 26px 28px;
}
.login-hero .skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 62%; opacity: .22; }
.login-hero .brand { position: relative; display: flex; align-items: center; }
.login-hero .brand img { height: 38px; width: auto; display: block; }
.login-hero .welcome {
    position: relative; margin: auto 0; text-align: center;
    font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: 1px; text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.login-hero .welcome::after, .login-hero .welcome::before {
    content: ''; display: block; height: 2px; width: 62%; background: rgba(255, 255, 255, .75); margin: 14px auto;
}
.login-hero .welcome::before { display: none; }
.login-form-wrap { flex: 1; padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-form-wrap h1 { text-align: center; font-size: 26px; color: #1f2937; margin-bottom: 26px; font-weight: 700; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.field .control { position: relative; }
.field input {
    width: 100%; padding: 11px 38px 11px 12px; font-size: 13px; font-family: inherit;
    border: none; border-left: 3px solid #3E6B43; border-radius: 4px; background: #f3f4f6; outline: none; color: #111827;
}
.field input:focus { background: #eceef2; box-shadow: 0 0 0 2px rgba(44, 85, 48, .25); }
.field .eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #6b7280; font-size: 14px; }
.btn-login {
    width: 100%; margin-top: 10px; padding: 12px; border: none; border-radius: 999px; cursor: pointer;
    background: linear-gradient(90deg, #2C5530, #4B7A50); color: #fff; font-size: 14px; font-weight: 700;
    box-shadow: 0 8px 18px rgba(36, 61, 29, .35); transition: transform .1s, box-shadow .1s;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(36, 61, 29, .42); }
.login-error { background: #fdecea; color: #b42318; border: 1px solid #f5c2c0; border-radius: 6px; padding: 9px 12px; margin-bottom: 14px; font-size: 12.5px; }
@media (max-width: 640px) {
    .login-card { flex-direction: column; min-height: 0; }
    .login-hero { min-height: 160px; padding: 20px; }
    .login-hero .welcome { font-size: 26px; margin: 18px 0 8px; }
    .login-form-wrap { padding: 28px 22px; }
}

/* ----------------------------------------------------------- shared bits */
.page-container { padding: 16px; }
.spinner {
    width: 40px; height: 40px; border-radius: 50%;
    border: 4px solid rgba(44, 85, 48, .2); border-top-color: var(--brand);
    animation: spin 1s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.change-pass-card {
    max-width: 440px; margin: 40px auto; background: #fff; border: 1.5px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow); padding: 26px 28px;
}
.change-pass-card h2 { font-family: 'Aboreto', 'Montserrat', sans-serif; color: var(--brand-dark); margin-bottom: 18px; font-size: 20px; }
.change-pass-card .field input { border-left-color: var(--brand); }
.change-pass-card .btn-login { background: var(--brand); box-shadow: none; border-radius: 8px; }
.change-pass-card .ok { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; border-radius: 6px; padding: 9px 12px; margin-bottom: 14px; }

.error-page { text-align: center; padding: 90px 20px; }
.error-page h1 { font-family: 'Aboreto', 'Montserrat', sans-serif; color: var(--brand-dark); font-size: 56px; }
.error-page a { color: var(--orange-dark); font-weight: 700; }

/* role label in the user menu */
.user-role-line { padding: 8px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid #eef0f3; margin-bottom: 4px; }
.user-role-line i { margin-right: 4px; color: var(--brand); }
