/* ============================================================
   Grad Vinkovci CMS – administracija
   ============================================================ */

:root {
    --blue-900: #07294a;
    --blue-800: #0a3a6b;
    --blue-700: #0a4d8c;
    --blue-600: #1273c4;
    --vk-yellow: #FFDD03;
    --gold-500: #e8b021;
    --ink: #1c2733;
    --ink-soft: #51606f;
    --bg: #f5f8fb;
    --border: #e0e5ea;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
}

a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----- Login ----- */
.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
}

.login-box {
    background: #fff;
    border-radius: 14px;
    padding: 36px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-box__head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.login-box__head img { width: 48px; height: auto; }
.login-box__head h1 { margin: 0; font-size: 20px; color: var(--blue-800); line-height: 1.2; }
.login-box__head h1 span { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.login-box label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.login-box__back { text-align: center; margin-top: 18px; font-size: 13px; }

/* ----- Layout ----- */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    height: 100dvh;
    flex-shrink: 0;
    background: var(--blue-900);
    color: #cbd8e4;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px 16px;
    border-bottom: 3px solid var(--vk-yellow);
    color: #fff;
    flex-shrink: 0;
}
.sidebar__brand img { width: 34px; height: auto; }
.sidebar__brand strong { font-size: 15px; display: block; line-height: 1.2; }
.sidebar__brand span { font-size: 11px; color: #9fb4c7; }

.sidebar nav {
    padding: 14px 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.sidebar nav a {
    display: block;
    padding: 11px 20px;
    color: #cbd8e4;
    font-weight: 500;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--blue-700); color: #fff; border-left: 4px solid var(--vk-yellow); padding-left: 16px; }

.sidebar__foot {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: 13px;
    flex-shrink: 0;
}
.sidebar__foot a { color: #9fb4c7; }

.main { flex: 1; margin-left: 240px; padding: 28px 36px; min-width: 0; }

.main__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.main__head h1 { margin: 0; font-size: 24px; color: var(--blue-800); }

/* ----- Komponente ----- */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 20px;
}

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-tile { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-tile strong { display: block; font-size: 30px; color: var(--blue-700); }
.stat-tile span { color: var(--ink-soft); font-size: 13px; }

table.data {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { background: #eef3f8; color: var(--blue-800); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #f8fafc; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge--on { background: #e2f5e9; color: #157a3c; }
.badge--off { background: #fdebec; color: #b00020; }
.badge--cat { background: #fff6d6; color: #8a6a00; }

/* ----- Forme ----- */
label { display: block; margin-bottom: 16px; font-weight: 600; font-size: 13px; color: var(--ink-soft); }

input[type="text"], input[type="password"], input[type="email"], input[type="date"],
input[type="number"], input[type="url"], select, textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #ccd4dc;
    border-radius: 8px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(18,115,196,.15);
}

textarea { min-height: 120px; resize: vertical; }
textarea.tall { min-height: 320px; font-family: Consolas, monospace; font-size: 13px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.checkbox-label input { width: auto; margin: 0; }

/* ----- Gumbi ----- */
.btn-primary, .btn-secondary, .btn-danger {
    display: inline-block;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--blue-700); color: #fff; }
.btn-primary:hover { background: var(--blue-600); text-decoration: none; }
.btn-secondary { background: #e8edf2; color: var(--blue-800); }
.btn-secondary:hover { background: #dde4eb; text-decoration: none; }
.btn-danger { background: #fdebec; color: #b00020; }
.btn-danger:hover { background: #f9d2d6; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ----- Poruke ----- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 500; }
.alert--success { background: #e2f5e9; color: #157a3c; border: 1px solid #b6e6c8; }
.alert--error { background: #fdebec; color: #b00020; border: 1px solid #f5c2c8; }

/* ----- Odabir ikone ----- */
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-option { display: inline-block; margin: 0; cursor: pointer; }
.icon-option input { position: absolute; opacity: 0; pointer-events: none; }
.icon-option span {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--blue-700);
    background: #fff;
    transition: border-color .15s, background .15s;
}
.icon-option:hover span { border-color: var(--blue-600); }
.icon-option input:checked + span { border-color: var(--blue-700); background: #e7f1fa; box-shadow: 0 0 0 3px rgba(18,115,196,.15); }

.img-preview { max-width: 220px; border-radius: 8px; border: 1px solid var(--border); display: block; margin-top: 8px; }
.video-preview { max-width: 360px; border-radius: 8px; border: 1px solid var(--border); display: block; margin-top: 8px; }

.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline; }

/* ----- Drag & drop izbornik ----- */
.menu-sort-head { display: flex; align-items: center; gap: 14px; }
.menu-sort-status { font-size: 13px; font-weight: 600; color: #157a3c; }
.menu-sort-status--error { color: #b00020; }
.menu-sort-hint { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

ul.menu-sort { list-style: none; margin: 0 0 28px; padding: 0; }
ul.menu-sort:empty,
ul.menu-sort--children:empty { min-height: 12px; }

.menu-sort__item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(16,42,67,.05);
}
.menu-sort__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}
.menu-sort__handle {
    cursor: grab;
    color: #97a4b1;
    font-size: 17px;
    user-select: none;
    line-height: 1;
    padding: 4px 2px;
}
.menu-sort__handle:active { cursor: grabbing; }
.menu-sort__title { min-width: 160px; }
.menu-sort__link { flex: 1; font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-sort__actions { margin-left: auto; }

ul.menu-sort--children {
    margin: 0 0 10px 42px;
    padding: 2px 0 2px 12px;
    border-left: 2px dashed #ccd4dc;
    min-height: 12px;
}
ul.menu-sort--children .menu-sort__item { background: #f8fafc; }

.menu-sort__item--ghost { opacity: .45; background: #e7f1fa; border-color: var(--blue-600); }

#menuTopbarList .menu-sort__item { background: #fffdf3; }

@media (max-width: 880px) {
    .admin-layout { flex-direction: column; }
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        overflow: visible;
    }
    .sidebar nav {
        overflow-y: visible;
        min-height: auto;
    }
    .main { margin-left: 0; padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
}
