/* TLK Backup Manager — Veeam-style tema */

:root {
  --bg: #0a0e13;
  --surface: #141a22;
  --surface-2: #1c232d;
  --surface-3: #232c38;
  --border: #2a323e;
  --border-strong: #3a4554;
  --text: #e6e9ee;
  --muted: #8893a4;
  --muted-2: #6b7585;
  --primary: #54B948;
  --primary-hover: #6ECC60;
  --primary-soft: rgba(84, 185, 72, 0.14);
  --primary-strong: #3F9C35;
  --danger: #e74c3c;
  --danger-soft: rgba(231, 76, 60, 0.14);
  --warn: #f39c12;
  --warn-soft: rgba(243, 156, 18, 0.14);
  --ok: #34C759;
  --info: #4a9eff;
  --topbar-h: 48px;
  --sidebar-w: 232px;

  /* Border radius scale — modern UI: gumbi 8, cards/inputs 8, modali 12 */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;

  /* Shadow scale za hover/focus states */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.20);

  /* Easing — sve micro-interakcije koriste isti curve */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography scale */
  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 14px;
  --text-lg:   16px;
  --text-xl:   20px;
  --text-2xl:  24px;

  /* Z-index scale */
  --z-toast: 2000;
  --z-modal: 1500;
  --z-dropdown: 1100;
}

html[data-theme="light"] {
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
}

/* Light tema — primijeni preko data-theme atributa na <html>. Toggle je u
   topbar-u; preferenca u localStorage('tlk_theme'). */
html[data-theme="light"] {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --surface-3: #e1e6ee;
  --border: #d1d8e1;
  --border-strong: #a8b1bd;
  --text: #1a202c;
  --muted: #5a6a7e;
  --muted-2: #8a96a8;
  --primary-soft: rgba(84, 185, 72, 0.18);
  --danger-soft: rgba(231, 76, 60, 0.10);
}
html[data-theme="light"] body { color-scheme: light; }
html[data-theme="light"] .code-block,
html[data-theme="light"] code {
  background: #f5f7fa;
  color: #1a202c;
  border-color: #e1e6ee;
}
html[data-theme="light"] pre, html[data-theme="light"] textarea {
  background: #f5f7fa;
  color: #1a202c;
}
html[data-theme="light"] input, html[data-theme="light"] select {
  background: #ffffff;
  color: #1a202c;
  border-color: #d1d8e1;
}
html[data-theme="light"] .progress-bar { background: #e1e6ee; }
html[data-theme="light"] .progress-text {
  color: #1a202c;
  text-shadow: 0 1px 2px rgba(255,255,255,0.7);
}
html[data-theme="light"] .badge-unknown { background: #e1e6ee; color: #5a6a7e; }
html[data-theme="light"] .modal { background: rgba(0, 0, 0, 0.35); }
/* Topbar ima hardkodiran tamni gradijent (vidi .app-topbar) — bez ovog
   overridea je u light temi brand tekst (var(--text) = taman) bio
   nevidljiv na tamnoj podlozi. */
html[data-theme="light"] .app-topbar {
  background: linear-gradient(to bottom, #ffffff 0%, #f3f5f9 100%);
}

/* Theme toggle button u topbar-u */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--r-md);
  font-size: 14px;
  margin-right: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.theme-toggle:hover {
  background: var(--surface-2);
  border-color: var(--primary);
}

/* Vrsta backupa — kartice s opisom (job wizard). Dvije opcije, uvijek
   vidljivi opisi; zamjena za dropdown koji je u modalu radio overlay probleme. */
.type-pick { display: flex; flex-direction: column; gap: 8px; }
.type-pick-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.type-pick-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.type-pick-card.active { border-color: var(--primary); background: var(--primary-soft); }
.type-pick-title {
  font-weight: 600; font-size: 13px; color: var(--text);
  display: flex; align-items: center; gap: 7px;
}
.type-pick-title [data-lucide], .type-pick-title .lucide { width: 15px; height: 15px; color: var(--primary); flex: none; }
.type-pick-badge {
  font-size: 10px; text-transform: uppercase; letter-spacing: .4px;
  background: var(--primary); color: #fff; padding: 1px 8px; border-radius: 999px;
}
.type-pick-desc { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 3px; }

/* "O proizvodu" link u topbaru — na uskim ekranima ostaje samo ikona */
.topbar-about-text { font-size: var(--text-sm); }
@media (max-width: 700px) { .topbar-about-text { display: none; } }

/* Custom dropdown — alternativa native <select> koji u Firefoxu ne radi
   unutar modal-a s @click.outside-om (popup se otvara izvan modal-a). */
.tlk-dd { position: relative; display: block; }
.tlk-dd-btn {
  width: 100%;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 7px 28px 7px 10px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  user-select: none;
  display: block;
  margin-top: 4px;
}
.tlk-dd-btn:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.tlk-dd-btn:after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.tlk-dd-btn:hover { border-color: var(--primary); }
.tlk-dd-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.tlk-dd-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 1100;
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.tlk-dd-item {
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
}
.tlk-dd-item:hover { background: var(--surface-2); }
.tlk-dd-item.active { background: var(--primary-soft); color: var(--text); font-weight: 600; }
.tlk-dd-item.disabled { color: var(--muted-2); cursor: not-allowed; }
.tlk-dd-item.disabled:hover { background: transparent; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* Lucide ikone — uniform sizing po kontekstu.
   Default svgIcon je 18×18 (sidebar, headers); inline-icon je 14×14 (uz tekst). */
[data-lucide], .lucide {
  display: inline-block;
  vertical-align: -0.125em;
  stroke-width: 2;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.inline-icon, .inline-icon[data-lucide] { width: 14px; height: 14px; vertical-align: -0.2em; }
.sb-icon [data-lucide], .sb-icon .lucide { width: 18px; height: 18px; }
.app-brand-icon [data-lucide], .app-brand-icon .lucide { width: 22px; height: 22px; color: var(--primary); }
.theme-toggle [data-lucide], .theme-toggle .lucide { width: 16px; height: 16px; }
button [data-lucide], button .lucide,
.btn-action [data-lucide], .btn-action .lucide { width: 14px; height: 14px; vertical-align: -0.15em; margin-right: 4px; }

/* Lucide ikone unutar klikabilnih elemenata moraju ignorirati pointer events,
   inače SVG hvata click umjesto button/a — vidjelo se na "..." gumbu (radio
   samo desni dio kad bi se kliknulo na sam SVG). */
button [data-lucide], button .lucide,
a [data-lucide], a .lucide,
[role="button"] [data-lucide], [role="button"] .lucide { pointer-events: none; }

/* Page header H1 ikona — uskladit s naslovom (28-30 px), accent boja */
h1 .page-h1-icon, h1 .page-h1-icon[data-lucide] {
  width: 28px;
  height: 28px;
  vertical-align: -0.18em;
  color: var(--primary);
  margin-right: 6px;
  stroke-width: 2;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03"; /* Inter alternative glyphs — modernije slovne forme */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  min-height: 100vh;
}
body.auth-body {
  display: flex;
  grid-template: none;
}
main { grid-area: main; min-width: 0; overflow-x: auto; }

[x-cloak] { display: none !important; }

/* Auth */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, #0f1a13 0%, #0a0e13 50%, #050709 100%);
  position: relative;
  overflow: hidden;
}
.auth-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(84, 185, 72, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 185, 72, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.auth-bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.18) 0%, transparent 60%);
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  animation: authGlow 6s ease-in-out infinite;
}
@keyframes authGlow {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1; transform: translateX(-50%) scale(1.1); }
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(34, 197, 94, 0.08);
  position: relative;
  z-index: 1;
}
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 12px;
  display: inline-block;
  filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.4));
}
.auth-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.auth-brand-accent {
  color: var(--primary);
  font-weight: 500;
}
.auth-tagline {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  letter-spacing: 0.2px;
}
.auth-card form { margin-top: 8px; }
.auth-card form button[type="submit"] {
  width: 100%;
  margin-top: 4px;
  padding: 12px;
  background: var(--primary);
  border-color: var(--primary);
  color: #052e16;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
}
.auth-card form button[type="submit"]:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

