/* =========================================================
   BELATRIX MOBILE - OSNOVNI STIL
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    color: #102a4c;
    background: #ffffff;
}

.hidden {
    display: none !important;
}

svg {
    display: block;
}


/* =========================================================
   ZAGLAVLJE
   ========================================================= */

.site-header {
    height: 130px;
    background: #ffffff;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e9ef;
}

.header-content {
    width: 100%;
    margin: 0;
    padding: 0 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-logo {
    width: 205px;
    height: 108px;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 34px;
}

.header-slogan {
    padding-left: 24px;
    border-left: 4px solid #1688e8;
    line-height: 1.25;
}

.header-slogan-title {
    font-size: 20px;
    font-weight: 700;
    color: #102a4c;
}

.header-slogan-subtitle {
    margin-top: 5px;
    font-size: 18px;
    font-weight: 600;
    font-style: italic;
    color: #65758b;
}

.portal-user {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-left: 25px;
    border-left: 1px solid #e0e6ed;
}

.user-icon {
    width: 23px;
    height: 23px;
    color: #087ee0;
}

.user-icon svg,
.logout-button svg,
.portal-download-button svg,
.refresh-button svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.portal-user-name {
    font-size: 15px;
    font-weight: 500;
    color: #233f5f;
    white-space: nowrap;
}

.logout-button {
    height: 42px;
    margin-left: 8px;
    padding: 0 16px;
    border: 1px solid #c8d7e7;
    border-radius: 8px;
    background: #ffffff;
    color: #102a4c;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.logout-button svg {
    width: 20px;
    height: 20px;
}


/* =========================================================
   LOGIN - GLAVNI DEO
   ========================================================= */

.page-content {
    min-height: calc(100vh - 130px - 48px);
    background-image:
        linear-gradient(
            90deg,
            rgba(4, 36, 70, 0.30) 0%,
            rgba(4, 36, 70, 0.12) 42%,
            rgba(4, 36, 70, 0.02) 100%
        ),
        url("../images/login-background.png");

    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.login-section {
    width: 100%;
    max-width: 1380px;
    min-height: calc(100vh - 130px - 48px);
    margin: 0 auto;
    padding: 0 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 330px;
    padding: 24px 26px 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(220, 226, 234, 0.95);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(0, 25, 55, 0.18);
}

.login-header {
    text-align: center;
    margin-bottom: 18px;
}

.login-header h1 {
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    color: #102a4c;
}

.login-header p {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #65758b;
}


/* =========================================================
   LOGIN FORMA
   ========================================================= */

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #344b67;
}

.form-group input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 15px;
    color: #102a4c;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-group input:focus,
.portal-control:focus {
    border-color: #1788e8;
    box-shadow: 0 0 0 3px rgba(23, 136, 232, 0.14);
}

.form-message {
    min-height: 15px;
    margin: 1px 0 8px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    color: #b42318;
}


/* =========================================================
   OSNOVNO DUGME
   ========================================================= */

.primary-button {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #1688e8, #0875d1);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        filter 0.15s ease;
}

.primary-button:hover {
    filter: brightness(1.04);
    box-shadow: 0 8px 20px rgba(0, 104, 196, 0.22);
}

.primary-button:active {
    transform: translateY(1px);
}

.primary-button:focus-visible {
    outline: 3px solid rgba(23, 136, 232, 0.30);
    outline-offset: 3px;
}

.primary-button:disabled,
.refresh-button:disabled,
.logout-button:disabled {
    opacity: 0.65;
    cursor: default;
}


/* =========================================================
   PORTAL - ZAGLAVLJE
   ========================================================= */

body.portal-mode .site-header {
    height: 88px;
}

body.portal-mode .header-content {
    padding: 0 60px;
}

body.portal-mode .brand-logo {
    width: 118px;
    height: 76px;
}

body.portal-mode .header-slogan {
    padding-left: 18px;
    border-left-width: 3px;
}

body.portal-mode .header-slogan-title {
    font-size: 15px;
}

body.portal-mode .header-slogan-subtitle {
    margin-top: 3px;
    font-size: 13px;
}


/* =========================================================
   PORTAL
   ========================================================= */

.portal-page {
    min-height: calc(100vh - 88px - 48px);
    padding: 20px 60px 38px;
    background-image:
        linear-gradient(
            90deg,
            rgba(4, 39, 73, 0.26) 0%,
            rgba(26, 83, 128, 0.18) 48%,
            rgba(20, 65, 106, 0.12) 100%
        ),
        url("../images/login-background.png");

    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}

.portal-shell {
    width: 100%;
    margin: 0;
}

.portal-title {
    margin-bottom: 16px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 31, 62, 0.24);
}

