/* ── RESET & BASE ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0f1218;
    --bg-card: #161b27;
    --bg-sidebar: #0d1117;
    --border: #1e293b;
    --border-2: #2d3547;
    --text: #f1f5f9;
    --text-muted: #64748b;
    --text-sub: #475569;
    --text-label: #94a3b8;
    --accent: #3b82f6;
    --green: #10b981;
    --red: #f87171;
    --yellow: #f59e0b;
    --sidebar-w: 220px;
    --nav-bg: #1e293b;
    --modal-bg: #1a1f2e;
}

[data-theme="light"] {
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #e2e8f0;
    --border: #cbd5e1;
    --border-2: #94a3b8;
    --text: #0f172a;
    --text-muted: #475569;
    --text-sub: #64748b;
    --text-label: #1e293b;
    --nav-bg: #ffffff;
    --modal-bg: #ffffff;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif; font-size: 15px; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-sidebar); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── APP SHELL ────────────────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── TOPBAR ───────────────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 0.875rem; position: fixed; top:0; left:0; right:0; height: 52px; background: var(--bg-sidebar); border-bottom: 1px solid var(--border); padding: 0 1rem; z-index: 90; }
.topbar-menu-btn { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); padding: 5px 8px; font-size: 1rem; line-height: 1; }
.topbar-brand { font-weight: 700; color: var(--text-label); font-size: 0.88rem; }
.low-stock-badge { margin-left: auto; background: #450a0a; color: var(--red); border: 1px solid #7f1d1d; border-radius: 20px; padding: 3px 10px; font-size: 0.72rem; font-weight: 700; }

/* ── SIDEBAR ──────────────────────────────────────────────────────────────── */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 98; }
.sidebar { position: fixed; top:0; left:0; bottom:0; width: var(--sidebar-w); background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 99; transform: translateX(-100%); transition: transform 0.25s ease; }
.sidebar--open { transform: translateX(0); }
.sidebar-header { padding: 1.25rem; border-bottom: 1px solid var(--border); }
.sidebar-logo { display: flex; align-items: center; gap: 0.6rem; }
.sidebar-logo-icon { width: 36px; height: 36px; background: #1d4ed8; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.sidebar-brand { font-weight: 800; font-size: 0.9rem; color: var(--text); }
.sidebar-sub { font-size: 0.65rem; color: var(--text-sub); }
.sidebar-nav { flex: 1; padding: 1rem 0.75rem; }
.nav-section-label { font-size: 0.65rem; color: #334155; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; padding-left: 0.5rem; }
.nav-item { display: flex; align-items: center; gap: 0.6rem; width: 100%; background: none; border: 1px solid transparent; border-radius: 10px; padding: 0.6rem 0.75rem; color: var(--text-muted); font-weight: 500; font-size: 0.88rem; margin-bottom: 2px; transition: all 0.15s; cursor: pointer; }
.nav-item:hover { background: var(--border); color: var(--text-label); }
.nav-item.active { background: var(--nav-bg); border-color: var(--border-2); color: var(--text); font-weight: 700; }
.nav-icon { font-size: 0.9rem; }
.sidebar-stats { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.stat-row { display: flex; justify-content: space-between; margin-bottom: 0.3rem; font-size: 0.78rem; }
.stat-label { color: var(--text-sub); }
.stat-val { font-weight: 700; color: var(--text-label); }
.stat-val--danger { color: var(--red); }

/* ── MAIN CONTENT ─────────────────────────────────────────────────────────── */
.main-content { flex: 1; padding: 1.5rem; padding-top: calc(52px + 1.5rem); min-width: 0; max-width: 1400px; width: 100%; margin: 0 auto; }

@media (min-width: 768px) {
  .topbar { display: none; }
  .sidebar { position: sticky; top: 0; height: 100vh; transform: none !important; }
  .main-content { padding-top: 1.5rem; }
  .app-shell { align-items: flex-start; }
}

/* ── PAGE HEADER ──────────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.page-title { font-weight: 800; font-size: 1.3rem; color: var(--text); }

/* ── BUTTONS ──────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; border: none; border-radius: 10px; padding: 0.6rem 1.2rem; font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--nav-bg); color: var(--text-label); border: 1px solid var(--border-2); }
.btn-green { background: #052e16; color: var(--green); border: 1px solid #14532d; }
.btn-danger { background: #450a0a; color: var(--red); border: 1px solid #7f1d1d; }
.btn-icon { background: var(--nav-bg); color: var(--text-label); border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px; font-size: 0.8rem; transition: opacity 0.15s; }
.btn-icon:hover { opacity: 0.75; }
.btn-icon--green { background: #052e16; color: var(--green); border-color: #14532d; }
.btn-icon--red   { background: #450a0a; color: var(--red);   border-color: #7f1d1d; }
.btn-icon--del   { color: var(--red); }

/* ── FORM ─────────────────────────────────────────────────────────────────── */
.field { margin-bottom: 1rem; }
.label { display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-label); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.35rem; }
.input { width: 100%; background: var(--bg); border: 1px solid var(--border-2); border-radius: 10px; padding: 0.6rem 0.875rem; color: var(--text); font-size: 0.88rem; outline: none; appearance: none; transition: border-color 0.15s, box-shadow 0.15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #3b82f620; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.info-box { background: var(--bg); border-radius: 10px; padding: 0.75rem; color: var(--text-label); font-size: 0.88rem; margin-bottom: 1rem; }
.info-box strong { color: var(--text); }
.error-msg { color: var(--red); font-size: 0.82rem; margin-bottom: 0.75rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ── MODAL ────────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--modal-bg); border: 1px solid var(--border-2); border-radius: 16px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0,0,0,0.5); }
.modal--wide { max-width: 700px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-2); }
.modal-title { font-weight: 700; font-size: 1rem; color: var(--text); }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.modal-body { padding: 1.5rem; }