label { display: block; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  margin-top: 4px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

button {
  padding: 10px 16px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
button:hover { background: var(--border); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #0a0e13;
  font-weight: 600;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  padding: 4px 8px;
  text-decoration: none;
  cursor: pointer;
}
.btn-link.danger { color: var(--danger); }
.btn-link:hover { text-decoration: underline; }

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn-action:hover { background: var(--border); border-color: var(--primary); }
.btn-action:active { background: var(--surface-3); }
.btn-action:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-action.primary {
  background: #22C55E !important;
  color: #ffffff !important;
  border-color: #16A34A !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}
.btn-action.primary:hover {
  background: #16A34A !important;
  border-color: #15803D !important;
}
.btn-action.primary:disabled,
.btn-action.primary[disabled] {
  background: #6B7280 !important;
  border-color: #6B7280 !important;
  color: #D1D5DB !important;
  cursor: not-allowed !important;
}
.btn-action.danger {
  color: var(--danger);
  border-color: rgba(231, 76, 60, 0.35);
}
.btn-action.danger:hover {
  background: rgba(231, 76, 60, 0.12);
  border-color: var(--danger);
}
.btn-action + .btn-action { margin-left: 4px; }

.muted { color: var(--muted); }
.center { text-align: center; }
.error { color: var(--danger); margin-top: 8px; }

/* App shell: topbar + sidebar */
.app-topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, #0c1117 0%, #0a0e13 100%);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  height: var(--topbar-h);
}
.app-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
}
.app-brand-icon { font-size: 18px; line-height: 1; }
.app-brand-name { font-size: 15px; color: var(--text); }
.app-brand-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.app-topbar-right { display: flex; align-items: center; gap: 16px; }
.app-user-name { font-size: 13px; color: var(--muted); }
.app-user-logout { font-size: 13px; color: var(--primary); text-decoration: none; }
.app-user-logout:hover { color: var(--primary-hover); }

.app-sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-nav { flex: 1; padding: 12px 0; }
.sb-section { margin-top: 12px; }
.sb-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted-2);
  padding: 4px 18px 6px;
  font-weight: 600;
}
.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.sb-link:hover {
  background: var(--surface-2);
  color: var(--text);
}
.sb-link:hover .sb-icon { color: var(--text); }
.sb-link.active {
  background: var(--primary-soft);
  border-left-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.sb-link.active .sb-icon { color: var(--primary); }
.sb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: color 0.15s var(--ease);
}
.sb-badge {
  margin-left: auto;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--warn);
  color: #1b1300;
  min-width: 18px;
  text-align: center;
}
.sb-badge.crit { background: var(--danger); color: white; }
.sb-link.active .sb-badge { box-shadow: 0 0 0 1px var(--surface); }
.sidebar-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
}

/* Sidebar collapse na narrow screens (<1100px) — samo ikone, tooltip na hover */
@media (max-width: 1100px) {
  body { grid-template-columns: 56px 1fr; }
  .app-sidebar { overflow-x: visible; }
  .sb-heading { display: none; }
  .sidebar-footer { display: none; }
  .sb-link {
    justify-content: center;
    padding: 12px 8px;
    position: relative;
  }
  .sb-link span:not(.sb-icon):not(.sb-badge) { display: none; }
  .sb-icon { font-size: 18px; width: auto; }
  .sb-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
    padding: 0 5px;
    font-size: 9px;
    min-width: 14px;
  }
  /* Tooltip na hover preko CSS-a */
  .sb-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    padding: 6px 10px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    color: var(--text);
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    pointer-events: none;
  }
  .app-brand-name, .app-brand-sub { display: none; }
  .app-brand { justify-content: center; }
  .container { padding: 16px 20px; }
}

/* Layout */
.container {
  width: 100%;
  margin: 0;
  padding: 22px 28px;
}
.container.narrow { max-width: 900px; margin: 0 auto; }
.container h1 { margin-top: 0; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: -10px;
  margin-bottom: 14px;
}