.portal-title h1 {
    font-size: 31px;
    line-height: 1.15;
    color: #ffffff;
}

.portal-title p {
    margin-top: 5px;
    font-size: 15px;
    color: #ffffff;
}

.portal-grid {
    width: 950px;
    max-width: 100%;
    display: grid;
    grid-template-columns: 560px 380px;
    gap: 12px;
    align-items: start;
}

.portal-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(220, 229, 238, 0.95);
    border-radius: 9px;
    box-shadow: 0 7px 18px rgba(8, 45, 78, 0.10);
}

.download-card {
    padding: 12px 18px 12px;
}

.instructions-card {
    padding: 8px;
    background: rgba(255, 255, 255, 0.98);
}

.section-heading,
.receipts-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-heading h2,
.block-heading,
.instructions-card h2,
.receipts-heading h2 {
    font-size: 15px;
    color: #102a4c;
}

.section-heading h2,
.block-heading {
    display: flex;
    align-items: center;
    gap: 9px;
}

.section-icon {
    width: 24px;
    height: 24px;
    color: #087ee0;
    flex: 0 0 auto;
}

.section-icon svg,
.table-title-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.link-button {
    border: 0;
    background: transparent;
    color: #0875d1;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.field-caption {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #4f637a;
}

.portal-control {
    width: 100%;
    height: 38px;
    margin-top: 4px;
    padding: 0 11px;
    border: 1px solid #c9d6e4;
    border-radius: 6px;
    background: #ffffff;
    color: #102a4c;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.section-divider {
    height: 1px;
    margin: 9px 0;
    background: #dce5ee;
}

.block-heading {
    margin: 0 0 5px;
}

.date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
}

.date-grid label {
    display: block;
    font-size: 11px;
    color: #4f637a;
}

.date-control {
    position: relative;
}

.date-control .portal-control {
    padding-right: 38px;
}

.date-icon {
    position: absolute;
    right: 11px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: #60758d;
    pointer-events: none;
}

.date-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.date-picker-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.checkbox-row {
    min-height: 27px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #344b67;
    cursor: pointer;
}

.checkbox-row input {
    width: 16px;
    height: 16px;
    accent-color: #1688e8;
}

.info-mini {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #1688e8;
    border-radius: 50%;
    color: #1688e8;
    font-size: 10px;
    font-weight: 700;
}

.format-row {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.format-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #344b67;
    cursor: pointer;
}

.format-row input {
    width: 16px;
    height: 16px;
    accent-color: #1688e8;
}

.format-badge {
    min-width: 24px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
}

.format-badge.xlsx {
    background: #16894a;
    color: #ffffff;
}

.format-badge.xml,
.format-badge.json {
    background: transparent;
    color: #102a4c;
    font-size: 15px;
}

.portal-message {
    min-height: 14px;
    margin-top: 5px;
    font-size: 11px;
    color: #b42318;
}

