:root {
    --inter: "Inter", sans-serif;
    --outfit: "Outfit", sans-serif;

    --primary: #0F1A1E;
    --secondary: #1F363C;
    --light: #878F57;
    --textwhite: #F6F8EB;

    --page-bg: #071419;
    --page-bg-soft: #0A1B20;
    --border: rgba(168, 189, 192, 0.16);
    --border-strong: rgba(168, 189, 192, 0.24);
    --muted: #A6B0AE;
    --reserved: #F0B72C;
    --shadow: 0 22px 55px rgba(0, 0, 0, 0.2);
    --sidebar-width: 248px;
}


/* =========================================================
   GLOBALNI STILOVI I GLAVNI LAYOUT
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--textwhite);
    background:
        radial-gradient(circle at 75% 0%, rgba(31, 70, 79, 0.22), transparent 36%),
        linear-gradient(135deg, var(--page-bg) 0%, var(--page-bg-soft) 46%, #08161A 100%);
    font-family: var(--inter);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button,
a,
select {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    color: inherit;
}

svg {
    width: 1.2rem;
    height: 1.2rem;
    stroke-width: 1.85;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.main-content {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 36px 28px 40px;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding: 28px 12px 22px;
    border-right: 1px solid var(--border-strong);
    background:
        linear-gradient(180deg, rgba(6, 24, 29, 0.98), rgba(7, 22, 27, 0.99)),
        var(--primary);
}

.sidebar__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px 42px;
}

.brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 39px;
    padding: 0 10px;
    border: 3px solid #8D9F3F;
    border-radius: 8px 8px 8px 4px;
    font-family: var(--outfit);
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0.2px;
}

.brand::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 105px;
    width: 27px;
    height: 7px;
    border-left: 3px solid #8D9F3F;
    border-bottom: 3px solid #8D9F3F;
    transform: skewX(-38deg);
    background: #07181D;
}

.brand__garden {
    color: #9EAE52;
    font-weight: 500;
}

.brand__sun {
    color: var(--textwhite);
    font-weight: 700;
}

.icon-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.06);
}

.sidebar__close,
.mobile-menu {
    display: none;
}

.sidebar__nav {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 54px;
    padding: 0 18px;
    border-radius: 12px;
    color: #EEF1E9;
    transition: 180ms ease;
}

.nav-link svg {
    width: 25px;
    height: 25px;
}

.nav-link:hover {
    color: #FFFFFF;
    background: rgba(135, 143, 87, 0.12);
}

.nav-link.is-active {
    color: #FFFFFF;
    background:
        linear-gradient(
            90deg,
            rgba(135, 143, 87, 0.28),
            rgba(135, 143, 87, 0.18)
        );
    box-shadow: inset 0 0 0 1px rgba(160, 171, 96, 0.05);
}

.nav-link.is-active svg {
    color: #B1C05C;
}


/* Dekorativna arhitektonska slika / ilustracija u sidebaru */

.sidebar__architecture {
    position: absolute;
    inset: auto 0 0;
    height: 320px;
    opacity: 0.15;
    pointer-events: none;
}

.sidebar__architecture img {
    width: 15vw;
}


/* Rezervna CSS ilustracija ako se ne koristi slika */

.architecture-building {
    position: absolute;
    bottom: 22px;
    border: 1px solid #AAB5A1;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0 16px,
            rgba(170, 181, 161, 0.55) 17px 18px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0 18px,
            rgba(170, 181, 161, 0.48) 19px 20px
        );
    clip-path: polygon(18% 8%, 100% 0, 100% 100%, 0 100%, 0 24%);
}

.architecture-building--back {
    right: 16px;
    width: 110px;
    height: 230px;
}

.architecture-building--front {
    left: 22px;
    width: 125px;
    height: 170px;
    clip-path: polygon(0 30%, 65% 0, 100% 8%, 100% 100%, 0 100%);
}

.architecture-tree {
    position: absolute;
    bottom: 17px;
    left: 12px;
    width: 2px;
    height: 64px;
    background: #AAB5A1;
}

.architecture-tree::before,
.architecture-tree::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 50px;
    height: 34px;
    border: 1px solid #AAB5A1;
    border-radius: 50%;
    transform: translateX(-50%);
}