/* ── FILTERS ──────────────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.search-wrap { position: relative; flex: 1 1 200px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-sub); pointer-events: none; font-size: 0.85rem; }
.search-input { padding-left: 2rem; }
.select-input { flex: 0 1 180px; }
.chip-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.chip { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.chip:hover { opacity: 0.8; }
.chip-count { opacity: 0.7; margin-left: 3px; }

/* ── BADGES ───────────────────────────────────────────────────────────────── */
.cat-badge { padding: 2px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.model-badge { background: #0f172a; color: var(--text-sub); border: 1px solid var(--border); padding: 2px 8px; border-radius: 20px; font-size: 0.7rem; }

/* ── ITEMS GRID ───────────────────────────────────────────────────────────── */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.875rem; }
.item-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.55rem; transition: border-color 0.2s; }
.item-card:hover { border-color: var(--cat-color, var(--accent)); }
.item-card--low { border-color: #7f1d1d; }
.item-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.item-card-info { flex: 1; min-width: 0; }
.item-name { font-weight: 700; color: var(--text); font-size: 0.9rem; margin-bottom: 0.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.item-qty { text-align: right; flex-shrink: 0; }
.item-qty-num { display: block; font-size: 1.4rem; font-weight: 800; color: var(--text); line-height: 1; }
.item-qty-unit { font-size: 0.68rem; color: var(--text-sub); }
.item-qty--low .item-qty-num { color: var(--red); }
.item-pos { color: var(--text-sub); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-footer { display: flex; align-items: center; justify-content: space-between; }
.item-price { color: var(--text-label); font-weight: 700; font-size: 0.88rem; }
.item-actions { display: flex; gap: 0.3rem; }

/* ── EMPTY / LOADING ──────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem; color: var(--text-sub); }
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-title { font-weight: 700; font-size: 1rem; color: var(--text-label); margin-bottom: 0.4rem; }
.empty-sub { font-size: 0.85rem; }
.loading-state { color: var(--text-muted); padding: 3rem; text-align: center; font-size: 1rem; }

/* ── TOAST ERROR ──────────────────────────────────────────────────────────── */
.toast-error { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: #450a0a; color: var(--red); border: 1px solid #7f1d1d; border-radius: 12px; padding: 0.75rem 1.25rem; font-size: 0.88rem; font-weight: 600; z-index: 2000; display: flex; align-items: center; gap: 0.75rem; box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.toast-error button { background: none; border: none; color: var(--red); cursor: pointer; font-size: 0.9rem; }

/* ── POSITIONS PAGE ───────────────────────────────────────────────────────── */
.pos-group { margin-bottom: 1.75rem; }
.pos-ormar { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; color: var(--text); font-size: 1rem; margin-bottom: 0.75rem; }
.pos-ormar-icon { color: var(--accent); }
.pos-polica-group { margin-left: 1.5rem; margin-bottom: 0.75rem; }
.pos-polica-label { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; margin-bottom: 0.5rem; }
.pos-kutije-grid { margin-left: 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.6rem; }
.pos-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 0.875rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.pos-kutija-name { font-weight: 700; color: var(--text); font-size: 0.88rem; }
.pos-item-count { color: var(--text-sub); font-size: 0.75rem; margin-top: 2px; }
.pos-card-actions { display: flex; gap: 0.35rem; }

/* ── QR ───────────────────────────────────────────────────────────────────── */
.qr-layout { display: flex; gap: 2rem; flex-wrap: wrap; }
.qr-left { display: flex; flex-direction: column; align-items: center; gap: 0.875rem; }
.qr-box { background: white; padding: 14px; border-radius: 12px; display: inline-block; }
.qr-label { text-align: center; }
.qr-pos-name { color: var(--text); font-weight: 700; }
.qr-pos-id { color: var(--text-sub); font-size: 0.75rem; margin-top: 3px; }
.qr-right { flex: 1; min-width: 200px; }
.qr-items-title { color: var(--text-label); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.qr-empty { color: var(--text-sub); font-size: 0.88rem; }
.qr-item-row { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.875rem; background: var(--bg); border-radius: 10px; font-size: 0.88rem; margin-bottom: 0.4rem; }
.qr-item-name { color: var(--text); font-weight: 600; }
.qr-item-model { color: var(--text-sub); font-size: 0.75rem; }
.qr-item-qty { color: var(--text); font-weight: 800; font-size: 1.1rem; }
.qr-item-unit { color: var(--text-sub); font-weight: 400; font-size: 0.75rem; }

/* ── HISTORY ──────────────────────────────────────────────────────────────── */
.history-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.25rem; }
.history-row { display: flex; gap: 0.875rem; align-items: flex-start; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.history-row:last-child { border-bottom: none; }
.history-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; font-size: 0.85rem; }
.history-body { flex: 1; min-width: 0; }
.history-top { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.history-name { font-weight: 700; color: var(--text); font-size: 0.88rem; }
.history-qty { font-weight: 800; font-size: 0.88rem; flex-shrink: 0; }
.history-meta { font-size: 0.78rem; color: var(--text-sub); margin-top: 2px; }

/* ── PRINT ────────────────────────────────────────────────────────────────── */
@media print {
  .topbar, .sidebar, .btn, .btn-icon, .modal-overlay, .filter-bar, .chip-bar { display: none !important; }
  .qr-box { border: 2px solid #000; }
}

/* ── LOADING ──────────────────────────────────────────────────── */
.loading-state { display: flex; align-items: center; gap: 0.75rem; padding: 3rem; color: var(--text-muted); }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink:0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ────────────────────────────────────────────────────── */
.toast-error {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: #450a0a; color: var(--red); border: 1px solid #7f1d1d;
  border-radius: 12px; padding: 0.75rem 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.88rem; font-weight: 600; z-index: 2000;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.toast-error button { background: none; border: none; color: var(--red); cursor: pointer; font-size: 1rem; }

/* ── QR SCANNER ───────────────────────────────────────────────── */
.qr-scanner-wrap {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1;
}
.qr-scanner-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qr-scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
}
.qr-scanner-frame {
  width: 65%;
  aspect-ratio: 1;
  border: 3px solid #3b82f6;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
  animation: scanner-pulse 1.8s ease-in-out infinite;
}
@keyframes scanner-pulse {
  0%, 100% { border-color: #3b82f6; box-shadow: 0 0 0 9999px rgba(0,0,0,0.45), 0 0 0 0 #3b82f640; }
  50%       { border-color: #60a5fa; box-shadow: 0 0 0 9999px rgba(0,0,0,0.45), 0 0 12px 4px #3b82f660; }
}

/* ── BARCODE SCANNER FRAME (Code128 - horizontalni) ──────────────── */
.barcode-scanner-frame {
  width: 80%;
  height: 120px;
  border: 3px solid #3b82f6;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  position: relative;
  animation: scanner-pulse 1.8s ease-in-out infinite;
}
.barcode-scanner-frame::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 2px;
  background: rgba(59,130,246,0.8);
  animation: scan-line 2s ease-in-out infinite;
}
@keyframes scan-line {
  0%, 100% { top: 20%; opacity: 0.6; }
  50%       { top: 80%; opacity: 1; }
}

/* ── THEME TOGGLE ─────────────────────────────────────────────────────────── */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.theme-toggle-label {
    font-size: 0.78rem;
    color: var(--text-sub);
    font-weight: 500;
}

.theme-toggle-btn {
    width: 44px;
    height: 24px;
    background: var(--border-2);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

    .theme-toggle-btn.active {
        background: var(--accent);
    }

    .theme-toggle-btn::after {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: white;
        transition: transform 0.2s;
    }

    .theme-toggle-btn.active::after {
        transform: translateX(20px);
    }
/* ── MASS ADD ─────────────────────────────────────────────────────────────── */
.modal--xl { max-width: 1100px; width: 96vw; }

.mass-pdf-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.mass-pdf-label { font-size: 0.82rem; color: var(--text-sub); margin-bottom: 0.6rem; font-weight: 500; }

.mass-table-wrap {
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.mass-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.mass-table th {
  background: var(--bg-card);
  color: var(--text-sub);
  font-weight: 600;
  padding: 0.5rem 0.4rem;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.mass-table td {
  padding: 0.25rem 0.3rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.mass-table tr:last-child td { border-bottom: none; }
.mass-table tr:hover td { background: var(--bg-card); }
.mass-row--error td { background: rgba(239,68,68,0.08) !important; }

.mass-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 0.28rem 0.4rem;
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
  min-width: 0;
}
.mass-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}
.mass-input:hover { border-color: var(--border-2); }

/* ── MASS ADD CARDS ───────────────────────────────────────────────────────── */
.mass-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 52vh;
  min-height: 200px;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 2px 4px 2px 2px;
  flex-shrink: 0;
}

.mass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-shrink: 0;        /* ← kartica nikad ne smanjuje visinu */
  overflow: visible;     /* ← body uvijek vidljiv */
}
.mass-card--error { border-color: #ef4444; }

.mass-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
}
.mass-card-num { font-size: 0.75rem; color: var(--text-sub); font-weight: 600; }

.mass-card-body {
  padding: 0.6rem 0.75rem;
  display: block;
}

.mass-row-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mass-field { display: flex; flex-direction: column; gap: 0.18rem; }
.mass-field label { font-size: 0.71rem; color: var(--text-sub); font-weight: 500; }
.mass-field .input { padding: 0.32rem 0.5rem; font-size: 0.82rem; }

/* ── LOGIN ───────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #0f0f13);
}
.login-card {
  background: var(--surface, #18181f);
  border: 1px solid var(--border, #2a2a35);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.login-logo {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}
.login-brand {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text, #f0f0f5);
}
.login-sub {
  font-size: 0.8rem;
  color: var(--text2, #6b6b80);
  margin-bottom: 1rem;
}
.login-fields {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.login-field { width: 100%; }
.login-error {
  width: 100%;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.3);
  color: #f87171;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  text-align: center;
}
.btn-login {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: #7c6aff;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background .2s;
}
.btn-login:hover:not(:disabled) { background: #6a58ee; }
.btn-login:disabled { opacity: .6; cursor: not-allowed; }
.login-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Logout gumb u topbaru */
.topbar-logout-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text2, #6b6b80);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: color .2s;
}
.topbar-logout-btn:hover { color: var(--text, #f0f0f5); }
