/* ════════════════════════════════════════
   DESIGN TOKENS
════════════════════════════════════════ */
:root {
    --nav-bg:        #1a2540;
    --nav-border:    rgba(255,255,255,0.07);
    --nav-text:      rgba(255,255,255,0.65);
    --nav-text-hover:#ffffff;
    --nav-accent:    #e63946;
    --nav-height:    56px;
    --font:          'Inter', system-ui, sans-serif;
    --radius:        8px;
}

/* ════════════════════════════════════════
   BASE RESET
════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

::selection {
    background: rgba(230, 57, 70, 0.2);
    color: #1a2540;
}

body {
    font-family: var(--font);
    color: #1a2540;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: url('/static/images/bckgrd.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: rgba(0, 0, 0, 0.3);
    background-blend-mode: darken;
}

/* ════════════════════════════════════════
   PAGE STRUCTURE
════════════════════════════════════════ */
#page-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

#content-wrap {
    flex: 1;
    padding-top: var(--nav-height);
    width: 100%;
}

/* ════════════════════════════════════════
   NAVBAR
════════════════════════════════════════ */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 500;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    font-family: var(--font); /* font protection in one place */
}

/* ── Logo ── */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 24px;
    text-decoration: none;
    flex-shrink: 0;
    cursor: pointer;
}
.nav-logo img { width: 32px; height: auto; display: block; }
.nav-logo-text {
    font-size: 13px; font-weight: 600;
    color: #fff; letter-spacing: 0.4px; white-space: nowrap;
}

/* ── Divider ── */
.nav-divider {
    width: 1px; height: 20px;
    background: var(--nav-border);
    margin-right: 16px; flex-shrink: 0;
}

/* ── Nav links ── */
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }

.nav-link {
    color: var(--nav-text);
    font-size: 13px; font-weight: 500;
    padding: 6px 13px;
    border-radius: var(--radius);
    text-decoration: none; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    display: flex; align-items: center; gap: 5px;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: var(--nav-text-hover); }
.nav-link.active { background: rgba(255,255,255,0.12); color: #fff; }

/* ── Dropdown ── */
.nav-dropdown { position: relative; list-style: none; }

/* Invisible bridge prevents menu closing when crossing the gap */
.nav-dropdown::after {
    content: ''; position: absolute;
    top: 100%; left: 0; width: 100%; height: 12px;
}
.nav-dropdown .nav-link { cursor: pointer; }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px); left: 0;
    background: #fff;
    border: 0.5px solid #e2e6f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px -4px rgba(26, 37, 64, 0.14);
    min-width: 160px; width: max-content; max-width: 240px;
    overflow: hidden; z-index: 600; padding: 4px 0;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown-menu:hover { display: block; }