/* Ribbon — Veeam-style action bar */
.ribbon {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.ribbon-group {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 0 8px;
  border-right: 1px solid var(--border);
}
.ribbon-group:last-child { border-right: none; }
.ribbon-group:first-child { padding-left: 4px; }
.ribbon-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 60px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s, border-color 0.1s;
}
.ribbon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.ribbon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ribbon-btn .ribbon-icon { font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.ribbon-btn .ribbon-icon [data-lucide], .ribbon-btn .ribbon-icon .lucide { width: 18px; height: 18px; stroke-width: 2; }
.ribbon-btn.primary { color: var(--primary); }
.ribbon-btn.primary:hover { background: var(--primary-soft); border-color: var(--primary); }
.ribbon-btn.danger { color: var(--danger); }
.ribbon-btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.ribbon-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
}
.ribbon-search input {
  width: 200px;
  height: 32px;
  margin: 0;
  font-size: 13px;
}

/* Job wizard */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 20px;
  padding: 10px 0;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.wizard-step:hover { opacity: 0.85; }
.wizard-step.active { opacity: 1; }
.wizard-step.done { opacity: 0.85; }
.wizard-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border-strong);
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}
.wizard-step.active .wizard-step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #052e16;
}
.wizard-step.done .wizard-step-num {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.wizard-step-label {
  font-size: 13px;
  font-weight: 500;
}
.wizard-step.active .wizard-step-label { color: var(--primary); font-weight: 600; }
.wizard-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  max-width: 80px;
}

/* Settings tabs */
.settings-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.settings-tab {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--r-md) 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: -1px;
  transition: background 0.1s, color 0.1s;
}
.settings-tab:hover { color: var(--text); background: var(--surface-2); }
.settings-tab.active {
  background: var(--surface);
  border-color: var(--border);
  border-bottom: 1px solid var(--surface);
  color: var(--primary);
  font-weight: 600;
}

/* Status icon system */
.s-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  flex-shrink: 0;
}
.s-icon.ok      { background: var(--ok); color: white; }
.s-icon.failed  { background: var(--danger); color: white; }
.s-icon.warn    { background: var(--warn); color: white; }
.s-icon.running { background: var(--info); color: white; animation: pulse 1.5s ease-in-out infinite; }
.s-icon.idle    { background: var(--surface-3); color: var(--muted); }
.s-text { display: inline-flex; align-items: center; gap: 6px; }

/* Cards / grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.card h2 { margin-top: 0; font-size: 16px; }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  /* overflow: visible — da "..." dropdown menu može izaći izvan tablice
     na zadnjim redovima. Border-radius i dalje izgleda rounded zbog
     vanjskog border-a; cells nisu vidljivi izvan granica jer su ionako
     unutar tablice. */
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:nth-child(odd) td { background: rgba(255,255,255,0.012); }
.data-table tbody tr:nth-child(odd):hover td { background: var(--surface-2); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge-online { background: rgba(39, 174, 96, 0.15); color: var(--ok); }
.badge-offline { background: rgba(231, 76, 60, 0.15); color: var(--danger); }
.badge-error { background: rgba(231, 76, 60, 0.15); color: var(--danger); }
.badge-unknown { background: rgba(136, 147, 164, 0.15); color: var(--muted); }
.badge-warning { background: rgba(243, 156, 18, 0.15); color: var(--warn); }
.badge-critical { background: rgba(231, 76, 60, 0.15); color: var(--danger); }
.badge-ok { background: rgba(39, 174, 96, 0.15); color: var(--ok); }
.badge-info { background: rgba(52, 152, 219, 0.15); color: #3498db; font-weight: 600; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
}
.modal-content h2 { margin-top: 0; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Progress bar — Veeam-style */
.progress-bar {
  position: relative;
  height: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: 4px 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a9eff 0%, #6ab7ff 100%);
  transition: width 0.4s ease;
}
.progress-bar.progress-warning .progress-fill {
  background: linear-gradient(90deg, #f39c12 0%, #f5b041 100%);
}
.progress-bar.progress-critical .progress-fill {
  background: linear-gradient(90deg, #e74c3c 0%, #ec7063 100%);
}
.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.storage-bar { height: 18px; }

.dest-usage { display: flex; flex-direction: column; gap: 3px; }
.dest-usage .storage-bar { height: 14px; }
.dest-usage-meta {
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
}

/* Active operations */
.active-op {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  margin-bottom: 8px;
}
.active-op-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}
.active-op-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  align-items: center;
}
.active-op-meta a { margin-left: auto; }
.log-tail {
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 3px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  overflow-x: auto;
  white-space: nowrap;
}

/* Card list */
.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.card-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.card-list li:last-child { border-bottom: none; }

.storage-row { margin-bottom: 12px; }
.storage-row-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
}

.row-missing td { opacity: 0.55; }
.row-missing td:first-child::before { content: "⚠ "; color: var(--danger); }

/* Job cards */
.job-card-list { display: flex; flex-direction: column; gap: 10px; }
.job-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  /* overflow: visible — da overflow menu (".tlk-menu-list") može izaći izvan card-a.
     ::before colored bar ima border-radius da prati kartu. */
}
.job-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--muted);
  border-top-left-radius: var(--r-md);
  border-bottom-left-radius: var(--r-md);
}
.job-card.status-ok::before     { background: var(--ok); }
.job-card.status-failed::before { background: var(--danger); }
.job-card.status-running::before{ background: var(--primary); }
.job-card.status-none::before   { background: var(--border); }

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.job-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}
.job-card-title .status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.job-card.status-ok      .status-dot { background: var(--ok); }
.job-card.status-failed  .status-dot { background: var(--danger); }
.job-card.status-running .status-dot { background: var(--primary); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.job-card-actions { display: flex; gap: 6px; }

.job-card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.job-card-stats .stat {
  padding: 12px 18px;
  border-right: 1px solid var(--border);
}
.job-card-stats .stat:last-child { border-right: none; }
.job-card-stats .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.job-card-stats .stat-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.job-card-stats .stat-value .extra {
  display: block;
  font-size: 11px;
  font-weight: normal;
  color: var(--muted);
  margin-top: 2px;
}

.job-card-footer { padding: 12px 18px; }
.job-card-lastrun {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  align-items: center;
}
.job-card-progress {
  background: rgba(74, 158, 255, 0.06);
  border: 1px solid rgba(74, 158, 255, 0.25);
  border-radius: var(--r-md);
  padding: 8px 10px;
  margin-bottom: 8px;
}
.jcp-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.jcp-line strong { color: var(--info); }
.jcp-log {
  margin-top: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-card-lastrun .never { color: var(--muted); font-style: italic; }
.job-card-lastrun .ok      { color: var(--ok); font-weight: 500; }
.job-card-lastrun .failed  { color: var(--danger); font-weight: 500; }
.job-card-lastrun .running { color: var(--primary); font-weight: 500; }
.job-card-lastrun .meta    { color: var(--muted); font-size: 12px; }

.job-card-destinations {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.dest-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.dest-chip .role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
}
.dest-chip .name { font-weight: 500; }
.dest-chip .ret  { color: var(--muted); font-size: 11px; }
.dest-chip.primary { border-color: rgba(74, 158, 255, 0.4); }
.dest-chip.primary .role { color: var(--primary); }
.dest-arrow { color: var(--muted); }

.job-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
}
.job-tag [data-lucide], .job-tag .lucide { width: 11px; height: 11px; stroke-width: 2.4; }

/* Overflow menu — "..." gumb + popup s sekundarnim akcijama */
.tlk-menu { position: relative; display: inline-block; }
.tlk-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.tlk-menu-btn:hover { background: var(--surface-3); border-color: var(--primary); color: var(--text); }
.tlk-menu-btn [data-lucide], .tlk-menu-btn .lucide { width: 16px; height: 16px; pointer-events: none; }
.tlk-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: var(--z-dropdown);
  list-style: none;
  margin: 0;
}
/* Flip-up varijanta — kad bi default donji prikaz prešao viewport, JS dodaje
   ovu klasu i meni se otvara prema gore umjesto dolje. */