.portal-download-button {
    height: 42px;
    margin-top: 2px;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.portal-download-button svg {
    width: 22px;
    height: 22px;
}

.instructions-inner {
    min-height: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    background: #eaf5ff;
}

.instructions-inner h2 {
    display: flex;
    align-items: center;
    gap: 9px;
}

.instruction-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #087ee0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

.instructions-card ol {
    margin: 9px 0 0 22px;
}

.instructions-card li {
    margin-bottom: 6px;
    padding-left: 2px;
    color: #264666;
    font-size: 13.5px;
    line-height: 1.35;
}

.instructions-card li:last-child {
    margin-bottom: 0;
}


/* =========================================================
   TABELA EVIDENTIRANIH RAČUNA
   ========================================================= */

.receipts-card {
    width: 950px;
    max-width: 100%;
    margin-top: 12px;
    padding: 12px 18px 13px;
}

.receipts-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-title-icon {
    width: 32px;
    height: 32px;
    color: #087ee0;
    flex: 0 0 auto;
}

.receipts-heading h2 {
    font-size: 19px;
}

.receipts-heading p {
    margin-top: 2px;
    color: #60758d;
    font-size: 12px;
}

.refresh-button {
    height: 36px;
    padding: 0 13px;
    border: 1px solid #c9d6e4;
    border-radius: 6px;
    background: #ffffff;
    color: #0875d1;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.refresh-button svg {
    width: 16px;
    height: 16px;
}

.table-message {
    min-height: 10px;
    margin-top: 3px;
    color: #b42318;
    font-size: 11px;
}

.receipts-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.receipts-filter label {
    font-size: 12px;
    font-weight: 600;
    color: #243f5c;
    white-space: nowrap;
}

.receipts-filter-select {
    width: 220px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #c9d6e4;
    border-radius: 5px;
    background: #ffffff;
    color: #243f5c;
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

.receipts-filter-select:focus {
    border-color: #1788e8;
    box-shadow: 0 0 0 2px rgba(23, 136, 232, 0.12);
}

.table-wrap {
    width: 100%;
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 3px;
    border: 1px solid #dfe7ef;
    border-radius: 6px;
}

.receipts-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #ffffff;
}

.receipts-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 10px;
    background: #eaf4fc;
    border-bottom: 1px solid #d8e2ec;
    border-right: 1px solid #d9d9d9;
    color: #243f5c;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.receipts-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e6edf4;
    border-right: 1px solid #d9d9d9;
    color: #243f5c;
    font-size: 12px;
    vertical-align: middle;
}

.receipts-table tbody tr:last-child td {
    border-bottom: 0;
}

.receipts-table th:last-child,
.receipts-table td:last-child {
    border-right: 0;
}

.receipts-table tbody tr:hover {
    background: #f8fbfe;
}

.col-worker { width: 23%; }
.col-pfr { width: 21%; }
.col-date { width: 15%; }
.col-amount { width: 11%; }

.col-note { width: 15%; }
.col-action { width: 15%; }

.receipts-table td.amount-cell {
    text-align: right !important;
}

.note-taxcore {
    color: #a86700;
    font-weight: 600;
}

.receipts-table td:last-child {
    text-align: center;
}

.show-receipt-button {
    width: auto;
    min-width: 106px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid #bfd8ed;
    border-radius: 5px;
    background: #edf7ff;
    color: #0875d1;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.show-receipt-button:hover {
    background: #e2f2ff;
}

.empty-table {
    padding: 22px !important;
    text-align: center;
    color: #75869a !important;
}

.record-count {
    margin-top: 8px;
    color: #536b84;
    font-size: 11px;
}



.checkbox-help-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-button {
    padding: 0;
    background: #ffffff;
    font-family: inherit;
    cursor: pointer;
}

.info-button:hover {
    background: #eaf5ff;
}

.help-modal-card {
    max-width: 520px;
}

.help-modal-text {
    color: #344b67;
    font-size: 14px;
    line-height: 1.55;
}

.help-modal-text p + p {
    margin-top: 14px;
}

.help-modal-card .modal-actions {
    margin-top: 22px;
}

.help-modal-card .modal-primary {
    min-width: 100px;
}

/* =========================================================
   MODAL - DODAVANJE FIRME
   ========================================================= */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(9, 31, 55, 0.48);
}

.modal-card {
    width: 100%;
    max-width: 480px;
    padding: 28px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 20px 55px rgba(0, 24, 52, 0.25);
}

.modal-card h2 {
    margin-bottom: 22px;
    font-size: 24px;
}

