:root {
    --bg: #f4f6f8;
    --surface: #fff;
    --text: #17212b;
    --muted: #687582;
    --line: #dfe4e8;
    --accent: #1d5f8a;
    --accent2: #174b6d;
    --success: #237a4b;
    --shadow: 0 8px 24px rgba(20,35,45,.07);
    font-family:Arial,Helvetica,sans-serif
}

* {
    box-sizing:border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height:1.5
}

.topbar {
    height: 72px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 5%;
    position: sticky;
    top: 0;
    z-index:20
}

.brand {
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent);
    text-decoration: none;
    font-size: 20px;
    margin-right:auto
}

.nav {
    display: flex;
    gap:6px
}

.nav a {
    color: #34424d;
    text-decoration: none;
    padding: 11px 15px;
    border-radius: 7px;
    font-size: 14px;
    font-weight:600
}

.nav a:hover,.nav a.active {
    background: #edf3f7;
    color:var(--accent)
}

.menu-toggle {
    display: none;
    border: 0;
    background: none;
    font-size:24px
}

.container {
    max-width: 100%;
    margin: auto;
    padding:46px 5%
}

.narrow {
    max-width:850px
}

.hero {
    background: linear-gradient(135deg,#fff,#edf3f7);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 48px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    box-shadow:var(--shadow)
}

.eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color:var(--accent)
}

h1 {
    font-size: 40px;
    line-height: 1.1;
    margin:9px 0 13px
}

h2 {
    margin: 5px 0;
    font-size:25px
}

h3 {
    margin: 3px 0 6px;
    font-size:17px
}

p {
    color: var(--muted);
    margin:6px 0
}

.button {
    display: inline-block;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 7px;
    padding: 10px 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration:none
}

.button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color:#fff
}

.button.small {
    padding: 7px 11px;
    font-size:12px
}

.stats {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 14px;
    margin:24px 0
}

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding:20px
}

.stat strong {
    display: block;
    font-size:26px
}

.stat span {
    font-size: 12px;
    color:var(--muted)
}

.section {
    margin-top:42px
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom:16px
}

.section-head a {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight:700
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap:14px
}

.category-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 23px;
    text-decoration: none;
    color: var(--text);
    transition:.2s
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow:var(--shadow)
}

.category-card span,.form-code {
    color: var(--accent);
    font-weight: 800;
    font-size:12px
}

.page-title {
    margin-bottom:28px
}

.page-title h1 {
    font-size:36px
}

.search-row {
    display: flex;
    gap: 10px;
    margin-bottom:18px
}

.search-row input,.search-row select {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:#fff
}

.search-row input {
    flex:1
}

.accordion {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 14px 0;
    overflow:hidden
}

.accordion-head {
    width: 100%;
    border: 0;
    background: #fff;
    text-align: left;
    padding: 17px 20px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    gap:10px
}

.accordion-head small {
    margin-left: auto;
    color: var(--muted);
    font-weight:500
}

.accordion-body {
    display: none;
    border-top:1px solid var(--line)
}

.accordion.open .accordion-body {
    display:block
}

.form-card {
    display: grid;
    grid-template-columns: 70px 1fr auto auto;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    border-bottom:1px solid var(--line)
}

.form-card:last-child {
    border-bottom:0
}

.meta {
    font-size: 12px;
    color:var(--muted)
}

.badge {
    font-size: 11px;
    font-weight: 800;
    padding: 5px 8px;
    border-radius:20px
}

.badge.active {
    background: #e7f4ed;
    color:var(--success)
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 25px;
    box-shadow:var(--shadow)
}

form.panel {
    display: grid;
    gap:18px
}

label {
    font-size: 13px;
    font-weight:700
}

label input,label select,label textarea {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background:#fff
}

.upload-note {
    padding: 13px;
    background: #f5f8fa;
    border-left: 3px solid var(--accent);
    font-size: 12px;
    color:var(--muted)
}

.message {
    font-weight: 700;
    color:var(--success)
}

.timeline {
    border-left: 2px solid #ccd6dd;
    margin-left:12px
}

.timeline-item {
    position: relative;
    padding:0 0 28px 28px
}

.timeline-item:before {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    left: -6px;
    top:5px
}

.time {
    font-size: 11px;
    color: var(--muted);
    display: block;
    margin-bottom:4px
}