.tlk-menu-list.flip-up {
  top: auto;
  bottom: calc(100% + 4px);
}
.tlk-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: var(--text-sm);
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s var(--ease);
}
.tlk-menu-item:hover { background: var(--surface-2); }
.tlk-menu-item.danger { color: var(--danger); }
.tlk-menu-item.danger:hover { background: var(--danger-soft); }
.tlk-menu-item:disabled { opacity: 0.4; cursor: not-allowed; }
.tlk-menu-item [data-lucide], .tlk-menu-item .lucide { width: 14px; height: 14px; flex-shrink: 0; color: var(--muted); pointer-events: none; }
.tlk-menu-item.danger [data-lucide] { color: var(--danger); }
.tlk-menu-divider { height: 1px; background: var(--border); margin: 4px 2px; }

/* Search input s Lucide ikonom unutra */
.search-input-wrap {
  position: relative;
  display: inline-block;
}
.search-input-wrap [data-lucide], .search-input-wrap .lucide {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}
.search-input-wrap input {
  padding-left: 32px !important;
}

.job-card { cursor: pointer; }
.job-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 4px 12px rgba(84,185,72,0.18);
}

/* Kompaktni layout — 2 retka po kartici (~64px ukupne visine) */
.job-card.compact { padding: 8px 14px; }
.job-card.compact .jc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}
.job-card.compact .jc-row-main { gap: 10px; }
.job-card.compact .jc-name { font-size: 14px; font-weight: 600; }
.job-card.compact .jc-actions { margin-left: auto; display: flex; gap: 4px; }
.job-card.compact .jc-actions .btn-action { padding: 4px 10px; font-size: 12px; }
/* Action gumbi koriste default .btn-action veličinu (6px 12px, 13px) — isto kao "Restore VM" */

.job-card.compact .jc-row-meta,
.job-card.compact .jc-row-info {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  padding-left: 28px;
  flex-wrap: wrap;
  row-gap: 2px;
  min-height: 20px;
}
.job-card.compact .jc-row-info > span,
.job-card.compact .jc-row-info code,
.job-card.compact .jc-row-info span.dest-chip {
  /* dopusti normalan text-flow */
}
.job-card.compact .jc-sep { color: var(--muted-2); font-weight: bold; }

.job-card.compact .jc-row-status {
  margin-top: 4px;
  padding-left: 28px;
  font-size: 13px;
  flex-wrap: wrap;
}
.job-card.compact .jc-status-arrow { margin: 0 6px; }

.job-card.compact .jc-row-progress {
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(74,158,255,0.06);
  border: 1px solid rgba(74,158,255,0.25);
  border-radius: var(--r-md);
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.dest-chip.compact {
  padding: 2px 8px;
  font-size: 12px;
  gap: 5px;
}
.dest-chip.compact .role { font-size: 10px; }
.dest-chip.compact .ret { font-size: 11px; }

/* Sakrij stari "stat tile grid" CSS kad nije korišten */
.job-card-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  margin-right: 4px;
  flex-shrink: 0;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.job-card-checkbox [data-lucide], .job-card-checkbox .lucide { width: 12px; height: 12px; stroke-width: 3; }
.job-card.selected .job-card-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: #0a0e13;
}
.job-card.selected .job-card-checkbox [data-lucide] { color: #052e16; }

/* Bulk actions ribbon group */
.ribbon-bulk {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--primary-soft);
  border-radius: var(--r-md);
  margin: 0 4px;
}
.ribbon-bulk-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}
.ribbon-context {
  background: var(--primary-soft);
  border-radius: var(--r-md);
  position: relative;
}
.ribbon-context::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* Detail panel — bottom dock */
.detail-dock {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  height: 320px;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  z-index: 800;
  transition: transform 0.2s ease;
}
.detail-dock.collapsed { transform: translateY(calc(100% - 36px)); }
.detail-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 36px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.detail-dock-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.detail-dock-title .muted { font-weight: 400; }
.detail-dock-controls { display: flex; gap: 4px; }
.detail-dock-controls button {
  padding: 2px 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
}
.detail-dock-controls button:hover { background: var(--surface-3); color: var(--text); }

.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.detail-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}
.detail-tab:hover { color: var(--text); }
.detail-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}
.detail-body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px;
}

/* Stat tiles within detail */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stat-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.stat-tile-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.stat-tile-value {
  font-size: 22px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--text);
}
.stat-tile-value.ok { color: var(--ok); }
.stat-tile-value.fail { color: var(--danger); }
.stat-tile-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Spark bar — last 30 runs as colored bars */
.spark-row {
  display: flex;
  align-items: end;
  gap: 2px;
  height: 36px;
  padding: 4px 0;
}
.spark-bar {
  flex: 1;
  min-width: 4px;
  max-width: 14px;
  border-radius: 2px;
  background: var(--surface-3);
  position: relative;
  cursor: help;
  transition: opacity 0.1s;
}
.spark-bar.ok { background: var(--ok); }
.spark-bar.failed { background: var(--danger); }
.spark-bar.running { background: var(--info); }
.spark-bar.canceled { background: var(--muted-2); }
.spark-bar:hover { opacity: 0.7; }

