/* Mirnovec admin – navy + yellow from the app prototype; light work area for long editing sessions. */
:root {
  --navy: #0B1522;
  --navy2: #16243A;
  --navy-line: #22324A;
  --accent: #FFE012;
  --on-accent: #0B1220;
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --text: #121A26;
  --muted: #5F6B7D;
  --line: #DDE2EA;
  --ok: #1F8A4C;
  --ok-bg: #E5F5EC;
  --warn: #9A6400;
  --warn-bg: #FFF4D6;
  --bad: #B42318;
  --bad-bg: #FDECEA;
  --info-bg: #E8F0FB;
  --radius: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: #1F4FD1; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
code { background: #EEF1F5; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ── Layout ─────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #C7CFDB; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; color: #fff; font-weight: 700; font-size: 15px; }
.brand img { width: 34px; height: 34px; }
.brand small { display: block; color: #9FAABB; font-weight: 500; font-size: 11px; }
.nav-group { margin: 14px 8px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6F7D92; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: #C7CFDB; }
.nav a:hover { background: var(--navy2); text-decoration: none; color: #fff; }
.nav a.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.side-foot { margin-top: 24px; padding: 12px 8px 0; border-top: 1px solid var(--navy-line); font-size: 12px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot form { display: inline; }
.side-foot button { background: none; border: 0; color: #9FAABB; padding: 0; cursor: pointer; font: inherit; }
.side-foot button:hover, .side-foot a:hover { color: #fff; }
.side-foot a { color: #9FAABB; }

.main { padding: 24px 28px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Cards / grid ───────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 2px; }
.stat .hint { color: var(--muted); font-size: 12px; }

/* ── Forms ──────────────────────────────────────────── */
label { display: block; font-weight: 600; font-size: 12px; margin-bottom: 4px; color: #2B3545; }
.field { margin-bottom: 14px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #C9D0DB; border-radius: 8px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #FFE01280; border-color: #B79E00; }
textarea { min-height: 84px; resize: vertical; }
input[type=file] { font: inherit; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.check input { width: 16px; height: 16px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 140px; }
.filters .grow { flex: 1; min-width: 200px; }
.form-foot { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding-top: 6px; flex-wrap: wrap; }
.inline { display: inline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid #C9D0DB;
  background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #F0F2F6; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: #E3C700; color: var(--on-accent); }
.btn.primary:hover { background: #F5D600; }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.dark:hover { background: var(--navy2); }
.btn.danger { color: var(--bad); border-color: #F1B5AF; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.link { border: 0; background: none; color: #1F4FD1; padding: 0; font-weight: 500; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Tables ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #FAFBFC; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tr.inactive td { color: #98A1AE; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .muted, .muted { color: var(--muted); }
td.nowrap { white-space: nowrap; }
.small-text { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.details-cell { max-width: 420px; word-break: break-word; }

/* ── Badges ─────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #EEF1F5; color: #3B4657; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: #1F4FD1; }
.badge.hq { background: var(--navy); color: var(--accent); }
.badge.shop { background: #FFF7C2; color: #6B5A00; }
.badge.franchise { background: #E62828; color: #FFFFFF; }

/* ── Alerts ─────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.alert.ok { background: var(--ok-bg); border-color: #B7E1C7; color: #145C33; }
.alert.bad { background: var(--bad-bg); border-color: #F1B5AF; color: #7A1A12; }
.alert.warn { background: var(--warn-bg); border-color: #F1D98A; color: #6B4600; }
.alert ul { margin: 4px 0 0 18px; padding: 0; }

/* ── Map editor ─────────────────────────────────────── */
.map { height: 380px; border-radius: 8px; border: 1px solid var(--line); background: #E9EEF4; }
.map-tools { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; align-items: center; }
.coords { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }

/* ── Publications ───────────────────────────────────── */
.pub-list { display: grid; gap: 12px; }
.pub { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.pub.inactive { opacity: .6; }
.pub .cover { width: 96px; height: 72px; border-radius: 6px; object-fit: cover; background: #E9EEF4; display: block; }
.pub .cover.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.pub .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pub .title { font-weight: 700; font-size: 15px; }
.cover-preview { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); display: block; margin-bottom: 8px; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.page-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #FAFBFC; }
.page-item img { width: 100%; height: 160px; object-fit: cover; border-radius: 6px; display: block; background: #E9EEF4; }
.page-item .tools { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.page-item input[type=text] { margin-top: 6px; font-size: 12px; padding: 5px 7px; }

/* ── Login ──────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); padding: 16px; }
.login { width: 100%; max-width: 380px; background: var(--surface); border-radius: 14px; padding: 28px; }
.login .brand { color: var(--text); padding: 0 0 18px; }
.login .brand small { color: var(--muted); }

.diff { font-size: 12px; color: var(--muted); margin: 0; padding-left: 16px; }
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-2, .row, .row.three { grid-template-columns: 1fr; }
  .main { padding: 18px 16px 48px; }
  .pub { grid-template-columns: 72px 1fr; }
  .pub .cover { width: 72px; height: 56px; }
  .pub .actions { grid-column: 1 / -1; }
}

/* Države i centrale: move the Centrala to another location */
.hq-change { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line, #E5E7EB); }

/* Lokacije: status badge with a small text action under it, like the Pin column */
.row-action { margin-top: 3px; }
.row-action .btn.link { font-size: 12px; font-weight: 500; }
td.cell-actions { text-align: right; white-space: nowrap; }

/* One height for every single-line field and button, in every browser (Safari draws <select> natively and
   ignores padding, so it is restyled with its own chevron). */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], select {
  height: 40px; line-height: 1.2;
}
select {
  -webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%235B6472' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
}
select:disabled, input:disabled { background-color: #F4F6F9; color: var(--muted); cursor: not-allowed; }
.btn:not(.small):not(.link) { min-height: 40px; }
.page-item input[type=text] { height: auto; }

/* Odjava: clearly visible red button at the bottom of the sidebar */
.side-foot form.logout { display: block; margin-top: 12px; }
.side-foot form.logout button {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 38px;
  background: #D92D20; color: #fff; border: 1px solid #D92D20; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.side-foot form.logout button:hover { background: #B42318; border-color: #B42318; color: #fff; }
.side-foot form.logout button:focus-visible { outline: 2px solid #FFE012; outline-offset: 2px; }

/* Lokacije overview map legend (same colours as the pins) */
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid; }
.map-legend .dot.hq { background: #0B1522; border-color: #FFE012; width: 14px; height: 14px; }
.map-legend .dot.shop { background: #FFD60A; border-color: #8A7400; }
.map-legend .dot.franchise { background: #E62828; border-color: #FFFFFF; box-shadow: 0 0 0 1px #F0A3A3; }
.map-legend .dot.faded { background: #FFD60A; border-color: #8A7400; opacity: .4; }

/* Sidebar: user block and Odjava pinned to the bottom of the screen (desktop) */
.side { display: flex; flex-direction: column; }
.side > .side-foot { margin-top: auto; padding-top: 12px; }
.side > .nav { margin-bottom: 24px; }
@media (max-width: 960px) {
  .side { display: block; }
  .side > .side-foot { margin-top: 24px; }
}

/* Developer credit (Globaldizajn logo): under the login card and at the bottom of the sidebar */
.login-wrap { flex-direction: column; gap: 24px; }
.gd-credit { display: block; opacity: .75; transition: opacity .15s; line-height: 0; }
.gd-credit:hover, .gd-credit:focus-visible { opacity: 1; }
.gd-credit:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.gd-credit img { display: block; height: auto; }
.login-wrap .gd-credit img { width: 120px; }
.side-foot .gd-credit { margin: 16px auto 4px; width: fit-content; }
.side-foot .gd-credit img { width: 96px; }

/* ── Pravila privatnosti ────────────────────────────── */
.lang-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
textarea.legal-body { min-height: 480px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; }
.legal-preview { max-height: 560px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 10px; overflow-wrap: anywhere; }
.legal-preview h2 { font-size: 17px; margin: 16px 0 6px; }
.legal-preview h3 { font-size: 15px; margin: 12px 0 4px; }
.legal-preview ul { padding-left: 20px; margin: 0 0 10px; }
