/* ============================================================
   GRADILIŠTE — stilovi
   Dark, miran interfejs: antracit + smaragdni akcenti
   ============================================================ */

:root {
    --bg: #111318;
    --bg-soft: #14171e;
    --panel: #171b24;
    --panel-2: #1d2230;
    --panel-3: #232937;
    --border: #262c3a;
    --border-soft: #20263355;
    --text: #e8edf5;
    --muted: #97a1b2;
    --muted-2: #6f7a8c;
    --accent: #10b981;
    --accent-2: #34d399;
    --accent-soft: rgba(16, 185, 129, 0.13);
    --accent-line: rgba(16, 185, 129, 0.35);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.12);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.12);
    --radius-lg: 20px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 20px 45px rgba(0, 0, 0, 0.38);
    --font-head: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(1200px 500px at 85% -10%, rgba(16, 185, 129, 0.07), transparent 60%),
        radial-gradient(900px 500px at 0% 0%, rgba(96, 165, 250, 0.05), transparent 55%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.2;
    margin: 0;
    letter-spacing: -0.01em;
}

p {
    margin: 0 0 10px;
}

a {
    color: var(--accent-2);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

svg {
    display: block;
}

.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 22px;
}

/* ---------- TOPBAR ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(17, 19, 24, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 72px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    flex-shrink: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand-badge {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #12c48b, #0a8f66);
    color: #04140e;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.28);
}

.brand-badge svg {
    width: 23px;
    height: 23px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-text small {
    font-size: 11.5px;
    color: var(--muted-2);
    margin-top: 3px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav::-webkit-scrollbar {
    display: none;
}

.nav a {
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav a:hover {
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
}

.nav a.is-active {
    background: var(--accent-soft);
    color: var(--accent-2);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    color: #d7fbed;
    background: linear-gradient(145deg, #233347, #182a2b);
    border: 1px solid #2d3d44;
}

.user-chip-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-chip-text strong {
    font-size: 13px;
    font-weight: 600;
}

.user-chip-text small {
    font-size: 11px;
    color: var(--muted-2);
}

.logout-form {
    margin: 0;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn:hover {
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.4);
    background: var(--danger-soft);
}

/* ---------- STRANICA ---------- */

.page {
    padding: 30px 0 64px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.page-head h1 {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
}

.page-head .subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    max-width: 720px;
}

/* ---------- DUGMAD ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 11px;
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: linear-gradient(145deg, #17c98d, #0b9f70);
    color: #041810;
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.22);
}

.btn-primary:hover {
    background: linear-gradient(145deg, #2ad79b, #10b981);
}

.btn-secondary {
    background: var(--panel-2);
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: #3a4356;
    background: var(--panel-3);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--muted);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: #3a4356;
}

.btn-danger {
    background: var(--danger-soft);
    border-color: rgba(248, 113, 113, 0.32);
    color: #fda4a4;
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
}

.btn-sm {
    padding: 7px 11px;
    font-size: 12.5px;
    border-radius: 9px;
}

.btn-block {
    width: 100%;
}

.btn-icon-only {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 9px;
}

/* ---------- PANELI / KARTICE ---------- */

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.panel + .panel {
    margin-top: 18px;
}

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

.panel-head h2,
.panel-head h3 {
    font-size: 17px;
    font-weight: 700;
}

.panel-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12.5px;
}

/* ---------- ALERTI ---------- */

.alert {
    border-radius: var(--radius);
    padding: 13px 16px;
    margin-bottom: 16px;
    font-size: 13.5px;
    border: 1px solid var(--border);
    background: var(--panel);
}

.alert-success {
    background: var(--accent-soft);
    border-color: rgba(16, 185, 129, 0.35);
    color: #7ef0c3;
}

.alert-error,
.alert-danger {
    background: var(--danger-soft);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fda4a4;
}

.alert-info {
    background: var(--info-soft);
    border-color: rgba(96, 165, 250, 0.35);
    color: #a9ccff;
}