/* Mini activity list */
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mini-list-item {
  display: grid;
  grid-template-columns: 24px 140px 1fr 100px 100px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 12px;
}
.mini-list-item.failed { border-left: 3px solid var(--danger); }
.mini-list-item.completed { border-left: 3px solid var(--ok); }
.mini-list-item.running { border-left: 3px solid var(--info); }
.mini-list-item .mli-time { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 11px; }
.mini-list-item .mli-status { font-weight: 500; }
.mini-list-item .mli-status.ok { color: var(--ok); }
.mini-list-item .mli-status.failed { color: var(--danger); }
.mini-list-item .mli-status.running { color: var(--info); }
.mini-list-item .mli-meta { color: var(--muted); text-align: right; font-family: "JetBrains Mono", monospace; }
.mini-list-item .mli-error { color: var(--danger); font-size: 11px; }

/* Make space for the dock when open */
body.dock-open main { padding-bottom: 320px; }

/* File browser — folder linkovi svjetli plavi */
.modal-content .data-table a {
  color: #7BC1FF;
  text-decoration: none;
  font-weight: 500;
}
.modal-content .data-table a:hover {
  color: #A8D5FF;
  text-decoration: underline;
}

/* File browser loader */
.fb-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px 16px;
  gap: 14px;
}
.fb-loader-spinner {
  font-size: 48px;
  color: var(--primary);
  animation: spin 1.4s linear infinite;
  line-height: 1;
}
.fb-loader-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.fb-loader-elapsed {
  font-size: 12px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}
.fb-loader-elapsed strong { color: var(--primary); }
.fb-loader-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 400px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 16px;
}
.fb-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.fb-step.st-done    { color: var(--ok); }
.fb-step.st-active  { color: var(--primary); font-weight: 500; }
.fb-step.st-skipped { color: var(--muted-2); font-style: italic; }
.fb-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--muted);
  flex-shrink: 0;
}
.fb-step.st-done .fb-step-icon    { background: var(--ok); color: #0a0e13; }
.fb-step.st-active .fb-step-icon  { background: var(--primary); color: #0a0e13; animation: spin 1.4s linear infinite; }
.fb-step.st-skipped .fb-step-icon { background: var(--surface-3); color: var(--muted); }
.fb-loader-hint {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  max-width: 480px;
  line-height: 1.5;
  margin: 4px 0 0;
}

/* VM picker (checkbox list) */
.vm-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px;
}
.vm-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  margin: 0 !important;
  transition: background 0.1s, border-color 0.1s;
  user-select: none;
}
.vm-picker-item:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}
.vm-picker-item.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.vm-picker-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.vm-pick-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
  color: transparent;
  flex-shrink: 0;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.vm-picker-item.selected .vm-pick-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #0a0e13;
}
.vm-pick-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}
.vm-pick-state {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
}
.vm-pick-state.on  { background: rgba(52, 199, 89, 0.18); color: var(--ok); }
.vm-pick-state.off { background: var(--surface-3); color: var(--muted); }

/* Tip gosta u VM pickeru (Proxmox: KVM vs LXC — bitno jer imaju različite
   backup metode; Hyper-V nema vm_type pa se badge ne prikazuje) */
.vm-pick-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
  flex: none;
}
.vm-pick-type.kvm { background: rgba(74, 158, 255, 0.16); color: var(--info); }
.vm-pick-type.lxc { background: rgba(243, 156, 18, 0.16); color: var(--warn); }
.vm-pick-vmid { font-size: 10px; color: var(--muted-2); font-family: monospace; }

/* Restore points tree */
.rp-tree { display: flex; flex-direction: column; gap: 8px; }
.rp-vm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.rp-vm-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}
.rp-vm-head:hover { background: var(--surface-2); }
.rp-vm-actions {
  margin-left: 14px;
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Restore point picker (date selector) */
.rp-picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 360px;
  overflow-y: auto;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  background: var(--surface-2);
}
.rp-picker-item {
  display: grid !important;
  grid-template-columns: 28px 70px 1fr 100px 90px 22px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  margin: 0 !important;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition: background 0.1s, border-color 0.1s, transform 0.05s;
}
.rp-picker-item:hover:not(:disabled):not(.selected) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.rp-picker-item:active:not(:disabled) { transform: scale(0.99); }
.rp-picker-item.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  border-width: 2px;
  padding: 11px 15px; /* kompenzacija za 2px border */
  box-shadow: 0 0 0 1px var(--primary), 0 2px 8px rgba(34, 197, 94, 0.2);
}
.rp-picker-item.disabled,
.rp-picker-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--surface-2);
}
.rp-pick-icon { font-size: 18px; text-align: center; }
.rp-pick-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  text-align: center;
  letter-spacing: 0.4px;
}
.rp-pick-type.full { background: rgba(74, 158, 255, 0.18); color: var(--info); }
.rp-pick-type.incremental { background: rgba(84, 185, 72, 0.18); color: var(--primary); }
.rp-pick-date { font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 500; }
.rp-pick-size { font-family: "JetBrains Mono", monospace; font-size: 12px; text-align: right; color: var(--muted); }
.rp-pick-status { text-align: right; }
.rp-pick-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s var(--ease);
}
.rp-pick-check > svg {
  width: 12px; height: 12px;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
  pointer-events: none;
}
.rp-pick-check.is-checked,
.rp-picker-item.selected .rp-pick-check {
  background: var(--primary);
}
.rp-pick-check.is-checked > svg,
.rp-picker-item.selected .rp-pick-check > svg {
  opacity: 1;
  color: #052e16;
}
.rp-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
  pointer-events: none; /* SVG path s fill=none ne hvata klikove u praznom prostoru —
                            cijeli .rp-vm-head/.rp-chain-head ima @click pa neka click ide gore. */
}
.rp-toggle [data-lucide], .rp-toggle .lucide { width: 16px; height: 16px; }
.rp-icon { display: inline-flex; align-items: center; pointer-events: none; }
.rp-icon [data-lucide], .rp-icon .lucide { width: 14px; height: 14px; color: var(--muted); }
.rp-stats { margin-left: auto; font-size: 12px; }

