/* KDT Doboj - admin panel */
:root {
    --bg: #f4f6f9;
    --card: #ffffff;
    --line: #e3e8ef;
    --line-2: #eef1f6;
    --ink: #0f172a;
    --ink-2: #475569;
    --muted: #94a3b8;
    --red: #d8232a;
    --dark: #111827;
    --dark-2: #1f2937;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

/* Sidebar */
.side {
    width: 232px; flex: 0 0 232px; background: var(--dark); color: #cbd5e1;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 18px; color: #fff; font-weight: 700; font-size: 15px;
    border-bottom: 1px solid #1f2937;
}
.side-brand svg { width: 24px; height: 24px; color: var(--red); }
.side nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-i {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: 8px; color: #cbd5e1; text-decoration: none; font-size: 14px;
}
.nav-i svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .8; }
.nav-i:hover { background: var(--dark-2); color: #fff; }
.nav-i.is-on { background: var(--red); color: #fff; }
.nav-i.is-on svg { opacity: 1; }
.side-foot { padding: 14px 18px; border-top: 1px solid #1f2937; color: #6b7280; font-size: 12px; }

/* Glavni dio */
.main { flex: 1; padding: 26px 30px 60px; min-width: 0; }

.bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.bar h1 { margin: 0; font-size: 23px; letter-spacing: -.3px; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--red); color: #fff; text-decoration: none; border: 0; cursor: pointer;
    font: 600 14px/1 inherit; padding: 11px 18px; border-radius: 9px;
}
.btn:hover { background: #b21c22; }
.btn svg { width: 16px; height: 16px; }

.btn-line {
    background: #fff; border: 1px solid var(--line); color: var(--ink); cursor: pointer;
    font: 500 14px/1 inherit; padding: 10px 16px; border-radius: 9px; text-decoration: none;
    display: inline-flex; align-items: center;
}
.btn-line:hover { border-color: #c8d1de; }
.btn-line.ghost { color: var(--muted); }

.flash { background: #eaf7ef; border: 1px solid #b7e0c6; color: #15803d; padding: 11px 16px; border-radius: 9px; margin-bottom: 18px; }

/* Statistika */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 16px 18px; }
.stat-n { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.stat-l { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* Filteri */
.filters {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin-bottom: 16px;
}
.search { position: relative; flex: 1 1 300px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input { width: 100%; padding-left: 36px; }
.filters input, .filters select {
    font: inherit; color: var(--ink); background: #fff;
    border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
}
.filters input:focus, .filters select:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 3px rgba(216, 35, 42, .12); }

/* Tabela */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 11px; overflow: auto; }
.tbl { width: 100%; min-width: 1040px; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
    position: sticky; top: 0; z-index: 2;
    background: #f8fafc; text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px;
    color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tbody tr:hover { background: #fafbfd; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.strong { font-weight: 700; }
.mut { color: var(--muted); font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.lnk { color: var(--ink); text-decoration: none; }
.lnk:hover { color: var(--red); text-decoration: underline; }

.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag { background: #f1f5f9; border: 1px solid var(--line); color: var(--ink-2); font-size: 11.5px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.note { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); background: #fffbeb; border-left: 3px solid #fbbf24; padding: 5px 9px; border-radius: 0 5px 5px 0; max-width: 340px; }

.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.b-nova { background: #eff6ff; color: #1d4ed8; }
.b-potvrdjena { background: #eaf7ef; color: #15803d; }
.b-odbijena { background: #fef2f2; color: #b91c1c; }

.row-actions { display: inline-block; margin: 0 4px 0 0; vertical-align: middle; }
.row-actions select { font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: #fff; }
.icon-btn {
    background: #fff; border: 1px solid var(--line); border-radius: 7px; cursor: pointer;
    padding: 6px; color: var(--muted); line-height: 0;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--red); border-color: #f3c2c4; background: #fff5f5; }

/* Stranice */
.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a {
    min-width: 36px; text-align: center; padding: 8px 10px; border: 1px solid var(--line);
    background: #fff; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: 13px;
}
.pager a:hover { border-color: #c8d1de; }
.pager a.is-on { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login {
    width: 100%; max-width: 360px; background: var(--card);
    border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, .06);
}
.login-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); }
.login-brand svg { width: 24px; height: 24px; color: var(--red); }
.login h1 { margin: 14px 0 20px; font-size: 19px; }
.login label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.login input {
    width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 9px;
    padding: 11px 13px; margin-bottom: 15px; background: #fff;
}
.login input:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 3px rgba(216, 35, 42, .12); }
.login button {
    width: 100%; border: 0; background: var(--red); color: #fff; cursor: pointer;
    font: 600 15px/1 inherit; padding: 13px; border-radius: 9px; margin-top: 4px;
}
.login button:hover { background: #b21c22; }
.login-err { background: #fff5f5; border: 1px solid #f3c2c4; color: #8f1a1f; padding: 10px 13px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }

@media (max-width: 900px) {
    .app { flex-direction: column; }
    .side { width: 100%; flex: none; height: auto; position: static; }
    .side nav { flex-direction: row; overflow-x: auto; }
    .nav-i span { white-space: nowrap; }
    .side-foot { display: none; }
    .main { padding: 20px 16px 50px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Dugmad u zaglavlju i ikonice u redu tabele */
.bar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-line svg { width: 16px; height: 16px; margin-right: 7px; opacity: .7; }
a.icon-btn { display: inline-flex; align-items: center; vertical-align: middle; margin-right: 4px; }
a.icon-btn:hover { color: var(--red); border-color: #f3c2c4; background: #fff5f5; }