.alert-warning {
    background: var(--warn-soft);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fbdc86;
}

/* ---------- STATISTIKA ---------- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}

.stat::after {
    content: '';
    position: absolute;
    inset: auto -30% -60% auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12), transparent 70%);
}

.stat-label {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 4px;
}

.stat-value.accent {
    color: var(--accent-2);
}

.stat-value.warn {
    color: var(--warn);
}

.stat-value.info {
    color: var(--info);
}

/* ---------- TABOVI ---------- */

.tabs {
    display: inline-flex;
    gap: 5px;
    padding: 5px;
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 13px;
    margin-bottom: 20px;
    max-width: 100%;
    overflow-x: auto;
}

.tab {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.tab:hover {
    color: var(--text);
}

.tab.is-active {
    background: var(--accent-soft);
    color: var(--accent-2);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

/* ---------- FORME ---------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field > label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.field .req {
    color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    background: #12151d;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 11px 13px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-height: 44px;
}

textarea {
    min-height: 118px;
    resize: vertical;
    line-height: 1.55;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2397a1b2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

input::placeholder,
textarea::placeholder {
    color: #5b6577;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
    width: 17px;
    height: 17px;
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.form-grid .span-2 {
    grid-column: span 2;
}

.field-hint {
    font-size: 12px;
    color: var(--muted-2);
    margin-top: 2px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.form-actions.between {
    justify-content: space-between;
}

/* ---------- FILTERI ---------- */

.filters {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 16px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 12px;
    align-items: end;
}

.filters-grid .search-cell {
    grid-column: span 2;
}

.quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    align-items: center;
}

.quick-chips .label {
    font-size: 12px;
    color: var(--muted-2);
    margin-right: 2px;
}

.chip-btn {
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--muted);
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.15s ease;
}

.chip-btn:hover {
    color: var(--text);
    border-color: #3a4356;
}

.chip-btn.is-active {
    background: var(--accent-soft);
    border-color: var(--accent-line);
    color: var(--accent-2);
}

/* ---------- GRUPNE AKCIJE ---------- */

.bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.bulk-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}

.bulk-info strong {
    color: var(--text);
}

.bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.check-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

/* ---------- BADGE ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.015em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
}

.badge-new {
    background: var(--info-soft);
    border-color: rgba(96, 165, 250, 0.3);
    color: #8ec2ff;
}

.badge-reviewed {
    background: rgba(167, 139, 250, 0.13);
    border-color: rgba(167, 139, 250, 0.3);
    color: #c4b5fd;
}

.badge-rework {
    background: var(--warn-soft);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fbd582;
}

.badge-approved {
    background: var(--accent-soft);
    border-color: var(--accent-line);
    color: #6fe7b8;
}

.badge-active {
    background: var(--accent-soft);
    border-color: var(--accent-line);
    color: #6fe7b8;
}

.badge-completed {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
}

.badge-paused {
    background: var(--warn-soft);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fbd582;
}

.badge-inactive {
    background: var(--danger-soft);
    border-color: rgba(248, 113, 113, 0.3);
    color: #fda4a4;
}

.badge-cat {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.22);
    color: #cbd5e1;
}

.badge-cat::before {
    display: none;
}

/* ---------- LISTA UNOSA ---------- */

.entries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 16px;
}

.entry-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
}

.entry-card:hover {
    border-color: #35405a;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

.entry-card.is-selected {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 1px var(--accent-line) inset;
}

.entry-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 16px 0;
    flex-wrap: wrap;
}

.entry-top .spacer {
    flex: 1;
}

.entry-title {
    padding: 12px 16px 0;
}

.entry-title h3 {
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 8px 16px 0;
    font-size: 12.5px;
    color: var(--muted);
}

.entry-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.entry-meta svg {
    width: 13px;
    height: 13px;
    opacity: 0.7;
    flex-shrink: 0;
}

.entry-note {
    margin: 12px 16px 0;
    color: #c3ccdb;
    font-size: 13.5px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.entry-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 14px 16px 0;
}

.thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 9px;
    overflow: hidden;
    background: var(--panel-2);
    border: 1px solid var(--border-soft);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.thumb:hover img {
    transform: scale(1.06);
}

.thumb-more {
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: var(--panel-2);
}

.thumb-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

.entry-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 16px;
    margin-top: auto;
    flex-wrap: wrap;
}

.entry-footer .hint {
    font-size: 12px;
    color: var(--muted-2);
}

.checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrap input {
    width: 17px;
    height: 17px;
}

/* ---------- EMPTY / LOADING ---------- */

.empty {
    text-align: center;
    padding: 56px 22px;
    color: var(--muted);
    background: var(--panel);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

.empty svg {
    width: 42px;
    height: 42px;
    margin: 0 auto 12px;
    opacity: 0.5;
}

.empty h3 {
    color: var(--text);
    font-size: 17px;
    margin-bottom: 6px;
}

.empty p {
    font-size: 13.5px;
    max-width: 460px;
    margin: 0 auto;
}

.loading-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--muted);
    font-size: 13.5px;
}

.spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- TABELE ---------- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 660px;
}

table.data th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted-2);
    background: var(--panel-2);
    white-space: nowrap;
}

table.data td {
    padding: 13px 14px;
    border-top: 1px solid var(--border-soft);
    vertical-align: middle;
}

table.data tbody tr:hover {
    background: #ffffff04;
}

table.data td .row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cell-strong {
    font-weight: 600;
}

.cell-sub {
    display: block;
    font-size: 12px;
    color: var(--muted-2);
    margin-top: 2px;
}

/* ---------- ADMIN: GRADILIŠTA ---------- */

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 18px;
    align-items: start;
}

.site-list {
    display: grid;
    gap: 14px;
}

.site-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.site-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.site-card h3 {
    font-size: 16px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.site-code {
    display: inline-block;
    margin-top: 5px;
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-size: 11.5px;
    letter-spacing: 0.04em;
    color: var(--accent-2);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: 6px;
    padding: 1px 7px;
}

.site-card .addr {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--muted);
    display: flex;
    gap: 7px;
    align-items: flex-start;
}

.site-card .addr svg {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex-shrink: 0;
    opacity: 0.7;
}

.site-desc {
    margin: 8px 0 0;
    font-size: 13px;
    color: #b9c2d0;
    line-height: 1.5;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 9px;
    border-radius: 7px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: #c7d0de;
}

.chip-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.chip-empty {
    color: var(--muted-2);
    font-style: italic;
    font-size: 12px;
    padding: 4px 0;
}

.site-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}

/* ---------- DETALJI (MODAL) ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    padding: 24px 18px;
    background: rgba(5, 8, 13, 0.74);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-backdrop.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal {
    width: min(760px, 100%);
    margin: auto;
    background: #161a23;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    animation: modalIn 0.18s ease;
}

.modal-lg {
    width: min(1020px, 100%);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to { opacity: 1; transform: none; }
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--border-soft);
}

.modal-head h2 {
    font-size: 19px;
    font-weight: 700;
}

.modal-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12.5px;
}

.modal-close {
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--muted);
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 9px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.modal-close:hover {
    color: var(--text);
    border-color: #3a4356;
}

.modal-body {
    padding: 20px 22px 22px;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 22px;
    align-items: start;
}

.detail-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

.detail-note {
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #cbd4e1;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.detail-note.empty-note {
    color: var(--muted-2);
    font-style: italic;
}

.detail-section-title {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin: 20px 0 10px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.gallery a {
    display: block;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--panel-2);
    border: 1px solid var(--border-soft);
}

.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-list {
    display: grid;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border: 1px solid var(--border-soft);
    background: var(--panel);
    border-radius: 10px;
    color: var(--text);
}

.file-item:hover {
    border-color: #3a4356;
    text-decoration: none;
}

.file-ico {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--panel-2);
    color: var(--accent-2);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    text-transform: uppercase;
}

.file-item .file-name {
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.file-item .file-size {
    font-size: 11px;
    color: var(--muted-2);
    margin-top: 2px;
}

.file-item > .file-text {
    min-width: 0;
    flex: 1;
}

.detail-side {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.detail-side h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 12.5px;
}

.info-row:last-of-type {
    border-bottom: 0;
}

.info-row dt,
.info-row .k {
    color: var(--muted-2);
    flex-shrink: 0;
}

.info-row dd,
.info-row .v {
    margin: 0;
    text-align: right;
    color: var(--text);
    overflow-wrap: anywhere;
}

.manager-comment {
    margin-top: 8px;
    background: var(--warn-soft);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12.5px;
    color: #f3d489;
    white-space: pre-line;
}

/* ---------- LIGHTBOX ---------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 4, 8, 0.92);
}

.lightbox.is-open {
    display: flex;
}

.lightbox img {
    max-width: 94vw;
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #333c4d;
    background: #1b202b;
    color: #e8edf5;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}

/* ---------- TOAST ---------- */

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-width: min(380px, calc(100vw - 36px));
}