.rp-chains {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.rp-chain {
  border-bottom: 1px solid var(--border);
}
.rp-chain:last-child { border-bottom: none; }
.rp-chain-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 36px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}
.rp-chain-head:hover { background: var(--surface-3); }
.rp-chain-id {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text);
}
.rp-points {
  background: var(--bg);
}
.rp-point {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 56px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.rp-point > * { flex: 0 0 auto; }
.rp-point:last-child { border-bottom: none; }
.rp-point:hover { background: var(--surface-2); }
.rp-point.missing { opacity: 0.6; }
.rp-point-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 6px;
  border-radius: 3px;
  text-align: center;
  min-width: 52px;
}
.rp-point-type.full { background: rgba(74, 158, 255, 0.18); color: var(--info); }
.rp-point-type.incremental { background: rgba(84, 185, 72, 0.14); color: var(--primary); }
.rp-point-date { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); white-space: nowrap; }
.rp-point-size { font-family: "JetBrains Mono", monospace; font-weight: 500; min-width: 70px; text-align: right; white-space: nowrap; }
.rp-point .badge { white-space: nowrap; padding: 2px 8px; }
.rp-point-status { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rp-point-actions { display: flex; gap: 6px; justify-content: end; margin-left: auto; }

/* Alarms list */
.alarms-list { display: flex; flex-direction: column; gap: 8px; }
.alarm-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: var(--r-md);
}
.alarm-item.sev-critical { border-left-color: var(--danger); }
.alarm-item.sev-warning  { border-left-color: var(--warn); }
.alarm-item.acked { opacity: 0.55; }
.alarm-icon { display: flex; align-items: center; justify-content: center; }
.alarm-title { font-weight: 600; font-size: 14px; }
.alarm-message {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  font-family: "JetBrains Mono", monospace;
  word-break: break-word;
}
.alarm-meta { font-size: 11px; margin-top: 4px; }
.alarm-actions { display: flex; gap: 6px; flex-direction: column; }

/* Dashboard overview tiles */
.overview-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.ov-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 16px 18px;
}
.ov-tile.has-fail { border-left-color: var(--danger); }
.ov-tile.is-ok    { border-left-color: var(--ok); }
.ov-tile-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}
.ov-tile-value {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ov-num.ok   { color: var(--ok); }
.ov-num.fail { color: var(--danger); }
.ov-sep      { color: var(--muted); }
.ov-tile-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Aktivna verifikacija — pulsira */
.verify-active {
  display: inline-block;
  color: var(--info);
  font-weight: 600;
  background: rgba(74, 158, 255, 0.12);
  border: 1px solid rgba(74, 158, 255, 0.35);
  padding: 1px 8px;
  border-radius: 10px;
  animation: verifyPulse 1.4s ease-in-out infinite;
  font-size: 11px;
}
@keyframes verifyPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 158, 255, 0.4); }
  50%      { opacity: 0.7; box-shadow: 0 0 0 4px rgba(74, 158, 255, 0); }
}

/* Verify badge u header redu joba — istaknut, pored Pokreni gumba */
.jc-verify-status {
  margin-left: auto;
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
}
.verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1.5px solid;
}
.verify-badge .when {
  font-weight: 400;
  font-size: 11px;
  opacity: 0.75;
  margin-left: 2px;
}
.verify-badge.verified {
  color: var(--ok);
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.45);
}
.verify-badge.partial {
  color: var(--ok);
  background: rgba(52, 199, 89, 0.06);
  border-color: rgba(52, 199, 89, 0.30);
  border-style: dashed;
}
.verify-badge.corrupted {
  color: var(--danger);
  background: rgba(231, 76, 60, 0.14);
  border-color: rgba(231, 76, 60, 0.5);
}
.verify-badge.none {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.verify-badge.active {
  color: var(--info);
  background: rgba(74, 158, 255, 0.14);
  border-color: rgba(74, 158, 255, 0.55);
  animation: verifyPulse 1.4s ease-in-out infinite;
}
.verify-badge.active strong { font-size: 13px; }

.job-card.compact .jc-actions { margin-left: 0; }
.job-overview-row.is-verifying {
  border-left-color: var(--info);
  background: rgba(74, 158, 255, 0.05);
}

/* Dashboard pregled jobova s verifikacijom */
.job-overview-list { display: flex; flex-direction: column; gap: 4px; }
.job-overview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: var(--r-md);
  font-size: 13px;
}
.job-overview-row.is-verified   { border-left-color: var(--ok); }
.job-overview-row.is-corrupted  { border-left-color: var(--danger); }
.job-overview-row.is-failed     { border-left-color: var(--danger); }
.job-overview-row.is-unverified { border-left-color: var(--muted); }
.job-overview-icon {
  display: inline-block;
  width: 18px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}
.job-overview-row.is-verified   .job-overview-icon { color: var(--ok); }
.job-overview-row.is-corrupted  .job-overview-icon { color: var(--danger); }
.job-overview-row.is-failed     .job-overview-icon { color: var(--danger); }
.job-overview-row.is-unverified .job-overview-icon { color: var(--muted); }
.job-overview-meta { font-size: 12px; }
.job-overview-flex { flex: 1; }
.job-overview-verified { font-size: 11px; white-space: nowrap; }
.job-overview-legend {
  margin-top: 10px;
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--muted);
}

/* Dashboard donji blok — 2 šire kartice */
.dash-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .dash-bottom { grid-template-columns: 1fr; }
}
.dash-storage h2, .dash-alarms h2 { margin-top: 0; font-size: 15px; }

.dash-alarm-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-alarm-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: var(--r-md);
}
.dash-alarm-item.sev-critical { border-left-color: var(--danger); }
.dash-alarm-item.sev-warning  { border-left-color: var(--warn); }
.dash-alarm-title { font-size: 13px; font-weight: 500; }
.dash-alarm-meta { font-size: 11px; margin-top: 2px; }