.nav-dropdown-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    font-size: 13px; font-weight: 500;
    color: #1a2540; text-decoration: none;
    transition: background 0.1s;
}
.nav-dropdown-menu a:hover { background: #f5f7fb; }
.nav-dropdown-menu a i { width: 16px; text-align: center; color: #9ba5ba; font-size: 12px; }

.nav-dropdown-divider { height: 0.5px; background: #eff1f6; margin: 4px 0; }

/* ── User chip ── */
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-user  { position: relative; list-style: none; }

.nav-user-chip {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 4px 12px 4px 4px;
    cursor: pointer; transition: background 0.15s;
}
.nav-user-chip:hover { background: rgba(255,255,255,0.14); }

.nav-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--nav-accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff;
    flex-shrink: 0; text-transform: uppercase;
}
.nav-username {
    font-size: 12px; font-weight: 500; color: #fff;
    white-space: nowrap; max-width: 120px;
    overflow: hidden; text-overflow: ellipsis;
}
.nav-caret { font-size: 9px; color: rgba(255,255,255,0.5); margin-left: 2px; }

.nav-user .nav-dropdown-menu { left: auto; right: 0; width: 180px; }

/* ── Mobile button ── */
.nav-mobile-btn {
    display: none;
    background: none; border: none;
    color: rgba(255,255,255,0.8);
    font-size: 18px; cursor: pointer;
    padding: 6px 8px; border-radius: var(--radius);
    transition: background 0.15s; margin-left: auto;
}
.nav-mobile-btn:hover { background: rgba(255,255,255,0.1); }

/* ── Mobile panel ── */
.nav-mobile-panel {
    display: none;
    position: fixed;
    top: var(--nav-height); left: 0; right: 0;
    background: #fff;
    border-bottom: 0.5px solid #e2e6f0;
    box-shadow: 0 8px 24px -4px rgba(26,37,64,0.12);
    z-index: 490; padding: 8px 0 16px;
}
.nav-mobile-panel.open { display: block; }

.mobile-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px;
    font-size: 14px; font-weight: 500; color: #1a2540;
    text-decoration: none;
    border-bottom: 0.5px solid #f5f7fb;
    transition: background 0.1s;
}
.mobile-nav-link:last-child { border-bottom: none; }
.mobile-nav-link:hover { background: #f5f7fb; }
.mobile-nav-link i { width: 18px; text-align: center; color: #9ba5ba; font-size: 13px; }

.mobile-section-label {
    padding: 10px 20px 4px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px; color: #b0b8cc;
}

.mobile-isu-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 11px 20px;
    font-size: 14px; font-weight: 500; color: #1a2540;
    border-bottom: 0.5px solid #f5f7fb;
    cursor: pointer; transition: background 0.1s;
}
.mobile-isu-toggle:hover { background: #f5f7fb; }
.mobile-isu-toggle i.fa-caret-down { font-size: 11px; color: #9ba5ba; transition: transform 0.15s; }
.mobile-isu-toggle.open i.fa-caret-down { transform: rotate(180deg); }

.mobile-submenu { display: none; background: #fafbfc; border-bottom: 0.5px solid #f5f7fb; }
.mobile-submenu.open { display: block; }
.mobile-submenu .mobile-nav-link { padding-left: 40px; font-size: 13px; }

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
#footer {
    position: relative; width: 100%; margin: 0;
    padding: 14px 20px;
    color: rgba(255,255,255,0.3);
    text-align: center;
    font-family: var(--font); font-size: 12px;
    background: var(--nav-bg);
    border-top: 1px solid var(--nav-border);
    box-sizing: border-box;
}

/* ════════════════════════════════════════
   FLASH MESSAGES (global — used on all pages)
════════════════════════════════════════ */
.flash-message {
    display: flex; align-items: center; gap: 12px;
    background: #fff;
    border: 0.5px solid #c0dd97;
    border-left: 3px solid #639922;
    border-radius: 0 10px 10px 0;
    color: #3b6d11;
    font-size: 13px; font-weight: 500;
    padding: 12px 16px; margin: 12px 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px -2px rgba(99,153,34,0.12);
    transition: opacity 0.2s;
}
.flash-message:hover { opacity: 0.85; }

.flash-message.flash-error {
    border-color: #f7c1c1; border-left-color: #e24b4a;
    color: #a32d2d;
    box-shadow: 0 2px 10px -2px rgba(226,75,74,0.12);
}
.flash-message.flash-error .flash-icon { background: #fcebeb; color: #a32d2d; }

.flash-message.flash-warning {
    border-color: #f5dfa0; border-left-color: #ef9f27;
    color: #854f0b;
    box-shadow: 0 2px 10px -2px rgba(239,159,39,0.12);
}
.flash-message.flash-warning .flash-icon { background: #faeeda; color: #854f0b; }

.flash-icon {
    width: 22px; height: 22px; border-radius: 50%;
    background: #eaf3de;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0; color: #3b6d11;
}
.flash-text { flex: 1; }
.flash-close {
    background: none; border: none; font-size: 16px;
    color: #9ba5ba; cursor: pointer; line-height: 1;
    padding: 0; transition: color 0.12s;
}
.flash-close:hover { color: #1a2540; }

/* ════════════════════════════════════════
   UTILITIES
════════════════════════════════════════ */
.resp-container { position: relative; overflow: hidden; padding-top: 56.25%; }
.resp-iframe    { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.file_container { display: flex; }
.blink          { animation: blinker 1s linear infinite; }
@keyframes blinker { 90% { opacity: 0; } }
#panel_button   { margin: 20px; max-width: 90%; }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 860px) {
    .nav-links, .nav-divider, .nav-logo-text, .nav-right { display: none; }
    .nav-mobile-btn { display: flex; align-items: center; }
}
@media (max-width: 600px) {
    .flash-message { margin: 8px 12px; }
}
@media (max-width: 400px) {
    .nav-logo img { width: 26px; }
}