.toast {
    background: #1b202b;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 11px;
    padding: 12px 15px;
    font-size: 13px;
    color: var(--text);
    box-shadow: var(--shadow);
    animation: toastIn 0.2s ease;
    overflow-wrap: anywhere;
}

.toast.toast-error {
    border-left-color: var(--danger);
}

.toast.toast-info {
    border-left-color: var(--info);
}

.toast.is-hiding {
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.25s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ---------- LOGIN ---------- */

.login-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    gap: 20px;
    background:
        radial-gradient(800px 420px at 50% -10%, rgba(16, 185, 129, 0.14), transparent 65%),
        radial-gradient(700px 400px at 90% 100%, rgba(96, 165, 250, 0.07), transparent 60%),
        var(--bg);
}

.login-card {
    width: min(430px, 100%);
    background: rgba(23, 27, 36, 0.92);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 34px 30px 30px;
    box-shadow: var(--shadow);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.login-brand .brand-badge {
    width: 46px;
    height: 46px;
}

.login-brand strong {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 800;
    display: block;
    letter-spacing: -0.02em;
}

.login-brand small {
    display: block;
    color: var(--muted-2);
    font-size: 12px;
    margin-top: 3px;
}

.login-card h1 {
    font-size: 23px;
    font-weight: 800;
    margin-bottom: 6px;
}

.login-card .lead {
    color: var(--muted);
    font-size: 13.5px;
    margin-bottom: 22px;
}

.login-card form {
    display: grid;
    gap: 14px;
}

.login-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
}

.login-hint {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 11px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    font-size: 12px;
    color: #93e9c6;
    line-height: 1.6;
}

.login-hint code {
    font-family: ui-monospace, Consolas, monospace;
    background: rgba(0, 0, 0, 0.25);
    padding: 1px 5px;
    border-radius: 4px;
    color: #c9ffe9;
}

.login-foot {
    color: var(--muted-2);
    font-size: 12px;
    text-align: center;
}

/* ---------- NOVI UNOS ---------- */

.form-shell {
    max-width: 900px;
    margin: 0 auto;
}

.upload-box {
    border: 1.5px dashed #35405a;
    border-radius: var(--radius);
    padding: 26px 20px;
    text-align: center;
    background: #12151d;
    transition: border-color 0.15s ease, background 0.15s ease;
    cursor: pointer;
    display: block;
}

.upload-box:hover,
.upload-box.is-drag {
    border-color: var(--accent-line);
    background: rgba(16, 185, 129, 0.05);
}

.upload-box svg {
    width: 30px;
    height: 30px;
    margin: 0 auto 10px;
    color: var(--accent);
    opacity: 0.9;
}

.upload-box strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.upload-box span {
    font-size: 12px;
    color: var(--muted-2);
    line-height: 1.55;
    display: block;
}