.tag {
    display: inline-block;
    font-size: 10px;
    background: #edf3f7;
    color: var(--accent);
    padding: 4px 7px;
    border-radius: 4px;
    margin-top:8px
}

.admin-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
    margin-bottom:18px
}

.admin-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size:13px
}

.admin-row:last-child {
    border-bottom:0
}

.admin-row button {
    border: 0;
    background: none;
    color: var(--accent);
    font-weight: 700;
    cursor:pointer
}

.drive-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin:20px 0 10px
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #2f9b60;
    border-radius:50%
}

.drive-status b {
    color:var(--success)
}

@media(max-width:800px) {
    .topbar {
        padding:0 20px
    }

    .menu-toggle {
        display:block
    }

    .nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--line);
        padding: 10px 20px;
        flex-direction:column
    }

    .nav.open {
        display:flex
    }

    .hero {
        padding: 30px;
        display:block
    }

    .hero .button {
        margin-top:20px
    }

    .stats,.category-grid {
        grid-template-columns:repeat(2,1fr)
    }

    .form-card {
        grid-template-columns:60px 1fr
    }

    .form-card .badge,.form-card .button {
        grid-column: 2;
        justify-self:start
    }

    .admin-grid {
        grid-template-columns:1fr
    }

}

@media(max-width:520px) {
    .container {
        padding:30px 18px
    }

    h1 {
        font-size:32px
    }

    .stats,.category-grid {
        grid-template-columns:1fr
    }

    .search-row {
        flex-direction:column
    }

    .form-card {
        grid-template-columns:1fr
    }

    .form-card .badge,.form-card .button {
        grid-column:1
    }

    .admin-row {
        grid-template-columns:1fr auto
    }

    .admin-row span:last-child {
        grid-column:2
    }

    .hero {
        padding:24px
    }

    .page-title h1 {
        font-size:30px
    }

}

/* Admin V2 preview */

.admin-grid-main {
    grid-template-columns:1.55fr .75fr
}

.admin-help {
    font-size: 12px;
    max-width:650px
}

.admin-table-wrap {
    overflow-x:auto
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size:13px
}

.admin-table th {
    text-align: left;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 11px 10px;
    border-bottom:1px solid var(--line)
}

.admin-table td {
    padding: 15px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align:middle
}

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

.admin-table td:first-child b {
    display:block
}

.admin-table td:first-child small {
    display: block;
    color: var(--muted);
    margin-top:3px
}

.admin-table .align-right {
    text-align:right
}

.table-actions {
    text-align: right;
    white-space:nowrap
}

.table-actions button,.text-action {
    border: 0;
    background: none;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    padding:4px 6px
}

.table-actions .danger-link {
    color:#a64a4a
}

.admin-rule {
    margin-top: 18px;
    padding: 13px 15px;
    border-radius: 8px;
    background: #f5f8fa;
    border-left: 3px solid var(--accent);
    font-size:12px
}

.admin-rule b {
    display: block;
    margin-bottom:3px
}

.admin-rule span {
    color:var(--muted)
}

.user-card {
    display: grid;
    grid-template-columns: 38px 1fr auto auto;
    align-items: center;
    gap: 11px;
    padding: 14px 0;
    border-bottom:1px solid var(--line)
}

.user-card:last-of-type {
    border-bottom:0
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf3f7;
    color: var(--accent);
    font-size: 12px;
    font-weight:800
}

.user-info b,.user-info span {
    display:block
}

.user-info span {
    font-size: 11px;
    color: var(--muted);
    margin-top:2px
}

.role-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 5px 8px;
    background: #f0f2f4;
    border-radius: 20px;
    color:#53606b
}

.admin-role {
    background: #e8f1f7;
    color:var(--accent)
}

.users-note {
    margin-top:17px
}

.badge.inactive {
    background: #f0f1f2;
    color:#687582
}

.archive-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 15px 0;
    border-bottom:1px solid var(--line)
}

.archive-row:last-child {
    border-bottom:0
}

.archive-row div b {
    display: block;
    margin-top: 2px;
    font-size:13px
}

.system-data {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size:12px
}

.system-data span {
    color:var(--muted)
}

.system-button {
    margin-top:18px
}

.admin-activity {
    margin-top:18px
}

.admin-history-link {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    text-decoration:none
}

.activity-row {
    display: grid;
    grid-template-columns: 155px 150px 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    font-size:12px
}

.activity-row:last-child {
    border-bottom:0
}

