:root {
    color-scheme: light;
    font-family: Montserrat, "Segoe UI", sans-serif;
    background: #f4f1ea;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: #f4f1ea;
    color: #1d2e28;
}

h1:focus { outline: none; }

.app-input .mud-input-filled { background-color: #f3f4f6; }
.app-input .mud-input-filled:hover { background-color: #eceff3; }
.app-input .mud-input-filled.mud-input-focused { background-color: #eef1f5; }

.app-header {
    border-bottom: 1px solid rgba(255, 255, 255, .16);
    background-color: #133e85 !important;
}

.menu-toggle { margin-right: .2rem !important; }

.app-wordmark {
    display: flex;
    align-items: center;
    font-weight: 750;
    letter-spacing: -.02em;
}

.app-user-name { margin-right: .5rem; opacity: .9; }
.app-main-content {
    min-height: calc(100vh - 40px);
    background: #f4f1ea;
}

.app-footer {
    height: 30px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: left;
    padding: 0 1rem;
    color: #61656b;
    background: #d7d9db;
    font-size: .70rem;
    font-weight: 500;
    letter-spacing: .01em;
    text-align: left;
}

.home-page { padding-top: 50px; padding-bottom: 5rem; }

.home-hero {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(2rem, 6vw, 5rem);
}

.home-logo {
    display: block;
    flex: 0 0 auto;
    max-width: 100%;
    height: auto;
}

.home-copy {
    width: min(100%, 42rem);
    display: grid;
    gap: 1rem;
}

.home-info-block {
    padding: clamp(1.1rem, 2.5vw, 1.6rem);
    border: 1px solid #dde4e0;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, .92) !important;
    box-shadow: 0 14px 38px rgba(24, 54, 43, .07) !important;
}

.home-welcome-block { border-left: 4px solid #133e85; }

.app-user-link {
    max-width: min(24vw, 18rem);
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.app-user-fullname {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-drawer .mud-drawer-content {
    display: flex;
    flex-direction: column;
    background: #fbfaf7;
}

.drawer-logo {
    display: block;
    width: 72px;
    height: 72px;
    margin: 1rem auto .65rem;
    object-fit: fill;
}

.app-nav-menu { padding: .9rem .7rem !important; }

.app-nav-menu .mud-nav-link {
    min-height: 3rem;
    margin-bottom: .3rem;
    border-radius: 10px;
}

.app-nav-menu .mud-nav-link.active {
    color: #315c49;
    background: #e5eee9;
    font-weight: 700;
}

.drawer-footer {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: auto;
    padding: 1rem 1.25rem 1.4rem;
    color: #7b8581;
    font-size: .76rem;
    line-height: 1.45;
}

.construction-page {
    min-height: calc(100vh - var(--mud-appbar-height) - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.construction-card {
    position: relative;
    width: min(100%, 46rem);
    overflow: hidden;
    padding: clamp(2rem, 6vw, 4.25rem);
    border: 1px solid rgba(19, 62, 133, .16);
    border-radius: 26px !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(238, 243, 250, .96)) !important;
    box-shadow: 0 24px 70px rgba(19, 62, 133, .14) !important;
}

.construction-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.construction-icon-ring {
    width: 6rem;
    height: 6rem;
    display: grid;
    place-items: center;
    margin-bottom: 1.4rem;
    border: 1px solid rgba(19, 62, 133, .16);
    border-radius: 50%;
    color: #133e85;
    background: #fff;
    box-shadow: 0 14px 34px rgba(19, 62, 133, .16);
}

.construction-icon-ring .mud-icon-root { font-size: 3.15rem; }

.construction-title {
    margin-top: 1rem !important;
    color: #17365f;
    font-weight: 750 !important;
}

.construction-message {
    max-width: 35rem;
    margin-top: .8rem !important;
    color: #586979;
    line-height: 1.75 !important;
}

.construction-status {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-top: 1.6rem;
    padding: .65rem 1rem;
    border-radius: 999px;
    color: #7d541f;
    background: #fff1dd;
    font-size: .8rem;
    font-weight: 700;
}

.construction-status .mud-icon-root { font-size: 1.1rem; }

.construction-decoration {
    position: absolute;
    border-radius: 50%;
    background: rgba(19, 62, 133, .055);
}

.construction-decoration-one { width: 15rem; height: 15rem; top: -8rem; right: -5rem; }
.construction-decoration-two { width: 10rem; height: 10rem; bottom: -5rem; left: -3rem; }

.drawer-footer .mud-icon-root { color: #315c49; font-size: 1.1rem; }

.content-page {
    padding-top: 2rem;
    padding-bottom: 3.5rem;
}

.page-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.page-heading-row h1,
.profile-page h1 {
    color: #17372c;
    font-family: Montserrat, "Segoe UI", sans-serif;
    font-weight: 700;
    letter-spacing: -.025em;
}

.page-title { font-family: Montserrat, "Segoe UI", sans-serif !important; font-weight: 700 !important; }

.page-subtitle { margin-top: .55rem !important; color: #707c77; }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 15rem));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .8rem 1rem;
    border: 1px solid #e3e6e1;
    border-radius: 15px !important;
    background: rgba(255, 255, 255, .82) !important;
}

.summary-card > .mud-icon-root {
    padding: .65rem;
    box-sizing: content-box;
    border-radius: 11px;
    color: #315c49;
    background: #e6eee9;
}

.summary-card .mud-typography-h5 { color: #17372c; font-weight: 780; }
.summary-card .mud-typography-caption { color: #7a8580; }

.data-panel {
    overflow: hidden;
    border: 1px solid #e1e4df;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, .9) !important;
    box-shadow: 0 18px 50px rgba(29, 52, 44, .07) !important;
}

.data-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem 1rem;
    border-bottom: 1px solid #e9ebe7;
}

.user-search { width: min(100%, 23rem); }
.app-data-grid { overflow-x: auto; }

/* Jedinstvena boja zaglavlja za sve MudDataGrid komponente u aplikaciji. */
.mud-data-grid .mud-table-head .mud-table-cell {
    background-color: #cccbca !important;
}

.empty-state {
    min-height: 12rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    color: #85908b;
}

.empty-state .mud-icon-root { font-size: 2.5rem; color: #9daba5; }

.profile-page { padding-top: 2.5rem; }

.profile-card {
    margin-top: 2rem;
    padding: clamp(1.25rem, 3vw, 1.8rem);
    border: 1px solid #e0e4df;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, .92) !important;
    box-shadow: 0 22px 65px rgba(29, 52, 44, .09) !important;
}

.profile-identity { display: flex; align-items: center; gap: 1.2rem; }

.profile-avatar {
    width: 4.8rem;
    height: 4.8rem;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(145deg, #315c49, #17372c);
    box-shadow: 0 12px 28px rgba(49, 92, 73, .22);
    font-family: Montserrat, "Segoe UI", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-note { margin-top: 1.25rem !important; }

.profile-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1.5rem;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(390px, 46%) 1fr;
    background: #f4f1ea;
}

.login-story {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: clamp(2rem, 4vw, 4.5rem);
    color: #f9f5ec;
    background:
        radial-gradient(circle at 12% 5%, rgba(224, 169, 105, .3), transparent 28%),
        linear-gradient(145deg, #214c3c 0%, #15392f 54%, #0f2d26 100%);
}

.login-story::before,
.login-story::after {
    content: "";
    position: absolute;
    z-index: -1;
    border: 1px solid rgba(236, 210, 173, .12);
    border-radius: 50%;
}

.login-story::before { width: 36rem; height: 36rem; right: -22rem; top: 9%; }
.login-story::after { width: 24rem; height: 24rem; left: -15rem; bottom: -8rem; }

.story-topline,
.mobile-wordmark {
    display: flex;
    align-items: center;
    gap: .85rem;
    font-size: 1.12rem;
    font-weight: 760;
    letter-spacing: -.02em;
}

.brand-logo-frame {
    width: 5rem;
    height: 3.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: .22rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 12px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .16);
}

.brand-logo-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-logo-frame.small { width: 4rem; height: 2.55rem; }

.story-copy {
    margin: auto 0;
    max-width: 34rem;
    padding: 4rem 0;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 1.25rem;
    color: #e7bb80;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.story-copy h1 {
    margin: 0;
    font-family: Montserrat, "Segoe UI", sans-serif;
    font-size: clamp(3.15rem, 5.6vw, 5.5rem);
    line-height: .99;
    letter-spacing: -.055em;
    font-weight: 700;
}

.story-copy p {
    max-width: 29rem;
    margin: 1.8rem 0 0;
    color: rgba(249, 245, 236, .72);
    font-size: clamp(1rem, 1.4vw, 1.17rem);
    line-height: 1.7;
}

.archive-motif {
    position: absolute;
    right: 6%;
    bottom: 12%;
    display: flex;
    align-items: end;
    gap: 7px;
    opacity: .46;
}

.archive-motif span { display: block; width: 8px; border-radius: 8px; background: #e7bb80; }
.archive-motif span:nth-child(1) { height: 40px; opacity: .42; }
.archive-motif span:nth-child(2) { height: 68px; opacity: .58; }
.archive-motif span:nth-child(3) { height: 92px; opacity: .78; }
.archive-motif span:nth-child(4) { height: 122px; }

.story-footnote {
    display: flex;
    align-items: center;
    gap: .6rem;
    max-width: 30rem;
    color: rgba(249, 245, 236, .62);
    font-size: .78rem;
}

.story-footnote .mud-icon-root { color: #e7bb80; font-size: 1rem; }

.login-form-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 3rem clamp(1.5rem, 7vw, 8rem);
    background: radial-gradient(circle at 88% 12%, rgba(215, 155, 91, .17), transparent 28%), #f4f1ea;
}

.mobile-wordmark { display: none; align-self: flex-start; color: #214c3c; }

.login-card {
    width: min(100%, 31rem);
    padding: clamp(2rem, 4vw, 3.2rem);
    border: 1px solid rgba(38, 73, 60, .09);
    border-radius: 26px !important;
    background: rgba(255, 255, 255, .86) !important;
    box-shadow: 0 24px 80px rgba(29, 52, 44, .10) !important;
    backdrop-filter: blur(16px);
}

.login-heading { margin-bottom: 2rem; }

.login-icon,
.success-icon {
    width: 3.45rem;
    height: 3.45rem;
    display: grid;
    place-items: center;
    margin-bottom: 1.4rem;
    border-radius: 16px;
    color: #315c49;
    background: #e6eee9;
}

.login-heading h2,
.login-success h3 {
    color: #17372c;
    font-family: Montserrat, "Segoe UI", sans-serif;
    font-weight: 700;
    letter-spacing: -.035em;
}

.login-subtitle { margin-top: .7rem !important; color: #6c7772; line-height: 1.65 !important; }
.login-email .mud-input-outlined-border { border-color: #ccd5d0 !important; }

.login-submit {
    min-height: 3.35rem;
    margin-top: 1.15rem !important;
    border-radius: 12px !important;
    font-weight: 720 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    box-shadow: 0 12px 26px rgba(49, 92, 73, .22) !important;
}

.login-submit .mud-button-label { gap: .65rem; }
.login-alert { margin: .75rem 0; border-radius: 12px !important; }

.login-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin-top: 1.7rem;
    color: #7a8580;
    font-size: .77rem;
}

.login-security-note .mud-icon-root { font-size: 1rem; color: #527161; }

.login-success {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .85rem;
}

.success-icon { color: #276148; background: #e0f0e7; }
.success-hint { color: #74807b; line-height: 1.6 !important; }

.development-link { width: 100%; margin: .5rem 0; border-radius: 12px !important; }

.development-link .mud-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-top: .3rem;
    font-weight: 700;
}

.login-help { margin: 1.5rem 0 0; color: #7a8580; font-size: .78rem; text-align: center; }

#blazor-error-ui {
    display: none;
    position: fixed;
    z-index: 1000;
    right: 1rem;
    bottom: 1rem;
    padding: 1rem 3rem 1rem 1rem;
    border-radius: 10px;
    color: #fff;
    background: #8d2e2e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

#blazor-error-ui .dismiss { position: absolute; right: .8rem; cursor: pointer; }
#blazor-error-ui .reload { margin-left: .8rem; color: #fff; font-weight: 700; }

@media (max-width: 900px) {
    .login-page { grid-template-columns: 1fr; }
    .login-story { display: none; }
    .login-form-side { justify-content: flex-start; padding-top: 2rem; }
    .mobile-wordmark { display: flex; width: min(100%, 31rem); margin: 0 auto 2rem; }
    .login-card { margin: auto 0; }
    .page-heading-row { align-items: flex-start; }
    .home-hero { flex-direction: column; text-align: center; }
    .home-logo { margin: 0 auto; }
}

@media (max-width: 520px) {
    .login-form-side { padding: 1.25rem; }
    .login-card { padding: 1.5rem; border-radius: 20px !important; }
    .app-user-name { display: none; }
    .app-wordmark { font-size: .78rem; }
    .app-user-fullname { display: none; }
    .app-user-link { min-width: 2.5rem !important; padding: .5rem !important; }
    .content-page { padding-top: 1.5rem; padding-bottom: 3rem; }
    .page-heading-row { flex-direction: column; }
    .page-heading-row .mud-button-root { width: 100%; }
    .summary-grid { grid-template-columns: 1fr; }
    .data-toolbar { align-items: stretch; }
    .user-search { width: 100%; }
    .profile-identity { align-items: flex-start; }
    .profile-avatar { width: 4rem; height: 4rem; border-radius: 16px; }
    .profile-actions { flex-direction: column-reverse; }
    .profile-actions .mud-button-root { width: 100%; }
}
