/* includes/navbar.php — moved from its inline <style> block (loaded at the same position). */
/* ── Variables (same dark-green palette as sidebar) ────────────── */
:root {
    --nb-green-d:  #1b4332;
    --nb-green-m:  #2d6a4f;
    --nb-green-l:  #7FBDB7;
    --nb-text:     #2C3E36;
    --nb-border:   rgba(168,194,158,.35);
    --nb-font:     'Sarabun','Kanit',sans-serif;
    --nb-shadow:   0 4px 20px rgba(27,67,50,.35);
}

/* ── Navbar bar ─────────────────────────────────────────────────── */
.nb-nav {
    background: #fff !important;
    border-bottom: 1px solid #e6eee9;
    box-shadow: none;
    transition: box-shadow .3s, transform .3s;
}
.nb-nav.nb-scrolled {
    box-shadow: none !important;
}
.nb-logo {
    height: 44px;
    max-width: 120px;
    width: auto;
    object-fit: contain;
    padding: 2px 5px;
}
.nb-brand-text {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    font-family: 'Kanit','Sarabun',sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1;
    text-shadow: 0 1px 8px rgba(27,67,50,.22);
}
.nb-brand-ku { color: #F5F0C8; }
.nb-brand-four { color: #ffd166; margin: 0 .02em; }
.nb-brand-life { color: #fff; font-weight: 700; }

/* ── Navbar icon buttons ────────────────────────────────────────── */
.nb-icon-btn {
    background: rgba(255,255,255,.12);
    border: 1.5px solid rgba(255,255,255,.35);
    color: #fff; border-radius: 8px;
    min-width: 40px; min-height: 40px;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, transform .2s;
}
.nb-icon-btn:hover { background: rgba(255,255,255,.25); color: #fff; transform: translateY(-1px); }
.nb-badge {
    position: absolute; top: -4px; right: -4px;
    background: #dc3545; color: #fff; font-size: .6rem; font-weight: 700;
    width: 17px; height: 17px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--nb-green-m);
    animation: nbPulse 2s infinite;
}
@keyframes nbPulse { 0%,100% { box-shadow:0 0 0 0 rgba(220,53,69,.4); } 50% { box-shadow:0 0 0 5px rgba(220,53,69,0); } }

/* ── Desktop profile button ──────────────────────────────────────── */
.nb-profile-btn { padding: 3px; min-width: 40px; width: 40px; height: 40px; }
.nb-avatar-sm   { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; display: block; }
/* ── Hamburger button ────────────────────────────────────────────── */
.nb-hamburger { min-width: 40px; width: 40px; height: 40px; padding: 0; }

/* ── Role badge (in navbar) ─────────────────────────────────────── */
.nb-role-badge { font-size: .65rem; font-weight: 600; padding: .25em .6em; border-radius: 999px; }
.nb-role-admin { background: #dc3545 !important; color: #fff !important; }
.nb-role-staff { background: #fd7e14 !important; color: #fff !important; }
.nb-role-inst  { background: #0d6efd !important; color: #fff !important; }
.nb-role-stud  { background: #198754 !important; color: #fff !important; }

/* ── Guest buttons ──────────────────────────────────────────────── */
.nb-outline-btn {
    background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.5);
    color: #fff; font-size: .85rem; border-radius: 8px; transition: background .2s;
    white-space: nowrap; height: 40px; display: inline-flex; align-items: center; justify-content: center;
}
.nb-outline-btn:hover { background: rgba(255,255,255,.25); color: #fff; }
.nb-light-btn {
    background: #F5F0C8; border: 1.5px solid rgba(255,255,255,.3);
    color: var(--nb-text); font-size: .85rem; border-radius: 8px; transition: background .2s;
    white-space: nowrap; height: 40px; display: inline-flex; align-items: center; justify-content: center;
}
.nb-light-btn:hover { background: #fff; color: var(--nb-text); }

/* ── Search bar ─────────────────────────────────────────────────── */
.nb-search { max-width: 280px; width: 100%; }
.nb-search .form-control {
    background: rgba(245,240,200,.92); border: 1.5px solid rgba(127,189,183,.5);
    color: var(--nb-text); border-radius: 8px 0 0 8px; font-size: .9rem; height: 40px;
}
.nb-search .form-control:focus { background: #fff; box-shadow: 0 0 0 .2rem rgba(127,189,183,.3); border-color: var(--nb-green-l); }
.nb-search .btn-light { background: #F5F0C8; border: 1.5px solid rgba(127,189,183,.5); border-left: none; border-radius: 0 8px 8px 0; color: var(--nb-text); height: 40px; }

/* ══════════════════════════════════════════════════════════════════
   Offcanvas
   ══════════════════════════════════════════════════════════════════ */
.nb-offcanvas { width: min(360px, 92vw) !important; font-family: var(--nb-font); }
.nb-offcanvas-head {
    background: #2d6a4f;
    padding: 1rem 1.1rem; border-bottom: 0;
}
.nb-avatar-lg { width: 48px; height: 48px; object-fit: cover; }
.nb-head-name { font-family: 'Kanit',sans-serif; font-size: .95rem; }
.nb-offcanvas-head .btn-close { width: 1.25rem; height: 1.25rem; opacity: .9; }
.nb-offcanvas-body { background: #f6fbf8; padding: .75rem !important; overflow-y: auto; }

/* ── Accordion section ──────────────────────────────────────────── */
.nb-section {
    margin-bottom: .75rem !important; border-radius: 13px; overflow: hidden;
    border: 1px solid var(--nb-border);
    background: #fff; box-shadow: 0 2px 7px rgba(27,67,50,.06);
}
.nb-sec-hd {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: .78rem 1rem; background: #b8e6c1;
    color: #1b4332; font-weight: 600; font-size: .95rem;
    border: none; cursor: pointer; text-align: left;
    transition: background .2s, color .2s; font-family: 'IBM Plex Sans Thai','Sarabun',sans-serif;
}
.nb-sec-hd:hover,
.nb-sec-hd.nb-open { background: #2d6a4f; color: #fff; }
.nb-chev { transition: transform .3s ease; font-size: .72rem; flex-shrink: 0; }
.nb-sec-hd.nb-open .nb-chev,
.nb-sec-hd[aria-expanded="true"] .nb-chev { transform: rotate(180deg); }

/* ── Menu items ─────────────────────────────────────────────────── */
.nb-sec-body { padding: .25rem 0; }
.nb-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .7rem 1rem .7rem 1.1rem;
    color: var(--nb-text); text-decoration: none;
    font-size: .95rem; font-family: var(--nb-font);
    transition: background .15s, color .15s, padding-left .15s;
    border-left: 3px solid transparent; min-height: 48px;
}
.nb-item i { width: 18px; text-align: center; font-size: .95rem; color: var(--nb-green-m); flex-shrink: 0; }
.nb-item:hover { background: rgba(127,189,183,.1); color: var(--nb-green-m); padding-left: 1.4rem; border-left-color: var(--nb-green-l); }
.nb-item--active { background: #edf8f3; color: #2d6a4f; border-left-color: #5fb3a5; font-weight: 700; }
.nb-item--active i { color: var(--nb-green-m); }
.nb-item .badge { min-width: 24px; min-height: 22px; padding: .25rem .45rem; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; }
.nb-danger   { color: #dc3545 !important; }
.nb-danger i { color: #dc3545 !important; }
.nb-danger:hover { background: rgba(220,53,69,.07) !important; border-left-color: #dc3545 !important; }

/* ── Footer ─────────────────────────────────────────────────────── */
.nb-footer { border-radius: 13px; overflow: hidden; border: 1px solid var(--nb-border); background: #fff; }

/* ── Guest buttons in offcanvas ─────────────────────────────────── */
.nb-offcanvas .nb-primary-btn { background: linear-gradient(135deg,var(--nb-green-m),var(--nb-green-d)); color:#fff !important; border:none; border-radius:8px; font-family:'Kanit',sans-serif; font-weight:600; }
.nb-offcanvas .nb-primary-btn:hover,
.nb-offcanvas .nb-primary-btn:focus,
.nb-offcanvas .nb-primary-btn:active { background: linear-gradient(135deg,var(--nb-green-d),#163826); color:#fff !important; }
.nb-offcanvas .nb-primary-btn i { color:#fff !important; }
.nb-outline-btn2 { border: 2px solid var(--nb-green-m); color:var(--nb-green-m); border-radius:8px; font-family:'Kanit',sans-serif; font-weight:600; }
.nb-outline-btn2:hover { background: var(--nb-green-m); color:#fff; }

/* ── Accessibility ──────────────────────────────────────────────── */
.nb-icon-btn:focus-visible,
.nb-item:focus-visible { outline: 3px solid var(--nb-green-l); outline-offset: -2px; }

/* ── Print ──────────────────────────────────────────────────────── */
@media print { .nb-nav, .nb-offcanvas { display: none !important; } }

/* new-item count on a menu section header; the items show their own badge once it is open */
.nb-sec-hd .nb-sec-badge { margin-left: auto; margin-right: .5rem; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #dc3545; color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; }
.nb-sec-hd.nb-open .nb-sec-badge { display: none; }
