/**
 * Scandinavian minimal overrides for SMP (Bootstrap 5).
 */

:root {
    /* Legacy-inspired palette (lighter mode) */
    --legacy-navy: #23255A;
    --legacy-orange: #FF9900;
    --legacy-blue: #6699CC;

    --scandi-bg: #f3f6fb;           /* light blue-grey */
    --scandi-card-bg: #fff;
    --scandi-border: #e9ecef;
    --scandi-text: #4b5563;         /* cooler grey */
    --scandi-side-width: 220px;
    --scandi-side-bg: #f7f9fd;
    --scandi-side-active: #e8eef9;
    --scandi-top-accent: #185FA5;
}

body.scandi-bg {
    background-color: var(--scandi-bg);
    color: var(--scandi-text);
    font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.scandi-login-card {
    max-width: 360px;
    width: 100%;
    background: var(--scandi-card-bg);
    border: 1px solid var(--scandi-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.login-banner {
    max-width: 360px;
    height: 100%;
    object-fit: cover;
    object-position: left center; /* keep building portion visible */
}

.login-layout {
    max-width: 760px;
    align-items: stretch !important; /* match logo height to card height on wide screens */
}

.login-logo,
.scandi-login-card {
    min-height: 260px;
}

.scandi-sidebar {
    min-width: var(--scandi-side-width);
    background: var(--scandi-side-bg);
    border-right: 1px solid var(--scandi-border);
}

.scandi-sidebar .fw-semibold {
    color: var(--legacy-navy);
}

.scandi-sidebar > .mb-3 > a.fw-semibold {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.scandi-sidebar > .mb-3 > a.fw-semibold::before {
    content: "";
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    background: url("../images/ex-logo.gif") center / contain no-repeat;
}

.scandi-side-nav .nav-link {
    color: var(--legacy-navy);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.scandi-side-nav .nav-link:hover {
    background: #eef2ff;
    color: var(--legacy-navy);
}

.scandi-side-nav .nav-link.active {
    font-weight: 600;
    color: var(--legacy-navy);
    background: var(--scandi-side-active);
    border-left: 3px solid #E65100;
}

.side-toggle {
    background: none;
    border: 0;
    text-align: left;
    width: 100%;
}

.side-toggle:focus {
    outline: none;
    box-shadow: none;
}

.side-toggle-icon {
    font-size: 0.75rem;
}

.side-submenu {
    padding-left: 0.75rem;
}

.side-submenu-link {
    font-size: 0.875rem;
    padding-left: 1.25rem;
}

.scandi-card {
    background: var(--scandi-card-bg);
    border: 1px solid var(--scandi-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.btn-primary {
    background-color: var(--legacy-navy);
    border-color: var(--legacy-navy);
}

.btn-primary:hover {
    background-color: #2d2f6f; /* slightly lighter than deep navy */
    border-color: #2d2f6f;
}

/* Security / Sistem Sekuriti menu box */
.security-menu-box {
    background: #ffe0b3;
    border-radius: 6px;
    border: 1px solid #ffcc80;
    padding: 0;
    max-width: 360px;
}

.security-menu-header {
    background: var(--legacy-orange);
    color: #ffffff;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 6px 6px 0 0;
}

.security-menu-list {
    margin: 0;
    padding: 0.5rem 0.75rem 0.75rem;
}

.security-menu-link {
    display: block;
    padding: 0.25rem 0;
    color: var(--legacy-navy);
    text-decoration: none;
}

.security-menu-link::before {
    content: '▸';
    margin-right: 0.4rem;
    font-size: 0.75rem;
}

.security-menu-link:hover {
    text-decoration: underline;
}

/* Subtle legacy orange accents */
a:not(.btn) {
    color: var(--legacy-blue);
}
a:not(.btn):hover {
    color: #4b86c5;
}

/* Thin top accent (optional utility class) */
.scandi-top-accent {
    height: 4px;
    background: linear-gradient(90deg, #b42330 0%, #cf4b58 45%, #e58a93 100%);
}

.main-menu-header-divider {
    height: 1px;
    background: #e5e7eb;
}

.main-menu-header-row {
    min-height: 56px;
    align-items: stretch !important;
    flex-wrap: wrap;
    column-gap: 1rem;
    row-gap: 0.5rem;
    margin-top: -1.5rem;
    margin-left: -1.5rem;
    padding-left: 1.5rem;
    background: linear-gradient(90deg, #ffffff 0%, #f3f5f8 100%);
    box-shadow: inset 8px 0 12px -10px rgba(15, 23, 42, 0.22);
}

.main-menu-header-row > h1 {
    display: flex;
    align-items: center;
    flex: 1 1 420px;
    min-width: 260px;
    margin-right: auto;
}

.main-menu-title-icon {
    display: inline-flex;
    width: 1.7rem;
    margin-right: 0.7rem;
    color: #9f2f3e;
    font-size: 1.45rem;
    align-items: center;
    justify-content: center;
}

.main-menu-user-chip {
    background: #f3cfd4;
    border: 0;
    color: #5f1b24 !important;
    border-radius: 0 0 0 34px;
    padding: 0.45rem 1.5rem 0.45rem 1rem;
    margin-right: -1.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
    line-height: 1.35;
    flex: 0 1 auto;
    max-width: 100%;
    box-shadow: 0 4px 10px rgba(107, 31, 39, 0.12);
}

.main-menu-user-chip a {
    color: #5f1b24 !important;
    text-decoration: underline;
}

.main-menu-header-pills {
    margin-left: auto;
    display: flex;
    align-items: stretch;
    gap: 0;
    max-width: 100%;
}

.main-menu-carian-chip {
    background: #dce8f8;
    border: 0;
    color: #0f3f76 !important;
    border-radius: 0 0 0 28px;
    padding: 0.45rem 1.9rem 0.45rem 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    line-height: 1.35;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(33, 72, 120, 0.14);
    margin-right: -1.5rem;
    margin-top: 0;
    position: relative;
    z-index: 1;
}

.main-menu-carian-chip:hover {
    background: #cfe0f6;
    color: #0b335f !important;
}

.main-menu-carian-chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.main-menu-header-pills .main-menu-user-chip {
    position: relative;
    z-index: 2;
}

/* FreeDash-like menu styling (scoped to main_menu duplicate only) */
.freedash-sidebar {
    background: #ffffff;
    border-right-color: #e9edf4 !important;
    width: 270px;
    min-width: 270px;
    max-width: 270px;
    flex: 0 0 270px;
    min-height: 100%;
    height: auto;
    max-height: none;
    align-self: stretch;
    overflow-y: visible;
    overflow-x: hidden;
    box-shadow: 6px 0 16px rgba(15, 23, 42, 0.06);
    scrollbar-width: none;
    scrollbar-color: transparent transparent;
}

.freedash-sidebar::-webkit-scrollbar {
    width: 0;
}

.freedash-sidebar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.freedash-sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    border: 2px solid transparent;
}

.freedash-sidebar:hover {
    scrollbar-width: thin;
    scrollbar-color: #cfd7e6 #f7f9fd;
}

.freedash-sidebar:hover::-webkit-scrollbar {
    width: 8px;
}

.freedash-sidebar:hover::-webkit-scrollbar-track {
    background: #f7f9fd;
}

.freedash-sidebar:hover::-webkit-scrollbar-thumb {
    background: #cfd7e6;
    border: 2px solid #f7f9fd;
}

.freedash-sidebar:hover::-webkit-scrollbar-thumb:hover {
    background: #bcc7da;
}

.freedash-sidebar > .mb-3 > a.fw-semibold {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 2rem;
    font-weight: 700 !important;
    color: #111827 !important;
}

.freedash-sidebar > .mb-3 > a.fw-semibold::before {
    content: "";
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    background: url("../images/ex-logo.gif") center / contain no-repeat;
}

.freedash-sidebar > .mb-3 > .small.text-muted {
    font-size: 0.875rem;
}


.freedash-sidebar .freedash-side-nav {
    gap: 0.25rem;
}

.freedash-sidebar .freedash-top-divider {
    height: 1px;
    margin: 0.15rem 0.2rem 0.7rem;
    background: #e5e7eb;
}

.freedash-sidebar .freedash-side-section-label {
    margin: 0.8rem 0.2rem 0.45rem;
    padding: 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #111827;
}

.freedash-sidebar .freedash-side-nav .nav-link {
    color: #374151;
    border-radius: 12px;
    padding: 0.62rem 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.freedash-sidebar .freedash-side-nav .nav-link:hover {
    background: #f3f5fb;
    color: #111827;
}

.freedash-sidebar .freedash-side-nav .side-toggle {
    border: 0;
    background: transparent;
}

.freedash-sidebar .freedash-side-nav .side-toggle-icon {
    color: #9ca3af;
    font-size: 0.8rem;
}

.freedash-sidebar .freedash-side-nav .side-submenu {
    margin: 0.2rem 0 0.35rem;
    padding: 0.2rem 0 0.2rem 0;
    border-left: 0;
}

.freedash-sidebar .freedash-side-nav .side-submenu-link {
    font-size: 0.92rem;
    color: #4b5563;
    border-radius: 10px;
    padding: 0.62rem 0.85rem;
}

.freedash-sidebar .freedash-side-nav .side-submenu-link.active {
    color: #0f172a;
    background: #dbe6ff;
    border-left: 0;
    font-weight: 700;
    border-radius: 0 22px 22px 0;
    margin-left: -1rem;
    padding-left: 1.7rem;
}

.freedash-sidebar .freedash-side-nav > .nav-link.active,
.freedash-sidebar .freedash-side-nav > .side-toggle.active {
    color: #ffffff !important;
    background: linear-gradient(90deg, #5663ff 0%, #6e7aff 100%) !important;
    box-shadow: 0 8px 18px rgba(86, 99, 255, 0.24);
    border-left: 0;
    border-radius: 0 22px 22px 0;
    margin-left: -1rem;
    padding-left: 1.7rem;
}

.freedash-sidebar .freedash-side-nav > .side-toggle.active .side-toggle-icon {
    color: #ffffff;
}

.freedash-sidebar .freedash-nav-icon {
    display: inline-flex;
    width: 1.35rem;
    margin-right: 0.5rem;
    color: #6b7280;
    align-items: center;
    justify-content: center;
    font-size: 1.08rem;
}

.freedash-sidebar .freedash-side-nav > .nav-link.active .freedash-nav-icon,
.freedash-sidebar .freedash-side-nav > .side-toggle.active .freedash-nav-icon {
    color: #ffffff;
}

/* Global rollout for default side_menu.php usage */
.scandi-sidebar:not(.freedash-sidebar) {
    background: #ffffff;
    border-right-color: #e9edf4 !important;
    min-width: 270px;
    min-height: 100vh;
    box-shadow: 6px 0 16px rgba(15, 23, 42, 0.06);
}

.scandi-sidebar:not(.freedash-sidebar) > .mb-3 > a.fw-semibold {
    font-size: 1.8rem;
    font-weight: 700 !important;
    color: #111827 !important;
}

.scandi-sidebar:not(.freedash-sidebar) > .mb-3 > a.fw-semibold::before {
    display: none;
}

.scandi-sidebar:not(.freedash-sidebar) .scandi-side-nav .nav-link {
    color: #374151;
    border-radius: 12px;
    padding: 0.62rem 0.85rem;
    font-weight: 500;
}

.scandi-sidebar:not(.freedash-sidebar) .scandi-side-nav .nav-link:hover {
    background: #f3f5fb;
    color: #111827;
}

.scandi-sidebar:not(.freedash-sidebar) .scandi-side-nav .side-submenu {
    margin: 0.2rem 0 0.35rem;
    padding: 0.2rem 0 0.2rem 0;
    border-left: 0;
}

.scandi-sidebar:not(.freedash-sidebar) .scandi-side-nav .side-submenu-link {
    font-size: 0.92rem;
    color: #4b5563;
    border-radius: 10px;
    padding: 0.62rem 0.85rem;
}

.scandi-sidebar:not(.freedash-sidebar) .scandi-side-nav .side-submenu-link.active {
    color: #0f172a;
    background: #dbe6ff;
    font-weight: 700;
    border-radius: 0 22px 22px 0;
    margin-left: -1rem;
    padding-left: 1.7rem;
}

.scandi-sidebar:not(.freedash-sidebar) .scandi-side-nav > .nav-link.active,
.scandi-sidebar:not(.freedash-sidebar) .scandi-side-nav > .side-toggle.active {
    color: #ffffff !important;
    background: linear-gradient(90deg, #5663ff 0%, #6e7aff 100%) !important;
    box-shadow: 0 8px 18px rgba(86, 99, 255, 0.24);
    border-left: 0;
    border-radius: 0 22px 22px 0;
    margin-left: -1rem;
    padding-left: 1.7rem;
}
