@charset "utf-8";
@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Barlow+Condensed:wght@500;600;700&display=swap');

/* =========================================================
   Preventiva — Design System v2
   Aesthetic: Industrial Precision
   ========================================================= */

:root {
    --primary:        #1E3A5F;
    --primary-dark:   #132740;
    --primary-mid:    #2A4F7C;
    --primary-light:  #EBF2FA;
    --accent:         #D97706;
    --accent-dark:    #B45309;
    --accent-light:   #FEF3C7;
    --success:        #15803D;
    --success-light:  #D1FAE5;
    --danger:         #B91C1C;
    --danger-light:   #FEE2E2;

    --bg-body:    #0F1923;
    --bg-app:     #F5F3EE;
    --bg-card:    #FFFFFF;
    --bg-stripe:  #F9F8F5;
    --bg-hover:   #EEF2F8;
    --bg-input:   #FAFAF8;

    --text:       #1C2B3A;
    --text-mid:   #4A5568;
    --text-light: #718096;

    --border:       #D8D5CC;
    --border-light: #EAE7DF;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.11);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.32);

    --font:         'Figtree', system-ui, -apple-system, sans-serif;
    --font-display: 'Barlow Condensed', 'Figtree', sans-serif;
    --radius:    6px;
    --radius-lg: 10px;

    /* Font scale — rem units scale with browser/OS DPI settings */
    --fs-xs:   0.6875rem;  /* 11px */
    --fs-sm:   0.75rem;    /* 12px */
    --fs-base: 0.8125rem;  /* 13px */
    --fs-md:   0.875rem;   /* 14px */
    --fs-lg:   1rem;       /* 16px */
    --fs-xl:   1.125rem;   /* 18px */
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 100%; /* respects browser/OS DPI calibration (~16px on 96dpi) */
}

body {
    background-color: var(--bg-body);
    background-image: radial-gradient(rgba(255,255,255,0.032) 1px, transparent 1px);
    background-size: 28px 28px;
    padding: 0;
    margin: 0;
    font-family: var(--font);
    font-size: 0.8125rem; /* 13px at 16px base */
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

hr {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border-light);
    margin: 0;
}

h2 {
    font-size: 1.125rem; /* 18px */
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0 0 10px;
}
h3 {
    font-size: 1rem; /* 16px */
    color: var(--primary);
    text-align: center;
    font-family: var(--font);
    font-weight: 600;
    margin: 10px 0;
}
h4 {
    font-size: 0.875rem; /* 14px */
    font-weight: 600;
    margin: 10px 0 5px;
    color: var(--text);
    font-family: var(--font);
}
.half { width: 300px; float: left; }

/* ---- Main container ---- */
#poz1 {
    margin: 0 auto;
    display: block;
    width: 990px;
    overflow: auto;
    min-height: 1000px;
    background-color: var(--bg-app);
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 10px 10px;
    padding: 0 24px 32px;
    box-sizing: border-box;
}

/* ======================================================
   HEADER
   ====================================================== */
#headimg { margin: 0 auto; width: 990px; }

#header-banner {
    width: 990px;
    height: 116px;
    background: #0D1B2A;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding-left: 36px;
    box-sizing: border-box;
    border-bottom: 4px solid var(--accent);
}
#header-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}
#header-banner::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 360px;
    background: linear-gradient(90deg, transparent 0%, rgba(180,40,0,0.14) 55%, rgba(255,100,0,0.20) 100%);
    pointer-events: none;
}

.header-content { position: relative; z-index: 1; }

.header-brand {
    display: block;
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 3px;
    text-transform: uppercase;
    line-height: 1;
    text-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
.header-brand span { color: var(--accent); }

.header-tagline {
    display: block;
    font-family: var(--font);
    font-size: 0.625rem;
    color: rgba(255,255,255,0.45);
    letter-spacing: 3.5px;
    text-transform: uppercase;
    margin-top: 8px;
}

/* Fire canvas */
.header-shapes {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 640px;
    pointer-events: none;
    overflow: hidden;
}
#fire-canvas {
    position: absolute;
    right: 10px;
    bottom: 0;
    display: block;
}

/* ======================================================
   NAVIGATION
   ====================================================== */
#navigacija {
    float: left;
    width: calc(100% + 48px);
    margin-left: -24px;
    margin-right: -24px;
    overflow: hidden;
    height: 38px;
    margin-bottom: 20px;
    background: #152231;
    border-bottom: 3px solid var(--accent);
    text-align: center;
}
#navigacija ul {
    list-style: none;
    padding: 0;
    margin: 0;
    height: 100%;
    width: 100%;
    text-align: center;
    float: left;
}
#navigacija ul li {
    height: 100%;
    vertical-align: middle;
    padding: 0 15px 0 10px;
    text-align: center;
    border-left: 1px solid rgba(255,255,255,0.1);
    float: left;
    cursor: pointer;
    transition: background 0.12s;
}
#navigacija ul li:hover { background: rgba(255,255,255,0.11); }
#navigacija ul li a {
    font-family: var(--font);
    font-size: var(--fs-md);
    color: rgba(255,255,255,0.88);
    height: 100%;
    display: block;
    padding-top: 9px;
    text-shadow: none;
    transition: color 0.12s;
}
#navigacija ul li:hover a { color: #fff; text-decoration: none; }
#navigacija ul li a:link,
#navigacija ul li a:visited,
a.link, a.visited { text-decoration: none; }

#navigacija .nav-home {
    display: inline-block;
    color: rgba(255,255,255,0.88);
    font-family: var(--font);
    font-size: var(--fs-base);
    font-weight: 600;
    text-decoration: none;
    padding: 0 16px;
    line-height: 38px;
    height: 38px;
    letter-spacing: 0.01em;
    transition: color 0.12s;
}
#navigacija .nav-home:hover { color: var(--accent); text-decoration: none; }

