:root {
  --app-zoom: 0.8;
  --bg: #eef3f8;
  --bg-soft: #f7fbff;
  --card: #ffffff;
  --text: #122033;
  --muted: #5f7085;
  --line: #d8e4ef;
  --blue-dark: #0e2a52;
  --blue: #2196f3;
  --blue-soft: #eef6ff;
  --blue-deep: #173b6d;
  --shadow: 0 18px 44px rgba(15, 32, 59, 0.10);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --danger-bg: #fff1f2;
  --danger-border: #fecdd3;
  --danger-text: #b42318;
  --ok-bg: #ecfdf5;
  --ok-text: #166534;
  --warn-bg: #fff7ed;
  --warn-text: #9a3412;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
html, body { overflow-x: clip; }
body {
  zoom: var(--app-zoom);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(33,150,243,0.10), transparent 22%),
    radial-gradient(circle at bottom right, rgba(14,42,82,0.10), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

@supports not (zoom: 1) {
  body {
    width: calc(100% / var(--app-zoom));
    min-height: calc(100vh / var(--app-zoom));
    transform: scale(var(--app-zoom));
    transform-origin: top left;
  }
}
a { color: var(--blue-dark); }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
.app-global-search { position:fixed;z-index:100;top:0;right:0;left:250px;height:66px;padding:12px 26px;border-bottom:1px solid #dce3e8;background:#fff; }
.service-topbar .app-global-search { position:relative;top:auto;right:auto;left:auto;z-index:40;width:min(430px,32vw);height:auto;margin-left:24px;padding:0;border:0;background:transparent; }
.app-global-search-form { display:flex;align-items:center;gap:9px;width:min(430px,100%);min-height:42px;padding:3px 4px 3px 14px;border:1px solid #dce3e8;border-radius:5px;background:#f2f5f6;box-shadow:none; }
.app-global-search-icon { color:var(--blue);font-size:23px; }
.app-global-search-form input { min-width:0;flex:1;border:0;outline:0;background:transparent;color:var(--text);font-size:15px; }
.app-global-search-form kbd { padding:5px 8px;border:1px solid var(--line);border-radius:7px;background:var(--bg-soft);color:var(--muted);font:700 11px Arial,sans-serif; }
.app-global-search-form button { align-self:stretch;padding:0 16px;border:0;border-radius:4px;background:#1ba3d5;color:#fff;font-weight:800;cursor:pointer; }
.app-global-search-panel { position:absolute;top:58px;left:26px;width:min(650px,calc(100% - 52px));max-height:min(560px,70vh);overflow-y:auto;padding:10px;border:1px solid var(--line);border-radius:5px;background:#fff;box-shadow:0 16px 36px rgba(15,32,59,.18); }
.service-topbar .app-global-search-panel { top:calc(100% + 8px);left:0;width:min(650px,70vw); }
.app-global-search-status { margin:4px 6px 10px;color:var(--muted);font-size:13px; }
.app-global-search-results { display:grid;gap:6px; }
.app-global-search-result { display:grid;grid-template-columns:110px minmax(160px,1fr) 1fr;gap:10px;align-items:center;padding:11px 12px;border-radius:10px;color:var(--text);text-decoration:none; }
.app-global-search-result:hover { background:var(--blue-soft); }
.app-global-search-result span { color:var(--blue);font-size:10px;font-weight:900;text-transform:uppercase; }
.app-global-search-result small { overflow:hidden;color:var(--muted);text-overflow:ellipsis;white-space:nowrap; }
body:has(.service-shell.service-sidebar-collapsed) .app-global-search { left:0; }
body:has(.app-global-search):not(:has(.service-shell)) { padding-top:66px; }
@media(max-width:1200px) and (min-width:821px) {
  .app-global-search { left:228px; }
}
@media(max-width:700px) {
  :root { --app-zoom: 1; }
  .app-global-search { left:0;height:60px;padding:9px 10px; }
  .app-global-search-form { padding-left:12px; }
  .app-global-search-form kbd { display:none; }
  .app-global-search-form button { padding:0 12px; }
  .app-global-search-result { grid-template-columns:80px 1fr; }
  .app-global-search-result small { grid-column:2; }
  .service-topbar .app-global-search { width:100%;height:auto;margin-left:0;padding:0; }
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #0b1f3c, #16345f 60%, #1f4d86 100%);
  color: #fff;
  padding: 18px 16px;
  box-shadow: 0 10px 28px rgba(11,31,60,0.20);
}
.topbar-inner {
  max-width: 1700px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.brand-block { display:flex; align-items:center; gap:14px; }
.brand-mark {
  width: 54px; height: 54px; object-fit: contain; display:block;
  background: rgba(255,255,255,0.08); padding: 6px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
}
.topbar h1 { margin: 0; font-size: 28px; line-height:1.1; }
.topbar .meta { font-size: 14px; color: rgba(255,255,255,0.78); margin-top: 6px; }
.topbar .links, .links { display:flex; gap:10px; flex-wrap:wrap; }
.topbar a, .nav-link {
  color:#fff; text-decoration:none; font-weight:700;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
}
.topbar a:hover, .nav-link:hover { background: rgba(255,255,255,0.14); }
.topbar-context{font-weight:800;font-size:28px;line-height:1;color:#fff;margin-bottom:8px;}
.topbar-logo img{width:170px;max-width:100%;height:auto;}
.topbar-page-actions{display:flex;gap:10px;align-self:flex-end;margin-left:auto;}
.topbar-page-actions button{
  color:#fff;
  font-weight:700;
  padding:10px 14px;
  border-radius:12px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.10);
  cursor:pointer;
}
.topbar-page-actions button:hover{background:rgba(255,255,255,0.14);}
.topbar-main{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;width:100%;flex-wrap:wrap;}
.topbar-left{min-width:0;flex:1 1 auto;}

.topbar-notifications {
  position: relative;
  align-self: flex-end;
  margin-left: auto;
}

.topbar-alerts {
  margin-left: 0;
}

.notifications-toggle {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  color: #fff;
  box-shadow: none;
}

.notifications-toggle:hover,
.notifications-toggle.has-unread {
  background: rgba(255,255,255,0.18);
}

.notifications-icon {
  font-size: 21px;
  line-height: 1;
}

.notifications-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #16345f;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}

.alerts-count {
  background: #f59e0b;
}

.notifications-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  display: none;
  width: min(380px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(15, 32, 59, 0.12);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 22px 60px rgba(15, 32, 59, 0.22);
}

.topbar-notifications.is-open .notifications-panel {
  display: block;
}

@media (max-width: 820px) {
  .notifications-panel {
    position: fixed;
    top: var(--notifications-mobile-top, 76px);
    right: 12px;
    left: 12px;
    width: auto;
    max-height: var(--notifications-mobile-max-height, calc(100dvh - 88px));
    border-radius: 14px;
  }

  .topbar-notifications.is-open .notifications-panel {
    display: flex;
    flex-direction: column;
  }

  .notifications-list {
    min-height: 0;
    max-height: none;
    overscroll-behavior: contain;
  }

  .notifications-head,
  .notifications-all {
    flex: 0 0 auto;
  }
}

.notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.notifications-head strong {
  color: var(--blue-dark);
  font-size: 16px;
}

.notifications-mark-all {
  width: auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue-dark);
  font-size: 12px;
  box-shadow: none;
}

.notifications-list {
  max-height: 390px;
  overflow-y: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  background: #f8fbff;
  color: inherit;
  text-decoration: none;
}

.notification-item:hover {
  background: #eef6ff;
}

.notification-item.is-read {
  background: #fff;
}

.notification-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--blue);
}

.notification-item.is-read .notification-dot {
  background: #cbd5e1;
}

.alert-notification-item .notification-dot {
  background: #f59e0b;
}

.alert-notification-item.alert-high .notification-dot {
  background: #dc2626;
}

.alert-notification-item.alert-low .notification-dot {
  background: #2563eb;
}

.notification-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.notification-body strong {
  color: #111827;
  font-size: 14px;
}

.notification-body span {
  color: #344054;
  font-size: 13px;
  line-height: 1.35;
}

.notification-body small {
  color: var(--muted);
  font-size: 12px;
}

.notifications-empty {
  margin: 0;
  padding: 18px 14px;
  color: var(--muted);
  font-size: 14px;
}

.notifications-all {
  display: block;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: #f5faff;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.wrap { max-width: 1700px; margin: 0 auto; padding: 26px 14px 42px; }
.panel {
  background: rgba(255,255,255,0.98);
  border:1px solid rgba(216,228,239,0.95);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.hero { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; flex-wrap:wrap; }
.hero h2, .panel h2 { margin:0 0 8px; color: var(--blue-dark); font-size: 30px; }
.summary { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:14px; margin: 18px 0 22px; }
.summary-card {
  border:1px solid var(--line); border-radius: 18px; padding:14px 16px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.summary-card .label { font-size: 12px; color: var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:0.04em; }
.summary-card .value { font-size:18px; font-weight:800; margin-top: 8px; color: var(--blue-dark); }
.form-grid, .grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:14px; }
.po-grid, .row2, .inline-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:14px; }
.field, .field-long, .time-block {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border:1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.field.full, .field-long, .time-block, .actions.full { grid-column: 1 / -1; }
.field label, .field-long label, .time-block label {
  display:block; margin-bottom:8px; font-size:14px; font-weight:800; color: var(--blue-dark);
}
input, select, textarea, button {
  font-family: inherit; font-size:16px;
}
input, select, textarea {
  width:100%; border:1px solid #c7d7e8; border-radius:14px; padding:12px 14px;
  background: #f4f9ff; color: var(--text); outline:none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  background:#fff;
  box-shadow: 0 0 0 4px rgba(33,150,243,0.12);
}
textarea { resize: vertical; min-height: 92px; }
button, .link-btn {
  border:none; border-radius:14px; padding:12px 18px; font-weight:800; cursor:pointer;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue)); color:#fff;
  text-decoration:none; display:inline-flex; align-items:center; justify-content:center;
  box-shadow: 0 12px 24px rgba(14,42,82,0.16);
}
button.secondary { background: #e9eef5; color: var(--blue-dark); box-shadow:none; }
.toolbar {
  display:grid; gap:10px; margin-bottom:16px;
  grid-template-columns: 1.5fr repeat(4, minmax(140px,1fr)) auto auto;
}
.small, .help, .hint, .subtle, .muted, #countInfo, .meta {
  color: var(--muted); font-size: 13px; line-height: 1.5;
}
.hint {
  background: #f6fbff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px;
}
.table-scroller { overflow-x:auto; border:1px solid var(--line); border-radius:18px; background:#fff; }
table { width:100%; border-collapse: collapse; min-width: 1200px; }
th, td { text-align:left; padding: 12px 12px; border-bottom:1px solid #e8eef5; vertical-align:top; }
th {
  background: #f5faff; color: var(--blue-dark); font-size: 13px; font-weight:800; white-space: nowrap;
}
tr:hover td { background: #fbfdff; }
.metric, .badge {
  display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; font-size:12px; font-weight:800;
}
.metric { background:#f5faff; border:1px solid var(--line); color: var(--blue-dark); }
.badge { background:#eef6ff; color: var(--blue-dark); }
.badge.novo { background:#dbeafe; color:#1d4ed8; }
.badge.utijeku { background:#fff1cc; color:#9a6700; }
.badge.zavrseno { background:#dcfce7; color:#166534; }
.attachments a { display:inline-block; margin:3px 0; word-break: break-word; }
.actions { display:flex; gap:10px; flex-wrap:wrap; margin-top: 16px; }
.status { margin-top:12px; font-weight:700; color: var(--blue-dark); }
.message { margin-top: 14px; padding: 13px 14px; border-radius: 14px; font-weight: 700; display:none; }
.message.ok { display:block; background: var(--ok-bg); color: var(--ok-text); }
.message.err { display:block; background: var(--danger-bg); color: var(--danger-text); }
.login-shell { max-width:760px; margin: 0 auto; }
.login-card {
  background: rgba(255,255,255,0.98); border:1px solid rgba(216,228,239,0.95); border-radius:28px;
  box-shadow: var(--shadow); padding: 38px 38px 28px; overflow:hidden; position:relative;
}
.login-card::before { content:""; position:absolute; left:0; top:0; width:100%; height:6px; background: linear-gradient(90deg, var(--blue-dark), var(--blue)); }
.brand { display:flex; flex-direction:column; align-items:center; text-align:center; margin-bottom:30px; }
.brand-logo { width:min(100%, 360px); height:auto; display:block; margin-bottom:18px; }
.brand-title { margin:0; font-size:38px; line-height:1.08; font-weight:800; color:var(--blue-dark); letter-spacing:-0.02em; }
.brand-title .accent { color: var(--blue); }
.brand-subtitle { margin:12px 0 0; font-size:18px; line-height:1.5; color:var(--muted); }
.form-wrap { background:linear-gradient(180deg, #fff 0%, #fbfdff 100%); border:1px solid var(--line); border-radius:22px; padding:28px 24px 24px; margin-top:10px; }
.form-title { margin:0 0 8px; font-size:24px; font-weight:800; color: var(--blue-dark); }
.form-subtitle { margin:0 0 22px; color:var(--muted); font-size:16px; line-height:1.5; }
.login-field { margin-bottom:16px; background:none; border:none; padding:0; }
.error { margin-bottom:18px; padding:13px 14px; border-radius:14px; background:var(--danger-bg); border:1px solid var(--danger-border); color:var(--danger-text); font-weight:700; font-size:14px; }
.powered { margin-top:28px; padding-top:22px; border-top:1px solid var(--line); display:flex; flex-direction:column; align-items:center; gap:16px; text-align:center; }
.powered-label { font-size:14px; font-weight:700; color:var(--muted); letter-spacing:0.02em; }
.powered-logos { display:flex; align-items:center; justify-content:center; gap:22px; flex-wrap:wrap; }
.powered-odrzavajme { width:190px; }
.powered-avantcar { width:180px; filter: brightness(0) saturate(100%); opacity:0.96; }
.divider { width:1px; height:30px; background: var(--line); }
@media (max-width: 1200px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .grid, .summary, .form-grid, .po-grid, .row2, .inline-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .wrap { padding-top: 18px; }
  .grid, .summary, .form-grid, .po-grid, .row2, .inline-grid, .toolbar { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 24px; }
  .panel { padding: 18px; border-radius: 18px; }
  .brand-title { font-size: 28px; }
  .brand-logo { width: min(100%, 280px); }
  .divider { display:none; }
}

.user-pill-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.service-user-menu-toggle {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}

.user-pill-menu .service-user-menu-toggle {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.user-pill-menu .service-user-menu-toggle:hover,
.user-pill-menu.is-open .service-user-menu-toggle {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.service-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  display: none;
  min-width: 170px;
  overflow: hidden;
  border: 1px solid rgba(15, 32, 59, 0.12);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 18px 44px rgba(15, 32, 59, 0.22);
}

.user-pill-menu.is-open .service-user-menu {
  display: block;
}

.topbar .service-user-menu a,
.service-user-menu a,
.service-user-menu .logout-button {
  display: block;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.topbar .service-user-menu a:hover,
.service-user-menu a:hover,
.service-user-menu .logout-button:hover {
  background: #eef6ff;
}

.service-user-menu .logout-form {
  margin: 0;
}
.topbar-messages { margin-left: 0; }
.messages-count { background: #22c55e; }
.message-notification-item .notification-dot { background: #22c55e; }
.timeline-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.timeline-attachments a { border: 1px solid #cfe0f3; border-radius: 999px; padding: 6px 10px; background: #f4f9ff; color: var(--blue-dark); font-size: 13px; font-weight: 800; text-decoration: none; }
