/* =====================================================================
   AreonD izgled: tamno zaglavlje sa modulima kao ikonicama (naziv u tooltip-u),
   meni modula sa grupama i pločicama u boji modula, početna strana.
   Ikonice: Lucide (ISC), wwwroot/images/lucide — boje se preko CSS maske.
   ===================================================================== */

:root {
    --nx-bg: #f4f6f9;
    --nx-header: #1f2530;
    --nx-header-text: #e8ebf0;
    --nx-header-muted: #9aa4b2;
    --nx-header-hover: rgba(255, 255, 255, .07);
    --nx-areon: #005baa; /* plava iz Areon logoa */
}

.nx-ico {
    display: inline-block;
    width: 24px;
    height: 24px;
    flex: none;
    background-color: currentColor;
    -webkit-mask: var(--ico) center / contain no-repeat;
    mask: var(--ico) center / contain no-repeat;
}
.nx-ico--sm { width: 18px; height: 18px; }
.nx-ico--xs { width: 16px; height: 16px; }
.nx-png { width: 26px; height: 26px; object-fit: contain; }
.nx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pozadina bez slike, logo u uglu (prigušen da ne odvlači pažnju od sadržaja) */
.app-background--nx { background: var(--nx-bg); }
.app-background--nx::after {
    content: "";
    position: absolute;
    right: 32px;
    bottom: 24px;
    width: 190px;
    height: 60px;
    background: url(../images/areon-new.png) right bottom / contain no-repeat;
    opacity: .55;
}

/* ---------- Zaglavlje ---------- */
.nx-header {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 65px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 14px 0 10px;
    z-index: 10;
    font-family: "Montserrat", sans-serif;
    background: var(--nx-header);
    color: var(--nx-header-text);
}

