/* HST portal — visual alignment with www.hst.hr (Nunito, blues, teal accent) */
:root,
[data-bs-theme='light'] {
    --hst-topbar-height: 72px;
    --hst-dark: #002266;
    --hst-nav: #27408b;
    --hst-accent: #27408b;
    --hst-accent-hover: #132144;
    --hst-teal: #00e49a;
    --hst-main-bg: #eef0f5;
    --hst-text: #002266;
    --hst-text-muted: #777;
    --bs-primary: #27408b;
    --bs-primary-rgb: 39, 64, 139;
    --bs-link-color: #27408b;
    --bs-link-hover-color: #132144;
}

body.hst-app {
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--hst-main-bg) !important;
    margin: 0;
    min-height: 100vh;
    color: #333;
}

.hst-guest-topbar {
    height: var(--hst-topbar-height);
    background: #fff;
    border-bottom: 1px solid rgba(0, 34, 102, 0.1);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: 0 1px 0 rgba(0, 34, 102, 0.04);
}

/* Login page: HST brand only in header; partner logos sit below the card */
.hst-guest-topbar--login {
    justify-content: flex-start;
}
.hst-guest-topbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--hst-dark);
    font-size: 1rem;
    text-decoration: none;
}
.hst-brand-logo {
    max-height: 48px;
    width: auto;
    max-width: min(240px, 48vw);
    height: auto;
    object-fit: contain;
    display: block;
}
.hst-guest-topbar-end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.hst-guest-topbar .hst-topbar-partner-logos {
    margin-right: 0;
}

.hst-guest-topbar .hst-guest-login-btn {
    color: #fff !important;
    background-color: var(--hst-accent);
    border-color: var(--hst-accent);
    font-weight: 600;
    flex-shrink: 0;
}
.hst-guest-topbar .hst-guest-login-btn:hover {
    background-color: var(--hst-accent-hover);
    border-color: var(--hst-accent-hover);
    color: #fff !important;
}
.hst-guest-main {
    min-height: calc(100vh - var(--hst-topbar-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--hst-main-bg);
}

/* Public survey (guest link): fixed 40% viewport width; height grows with content */
.hst-guest-main--public-survey {
    justify-content: flex-start;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.hst-public-survey-stack {
    width: 40vw;
    max-width: calc(100% - 2rem);
    flex-shrink: 0;
    align-self: center;
}

.hst-public-survey-panel {
    width: 100%;
    height: auto;
    min-height: 0;
    box-sizing: border-box;
}

.hst-public-survey-form {
    width: 100%;
}

.hst-public-survey-stack .hst-public-survey-panel .card-body {
    height: auto;
}
.hst-login-page-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}
.hst-login-page-stack .hst-auth-card {
    width: 100%;
}
.hst-login-page-stack .hst-login-partner-logos {
    margin-top: 3.25rem;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.25rem 1.75rem;
}

/* Same visual size as header .hst-brand-logo (login + app topbar) */
.hst-partner-logo,
.hst-login-partner-logo {
    max-height: 48px;
    width: auto;
    max-width: min(240px, 48vw);
    height: auto;
    object-fit: contain;
    display: block;
}

.hst-topbar-partner-logos,
.hst-partner-footer-logos {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.hst-partner-footer {
    display: none;
}

.hst-partner-footer-logos {
    margin-right: 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.25rem;
}

.hst-guest-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--hst-topbar-height));
}

.hst-guest-page .hst-guest-main {
    flex: 1 1 auto;
    min-height: 0;
}

.hst-guest-page--login .hst-guest-main {
    flex: 0 1 auto;
    min-height: calc(100vh - var(--hst-topbar-height));
}

.hst-app-topbar .user-dropdown {
    flex-shrink: 0;
}
.hst-auth-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 0.25rem 1rem rgba(0, 34, 102, 0.1);
    max-width: 440px;
    width: 100%;
}