.upload-box input[type="file"] {
    display: none;
}

.file-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--panel-2);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .preview-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    text-align: center;
    height: 100%;
    font-size: 9.5px;
    color: var(--muted);
    line-height: 1.3;
    word-break: break-word;
}

.preview-item .preview-file b {
    font-size: 11px;
    color: var(--accent-2);
    letter-spacing: 0.04em;
}

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 0;
    background: rgba(8, 10, 15, 0.78);
    color: #fda4a4;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.preview-badge {
    position: absolute;
    left: 5px;
    bottom: 5px;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(8, 10, 15, 0.8);
    color: #9beac9;
    font-size: 9px;
    font-weight: 600;
}

.upload-status {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 12px;
    min-height: 20px;
}

.progress {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: var(--panel-2);
    overflow: hidden;
    margin-top: 10px;
    display: none;
}

.progress.is-visible {
    display: block;
}

.progress > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #0f9f72, #34d399);
    transition: width 0.2s ease;
}

/* ---------- DETALJI UNOSA (ŠEF) ---------- */

.entry-card-note {
    margin: 12px 16px 0;
    background: var(--warn-soft);
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 9px;
    padding: 9px 11px;
    font-size: 12.5px;
    color: #f0d492;
    white-space: pre-line;
}

.entry-card-note b {
    color: #f8e2ab;
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
}

/* ---------- FOOTER ---------- */

.footer {
    border-top: 1px solid var(--border);
    padding: 18px 0 26px;
    margin-top: 10px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted-2);
}

/* ---------- RESPONSIVE ---------- */

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

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

    .filters-grid .search-cell {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .topbar-inner {
        flex-wrap: wrap;
        gap: 10px 14px;
        padding-top: 9px;
        padding-bottom: 9px;
    }

    .brand-text small {
        display: none;
    }

    .nav {
        order: 3;
        width: 100%;
        margin-left: 0;
        padding-bottom: 2px;
    }

    .nav a {
        padding: 7px 12px;
        font-size: 13px;
    }

    .topbar-user {
        margin-left: auto;
    }

    .user-chip-text {
        display: none;
    }

    .page {
        padding: 20px 0 46px;
    }

    .container {
        padding: 0 15px;
    }

    .panel {
        padding: 18px;
        border-radius: 16px;
    }

    .filters {
        padding: 15px;
    }

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

    .filters-grid .search-cell {
        grid-column: span 2;
    }

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

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

    .stat {
        padding: 14px 15px;
    }

    .stat-value {
        font-size: 24px;
    }

    .bulk-bar {
        padding: 12px 14px;
    }

    .bulk-actions {
        width: 100%;
    }

    .bulk-actions .btn {
        flex: 1;
    }

    .gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    .modal-backdrop {
        padding: 12px 10px;
    }

    .modal-head,
    .modal-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .toast-stack {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }

    .form-grid .span-2 {
        grid-column: span 1;
    }

    .page-head {
        align-items: flex-start;
    }

    .page-head .btn {
        width: 100%;
    }

    .login-card {
        padding: 26px 20px 24px;
    }
}

@media (max-width: 480px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }

    .filters-grid .search-cell {
        grid-column: span 1;
    }

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

    .site-card-actions .btn {
        flex: 1;
    }
}

/* ============================================================
   Dodaci: administracija i sitne korekcije
   ============================================================ */

.site-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    background: #12151d;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
    max-height: 240px;
    overflow-y: auto;
}

.site-checks .checkbox-wrap {
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.4;
    padding: 3px 0;
}

.site-checks .checkbox-wrap input {
    margin-top: 2px;
    flex-shrink: 0;
}

.thumb .thumb-more {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 16, 0.64);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    backdrop-filter: blur(1px);
}

dl.info-row {
    margin: 0;
}

.preview-item .preview-file span {
    max-height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

@media (max-width: 760px) {
    .site-checks {
        grid-template-columns: 1fr;
        max-height: 210px;
    }
}