.nx-home {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}
/* Početna u boji Areon logoa */
.nx-home { transition: background .2s, box-shadow .2s; }
.nx-home:hover { background: color-mix(in srgb, var(--nx-areon) 55%, transparent); color: #fff; }
.nx-home.is-active { background: var(--nx-areon); color: #fff; box-shadow: 0 5px 15px color-mix(in srgb, var(--nx-areon) 60%, transparent); }

.nx-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 17px;
    white-space: nowrap;
}
.nx-title__module { color: var(--nx-header-muted); font-weight: 500; text-decoration: none; }
.nx-title__module:hover { color: inherit; text-decoration: none; }
.nx-title__module.is-current { color: inherit; font-weight: 700; }
.nx-title__sep { color: var(--nx-header-muted); opacity: .6; }
.nx-title__item { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.nx-refresh {
    display: inline-flex;
    padding: 6px;
    border-radius: 8px;
    color: var(--nx-header-muted);
}
.nx-refresh:hover { background: var(--nx-header-hover); color: inherit; }

.nx-nav {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}
/* Kvadrat koji klizi (kao MED .indicator); položaj i boju daje MainLayout (NavIndicatorCss) */
.nx-nav__ind {
    position: absolute;
    left: 0;
    top: 50%;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: transform .45s cubic-bezier(.4, 0, .2, 1), background .35s, box-shadow .35s, opacity .3s;
}
.nx-nav__item {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nx-header-muted);
    text-decoration: none;
    z-index: 1;
    transition: color .2s;
}
.nx-nav__item .nx-ico { transition: transform .3s; }
.nx-nav__item:hover, .nx-nav__item.is-active { color: #fff; }
.nx-nav__item:hover .nx-ico { transform: scale(1.08); }
.nx-nav__item.is-locked { opacity: .38; }

.nx-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 14px;
    margin-left: 6px;
    border-left: 1px solid rgba(154, 164, 178, .3);
}
.nx-user__text { display: flex; flex-direction: column; line-height: 1.2; max-width: 190px; }
.nx-user__text strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-user__text small { font-size: 11px; color: var(--nx-header-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-logout {
    display: inline-flex;
    padding: 8px;
    border-radius: 10px;
    color: var(--nx-header-muted);
}
.nx-logout:hover { background: var(--nx-header-hover); color: #ff6b6e; }

/* Tooltip ispod stavke zaglavlja */
.nx-header [data-tip] { position: relative; }
.nx-header [data-tip]::before {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, -4px);
    padding: 6px 10px;
    border-radius: 7px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease .15s, transform .12s ease .15s;
    z-index: 50;
}
.nx-header [data-tip]:hover::before { opacity: 1; transform: translate(-50%, 0); }
/* Uz levu i desnu ivicu tooltip se ne centrira, da ne izađe iz ekrana */
.nx-header .nx-home[data-tip]::before { left: 0; transform: translateY(-4px); }
.nx-header .nx-home[data-tip]:hover::before { transform: translateY(0); }
.nx-header .nx-logout[data-tip]::before { left: auto; right: 0; transform: translateY(-4px); }
.nx-header .nx-logout[data-tip]:hover::before { transform: translateY(0); }

/* ---------- Meni modula (pločice u boji modula) ---------- */
.nx-menu {
    height: calc(100vh - 75px);
    overflow-y: auto;
    padding: 18px 22px 40px;
    font-family: "Montserrat", sans-serif;
}
.nx-group { margin-bottom: 22px; }
.nx-group__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #6b7686;
}
.nx-group__title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #dfe3ea;
}
.nx-tiles { display: flex; flex-wrap: wrap; gap: 14px; }

/* Senka pločica: tamna ispod (odvaja od pozadine) + blaga u boji modula */
.nx-tile, .nx-module {
    --nx-tile-shadow: 0 6px 14px -4px rgba(15, 23, 42, .35), 0 2px 5px rgba(15, 23, 42, .12), 0 8px 20px -6px color-mix(in srgb, var(--m) 45%, transparent);
    --nx-tile-shadow-hover: 0 14px 26px -6px rgba(15, 23, 42, .4), 0 4px 8px rgba(15, 23, 42, .12), 0 14px 30px -8px color-mix(in srgb, var(--m) 55%, transparent);
}

.nx-tile {
    position: relative;
    width: 138px;
    height: 112px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px;
    text-decoration: none;
    background: linear-gradient(150deg, color-mix(in srgb, var(--m) 92%, #ffffff), color-mix(in srgb, var(--m) 82%, #000000));
    box-shadow: var(--nx-tile-shadow);
    color: #ffffff;
    transition: transform .15s ease, box-shadow .15s ease;
}
.nx-tile:hover {
    transform: translateY(-3px);
    text-decoration: none;
    color: #ffffff;
    box-shadow: var(--nx-tile-shadow-hover);
}
.nx-tile__icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .17);
    color: #ffffff;
}
.nx-tile__icon .nx-ico { width: 24px; height: 24px; }
.nx-tile__title {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}
.nx-tile__soon {
    position: absolute;
    top: -7px;
    right: 10px;
    font-style: normal;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 10px;
    background: #ffffff;
    color: color-mix(in srgb, var(--m) 85%, #000000);
    box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
}
.nx-tile.is-soon { opacity: .6; }

/* ---------- Početna (po uzoru na Sales Dashboard) ---------- */
.nx-home-page {
    height: calc(100vh - 75px);
    overflow-y: auto;
    padding: 20px 26px 40px;
    font-family: "Montserrat", sans-serif;
}
/* Watermark logo se na početnoj ne prikazuje, logo je već u traci dobrodošlice */
body:has(.nx-home-page) .app-background--nx::after { display: none; }
.nx-home-wrap { max-width: 1240px; margin: 0 auto; }

.nx-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 22px 28px;
    margin-bottom: 22px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--nx-areon) 0%, #3d86d6 100%);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--nx-areon) 28%, transparent);
}
.nx-welcome h1 { margin: 0; font-size: 24px; font-weight: 700; color: #fff; }
.nx-welcome p { margin: 6px 0 0; font-size: 13.5px; opacity: .92; }
.nx-welcome__badge {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}
.nx-welcome__badge img { height: 38px; width: auto; display: block; }

.nx-section-title {
    margin: 0 0 12px 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #475569;
}

.nx-modules { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 26px; }
.nx-module {
    position: relative;
    width: 192px;
    padding: 16px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    background: linear-gradient(150deg, color-mix(in srgb, var(--m) 92%, #ffffff), color-mix(in srgb, var(--m) 82%, #000000));
    box-shadow: var(--nx-tile-shadow);
    color: #ffffff;
    transition: transform .15s ease, box-shadow .15s ease;
}
.nx-module:hover {
    transform: translateY(-3px);
    color: #fff;
    text-decoration: none;
    box-shadow: var(--nx-tile-shadow-hover);
}
.nx-module__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .17);
}
.nx-module__icon .nx-ico { width: 22px; height: 22px; }
.nx-module__title { font-size: 14.5px; font-weight: 700; }
.nx-module__meta { font-size: 11.5px; opacity: .85; }
.nx-module.is-locked { opacity: .45; filter: grayscale(.5); }
.nx-module__lock { position: absolute; top: 14px; right: 14px; }

/* Brze veze: bele kartice sa trakom u boji modula (Sales QuickLink) */
.nx-quick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(max(260px, calc((100% - 28px) / 3)), 1fr));
    gap: 14px;
}
.nx-quick__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    border-left: 4px solid var(--m);
    background: #fff;
    color: #111827;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    transition: transform .15s, box-shadow .15s;
}
.nx-quick__item:hover {
    transform: translateY(-3px);
    color: #111827;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}
.nx-quick__icon {
    display: inline-flex;
    padding: 10px;
    border-radius: 10px;
    color: var(--m);
    background: color-mix(in srgb, var(--m) 12%, transparent);
}
.nx-quick__icon .nx-ico { width: 22px; height: 22px; }
.nx-quick__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-family: "Inter", sans-serif; }
.nx-quick__text strong { font-size: 14px; font-weight: 700; }
.nx-quick__text small { font-size: 12px; color: #6b7280; }

/* ---------- Prijava ---------- */
.nx-login {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    background:
        radial-gradient(900px 500px at 12% 10%, rgba(224, 58, 62, .22), transparent 60%),
        radial-gradient(800px 500px at 90% 90%, rgba(31, 111, 197, .25), transparent 60%),
        radial-gradient(700px 400px at 85% 8%, rgba(21, 153, 71, .16), transparent 60%),
        var(--nx-header);
    font-family: "Inter", "Montserrat", sans-serif;
}
.nx-login__card {
    width: 100%;
    max-width: 400px;
    margin: 0;
    padding: 30px 30px 22px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.nx-login__logo { height: 52px; width: auto; align-self: center; margin-bottom: 4px; }
.nx-login__title { margin: 0 0 4px; text-align: center; font-size: 19px; font-weight: 700; color: #1f2937; }
.nx-login__field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.nx-login__label { font-size: 12.5px; font-weight: 600; color: #475467; }
.nx-login__input {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #cfd6df;
    border-radius: 10px;
    background: #fff;
    color: #98a2b3;
    transition: border-color .15s, box-shadow .15s;
}
.nx-login__input:focus-within { border-color: #408DFB; box-shadow: 0 0 0 3px rgba(64, 141, 251, .15); color: #408DFB; }
.nx-login__input input,
.nx-login__input select {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 14.5px;
    color: #1f2937;
    padding: 0;
}
.nx-login__eye { display: inline-flex; color: #98a2b3; }
.nx-login__eye:hover { color: #1f2937; }
.nx-login__remember { margin: 2px 0 4px; font-size: 13px; }
.nx-login__error { margin: 0; padding: 8px 10px; border-radius: 8px; background: #fdecec; color: #b42318; font-size: 13px; }
.nx-login__foot { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 6px; color: #98a2b3; font-size: 12px; font-weight: 600; }
.nx-login__foot img { height: 26px; width: auto; opacity: .8; }
.nx-login .nx-save:disabled { opacity: .7; cursor: default; }