.hst-app-topbar {
    height: var(--hst-topbar-height);
    background: #fff;
    border-bottom: 1px solid rgba(0, 34, 102, 0.1);
    display: flex;
    align-items: center;
    padding: 0 1rem 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 0 rgba(0, 34, 102, 0.04);
}
.hst-app-topbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--hst-dark);
    font-size: 1rem;
    text-decoration: none;
}
.hst-app-topbar .sidebar-toggle {
    color: var(--hst-dark);
    border: none;
    background: transparent;
    padding: 0.5rem;
    margin-left: 0.5rem;
    border-radius: 6px;
    flex-shrink: 0;
}
.hst-app-topbar .sidebar-toggle:hover {
    background: rgba(0, 34, 102, 0.06);
    color: var(--hst-accent);
}
.hst-app-topbar .user-dropdown .user-trigger {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--hst-text);
    line-height: 1.3;
    font-size: 13px;
}
.hst-app-topbar .user-dropdown .user-trigger:hover {
    background: rgba(0, 34, 102, 0.06);
    color: var(--hst-dark);
}
.hst-app-topbar .dropdown-user-img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(39, 64, 139, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hst-accent);
    flex-shrink: 0;
}
.hst-app-topbar .user-text {
    line-height: 1.3;
    text-align: right;
}
.hst-app-topbar .user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--hst-dark);
}
.hst-app-topbar .user-email {
    font-size: 12px;
    color: var(--hst-text-muted);
}
.hst-app-topbar .dropdown-toggle::after {
    border-top-color: var(--hst-dark);
    opacity: 0.65;
}
.hst-app-topbar .dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 0.35rem 1.25rem rgba(0, 34, 102, 0.12);
}
.hst-app-topbar .dropdown-menu .dropdown-header {
    white-space: normal;
}
.hst-btn-logout {
    color: var(--hst-dark);
    background-color: #eef0f5;
    border: none;
    padding: 6px 1rem;
    border-radius: 20px;
    width: fit-content;
    max-width: calc(100% - 1.5rem);
    text-align: center;
    display: block;
    margin: 10px auto 5px;
    font-size: 13px;
    text-decoration: none;
}
.hst-btn-logout:hover {
    background-color: #e0e2e8;
    color: var(--hst-dark);
}

.hst-app-wrapper {
    display: flex;
    min-height: calc(100vh - var(--hst-topbar-height));
}
.hst-app-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--hst-nav);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    transition: transform 0.2s ease;
}
.hst-app-sidebar .sidebar-nav {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.hst-sidebar-user {
    padding: 0.85rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.hst-sidebar-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    line-height: 1.3;
}

.hst-sidebar-user-email {
    font-size: 0.75rem;
    color: #fff;
    line-height: 1.35;
    word-break: break-word;
    margin-top: 0.2rem;
}

.hst-sidebar-nav-footer {
    margin-top: auto;
    padding-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hst-nav-link-logout:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.hst-nav-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.hst-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.hst-nav-link.active {
    background: rgba(39, 64, 139, 0.35);
    color: #fff;
    border-left-color: var(--hst-teal);
    font-weight: 500;
}
.hst-nav-link i:first-child {
    width: 22px;
    margin-right: 0.5rem;
    text-align: center;
}
.hst-nav-link .bi-chevron-down {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s;
}
.hst-nav-link[aria-expanded='true'] .bi-chevron-down {
    transform: rotate(180deg);
}
.hst-moduli-title {
    padding: 0.75rem 1rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
}
.hst-sub-nav {
    list-style: none;
    padding: 0 0 0 2rem;
    margin: 0;
}
.hst-sub-nav .hst-nav-link {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
}
.hst-sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.hst-app-main {
    flex: 1;
    background: var(--hst-main-bg);
    padding: 1.5rem 2rem;
    overflow-y: auto;
    min-width: 0;
}
.hst-app-main .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hst-text);
    margin-bottom: 1.5rem;
}
.hst-app-main .section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--hst-text-muted);
    margin-bottom: 0.75rem;
}
.hst-app-main .card {
    border: none;
    border-radius: 10px;
}
.hst-app-main .hst-dashboard-section.card {
    background: #fff;
    border: 1px solid rgba(0, 34, 102, 0.1);
    border-radius: 12px;
    overflow: hidden;
}
.hst-app-main .hst-dashboard-section.card .card-header {
    border-radius: 12px 12px 0 0;
}
/* Gumbi širine teksta (ne rastežu se na cijeli red u flex-column / karticama) */
.hst-app-main .btn,
.hst-guest-main .btn,
.hst-guest-topbar .btn {
    width: max-content;
    max-width: 100%;
}

