/* ============================================================
   GLOBAL STYLING
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #eef3f9;
    color: #1f3347;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.global-header {
    background: #1e2b3c;
    color: #e6edf5;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}
.global-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    text-decoration: none;
    white-space: nowrap;
}
.global-header .brand .logo-icon { font-size: 1.4rem; }
.global-header .brand .brand-text { font-size: 0.85rem; letter-spacing: 0.3px; }
.global-header .brand .brand-text small { font-weight: 400; color: #7a9ab8; font-size: 0.7rem; }

.global-header .nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}
.global-header .nav-links a {
    color: #a0b9d0;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.global-header .nav-links a:hover { background: rgba(255, 255, 255, 0.08); color: white; }
.global-header .nav-links a.active { background: #345072; color: white; }
.global-header .nav-links a.home-link {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.global-header .hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
}

/* ===== MOBIL NAV-OVERLAY ===== */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
}
.mobile-nav-overlay.active { display: block; }
.mobile-nav-overlay .mobile-menu {
    background: #1e2b3c;
    padding: 20px;
    max-width: 300px;
    width: 80%;
    height: 100%;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
}
.mobile-nav-overlay .mobile-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #ccdcee;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mobile-nav-overlay .mobile-menu a:hover,
.mobile-nav-overlay .mobile-menu a.active { background: #345072; color: white; }
.mobile-nav-overlay .mobile-menu a .icon { font-size: 1.3rem; width: 32px; text-align: center; }
.mobile-nav-overlay .mobile-menu .close-btn {
    background: none;
    border: none;
    color: #a0b9d0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 16px;
    text-align: right;
    width: 100%;
}

/* ===== FOOTER ===== */
.global-footer {
    margin-top: auto;
    background: #1e2b3c;
    color: #7a9ab8;
    font-size: 0.75rem;
    padding: 14px 20px;
}
.global-footer .footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== RESPONSIV ===== */
@media (max-width: 767px) {
    .global-header { padding: 0 12px; height: 54px; }
    .global-header .nav-links { display: none; }
    .global-header .hamburger { display: block; }
    .global-header .brand .brand-text small { display: none; }
    .global-header .brand .brand-text { font-size: 0.8rem; }
    .mobile-nav-overlay { top: 54px; }
}
@media (min-width: 768px) {
    .global-header .hamburger { display: none !important; }
    .mobile-nav-overlay { display: none !important; }
}

/* ===== Felles komponenter ===== */
.app-container {
    max-width: 1400px;
    margin: 10px auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 30px -8px rgba(0, 20, 40, 0.25);
    min-height: 85vh;
    display: flex;
    overflow: hidden;
}
.side-panel {
    width: 280px;
    background: #1e2b3c;
    color: #e6edf5;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 85vh;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}
.side-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.side-panel .panel-header h2 {
    font-weight: 400;
    font-size: 1rem;
    text-transform: uppercase;
    color: #a0b9d0;
}
.side-panel .close-panel {
    display: none;
    background: none;
    border: none;
    color: #a0b9d0;
    font-size: 1.5rem;
    cursor: pointer;
}
.panel-menu {
    flex: 1;
    overflow-y: auto;
    list-style: none;
}
.panel-menu li {
    padding: 12px 14px;
    margin-bottom: 4px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #ccdcee;
    border-left: 3px solid transparent;
    word-break: break-word;
    user-select: none;
}
.panel-menu li:hover { background: #2d4056; color: white; }
.panel-menu li.active {
    background: #345072;
    color: white;
    border-left-color: #7ab8e0;
    font-weight: 500;
}
.panel-menu .empty-message {
    color: #6c85a0;
    font-style: italic;
    padding: 16px;
    text-align: center;
}
.main-area {
    flex: 1;
    padding: 16px 18px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.mobile-header {
    display: none;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9eef3;
    margin-bottom: 14px;
}
.mobile-header .menu-toggle {
    background: #1e2b3c;
    color: white;
    border: none;
    font-size: 1.5rem;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
}
.mobile-header .mobile-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0b1a2a;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mobile-header .mobile-badge {
    background: #4a6a8a;
    color: white;
    padding: 2px 12px;
    border-radius: 30px;
    font-size: 0.6rem;
    font-weight: 600;
}
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
.overlay.active { display: block; }

@media (min-width: 768px) {
    .app-container { min-height: 600px; }
    .side-panel { min-height: 600px; }
    .main-area { padding: 24px 30px; }
    .mobile-header { display: none !important; }
}
@media (max-width: 767px) {
    .app-container { border-radius: 0; margin: 0; flex-direction: column; }
    .mobile-header { display: flex; }
    .side-panel {
        position: fixed;
        top: 54px; left: 0; bottom: 0;
        width: 280px;
        max-width: 80vw;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
        z-index: 1000;
    }
    .side-panel.open { transform: translateX(0); }
    .side-panel .close-panel { display: block !important; }
    .main-area { padding: 12px 14px; min-height: 90vh; }
}