/* ===== LED Code Admin – Cyan/Dark ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0F172A;
  --bg-card:     #1E293B;
  --bg-card-2:   #243447;
  --accent:      #00d4ff;
  --accent-dim:  rgba(0, 212, 255, 0.12);
  --text:        #E2E8F0;
  --text-muted:  #94A3B8;
  --border:      rgba(255,255,255,0.07);
  --radius:      10px;
  --font:        system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.85; }

.logo-light { color: #fff; font-weight: 900; letter-spacing: 1px; }
.logo-dark  { color: var(--accent); font-weight: 900; letter-spacing: 1px; }

/* =========================================================
   LOGIN
   ========================================================= */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(800px 400px at 50% -20%, var(--accent-dim), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.login-card h1 {
  font-size: 1.8rem;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.login-sub {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 11px;
  margin-bottom: 28px;
}
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #111;
  padding: 12px 22px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-google:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,212,255,0.18);
  opacity: 1;
}
.login-note  { color: var(--text-muted); font-size: 13px; }
.login-back  { margin-top: 24px; font-size: 13px; }

.alert {
  text-align: left;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.alert-error {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.4);
  color: #FCA5A5;
}

/* =========================================================
   ADMIN SHELL
   ========================================================= */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  font-size: 1.4rem;
  margin-bottom: 32px;
  padding: 0 6px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-nav a {
  color: var(--text);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.15s;
}
.sidebar-nav a:hover { background: var(--bg-card-2); opacity: 1; }
.sidebar-nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.sidebar-logout { margin-top: auto; }
.sidebar-logout button {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.sidebar-logout button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-main { padding: 36px 40px; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.admin-header h1 { font-size: 1.6rem; font-weight: 700; }
.admin-header .muted { color: var(--text-muted); font-size: 13px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-num {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 2px;
}

.placeholder-section {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.placeholder-section h2 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #fff;
}
.placeholder-section p { color: var(--text-muted); }

/* =========================================================
   SIDEBAR – Phase 4 erweitert (Icons + Top/Close)
   ========================================================= */
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.sidebar-top .sidebar-logo {
  display: block;
  margin: 0;
  padding: 0 6px;
  font-size: 1.4rem;
  text-decoration: none;
}
.sidebar-close {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-nav a svg { flex-shrink: 0; color: var(--text-muted); }
.sidebar-nav a.active svg { color: var(--accent); }
.sidebar-logout button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* =========================================================
   TOPBAR
   ========================================================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.topbar-burger {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title .muted { color: var(--text-muted); font-size: 13px; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 10px 6px 14px;
  border-radius: 999px;
}
.topbar-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.topbar-user-name { font-size: 13px; font-weight: 600; }
.topbar-user-mail { font-size: 11px; color: var(--text-muted); }
.avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  border: 2px solid var(--accent);
}

/* =========================================================
   DASHBOARD CARDS
   ========================================================= */
.stat-card-link {
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s;
}
.stat-card-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.card-link {
  font-size: 12px;
  color: var(--accent);
}
.recent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.recent-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.recent-link:hover { background: var(--bg-card-2); opacity: 1; }
.recent-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.recent-main strong {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent-sub {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

.quick-actions h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: #fff;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.quick-card:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }
.quick-card svg { color: var(--accent); flex-shrink: 0; }

/* =========================================================
   TABS
   ========================================================= */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); opacity: 1; }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-count {
  background: var(--bg-card-2);
  color: var(--text);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.tab.active .tab-count {
  background: var(--accent-dim);
  color: var(--accent);
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.badge-status {
  border: 1px solid transparent;
}
.badge-novo,           .badge-dot.badge-novo           { background: rgba(56,189,248,0.15);  color: #7dd3fc; border-color: rgba(56,189,248,0.35); }
.badge-u_obradi,       .badge-dot.badge-u_obradi       { background: rgba(250,204,21,0.15);  color: #fde047; border-color: rgba(250,204,21,0.35); }
.badge-ponuda_poslata, .badge-dot.badge-ponuda_poslata { background: rgba(167,139,250,0.15); color: #c4b5fd; border-color: rgba(167,139,250,0.35); }
.badge-prihvaceno,     .badge-dot.badge-prihvaceno     { background: rgba(74,222,128,0.15);  color: #86efac; border-color: rgba(74,222,128,0.35); }
.badge-odbaceno,       .badge-dot.badge-odbaceno       { background: rgba(248,113,113,0.15); color: #fca5a5; border-color: rgba(248,113,113,0.35); }
.badge-arhivirano,     .badge-dot.badge-arhivirano     { background: rgba(148,163,184,0.15); color: #cbd5e1; border-color: rgba(148,163,184,0.35); }
.badge-dot { padding: 0; width: 8px; height: 8px; border-radius: 50%; border: 0; }

.badge-priority-nisko    { background: rgba(148,163,184,0.12); color: #cbd5e1; }
.badge-priority-normalno { background: rgba(56,189,248,0.12);  color: #7dd3fc; }
.badge-priority-visoko   { background: rgba(248,113,113,0.15); color: #fca5a5; }

.badge-neutral { background: var(--bg-card-2); color: var(--text); }

.badge-files {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-left: 6px;
}

/* =========================================================
   FILTER BAR
   ========================================================= */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 18px;
}
.filter-search {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
}
.filter-search svg { color: var(--text-muted); flex-shrink: 0; }
.filter-search input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

/* =========================================================
   FORM INPUTS (dark)
   ========================================================= */
input[type="text"], input[type="email"], input[type="tel"],
input[type="search"], input[type="date"], input[type="number"],
select, textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 80px; }
select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%2394A3B8" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.kunde-form label, .note-form label {
  display: block;
  margin-bottom: 14px;
}
.kunde-form label span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.kunde-form input,
.kunde-form textarea,
.kunde-form select {
  width: 100%;
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}
.form-actions > form { display: inline; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  background: var(--bg-card-2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  font-family: inherit;
}
.btn:hover { opacity: 0.9; }
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(0,212,255,0.3); }
.btn-secondary {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger {
  background: transparent;
  border-color: rgba(239,68,68,0.4);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(239,68,68,0.12); color: #fff; }
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); opacity: 1; }
.btn-link {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: underline;
}

/* =========================================================
   TABLE
   ========================================================= */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table thead th {
  background: var(--bg-card-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.012); }
.data-table tbody tr:hover td { background: var(--bg-card-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.th-sort {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}
.th-sort:hover { color: var(--text); opacity: 1; }
.cell-main { font-weight: 500; }
.cell-main a { color: var(--text); text-decoration: none; }
.cell-main a:hover { color: var(--accent); opacity: 1; }
.cell-sub { margin-top: 2px; }
.link-id {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.link-id:hover { color: var(--accent); }
.muted { color: var(--text-muted); }
.muted-small { color: var(--text-muted); font-size: 12px; }

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  font-size: 13px;
}
.pagination a {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
}
.pagination a:hover { border-color: var(--accent); opacity: 1; }
.pagination-info { color: var(--text-muted); }

/* =========================================================
   DETAIL VIEW
   ========================================================= */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-decoration: none;
}
.back-link:hover { color: var(--accent); opacity: 1; }

.detail-actions {
  margin-bottom: 18px;
}
.detail-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
}
.action-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.action-block-right {
  margin-left: auto;
  flex-direction: row;
  gap: 10px;
}
.action-block-right > form { display: inline; }
.action-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.select-status {
  font-weight: 600;
  font-size: 13px;
  padding: 8px 32px 8px 14px;
  cursor: pointer;
}
.priority-buttons {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.prio-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.prio-btn:hover { color: var(--text); }
.prio-btn.active { background: var(--bg-card-2); color: var(--text); }
.prio-btn.prio-visoko.active { background: rgba(248,113,113,0.2); color: #fca5a5; }
.prio-btn.prio-nisko.active  { background: rgba(148,163,184,0.2); color: #cbd5e1; }
.prio-btn.prio-normalno.active { background: rgba(56,189,248,0.18); color: #7dd3fc; }

.ajax-msg {
  display: inline-block;
  font-size: 12px;
  margin-top: 8px;
  min-height: 18px;
  transition: opacity 0.3s;
}
.ajax-msg.ok    { color: #86efac; }
.ajax-msg.error { color: #fca5a5; }

.detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}
.detail-grid-kupac { grid-template-columns: 1fr 1fr; }
.detail-col-left, .detail-col-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* KV-list (Kunde-Info) */
.kv-list {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 16px;
  font-size: 14px;
}
.kv-list dt {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 2px;
}
.kv-list dd { color: var(--text); }

.message-text {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 6px;
  white-space: pre-wrap;
  margin-top: 6px;
  margin-bottom: 12px;
  font-size: 14px;
}

/* File grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.file-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.file-thumb {
  height: 110px;
  display: grid;
  place-items: center;
  background: var(--bg-card-2);
  color: var(--text-muted);
  overflow: hidden;
}
.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.file-meta {
  padding: 8px 10px;
  font-size: 12px;
}
.file-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-sub { margin-top: 2px; }
.file-download {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
}

/* Notes list (chat-like) */
.notes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 14px;
}
.notes-list li {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 10px 12px;
}
.note-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
  font-size: 12px;
}
.note-head strong { color: var(--text); font-weight: 600; }
.note-body { font-size: 13px; white-space: pre-wrap; }
.note-form { display: flex; flex-direction: column; gap: 8px; }
.note-form textarea { width: 100%; }
.note-form button { align-self: flex-end; }

/* Log */
.log-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}
.log-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.log-list li:last-child { border-bottom: 0; }
.log-action {
  background: var(--bg-card-2);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
}
.log-action-status_change   { background: rgba(56,189,248,0.15);  color: #7dd3fc; }
.log-action-prioritet_change{ background: rgba(250,204,21,0.15);  color: #fde047; }
.log-action-napomena        { background: rgba(167,139,250,0.15); color: #c4b5fd; }
.log-detail { color: var(--text); font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 11px; }

.alert-ok {
  background: rgba(74,222,128,0.1);
  border-color: rgba(74,222,128,0.4);
  color: #86efac;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid, .detail-grid-kupac { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .admin-shell[data-sidebar-open="true"] .sidebar { transform: translateX(0); }
  .admin-shell[data-sidebar-open="true"]::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 40;
  }
  .sidebar-close { display: block; }
  .topbar-burger { display: inline-grid; place-items: center; }
  .admin-main { padding: 20px 16px; }
  .topbar-user-meta { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .detail-actions-row { gap: 14px; }
  .action-block-right { margin-left: 0; width: 100%; }
}

@media (max-width: 700px) {
  /* override aus altem Block: stat-grid darf shrinken */
  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

/* =========================================================
   PHASE 5 – Ponuda-status-Badges (eigene Palette,
   damit sie sich von Anfrage-Status optisch trennen)
   ========================================================= */
.badge-ponuda-nacrt,      .badge-dot.badge-ponuda-nacrt      { background: rgba(148,163,184,0.18); color: #cbd5e1; border-color: rgba(148,163,184,0.4); }
.badge-ponuda-poslata,    .badge-dot.badge-ponuda-poslata    { background: rgba(56,189,248,0.18);  color: #7dd3fc; border-color: rgba(56,189,248,0.4); }
.badge-ponuda-prihvacena, .badge-dot.badge-ponuda-prihvacena { background: rgba(74,222,128,0.18);  color: #86efac; border-color: rgba(74,222,128,0.4); }
.badge-ponuda-odbijena,   .badge-dot.badge-ponuda-odbijena   { background: rgba(248,113,113,0.18); color: #fca5a5; border-color: rgba(248,113,113,0.4); }

/* =========================================================
   PHASE 5 – Chart-Wrapper (fixe Höhe, sonst wird Chart.js riesig)
   ========================================================= */
.chart-wrap {
  position: relative;
  height: 240px;
}
@media (max-width: 768px) {
  .chart-wrap { height: 220px; }
}

/* =========================================================
   PHASE 5 – Mail-Modal
   ========================================================= */
.mail-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.mail-modal[hidden] { display: none; }
.mail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
}
.mail-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.mail-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.mail-modal-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

/* =========================================================
   PHASE 5 – Ponuda-Form (Positions-Tabelle, kompakter)
   ========================================================= */
.ponuda-form .data-table td input {
  background: var(--bg);
  border-color: var(--border);
  padding: 6px 10px;
  font-size: 13px;
}
.ponuda-form .pos-num { font-variant-numeric: tabular-nums; }

.ponuda-form .form-actions {
  margin-top: 24px;
}