.hst-app-main .btn-primary {
    background-color: var(--hst-accent);
    border-color: var(--hst-accent);
}
.hst-app-main .btn-primary:hover {
    background-color: var(--hst-accent-hover);
    border-color: var(--hst-accent-hover);
}
.hst-app-main .btn-primary:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(0, 228, 154, 0.35);
}
.hst-app-main .btn-outline-primary {
    color: var(--hst-accent);
    border-color: var(--hst-accent);
}
.hst-app-main .btn-outline-primary:hover {
    background-color: var(--hst-accent);
    border-color: var(--hst-accent);
    color: #fff;
}
.hst-app-main a:not(.btn):not(.hst-nav-link):not(.dropdown-item):not(.page-link) {
    color: var(--hst-accent);
}
.hst-app-main .pagination .page-item.active .page-link {
    background-color: var(--hst-accent);
    border-color: var(--hst-accent);
    color: #fff;
}
.hst-app-main .pagination .page-link {
    color: var(--hst-accent);
}

@media (max-width: 767.98px) {
    .hst-app-sidebar {
        position: fixed;
        left: 0;
        top: var(--hst-topbar-height);
        bottom: 0;
        z-index: 1040;
        transform: translateX(-100%);
        box-shadow: 0 0 1rem rgba(0, 0, 0, 0.2);
    }
    .hst-app-sidebar.hst-sidebar-open {
        transform: translateX(0);
    }
    .hst-app-main {
        padding: 1rem;
    }

    .hst-guest-main--public-survey {
        padding-left: 10px;
        padding-right: 10px;
    }

    .hst-public-survey-stack {
        width: 100%;
        max-width: none;
    }

    .hst-partner-logos--topbar {
        display: none !important;
    }

    .hst-partner-footer {
        display: block;
        flex-shrink: 0;
        padding: 1.25rem 10px 1.5rem;
        background: var(--hst-main-bg);
        border-top: 1px solid rgba(0, 34, 102, 0.1);
    }

    .hst-partner-footer .hst-partner-logo {
        max-height: 40px;
        max-width: min(200px, 42vw);
    }

    .hst-guest-topbar-end {
        display: none;
    }
}

.hst-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1025;
}
.hst-sidebar-backdrop.show {
    display: block;
}

.hst-auth-card .btn-primary {
    background-color: var(--hst-accent);
    border-color: var(--hst-accent);
}
.hst-auth-card .btn-primary:hover {
    background-color: var(--hst-accent-hover);
    border-color: var(--hst-accent-hover);
}

.hst-guest-main a { color: var(--hst-accent); }
.hst-guest-main a:hover { color: var(--hst-accent-hover); }
.hst-app-main > h1.h3, .hst-app-main > h1.h4, .hst-app-main h1.h3:first-child { font-size: 1.5rem; font-weight: 700; color: var(--hst-text); margin-bottom: 1.25rem; }

/* DataTables + Buttons (Bootstrap 5 theme) */
.hst-app-main div.dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.hst-app-main div.dt-buttons .btn {
    margin: 0;
}
.hst-app-main table.dataTable thead th {
    border-bottom: 2px solid rgba(0, 34, 102, 0.12);
}
.hst-app-main .dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.35rem 0.65rem;
}
.hst-app-main .dataTables_wrapper .dataTables_length select {
    border-radius: 6px;
    padding: 0.25rem 1.75rem 0.25rem 0.5rem;
}