.activity-row b {
    font-size:11px
}

.activity-row span:nth-child(2) {
    color:var(--muted)
}

@media(max-width:900px) {
    .admin-grid-main {
        grid-template-columns:1fr
    }

    .activity-row {
        grid-template-columns:130px 1fr auto
    }

    .activity-row span:nth-child(2) {
        display:none
    }

}

@media(max-width:620px) {
    .section-head {
        align-items: flex-start;
        gap:14px
    }

    .section-head .button {
        flex-shrink:0
    }

    .user-card {
        grid-template-columns:38px 1fr auto
    }

    .user-card .text-action {
        grid-column: 2;
        justify-self: start;
        padding-left:0
    }

    .archive-row {
        grid-template-columns:1fr auto
    }

    .archive-row .button {
        grid-column: 1;
        justify-self:start
    }

    .activity-row {
        grid-template-columns:1fr auto
    }

    .activity-row span:nth-child(3) {
        grid-column:1 / -1
    }

    .admin-table {
        min-width:690px
    }

}

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

.login-body {
    margin: 0;
    background: var(--bg);
}

.login-page {
    width: 100%;
    max-width: 360px;
    margin: 55px auto 30px;
    padding: 0 15px;
}

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

.login-brand .eyebrow {
    font-size: 10px;
}

.login-brand h1 {
    margin: 5px 0 0;
    font-size: 22px;
    line-height: 1.2;
}

.login-box {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.login-header {
    margin-bottom: 20px;
}

.login-header h2 {
    margin: 0 0 5px;
    font-size: 19px;
}

.login-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
}

.login-form input[type="text"], .login-form input[type="password"] {
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
}

.login-form input[type="text"]:focus, .login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
}

.login-options {
    display: flex;
    align-items: center;
}

.login-form .login-remember {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.login-form .login-remember input {
    width: auto;
    margin: 0;
}

.login-button {
    width: 100%;
    padding: 9px 14px;
    text-align: center;
}

.login-footer {
    margin-top: 14px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
}

@media (max-width: 500px) {
    .login-page {
        max-width: 340px;
        margin-top: 30px;
        padding: 0 12px;
    }

    .login-box {
        padding: 20px;
    }

    .login-brand h1 {
        font-size: 20px;
    }

}

/* =========================================================
   LOGIN - FINALNO OGRANIČENJE ŠIRINE
   ========================================================= */

body.login-body {
    min-height: auto;
}

body.login-body .login-page {
    width: 360px;
    max-width: calc(100% - 32px);
    margin: 50px auto 30px;
    padding: 0;
}

body.login-body .login-box {
    width: auto;
    max-width: 100%;
    padding: 24px;
}

@media (max-width: 500px) {
    body.login-body .login-page {
        width: auto;
        max-width: calc(100% - 24px);
        margin-top: 30px;
    }

    body.login-body .login-box {
        padding: 20px;
    }
}

/* =========================================================
   MODAL
   ========================================================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 4px 0 0;
}

.modal-close {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.modal-form {
    display: grid;
    gap: 16px;
}

.modal-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.modal-form input,
.modal-form select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
}

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

body.modal-open {
    overflow: hidden;
}
/* =========================================================
   AKCIJE KORISNIKA
   ========================================================= */

.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.button.danger {
    background: #b42318;
    color: #ffffff;
    border-color: #b42318;
}

.button.danger:hover {
    background: #912018;
    border-color: #912018;
}

.message.error {
    color: #c62828;
}
/* =========================================================
   OBRASCI - AKCIJE
   ========================================================= */

.form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}


/* =========================================================
   VERZIJE OBRASCA
   ========================================================= */

#formVersionsContent {
    display: grid;
    gap: 10px;
}


.version-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}


.version-item:last-child {
    border-bottom: 0;
}


.version-item > div {
    min-width: 0;
}


.version-item b {
    display: block;
    margin-bottom: 3px;
    color: var(--accent);
    font-size: 13px;
}


.version-item > div > div {
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}


.version-item small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}


.version-item .button {
    flex-shrink: 0;
}


/* =========================================================
   VERZIJE OBRASCA - MOBILNI
   ========================================================= */

@media (max-width: 520px) {

    .form-actions {
        grid-column: 1;
        flex-wrap: wrap;
        justify-self: start;
    }


    .version-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }


    .version-item .button {
        justify-self: start;
    }

}
.search-row .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}