.modal-card label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #344b67;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.secondary-button,
.modal-primary {
    width: auto;
    min-width: 120px;
    height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.secondary-button {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #405873;
}

.modal-primary {
    border: 0;
    color: #ffffff;
}


/* =========================================================
   FOOTER - SAMO LOGIN STRANA
   ========================================================= */

.site-footer {
    min-height: 48px;
    background: #ffffff;
    display: flex;
    align-items: flex-start;
    border-top: 1px solid #e5e9ef;
}

.footer-content {
    width: 100%;
    margin: 0;
    padding: 2px 70px 4px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    font-size: 14px;
    color: #53657a;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.footer-brand strong {
    color: #102a4c;
}

.footer-services {
    display: flex;
    align-items: center;
}

.footer-services span {
    color: #315f93;
}

.footer-services span + span::before {
    content: "|";
    margin: 0 16px;
    color: #8da0b5;
}



/* =========================================================
   PORTAL FOOTER
   ========================================================= */

.portal-footer {
    display: none;
}

body.portal-mode .portal-footer {
    display: flex;
}

body.portal-mode #loginFooter {
    display: none;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {
    body.portal-mode .header-content {
        padding: 0 28px;
    }

    .portal-page {
        padding-left: 28px;
        padding-right: 28px;
    }

    .portal-grid {
        width: 100%;
        grid-template-columns: minmax(0, 560px) minmax(320px, 380px);
    }
}

@media (max-width: 900px) {
    .site-header { height: 105px; }
    .header-content { padding: 0 25px; }
    .brand-logo { width: 175px; height: 88px; }
    .header-slogan { padding-left: 18px; }
    .header-slogan-title { font-size: 16px; }
    .header-slogan-subtitle { font-size: 15px; }

    .page-content {
        min-height: 680px;
        background-position: 62% center;
    }

    .login-section {
        min-height: 680px;
        padding: 40px 25px;
        justify-content: flex-start;
    }

    .login-card { width: 330px; }
    .footer-content { padding: 2px 25px 4px; }

    body.portal-mode .site-header {
        height: 82px;
    }

    body.portal-mode .header-slogan {
        display: none;
    }

    .portal-page {
        min-height: calc(100vh - 82px);
        padding: 24px 22px 38px;
    }

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

    .portal-user {
        border-left: 0;
        padding-left: 0;
    }

    .instructions-card {
        max-width: 560px;
    }
}


/* =========================================================
   TELEFON
   ========================================================= */

@media (max-width: 600px) {
    .site-header { height: auto; min-height: 88px; }
    .header-content { padding: 10px 18px; }
    .brand-logo { width: 150px; height: 70px; }

    .header-slogan {
        padding-left: 12px;
        border-left-width: 3px;
    }

    .header-slogan-title {
        max-width: 170px;
        font-size: 13px;
    }

    .header-slogan-subtitle {
        margin-top: 3px;
        font-size: 12px;
    }

    .page-content {
        min-height: 610px;
        background-position: 68% center;
        background-image:
            linear-gradient(
                rgba(7, 38, 70, 0.40),
                rgba(7, 38, 70, 0.40)
            ),
            url("../images/login-background.png");
    }

    .login-section {
        min-height: 610px;
        padding: 35px 18px;
        justify-content: center;
    }

    .login-card {
        width: 100%;
        max-width: 330px;
        padding: 22px 20px 20px;
    }

    .login-header { margin-bottom: 16px; }
    .login-header h1 { font-size: 27px; }
    .login-header p { font-size: 13px; }
    .form-group input { font-size: 14px; }

    .footer-content {
        padding: 2px 18px 4px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .footer-services {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    body.portal-mode .header-content {
        padding: 7px 14px;
    }

    body.portal-mode .brand-logo {
        width: 92px;
        height: 62px;
    }

    .portal-user-name {
        display: none;
    }

    .logout-button {
        padding: 0 10px;
    }

    .portal-page {
        padding: 20px 14px 32px;
    }

    .portal-title h1 {
        font-size: 27px;
    }

    .portal-title p {
        font-size: 13px;
    }

    .download-card,
    .receipts-card {
        padding: 14px;
    }

    .date-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .format-row {
        gap: 16px;
    }

    .receipts-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .receipts-filter {
        width: 100%;
        margin-left: 0;
    }

    .receipts-filter-select {
        flex: 1;
        width: auto;
    }
}