#navigacija .nav-logout {
    float: right;
    color: rgba(255,255,255,0.55);
    font-family: var(--font);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
    padding: 0 12px;
    line-height: 20px;
    height: 20px;
    margin: 9px 10px 0;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 3px;
    transition: border-color 0.15s, color 0.15s;
}
#navigacija .nav-logout:hover {
    border-color: var(--danger);
    color: #FC8181;
    text-decoration: none;
}
#navigacija a:link:active { color: var(--danger); }

#navigacija .nav-istekli-akti {
    display: inline-block;
    color: #FEF3C7;
    font-family: var(--font);
    font-size: var(--fs-sm);
    font-weight: 600;
    padding: 0 12px;
    line-height: 42px;
    border: 1px solid rgba(217,119,6,0.5);
    border-radius: 4px;
    margin-left: 8px;
    transition: background 0.12s, color 0.12s;
}
#navigacija .nav-istekli-akti:hover { background: rgba(217,119,6,0.2); color: #fff; text-decoration: none; }

/* ======================================================
   FIELDSETS
   ====================================================== */
fieldset {
    clear: left;
    float: left;
    padding: 20px 24px 22px 20px;
    margin: 0 0 22px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

fieldset legend {
    color: #fff;
    font-weight: 600;
    font-family: var(--font);
    font-size: var(--fs-xs);
    padding: 3px 14px;
    background: var(--accent);
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

fieldset label {
    float: left;
    width: 140px;
    display: inline;
    clear: left;
    text-align: right;
    margin-right: 12px;
    color: var(--text);
    font-weight: 600;
    font-family: var(--font);
    font-size: var(--fs-sm);
    letter-spacing: 0.3px;
    line-height: 30px;
}
fieldset label:has(input[type="radio"]),
fieldset label:has(input[type="checkbox"]) {
    line-height: normal;
    width: auto;
    float: none;
    clear: none;
    text-align: left;
}

fieldset input {
    float: left;
    margin-bottom: 14px;
    clear: right;
}
fieldset input[type="radio"],
fieldset input[type="checkbox"] {
    float: none;
    clear: none;
    margin-bottom: 0;
    vertical-align: middle;
    width: auto;
}
fieldset textarea {
    float: left;
    margin-bottom: 10px;
    clear: right;
}

fieldset input:focus, fieldset input.focus,
fieldset textarea:focus {
    outline: none;
    border-color: var(--accent) !important;
    background: var(--bg-card) !important;
    box-shadow: 0 0 0 3px rgba(217,119,6,0.15) !important;
}

/* ---- Text inputs ---- */
fieldset input[type="text"],
fieldset input[type="password"],
fieldset input[type="number"],
fieldset input[type="email"],
fieldset textarea {
    border: 1.5px solid var(--border);
    border-radius: 5px;
    padding: 6px 10px;
    font-family: var(--font);
    font-size: var(--fs-base);
    background: var(--bg-input);
    color: var(--text);
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    height: auto;
    max-width: 100%;
    box-sizing: border-box;
}

fieldset input[type="file"] {
    border: 1.5px solid var(--border);
    border-radius: 5px;
    padding: 4px 6px;
    font-family: var(--font);
    font-size: var(--fs-base);
    background: var(--bg-input);
    color: var(--text);
    cursor: pointer;
    float: left;
    margin-bottom: 10px;
    transition: border-color 0.18s;
}
fieldset input[type="file"]::file-selector-button {
    border: 1.5px solid var(--accent);
    border-radius: 3px 0 0 3px;
    padding: 4px 12px;
    margin-right: 10px;
    background: transparent;
    color: var(--accent-dark);
    font-family: var(--font);
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
fieldset input[type="file"]::file-selector-button:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent-dark);
    box-shadow: 0 4px 12px rgba(217,119,6,0.32);
}
fieldset input[type="file"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217,119,6,0.15); }

/* ---- Select ---- */
select {
    border: 1.5px solid var(--border);
    border-radius: 5px;
    padding: 5px 10px;
    font-family: var(--font);
    font-size: var(--fs-base);
    background: var(--bg-input);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.18s, box-shadow 0.18s;
}
select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.15);
}

/* ======================================================
   FORM ROWS
   ====================================================== */
form label {
    width: 140px;
    text-align: center;
    float: left;
    position: relative;
    top: 5px;
}
form select { margin-top: 5px; float: left; }

.form-row {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    clear: both;
    border-radius: 4px;
    transition: background 0.1s;
}
.form-row:nth-child(even) { background: var(--bg-stripe); }
.form-row:hover { background: var(--bg-hover); }
.form-row:last-of-type { border-bottom: none; }