/* Heatmap */
.heatmap {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.hm-day {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted-2);
  cursor: help;
  transition: opacity 0.1s;
}
.hm-day:hover { opacity: 0.75; }
.hm-day.ok    { background: var(--ok); color: rgba(0,0,0,0.55); font-weight: 600; }
.hm-day.fail  { background: var(--danger); color: white; font-weight: 600; }
.hm-day.mixed { background: var(--warn); color: rgba(0,0,0,0.55); font-weight: 600; }
.hm-day.running { background: var(--info); color: white; font-weight: 600; }

.hm-legend {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--surface-3);
  vertical-align: middle;
  margin-right: 3px;
}
.hm-legend.ok    { background: var(--ok); }
.hm-legend.fail  { background: var(--danger); }
.hm-legend.mixed { background: var(--warn); }
.hm-legend.none  { background: var(--surface-3); }

/* Active operations widget — pinned bottom-right */
.active-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px var(--primary-soft);
  z-index: 900;
  overflow: hidden;
}
.active-widget-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--primary-soft);
  user-select: none;
}
.active-widget-bar:hover { background: rgba(84, 185, 72, 0.22); }
.active-widget-spinner {
  display: inline-block;
  font-size: 16px;
  color: var(--primary);
  animation: spin 1.4s linear infinite;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin-anim { animation: spin 1s linear infinite; }
.active-widget-text { font-size: 13px; flex: 1; }
.active-widget-text strong { color: var(--primary); margin-right: 4px; }

.active-widget-list {
  max-height: 320px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}
.active-widget-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.active-widget-item:last-child { border-bottom: none; }
.active-widget-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.active-widget-item-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--text);
}
.active-widget-stage {
  margin-top: 4px;
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
}
.active-widget-progress {
  margin-top: 6px;
}
.aw-stage-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-bottom: 4px;
}
.aw-stage-line strong { color: var(--text); }
.aw-pct {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  color: var(--primary);
}
.aw-bar {
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}
.aw-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%);
  transition: width 0.4s ease;
}

/* =============================================================================
   FAZA B — UI MODERNIZATION
   Button system, toasts, skeletons, empty states, sticky tables, badge polish.
   ============================================================================= */

/* --- Button system (.btn) — unificirano svi gumbi -----------------------------
   Coexistira s .btn-action (postojeći). Novi kod koristi .btn .btn-md .btn-primary;
   .btn-action ostaje za backward compat — već je polished iz Faze A. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
              color 0.15s var(--ease), transform 0.15s var(--ease),
              box-shadow 0.15s var(--ease), opacity 0.15s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important;
}
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Sizes */
.btn-sm { padding: 4px 10px; font-size: var(--text-sm); height: 28px; }
.btn-md { padding: 7px 14px; font-size: var(--text-sm); height: 34px; }
.btn-lg { padding: 10px 18px; font-size: var(--text-base); height: 40px; }

/* Variants */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #052e16;
  font-weight: 600;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:disabled { background: var(--primary-soft); border-color: var(--border); color: var(--muted); }

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--primary); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger {
  background: transparent;
  border-color: rgba(231, 76, 60, 0.35);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

/* --- Badges — uniform sizing + light-theme contrast -------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
}

/* Polish za light theme — soft alpha bg blijed, treba veći kontrast */
html[data-theme="light"] .badge-online,
html[data-theme="light"] .badge-ok {
  background: #dcfce7; color: #166534; border-color: #bbf7d0;
}
html[data-theme="light"] .badge-offline,
html[data-theme="light"] .badge-error,
html[data-theme="light"] .badge-critical {
  background: #fee2e2; color: #991b1b; border-color: #fecaca;
}
html[data-theme="light"] .badge-warning {
  background: #fef3c7; color: #92400e; border-color: #fde68a;
}
html[data-theme="light"] .badge-info {
  background: #dbeafe; color: #1e40af; border-color: #bfdbfe;
}
html[data-theme="light"] .badge-unknown {
  background: #e2e8f0; color: #475569; border-color: #cbd5e1;
}

/* --- Empty states ----------------------------------------------------------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-2);
  margin-bottom: 16px;
  color: var(--muted-2);
}
.empty-state-icon [data-lucide], .empty-state-icon .lucide {
  width: 28px; height: 28px;
}
.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-state-desc {
  font-size: var(--text-sm);
  max-width: 360px;
  margin: 0 0 20px;
  line-height: 1.6;
}

/* --- Skeleton loader (shimmer) ---------------------------------------------- */

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  border-radius: var(--r-sm);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }
.skeleton-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 12px;
}

/* --- Sticky table headers + sort indicators -------------------------------- */

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-2);
}
.data-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border-strong);
  user-select: none;
}
.data-table thead th.sortable { cursor: pointer; transition: color 0.15s var(--ease); }
.data-table thead th.sortable:hover { color: var(--text); }
.data-table thead th.sortable .sort-indicator {
  display: inline-block;
  width: 12px;
  margin-left: 4px;
  color: var(--muted-2);
  font-size: 10px;
}
.data-table thead th.sortable.asc .sort-indicator,
.data-table thead th.sortable.desc .sort-indicator {
  color: var(--primary);
}
.data-table thead th.sortable.asc .sort-indicator::after { content: "↑"; }
.data-table thead th.sortable.desc .sort-indicator::after { content: "↓"; }
.data-table thead th.sortable:not(.asc):not(.desc) .sort-indicator::after { content: "↕"; opacity: 0.5; }
.data-table tbody tr { transition: background 0.1s var(--ease); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody td {
  padding: 10px 12px;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border);
}

/* --- Toast notifications (alert() replacement) ------------------------------ */

.tlk-toast-wrap {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 16px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(360px, calc(100vw - 32px));
}
.tlk-toast {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px 12px 14px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: start;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--text);
  animation: toast-slide-in 0.25s var(--ease);
  position: relative;
  border-left: 3px solid var(--border);
}
.tlk-toast.removing { animation: toast-slide-out 0.2s var(--ease) forwards; }
.tlk-toast-icon { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.tlk-toast-icon [data-lucide], .tlk-toast-icon .lucide { width: 18px; height: 18px; }
.tlk-toast-body { min-width: 0; }
.tlk-toast-title { font-weight: 600; line-height: 1.3; }
.tlk-toast-desc { color: var(--muted); margin-top: 2px; line-height: 1.4; }
.tlk-toast-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 16px;
  align-self: start;
}
.tlk-toast-close:hover { color: var(--text); }