.architecture-tree::before {
    top: -24px;
}

.architecture-tree::after {
    top: -5px;
    width: 38px;
    height: 26px;
}

.sidebar-overlay {
    display: none;
}


/* =========================================================
   HEADER / TOPBAR
   ========================================================= */

.topbar {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto;
    align-items: start;
    gap: 28px;
    margin-bottom: 26px;
}

.page-heading h1 {
    margin: 0;
    font-family: var(--outfit);
    font-size: clamp(34px, 3vw, 45px);
    line-height: 1;
    letter-spacing: -1.2px;
}

.page-heading p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 16px;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.global-search {
    display: flex;
    align-items: center;
    gap: 11px;
    width: min(290px, 28vw);
    height: 46px;
    padding: 0 15px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: rgba(11, 34, 40, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.global-search:focus-within {
    border-color: rgba(164, 176, 93, 0.55);
    box-shadow: 0 0 0 3px rgba(135, 143, 87, 0.1);
}

.global-search svg {
    flex: 0 0 auto;
    color: #E8EDE3;
}

.global-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--textwhite);
    background: transparent;
}

.global-search input::placeholder {
    color: #9BA4A2;
}

.notification-button {
    border-radius: 50%;
}

.notification-dot {
    position: absolute;
    top: 9px;
    right: 8px;
    width: 7px;
    height: 7px;
    border: 2px solid var(--page-bg-soft);
    border-radius: 50%;
    background: var(--reserved);
}


/* Profil korisnika */

.profile {
    position: relative;
}

.profile__trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.profile__avatar {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: var(--textwhite);
    background: linear-gradient(145deg, #9BA64F, #737D3D);
    box-shadow: 0 8px 24px rgba(135, 143, 87, 0.16);
    font-weight: 600;
}

.profile__text {
    display: grid;
    gap: 2px;
    min-width: 104px;
    text-align: left;
}

.profile__text strong {
    font-size: 15px;
}

.profile__text small {
    color: var(--muted);
    font-size: 13px;
}

.profile__trigger > svg {
    width: 17px;
    height: 17px;
    color: #DCE0D8;
}

.profile-menu {
    position: absolute;
    z-index: 100;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    padding: 8px;
    border: 1px solid var(--border-strong);
    border-radius: 13px;
    background: #10292F;
    box-shadow: var(--shadow);
}

.profile-menu a,
.profile-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 11px;
    border: 0;
    border-radius: 8px;
    color: var(--textwhite);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.profile-menu a:hover,
.profile-menu button:hover {
    background: rgba(255, 255, 255, 0.06);
}


/* =========================================================
   RESPONSIVE — HEADER I SIDEBAR
   ========================================================= */

@media (max-width: 1270px) {
    .main-content {
        padding-inline: 22px;
    }
}

@media (max-width: 1050px) {
    :root {
        --sidebar-width: 220px;
    }

    .topbar {
        grid-template-columns: 1fr;
    }

    .topbar__actions {
        justify-content: space-between;
    }

    .global-search {
        width: min(420px, 48vw);
    }
}

@media (max-width: 820px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        transform: translateX(-102%);
        transition: transform 220ms ease;
        box-shadow: 22px 0 60px rgba(0, 0, 0, 0.4);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar__close,
    .mobile-menu {
        display: inline-grid;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: block;
        border: 0;
        background: rgba(0, 0, 0, 0.55);
        opacity: 0;
        visibility: hidden;
        transition: 180ms ease;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .main-content {
        padding: 22px 16px 30px;
    }

    .topbar {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        margin-bottom: 22px;
    }

    .mobile-menu {
        align-self: start;
        margin-top: 2px;
        border: 1px solid var(--border);
        background: rgba(14, 38, 45, 0.75);
    }

    .page-heading h1 {
        font-size: 34px;
    }

    .topbar__actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .global-search {
        flex: 1;
        width: auto;
    }

    .profile__text,
    .profile__trigger > svg {
        display: none;
    }

    .sidebar__architecture img {
        width: 93vw;
    }
}

@media (max-width: 560px) {
    .page-heading p {
        font-size: 14px;
    }

    .topbar__actions {
        gap: 8px;
    }

    .notification-button {
        display: none;
    }

    .profile__avatar {
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