.form-row > label:first-child {
    flex: 1;
    align-self: center;
    color: var(--text);
    font-size: var(--fs-base);
    font-weight: 600;
    font-family: var(--font);
    float: none; clear: none; width: auto;
    text-align: left;
    line-height: normal;
    border: none; padding: 0; margin: 0;
}
.form-row:has(select) > label:first-child { flex: 0 0 160px; min-width: unset; }
.form-row select { flex: 1; float: none; margin: 0; }
.form-row:has(textarea) { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.form-row:has(textarea) > label:first-child,
.form-row:has(input[type="text"]) > label:first-child,
.form-row:has(input[type="file"]) > label:first-child { flex: 0 0 auto; min-width: 180px; max-width: 180px; }
.form-row:has(textarea) > label:first-child { padding-top: 8px; }
.form-row textarea { flex: 1; min-width: 0; resize: vertical; float: none; margin: 0; overflow-y: auto; }
.form-row input[type="text"],
.form-row input[type="file"] { flex: 0 0 auto; width: 260px; align-self: center; margin-bottom: 0; }
.form-row:has(textarea[name="opisdj"]) { align-items: flex-start; }
.form-row input[type="file"] { float: none; margin-bottom: 0; }

/* ======================================================
   RADIO LABELS
   ====================================================== */
.radio-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 4px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--bg-stripe);
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text-mid);
    font-family: var(--font);
    cursor: pointer;
    float: none;
    width: auto;
    line-height: normal;
    transition: all 0.18s;
    user-select: none;
}
.radio-label:hover {
    background: var(--accent);
    border-color: var(--accent-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(217,119,6,0.32);
}
.radio-label input[type="radio"] { display: none; }
.radio-label:has(input[value="Da"]:checked) { background: var(--success); border-color: #145E31; color: #fff; box-shadow: 0 2px 6px rgba(21,128,61,0.28); }
.radio-label:has(input[value="Ne"]:checked) { background: var(--danger); border-color: #9B1A1A; color: #fff; box-shadow: 0 2px 6px rgba(185,28,28,0.28); }

/* ======================================================
   BUTTONS
   ====================================================== */

/* Images inside buttons adapt to background on hover */
.dugme img {
    vertical-align: middle;
    margin-right: 4px;
    transition: filter 0.15s;
}
.dugme:hover img { filter: brightness(0) invert(1); }
.dugme-pdf img, .dugme-obrisi img { filter: brightness(0) invert(1); }

/* Replace green add.png with minimal modern plus icon */
img[src*="add.png"] {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E3A5F' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}
/* On amber add-buttons, use amber-stroked icon */
.dugme:has(img[src*="add"]) img[src*="add.png"] {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B45309' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}
/* On hover (any dark bg) → white icon via inherited filter rule */

/* ---- Base button ---- */
.dugme {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1.5px solid var(--primary);
    padding: 6px 16px;
    background: var(--primary-light);
    font-size: var(--fs-base);
    font-weight: 600;
    font-family: var(--font);
    color: var(--primary);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.5;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 3px rgba(30,58,95,0.1);
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    user-select: none;
    white-space: nowrap;
}
.dugme:hover {
    background: var(--primary-mid);
    color: #fff;
    border-color: var(--primary-mid);
    text-decoration: none !important;
    box-shadow: 0 3px 10px rgba(30,58,95,0.22);
}
.dugme:active {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: #fff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

/* ---- Op-item: button text wraps inside fieldset ---- */
.op-item-wrap .dugme {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: left;
}

/* ---- Small size variant ---- */
.dugme-sm {
    padding: 3px 10px;
    font-size: var(--fs-sm);
    border-radius: 4px;
}

/* ---- Done / has-action state (e.g. opasnost s mjerama) ---- */
.dugme-done {
    background: #E8F5EC;
    border-color: #4CAF50;
    color: #1A5E20;
}
.dugme-done:hover {
    background: #C8E6CD;
    border-color: #388E3C;
    color: #1A5E20;
    box-shadow: 0 2px 6px rgba(76,175,80,0.2);
}

/* ---- Secondary / muted variant ---- */
.dugme-secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--text-mid);
    box-shadow: none;
}
.dugme-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text);
    box-shadow: none;
}

/* ---- Add-action buttons: amber accent ---- */
.dugme:has(img[src*="add"]),
.dugme-add {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent-dark);
}
.dugme:has(img[src*="add"]):hover,
.dugme-add:hover {
    background: var(--accent);
    border-color: var(--accent-dark);
    color: #fff;
    box-shadow: 0 3px 10px rgba(217,119,6,0.28);
}

/* ---- Back button ---- */
.dugme-back {
    background: transparent;
    border-color: var(--border);
    color: var(--text-mid);
    padding-left: 10px;
    box-shadow: none;
}
.dugme-back::before {
    content: '\2190';
    font-size: var(--fs-md);
    font-weight: bold;
    line-height: 1;
    margin-right: 2px;
}
.dugme-back:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text);
    box-shadow: none;
}
.dugme-back img { display: none; }

/* ---- PDF / delete buttons ---- */
.dugme-pdf {
    background: var(--danger);
    color: #fff;
    border-color: #9B1A1A;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(185,28,28,0.2);
}
.dugme-pdf:hover {
    background: #9B1A1A;
    border-color: #7F1515;
    color: #fff;
    box-shadow: 0 3px 10px rgba(185,28,28,0.3);
}
.oc-pdf { padding: 2px 8px; font-size: var(--fs-xs); line-height: 1.5; margin: 0 2px; text-decoration: none; }

.dugme-obrisi {
    background: var(--danger);
    border-color: #9B1A1A;
    color: #fff;
    box-shadow: 0 1px 3px rgba(185,28,28,0.2);
}
.dugme-obrisi:hover {
    background: #9B1A1A;
    border-color: #7F1515;
    color: #fff;
    box-shadow: 0 3px 10px rgba(185,28,28,0.3);
}

/* ======================================================
   LINKS
   ====================================================== */
a {
    color: var(--primary-mid);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.12s;
}
a:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}
a:visited { color: var(--primary-mid); }
a:visited:hover { color: var(--primary); }

a img { border: none; vertical-align: middle; }

/* ======================================================
   IMAGES — ACTIONS
   ====================================================== */
img[src*="pencil"] {
    cursor: pointer;
    width: 22px;
    height: 22px;
    opacity: 0.5;
    margin-left: 5px;
    vertical-align: middle;
    border-radius: 50%;
    padding: 3px;
    transition: opacity 0.15s, transform 0.15s, background-color 0.15s;
}
img[src*="pencil"]:hover {
    opacity: 1;
    transform: scale(1.25);
    background-color: var(--accent-light);
}

/* Standalone kanta (outside dugme) — danger bg on hover */
img[src*="kanta"] {
    cursor: pointer;
    width: 22px;
    height: 22px;
    opacity: 0.38;
    margin-left: 4px;
    vertical-align: middle;
    border-radius: 50%;
    padding: 3px;
    transition: opacity 0.15s, transform 0.15s, background-color 0.15s;
}
img[src*="kanta"]:hover {
    opacity: 1;
    transform: scale(1.2);
    background-color: var(--danger-light);
}
/* Reset standalone kanta styles when inside a button */
.dugme img[src*="kanta"] {
    border-radius: 0;
    padding: 0;
    margin: 0 4px 0 0;
    opacity: 1;
    background-color: transparent;
    transform: none;
}
.dugme img[src*="kanta"]:hover {
    background-color: transparent;
    transform: none;
}

/* ======================================================
   TABLE
   ====================================================== */