.tlk-toast-success { border-left-color: var(--ok); }
.tlk-toast-success .tlk-toast-icon { color: var(--ok); }
.tlk-toast-info    { border-left-color: var(--info); }
.tlk-toast-info    .tlk-toast-icon { color: var(--info); }
.tlk-toast-warn    { border-left-color: var(--warn); }
.tlk-toast-warn    .tlk-toast-icon { color: var(--warn); }
.tlk-toast-error   { border-left-color: var(--danger); }
.tlk-toast-error   .tlk-toast-icon { color: var(--danger); }

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-slide-out {
  to { opacity: 0; transform: translateX(20px); }
}

/* --- Card hierarchy --------------------------------------------------------- */

.card-elevated {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.card-elevated.interactive:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

/* --- Jobs tree (RP-style: grupirano po hostu, jedan red po jobu) ---------- */

.job-tree { display: flex; flex-direction: column; gap: 10px; }
.job-tree .rp-vm {
  background: var(--surface);
  /* override .rp-vm { overflow:hidden } — "..." dropdown na zadnjem job redu
     mora moći izaći izvan host group containera, inače je skriven ispod
     sljedećeg host-a */
  overflow: visible;
}
.job-tree .rp-chains { overflow: visible; }

.job-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 56px; /* lijevi indent (kao .rp-point) za hijerarhiju */
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: relative;
}
.job-row:last-child { border-bottom: none; }
.job-row:hover { background: var(--surface-2); }
.job-row.disabled { opacity: 0.65; }
.job-row.selected { background: rgba(34, 197, 94, 0.06); }
.job-row.selected::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
}

.job-row .status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}
.job-row .status-dot.st-ok      { background: var(--ok); }
.job-row .status-dot.st-failed  { background: var(--danger); }
.job-row .status-dot.st-running { background: var(--primary); animation: pulse 1.5s ease-in-out infinite; }
.job-row .status-dot.st-none    { background: var(--border-strong); }

.job-row-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.job-row-checkbox > svg {
  width: 11px; height: 11px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}
.job-row.selected .job-row-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}
.job-row.selected .job-row-checkbox > svg {
  opacity: 1;
  color: #052e16;
}

.job-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.job-row-name:hover { color: var(--primary); }

.job-row-meta {
  flex: 1 1 auto;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.job-row-meta .jc-sep { color: var(--muted-2); margin: 0 6px; font-weight: bold; }

.job-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}
.job-row-actions .btn-action { padding: 4px 10px; font-size: 12px; }

/* --- Restore points: Host grupa (vanjski layer iznad rp-vm) --------------- */

.rp-host {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 12px;
}
.rp-host-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  background: var(--surface-2);
  border-radius: var(--r-md) var(--r-md) 0 0;
  border-bottom: 1px solid var(--border);
}
.rp-host-head:hover { background: var(--surface-3); }
.rp-host-body {
  /* unutarnji rp-vm-ovi gube vlastiti border-radius da se uklope u host kontejner */
  padding: 0;
}
.rp-host-body .rp-vm {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
  background: transparent;
}
.rp-host-body .rp-vm:last-child { border-bottom: none; }

/* --- Restore wizard (jobs page) — pick lists ----------------------------- */

.wiz-pick-list {
  list-style: none;
  margin: 12px 0;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wiz-pick-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s var(--ease), border-color 0.1s var(--ease);
}
.wiz-pick-row:hover { background: var(--surface); border-color: var(--primary); }
.wiz-pick-row:disabled { opacity: 0.5; cursor: not-allowed; }
.wiz-pick-row .wiz-pick-icon { color: var(--muted); width: 16px; height: 16px; }
.wiz-pick-row .wiz-pick-arrow { margin-left: auto; color: var(--muted); width: 14px; height: 14px; }
.wiz-pick-row strong { font-weight: 600; }

/* --- Restore wizard calendar grid (Step 2) -------------------------------- */

.wiz-cal {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  margin: 12px 0;
}
.wiz-cal-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}
.wiz-cal-head strong {
  font-size: 14px;
  min-width: 160px;
  text-align: center;
  text-transform: capitalize;
}
.wiz-cal-head button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}
.wiz-cal-head button:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--primary);
  color: var(--primary);
}
.wiz-cal-head button:disabled { opacity: 0.35; cursor: not-allowed; }
.wiz-cal-head button [data-lucide], .wiz-cal-head button .lucide {
  width: 14px; height: 14px;
}

.wiz-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.6px;
  font-weight: 600;
}
.wiz-cal-dow span { text-align: center; padding: 4px 0; }

.wiz-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.wiz-cal-day {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 4px;
  font-family: inherit;
  font-size: 13px;
  min-height: 44px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.1s var(--ease), border-color 0.1s var(--ease), color 0.1s var(--ease);
}
.wiz-cal-day.pad { visibility: hidden; }
.wiz-cal-day.empty {
  color: var(--muted-2);
  cursor: default;
  opacity: 0.55;
  background: transparent;
}
/* Dani s backup-om — INC samo (plava) */
.wiz-cal-day.has-rp {
  background: rgba(74, 158, 255, 0.14);
  border-color: rgba(74, 158, 255, 0.45);
  color: var(--info);
  font-weight: 600;
}
/* Dani s FULL backup-om (jača boja, primary) */
.wiz-cal-day.has-rp.has-full {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.5);
  color: var(--ok);
}
.wiz-cal-day.has-rp:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #052e16;
}
.wiz-cal-day:disabled { cursor: not-allowed; }
.wiz-cal-day-num { font-size: 13px; line-height: 1.1; }
.wiz-cal-day-count {
  font-size: 9px;
  font-weight: 500;
  margin-top: 1px;
  opacity: 0.85;
}

.wiz-cal-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}
.wiz-cal-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.wiz-cal-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid;
}
.wiz-cal-swatch.full { background: rgba(34, 197, 94, 0.16); border-color: rgba(34, 197, 94, 0.5); }
.wiz-cal-swatch.inc  { background: rgba(74, 158, 255, 0.14); border-color: rgba(74, 158, 255, 0.45); }