.tabela {
    background: var(--bg-card);
    border-collapse: collapse;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    overflow: hidden;
}
.tabela th {
    background: var(--primary);
    color: #fff;
    font-family: var(--font);
    font-weight: 700;
    font-size: var(--fs-xs);
    padding: 9px 10px;
    border-bottom: 2px solid var(--primary-dark);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.tabela tr { height: 36px; transition: background 0.18s; cursor: pointer; }
.tabela tr:nth-child(even) td { background: var(--bg-stripe); }
.tabela tr:hover td {
    background: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px rgba(30,58,95,0.12);
}
.tabela tr td { width: 120px; padding: 6px 10px; border-bottom: 1px solid var(--border-light); font-family: var(--font); font-size: var(--fs-base); color: var(--text); }

/* ======================================================
   FIRMA ROWS
   ====================================================== */
.firma-row {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    border-radius: 4px;
    transition: background 0.1s;
    gap: 8px;
    clear: both;
}
.firma-row:nth-child(even) { background: var(--bg-stripe); }
.firma-row:hover { background: var(--bg-hover); }
.firma-row-photo { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }

.firma-label {
    flex: 0 0 230px;
    color: var(--text);
    font-size: var(--fs-base);
    font-weight: 600;
    font-family: var(--font);
    line-height: 1.4;
}
.firma-value {
    flex: 1;
    color: var(--text);
    font-size: var(--fs-base);
    font-family: var(--font);
    line-height: 1.4;
    word-break: break-word;
}
.firma-edit {
    flex: 0 0 auto;
    cursor: pointer;
    opacity: 0.28;
    transition: opacity 0.15s;
    vertical-align: middle;
}
.firma-row:hover .firma-edit { opacity: 0.88; }

/* ======================================================
   STATUS BADGES
   ====================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: var(--fs-xs);
    font-weight: 700;
    font-family: var(--font);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-da { background: var(--success); color: #fff; border: 1px solid #145E31; }
.badge-ne { background: var(--danger); color: #fff; border: 1px solid #9B1A1A; }

/* ======================================================
   INLINE EDIT
   ====================================================== */
.firma-editing { background: #FFFBF0 !important; }
.inline-edit-input {
    flex: 1;
    min-width: 0;
    float: none !important; clear: none !important;
    margin-bottom: 0 !important;
    font-family: var(--font);
    font-size: var(--fs-base);
    color: var(--text);
    border: 1.5px solid var(--accent);
    border-radius: 4px;
    padding: 5px 8px;
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.15);
    outline: none;
    resize: none;
    overflow: hidden;
}
.firma-editing-ta { flex-wrap: wrap; align-items: flex-start; }
.firma-editing-ta .inline-edit-input { flex: 1 1 100%; min-height: 60px; }
.firma-editing-ta .inline-controls { flex: 0 0 100%; display: flex; justify-content: flex-end; margin-top: 5px; }
.inline-controls { flex: 0 0 auto; display: inline-flex; gap: 5px; align-items: center; margin-left: 6px; }

.inline-save, .inline-cancel, .inline-ai {
    padding: 4px 14px;
    font-size: var(--fs-sm);
    font-family: var(--font);
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.inline-save {
    background: transparent;
    color: var(--success);
    border-color: var(--success);
}
.inline-save:hover {
    background: var(--success);
    color: #fff;
    border-color: #145E31;
    box-shadow: 0 4px 12px rgba(21,128,61,0.28);
}
.inline-cancel {
    background: transparent;
    color: var(--text-mid);
    border-color: var(--border);
}
.inline-cancel:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--border);
    box-shadow: none;
}
.inline-ai {
    background: transparent;
    color: #6D28D9;
    border-color: #5B21B6;
}
.inline-ai:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent-dark);
    box-shadow: 0 4px 12px rgba(217,119,6,0.32);
}
.inline-ai:disabled { background: #C4B5FD; border-color: #C4B5FD; cursor: wait; }

.ai-form-btn {
    display: inline-block;
    margin-left: 6px;
    padding: 3px 10px;
    font-size: var(--fs-xs);
    font-family: var(--font);
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    border: 1.5px solid var(--accent);
    background: transparent;
    color: var(--accent-dark);
    vertical-align: top;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.ai-form-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent-dark);
    box-shadow: 0 4px 12px rgba(217,119,6,0.32);
}
.ai-form-btn:disabled { background: #C4B5FD; border-color: #C4B5FD; cursor: wait; }

.inline-radio-group { display: inline-flex; gap: 4px; align-items: center; margin: 0 4px; }
.inline-radio-group .radio-label { margin-left: 0; margin-right: 4px; }

/* ======================================================
   AUTOCOMPLETE SEARCH
   ====================================================== */
#acfirma {
    width: 260px;
    padding: 9px 16px 9px 40px;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    font-family: var(--font);
    font-size: var(--fs-base);
    color: var(--text);
    background-color: var(--bg-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23D97706' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    box-shadow: var(--shadow-sm);
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}
#acfirma:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217,119,6,0.18); }
#acfirma::placeholder { color: var(--text-light); font-style: italic; }

/* ======================================================
   OBJEKAT CARDS
   ====================================================== */
.objekat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 6px; }
.objekat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.05s;
    box-shadow: var(--shadow-sm);
}
.objekat-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(217,119,6,0.2); }
.objekat-card:active { transform: translateY(1px); }
.objekat-card-thumb { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; background: var(--bg-stripe); display: flex; align-items: center; justify-content: center; }
.objekat-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.objekat-card-noimg { font-size: 2rem; color: var(--text-light); }
.objekat-card-body { flex: 1 1 auto; min-width: 0; padding-right: 22px; }
.objekat-card-title { font-weight: 600; color: var(--text); font-size: var(--fs-md); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.objekat-card-sub { margin-top: 3px; font-size: var(--fs-sm); color: var(--text-light); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.objekat-card-del { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; cursor: pointer; opacity: 0; transition: opacity 0.15s; z-index: 2; background: var(--bg-card); border-radius: 50%; padding: 2px; }
.objekat-card:hover .objekat-card-del { opacity: 0.75; }
.objekat-card-del:hover { opacity: 1 !important; }

/* ======================================================
   BOX COMPONENTS
   ====================================================== */
#box, .box {
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    font-family: var(--font);
}
#box { height: 150px; margin: 0 5px; }
.box { float: left; margin: 0 5px 10px; min-height: auto; }
.box ul { margin-left: 5px; margin-top: 0; padding-left: 0; list-style: none; }
.box li ul { margin: 0 0 10px 20px; list-style: none; color: var(--success); }
.box li ul li a { font-weight: normal; font-family: var(--font); }

.smallbox { border-radius: var(--radius); margin: 5px 5px 0; background: var(--bg-card); border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); float: left; width: 225px; }
.smallbox ul { color: var(--text); list-style-position: inside; padding: 0 0 0 10px; font-size: var(--fs-md); }
#box ul { color: var(--text); font-family: var(--font); list-style-position: inside; padding: 0 0 0 5px; font-size: var(--fs-md); margin: 0; }
.ulnaslovna li { font-size: var(--fs-sm); line-height: 1.5; }

.boxhead {
    height: 30px;
    line-height: 30px;
    margin: 0 0 10px;
    padding: 0 10px;
    font-family: var(--font);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.boxhead img { margin: 3px; }


/* ======================================================
   PDF LIST
   ====================================================== */
.pdf-lista { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 6px; background: var(--bg-card); }
.pdf-red {
    padding: 6px 10px;
    border: 1px solid transparent;
    border-top: 1px solid var(--border-light);
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
    line-height: 2;
    font-family: var(--font);
    font-size: var(--fs-base);
    cursor: pointer;
}
.pdf-red:first-child { border-top: 1px solid transparent; }
.pdf-red:hover {
    background: var(--accent);
    border-color: var(--accent-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(217,119,6,0.32);
}
.pdf-red:hover .pdf-red-vel { color: rgba(255,255,255,0.8); }
.pdf-red-vel { color: var(--text-light); margin: 0 4px; }

/* ======================================================
   OPASNOSTI — CHECKLIST
   ====================================================== */
.op-kat-hdr {
    cursor: pointer;
    padding: 8px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 5px;
    margin: 4px 0;
    color: var(--primary);
    font-weight: 700;
    font-family: var(--font);
    font-size: var(--fs-base);
    user-select: none;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.op-kat-hdr:hover {
    background: var(--primary-light);
    border-color: var(--primary-mid);
    border-left-color: var(--primary);
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(30,58,95,0.12);
}

.op-kat-item {
    display: none;
    cursor: pointer;
    margin: 2px 0 2px 22px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-bottom: 1px solid var(--border-light);
    font-family: var(--font);
    font-size: var(--fs-sm);
    color: var(--text);
    border-radius: 3px;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.op-kat-item:hover {
    background: var(--primary-light);
    border-color: rgba(30,58,95,0.18);
    color: var(--primary-dark);
    box-shadow: none;
}

/* ======================================================
   INLINE MJERE PANEL
   ====================================================== */
.op-mjere-panel-wrap {
    margin: 4px 0 8px;
    padding: 10px 14px 8px;
    background: var(--bg-stripe);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 5px;
}
.op-edit-panel {
    margin: 6px 0 8px;
    padding: 10px 14px 8px;
    background: var(--bg-stripe);
    border: 1px solid var(--border);
    border-left: 3px solid #B87333;
    border-radius: 5px;
}
.op-ed-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.op-ed-row label { width: 130px; flex-shrink: 0; font-size: var(--fs-sm); color: var(--text-mid); padding-top: 4px; font-family: var(--font); }
.op-ed-ta { flex: 1; font-size: var(--fs-sm); padding: 3px 6px; border: 1px solid var(--border); border-radius: 3px; resize: vertical; font-family: var(--font); }
.op-ed-sel { flex: 1; font-size: var(--fs-sm); padding: 3px 6px; border: 1px solid var(--border); border-radius: 3px; font-family: var(--font); }
.op-ed-inp { flex: 1; font-size: var(--fs-sm); padding: 3px 6px; border: 1px solid var(--border); border-radius: 3px; font-family: var(--font); }
.op-ed-rizik { font-weight: bold; font-size: var(--fs-md); padding: 2px 8px; background: var(--accent-light); border-radius: 4px; color: var(--accent-dark); }
.op-mil-inner { font-family: var(--font); }
.op-mil-section-label { font-size: var(--fs-xs); font-weight: 700; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.op-mil-row { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.op-mil-added { font-size: var(--fs-sm); color: var(--success); font-family: var(--font); }
.op-mil-mjera {
    display: block;
    padding: 4px 8px;
    margin: 2px 0;
    font-size: var(--fs-sm);
    font-weight: normal;
    color: var(--primary);
    border: 1px solid transparent;
    border-bottom: 1px solid var(--border-light);
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
    font-family: var(--font);
}
.op-mil-mjera:hover {
    background: var(--primary-light);
    border-color: rgba(30,58,95,0.18);
    color: var(--primary-dark);
    box-shadow: none;
    text-decoration: none !important;
}
.op-mil-mjera-added { color: var(--text-light); text-decoration: line-through; pointer-events: none; cursor: default; }
.op-mil-dodate-list .op-mil-row { border-bottom: 1px solid var(--border-light); padding-bottom: 4px; margin-bottom: 2px; }
.op-mil-dodate-list .op-mil-row:last-child { border-bottom: none; }
.op-mil-available-list.op-mil-has-dodate { margin-top: 14px; padding-top: 10px; border-top: 2px solid var(--border); }

/* ======================================================
   JQUERY UI DIALOG
   ====================================================== */
.ui-dialog {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0;
    font-family: var(--font);
    overflow: hidden;
}
.ui-dialog-titlebar {
    background: var(--primary);
    border: none;
    border-radius: 0;
    padding: 10px 14px;
    color: #fff;
}
.ui-dialog-title { font-family: var(--font); font-size: var(--fs-md); font-weight: 700; color: #fff; letter-spacing: 0.02em; }
.ui-dialog-titlebar-close { background: transparent; border: none; color: rgba(255,255,255,0.55); cursor: pointer; right: 8px; top: 50%; margin-top: -10px; }
.ui-dialog-titlebar-close:hover { color: #fff; }
.ui-dialog-titlebar-close .ui-icon-closethick { background-image: none; text-indent: 0; overflow: visible; font-size: var(--fs-lg); line-height: 1; color: rgba(255,255,255,0.6); }
.ui-dialog-content { padding: 16px 18px 8px; background: var(--bg-card); font-family: var(--font); font-size: var(--fs-base); color: var(--text); }
.ui-dialog-buttonpane { background: var(--bg-stripe); border-top: 1px solid var(--border); padding: 8px 14px; margin: 0; }
.ui-dialog-buttonset .ui-button {
    display: inline-block;
    border: 1.5px solid var(--accent);
    padding: 5px 14px;
    background: transparent;
    font-size: var(--fs-base);
    font-weight: 600;
    font-family: var(--font);
    color: var(--accent-dark);
    border-radius: 4px;
    cursor: pointer;
    margin-left: 6px;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.ui-dialog-buttonset .ui-button:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent-dark);
    box-shadow: 0 4px 12px rgba(217,119,6,0.32);
}
.ui-dialog-buttonset .ui-button:first-child {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent-dark);
}
.ui-dialog-buttonset .ui-button:first-child:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent-dark);
    box-shadow: 0 4px 12px rgba(217,119,6,0.32);
}
.ui-widget-overlay { background: #000; opacity: 0.5; }

/* ======================================================
   KOPIRAJ MODAL
   ====================================================== */
.kf-modal { padding: 2px 0; }
.kf-field { margin-bottom: 14px; }
.kf-field label { display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; font-family: var(--font); }
.kf-field input[type="text"] { display: block; width: 100%; box-sizing: border-box; padding: 6px 10px; font-size: var(--fs-base); font-family: var(--font); border: 1px solid var(--border); border-radius: 4px; background: var(--bg-input); color: var(--text); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.kf-field input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217,119,6,0.12); }
.kf-hint { font-size: var(--fs-xs); color: var(--text-light); margin-top: 3px; font-family: var(--font); }
.kf-selected-name { font-size: var(--fs-sm); color: var(--success); font-weight: 600; margin-top: 4px; min-height: 16px; font-family: var(--font); }

/* ======================================================
   LOGIN
   ====================================================== */
.login { display: block; width: 250px; height: 80px; text-align: center; background: var(--bg-card); border-radius: 10px; border: 1px solid var(--border); }
.login a { margin-top: 10px; }
.login label { color: var(--primary); font-weight: bold; font-family: var(--font); font-size: var(--fs-base); width: 100px; text-align: right; float: left; margin-right: 5px; }
.login input:focus { border: 2px solid var(--accent); }

/* ======================================================
   MISC & LAYOUT HELPERS
   ====================================================== */
hr { width: 100%; border: none; border-bottom: 1px solid var(--border-light); margin: 0; }

.dodajpolje { display: block; float: right; margin-right: 30px; color: var(--primary-mid); font-size: var(--fs-md); font-weight: bold; cursor: pointer; transition: color 0.12s; }
.dodajpolje:hover { color: var(--accent); text-decoration: underline; }
.popust { text-decoration: line-through; color: var(--danger); }
.sort { width: 100%; text-align: right; font-size: var(--fs-sm); margin-bottom: 10px; }
.dodajpolje img { border: none; }

.vijest { float: left; width: 100%; margin-left: 20px; font-size: var(--fs-sm); }
.vijest h4 { font-size: var(--fs-lg); }
.vijest img { float: left; display: inline; margin: 5px; }
.vijest p { margin: 0 40px 0 10px; text-indent: 15px; }
.vfooter { float: left; width: 90%; font-size: var(--fs-sm); text-align: right; border-top: 1px solid var(--border); }
.error { color: var(--danger); font-size: 0.625rem; margin: 3px; text-align: center; }
.opis { font-size: var(--fs-md); font-weight: normal; font-family: var(--font); text-indent: 20px; display: block; margin: 5px 15px 0 15px; line-height: 1.55; color: var(--text-mid); }
.razdvoji { margin-bottom: 20px; border-bottom: 1px dotted var(--border); width: 100%; display: block; }
.razdvoji2 { margin-bottom: 20px; border-bottom: 1px dotted var(--border); width: 430px; display: block; }
#vijestilink { font-size: var(--fs-xs); font-family: var(--font); font-weight: bold; }
.rijeci { float: left; width: 100%; text-align: center; font-size: var(--fs-sm); color: var(--text-light); }
table th p { font-size: var(--fs-xl); color: var(--text-mid); float: left; margin-left: 0; list-style-type: disc; }

#text2 { display: block; float: left; clear: both; margin: 5px 0 5px 40px; width: 50%; }
#text2 p { display: block; font-family: var(--font); font-style: italic; color: var(--accent); font-size: var(--fs-sm); }

#hiddenbox { background: var(--bg-card); padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); display: none; position: fixed; top: 50%; left: 50%; z-index: 1001; }
#grayout { width: 100%; height: 100%; position: fixed; top: 0; left: 0; background: #000; opacity: 0.5; z-index: 1000; }

#lista { margin-left: 30px; width: 80%; float: left; margin-top: 10px; }
#lista ul { padding-left: 40px; margin: 0; list-style-position: inside; }
#lista ul li { margin-left: 0; padding-left: 0; margin-top: 2px; list-style: disc; width: 550px; }
#lista ul li p { color: var(--primary); font-family: var(--font); font-weight: bold; font-size: var(--fs-base); margin-top: -5px; }

#vijest { display: block; float: left; clear: left; width: 700px; margin-top: 15px; margin-left: 150px; padding: 10px; background: var(--bg-stripe); border-radius: var(--radius); }
span.lajna { width: 400px; display: block; border-bottom: 1px solid var(--border-light); }
#clanak_div { padding: 3px 7px; height: 120px; display: block; }
#clanak_naslov { font-size: var(--fs-md); font-family: var(--font); font-weight: bold; margin-bottom: 7px; display: block; clear: both; }
.clanak { color: var(--text-mid); font-size: var(--fs-xs); width: 320px; display: inline; font-family: var(--font); }
.clanak_procitaj { float: right; clear: both; margin-right: 3px; }
#firma-link:hover { color: var(--text-mid); }
#firma-link { color: var(--text); }

#kontakttext p { font-weight: bold; font-size: var(--fs-md); margin-left: 20px; font-family: var(--font); color: var(--text); }
#rm { border-radius: 10px; }
#rm p { font-size: var(--fs-sm); }
#rm b { color: var(--text); font-size: var(--fs-lg); }
#rm hr { clear: left; }
#rm h3 { color: var(--text); }

#loginform label { width: auto; }
.drugilvl { display: none; color: var(--text); margin-left: 25px; font-size: var(--fs-xs); border-bottom: 1px solid var(--border-light); margin-bottom: 5px; padding-bottom: 2px; }
.naslov4 { border-bottom: 2px solid var(--border); color: var(--text); margin: 5px 0 10px; padding: 0 0 0 20px; font-family: var(--font); }

.red { width: 100%; border-bottom: 1px solid var(--border); float: left; display: block; margin-top: 10px; padding: 5px; }
.red ul { float: left; padding: 0; list-style-position: inside; font-size: var(--fs-md); margin-left: 10px; }
.red img { border: 2px solid var(--border); margin: 0 10px; }

.sredina { border-collapse: collapse; font-size: var(--fs-xs); font-family: var(--font); text-align: center; margin-bottom: 10px; }
.sredina th[title="naslov"] { font-size: var(--fs-md); }
.pnr label { width: 270px; }
.dsredinu label { display: block; width: 100%; text-align: left; color: var(--text); }
.dsredinu #forma label { width: 120px; text-align: center; }
.dsredinu a { display: block; color: var(--primary); font-weight: bold; font-family: var(--font); font-size: var(--fs-sm); cursor: pointer; }
.dsredinu fieldset { margin-left: 0; padding-top: 5px; border: none; }
.firmastanje label { width: auto; float: none; }
.firmastanje input[type="radio"] { float: none; clear: none; }

/* ======================================================
   INLINE ADD PANEL (rm fieldsets)
   ====================================================== */
.rm-inline-panel {
    float: none;
    clear: both;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 6px;
    margin: 6px 0 10px;
    padding: 12px 16px 14px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    box-sizing: border-box;
}

/* Override float-based fieldset label layout → stacked block */
.rm-inline-panel > label:not(.radio-label) {
    float: none;
    clear: both;
    width: 100%;
    display: block;
    text-align: left;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 0 4px;
    line-height: 1;
}
.rm-inline-panel > label:not(.radio-label):first-child { padding-top: 0; }

/* Full-width block inputs */
.rm-inline-panel input[type="text"],
.rm-inline-panel textarea {
    width: 100%;
    float: none;
    clear: both;
    display: block;
    box-sizing: border-box;
    margin-bottom: 0;
}

/* Hide <br> separators — block layout renders them unnecessary */
.rm-inline-panel br { display: none; }

/* Radio group inside panel — reset margin, keep inline flow */
.rm-inline-panel > .radio-label {
    margin-left: 0;
    margin-right: 6px;
    margin-bottom: 8px;
}

/* Action buttons row */
.rm-inline-panel .rip-actions {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.rm-inline-section {
    clear: both;
    background: var(--primary);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 4px 10px;
    margin: 12px -16px 10px;
    border-radius: 0;
}
.radio-label:has(input[value="Postoji"]:checked) { background: var(--success); color: #fff; border-color: var(--success); }
.radio-label:has(input[value="Ne postoji"]:checked) { background: var(--danger); color: #fff; border-color: var(--danger); }

#dradnika input { clear: none; float: none; }
#dpodkat { text-decoration: none; }
#container ul li #dpodkat:hover { text-decoration: none; }
#eviadd label { width: 250px; }
#podaci b { font-weight: normal; }

#container ul { font-size: var(--fs-md); font-weight: bold; list-style: none; color: var(--primary); }
#container ul #drugilvl { margin-left: 20px; font-family: var(--font); font-size: var(--fs-sm); color: var(--text); }
#container li:hover { color: var(--accent); text-decoration: underline; cursor: pointer; }
#container ul { list-style: none; }
#container ul li { color: var(--primary); font-weight: bold; font-family: var(--font); cursor: pointer; }
#container ul li:hover { color: var(--accent); }

#text { margin-left: 30px; text-indent: 30px; display: inline; width: 60%; float: left; }
#text p { color: var(--text-mid); font-family: var(--font); font-weight: bold; font-size: var(--fs-sm); }

/* ======================================================
   ADMIN
   ====================================================== */
#korisnik { display: block; margin-top: 5px; width: 100%; color: var(--danger); font-size: var(--fs-md); font-weight: bolder; font-family: var(--font); }
#navigacija-admin { display: block; clear: left; float: left; height: 400px; margin-top: 30px; }
#navigacija-admin ul li { padding: 2px 2px 2px 5px; margin: 2px; font-size: var(--fs-md); font-family: var(--font); background: var(--bg-card); width: 179px; }
#navigacija-admin li a { font-family: var(--font); position: relative; left: 5px; }
#navigacija-admin ul li a:active { color: var(--danger); }
#adminvijest { display: block; height: 150px; margin-bottom: 15px; padding: 0; border-bottom: 1px solid var(--border); width: 350px; }
#adminvijest .naslov { color: var(--text); font-size: var(--fs-md); font-family: var(--font); font-weight: bold; margin-bottom: 5px; display: block; clear: both; }
#adminvijest .clanak { color: var(--text-mid); font-size: var(--fs-sm); width: 320px; display: inline; }

/* ======================================================
   JQUERY UI AUTOCOMPLETE — override
   ====================================================== */
.ui-autocomplete {
    position: absolute;
    z-index: 9999;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 4px 0;
    font-family: var(--font);
    font-size: var(--fs-base);
    color: var(--text);
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    list-style: none;
    margin: 0;
}
.ui-autocomplete .ui-menu-item {
    margin: 0;
    padding: 0;
}
.ui-autocomplete .ui-menu-item-wrapper {
    display: block;
    padding: 7px 14px;
    cursor: pointer;
    color: var(--text);
    font-family: var(--font);
    font-size: var(--fs-base);
    font-weight: 400;
    line-height: 1.4;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ui-autocomplete .ui-menu-item-wrapper.ui-state-active,
.ui-autocomplete .ui-menu-item-wrapper.ui-state-focus,
.ui-autocomplete .ui-state-hover > .ui-menu-item-wrapper,
.ui-autocomplete .ui-menu-item:hover > .ui-menu-item-wrapper,
.ui-autocomplete li.ui-state-focus .ui-menu-item-wrapper,
.ui-autocomplete li.ui-state-active .ui-menu-item-wrapper {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 500;
    border: none !important;
    outline: none;
    box-shadow: none !important;
    margin: 0 !important;
}
.ui-autocomplete .ui-menu-divider {
    margin: 4px 0;
    height: 0;
    border-top: 1px solid var(--border-light);
}

/* Input koji se koristi za autocomplete pretragu (van fieldset-a) */
input#acfirma,
input.ac-input {
    border: 1.5px solid var(--border);
    border-radius: 5px;
    padding: 5px 10px;
    font-family: var(--font);
    font-size: var(--fs-base);
    background: var(--bg-input);
    color: var(--text);
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
    height: 31px;
}
input#acfirma:focus,
input.ac-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.15);
    background: var(--bg-card);
}

/* Select u toolbar redu (pregled.php) — ista visina kao input */
#selectFirma {
    height: 31px;
    box-sizing: border-box;
    padding: 0 10px;
}

/* ======================================================
   RESPONSIVE
   ====================================================== */

/* Fluid container when viewport < 1040px */
@media (max-width: 1040px) {
    #headimg       { width: 100% !important; }
    #header-banner { width: 100%; }
    #poz1          { width: 100%; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
}

/* Mobile — ≤ 768px */
@media (max-width: 768px) {

    /* Header */
    #header-banner { height: 76px; padding-left: 16px; }
    .header-brand  { font-size: 2rem; letter-spacing: 1px; }
    .header-shapes, #fire-canvas { display: none; }

    /* Container */
    #poz1 { padding: 0 10px 20px; }

    /* Navigation — wrap inline links */
    #navigacija {
        height: auto;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 0 8px;
    }
    #navigacija ul {
        display: flex;
        flex-wrap: wrap;
        float: none;
        height: auto;
        width: auto;
        flex: 1;
        text-align: left;
    }
    #navigacija ul li {
        height: auto;
        float: none;
        padding: 7px 10px;
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    #navigacija ul li a  { padding-top: 0; height: auto; line-height: 1.4; }
    #navigacija .nav-home       { height: auto; line-height: 1.4; padding: 8px 10px; }
    #navigacija .nav-logout     { float: none; margin: 6px 8px; }
    #navigacija .nav-istekli-akti { line-height: 1.4; margin: 4px 6px; }

    /* Firma rows — stack label over value */
    .firma-row   { flex-wrap: wrap; }
    .firma-label { flex: 0 0 100%; margin-bottom: 2px; }
    .firma-value { flex: 1; }

    /* Fieldset — switch label float to block */
    fieldset label {
        float: none;
        width: 100%;
        display: block;
        text-align: left;
        margin-right: 0;
        line-height: 1.5;
    }
    fieldset label:has(input[type="radio"]),
    fieldset label:has(input[type="checkbox"]) {
        width: auto;
        display: inline-flex;
    }
    fieldset input[type="text"],
    fieldset input[type="password"],
    fieldset input[type="number"],
    fieldset input[type="email"],
    fieldset textarea { float: none; width: 100%; box-sizing: border-box; clear: both; }
    fieldset input[type="file"] { float: none; width: 100%; box-sizing: border-box; }
    fieldset select  { width: 100%; }

    /* Form rows */
    .form-row { flex-wrap: wrap; }
    .form-row > label:first-child {
        flex: 0 0 100% !important;
        min-width: unset !important;
        max-width: unset !important;
    }
    .form-row:has(select) > label:first-child { flex: 0 0 100% !important; }
    .form-row input[type="text"],
    .form-row input[type="file"] { flex: 0 0 100% !important; width: 100% !important; }
    .form-row select   { width: 100%; }
    .form-row textarea { width: 100%; }

    /* Tables — horizontal scroll */
    .tabela,
    .sredina { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .egi-lok-lista { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Op edit rows */
    .op-ed-row { flex-wrap: wrap; }
    .op-ed-row label { width: 100%; padding-top: 0; }

    /* Misc legacy elements */
    .half      { width: 100%; float: none; }
    #lista ul li { width: auto; }
    .box       { float: none; width: 100%; margin: 0 0 10px 0; }
    .smallbox  { float: none; width: 100%; margin: 0 0 10px 0; }
    #vijest    { width: 100%; margin-left: 0; }
    .razdvoji2 { width: 100%; }

    /* Search / toolbar inputs */
    #acfirma    { width: 100% !important; box-sizing: border-box; }
    #selectFirma { width: 100% !important; height: 38px; }

    /* Pencil/edit icons — uvijek vidljivi na touch ekranima */
    .firma-edit { opacity: 0.55; }

    /* Op checklist — manji indent na uskim ekranima */
    .op-kat-item { margin-left: 8px; }
}

/* Small phones — ≤ 480px */
@media (max-width: 480px) {
    #header-banner  { height: 64px; padding-left: 12px; }
    .header-brand   { font-size: 1.6rem; }
    .header-tagline { font-size: 0.5rem; letter-spacing: 2px; }
    #poz1 { padding: 0 8px 16px; }

    #navigacija ul li a,
    #navigacija .nav-home { font-size: var(--fs-sm); }
}
