:root {
  /* Tema usklađena s HR Managerom / OBZ Praksom */
  --bg: #f1f4f8;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #e9eef5;
  --border: #dfe5ee;
  --border-strong: #c5cfdc;
  --text: #16243a;
  --text-2: #4a5a72;
  --muted: #74839a;
  --primary: #2a64ad;
  --primary-600: #20518f;
  --primary-50: #e8f0fa;
  --primary-100: #d3e2f5;
  --accent: #3ba3c9;
  --green: #1f9d6b;
  --green-bg: #dcf5ea;
  --green-text: #17654a;
  --red: #d64545;
  --red-bg: #fde6e6;
  --red-text: #a12f2f;
  --amber: #e3a008;
  --amber-bg: #fff3d6;
  --amber-text: #8a5d00;
  --purple: #7a68d6;
  --teal: #2f9e74;
  --sidebar: #1a2740;
  --sidebar-2: #23344f;
  --sidebar-text: #b9c6da;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22, 36, 58, .05), 0 2px 6px rgba(22, 36, 58, .05);
  --shadow-lg: 0 24px 48px -16px rgba(22, 36, 58, .35);
  --sans: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
[hidden] { display: none !important; }
svg.lucide { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }

/* ---------- Layout ---------- */
::selection { background: var(--primary-100); }
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; color: var(--sidebar-text);
  background: linear-gradient(180deg, #1a2740 0%, #1d2f4c 60%, #213a5c 100%);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-logo { width: 44px; height: 44px; display: block; flex-shrink: 0; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.brand-name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: #8fa3c0; margin-top: 2px; }
.brand-ver { font-size: 11px; color: #6f84a3; }
.nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(127,178,238,.45) transparent; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6f84a3; padding: 14px 12px 6px; font-weight: 600; }
.nav-label:first-child { padding-top: 2px; }
.nav a, .nav-bottom a, .nav-bottom button {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--sidebar-text);
  font-weight: 500; text-decoration: none; background: none; border: 0; cursor: pointer; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav-bottom a:hover, .nav-bottom button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: linear-gradient(90deg, var(--primary), #3576c4); color: #fff; box-shadow: 0 6px 16px -8px rgba(42,100,173,.9); }
.nav a.sub { padding: 7px 12px 7px 30px; font-size: 13px; }
.nav a.sub svg.lucide { width: 15px; height: 15px; opacity: .85; }
.nav-bottom { padding: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 12px 10px; min-width: 0; }
.user-chip > div:last-child { min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #3ba3c9, #2a64ad); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex-shrink: 0; }
.user-name { color: #fff; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11.5px; color: #8fa3c0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { flex: 1; min-width: 0; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 48px; }
.page.wide { max-width: none; }
.mobile-bar { display: none; }
/* Sakrivanje glavnog izbornika (računalo) */
.sidebar { transition: margin-left .2s ease; }
.nav-toggle { margin-left: auto; align-self: center; flex-shrink: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: #8fa3c0; cursor: pointer; transition: background .15s, color .15s; }
.nav-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-show { display: none; position: fixed; left: 0; top: 14px; z-index: 60; width: 34px; height: 40px; border: 0; border-radius: 0 10px 10px 0; background: linear-gradient(180deg, #1d2f4c, #213a5c); color: #c3d0e3; cursor: pointer; place-items: center; box-shadow: 0 6px 16px -8px rgba(22,36,58,.8); }
.nav-show:hover { color: #fff; width: 40px; }
.nav-show svg.lucide { width: 18px; height: 18px; }
.nav-toggle:focus-visible, .nav-show:focus-visible { outline: 2px solid #7fb2ee; outline-offset: 2px; }
html.nav-hidden .sidebar { margin-left: -248px; visibility: hidden; transition: margin-left .2s ease, visibility 0s .2s; }
html.nav-hidden .nav-show { display: grid; }
html.nav-hidden .main { padding-left: 30px; }
@media (prefers-reduced-motion: reduce) { .sidebar, html.nav-hidden .sidebar { transition: none; } }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-family: var(--sans); font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.015em; }
.page-sub { color: var(--text-2); margin-top: 4px; font-size: 14.5px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-block; font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: var(--primary-50); color: var(--primary); font-weight: 500; margin-top: 8px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 4px 12px -6px rgba(42,100,173,.8); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn-success:hover { background: #17845a; border-color: #17845a; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn-danger:hover { background: #b93636; border-color: #b93636; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.plain { border-color: transparent; background: transparent; }
.icon-btn.danger { color: var(--red); }

.input, .select, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(42, 100, 173, .15); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2374839a' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.search { position: relative; }
.search > svg.lucide { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 36px; }
.search input[data-search] { padding-right: 34px; }
.search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.search-clear:hover { background: var(--surface-2); color: var(--text); }
.search input:placeholder-shown + .search-clear { display: none; }
label.lbl, .lbl { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; color: var(--text-2); }
.lbl .opt { color: var(--muted); font-weight: 400; }
.field { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .field { margin-bottom: 14px; }
.date-field { display: flex; gap: 6px; position: relative; }
.date-field .native-picker { position: absolute; right: 0; bottom: 0; width: 34px; height: 34px; opacity: 0; pointer-events: none; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-title { font-size: 16px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-title svg.lucide { color: var(--primary); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.link-sm { font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { padding: 18px; display: flex; justify-content: space-between; align-items: flex-start; }
.stat-link { color: inherit; text-decoration: none; transition: box-shadow .18s, transform .18s, border-color .18s; }
.stat-link:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--border-strong); box-shadow: 0 10px 24px -8px rgba(22, 36, 58, .28); }
.stat-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.stat-label { color: var(--text-2); font-size: 13px; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.stat-icon svg.lucide { width: 20px; height: 20px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; border: 1px solid transparent; }
.list-item:hover { background: var(--primary-50); border-color: var(--primary-100); }
.li-title { font-weight: 500; }
.li-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.li-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 32px 0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.st-completed { background: var(--green-bg); color: var(--green-text); border-color: #bbf7d0; }
.st-cancelled { background: var(--red-bg); color: var(--red-text); border-color: #fecaca; }
.st-confirmed { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.st-pending { background: var(--amber-bg); color: var(--amber-text); border-color: #fde68a; }
.st-in-progress { background: #ccfbf1; color: #0f766e; border-color: #99f6e4; }
.st-scheduled { background: #dbeafe; color: #1d4ed8; }
.badge.grey { background: var(--surface-3); color: var(--text-2); }
.badge.repair { background: var(--red-bg); color: var(--red-text); }
.badge.service { background: #dbeafe; color: #1d4ed8; }
.badge.inspection { background: #ede9fe; color: #6d28d9; }
.badge.cleaning { background: #ccfbf1; color: #0f766e; }
.badge.upgrade { background: var(--amber-bg); color: var(--amber-text); }
.desk-ico { display: inline-flex; vertical-align: -2px; color: #059669; }
.desk-ico svg { width: 14px; height: 14px; }
.badge.blue { background: var(--primary-50); color: var(--primary); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; background: var(--surface-2); }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover { background: #f7f9fc; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl .num { text-align: center; }
.tbl .r { text-align: right; }
.tbl tfoot td { font-weight: 600; border-bottom: none; }
.sub { font-size: 12px; color: var(--muted); }
.money { color: var(--primary); font-weight: 600; }
.share { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-size: 12px; color: var(--muted); }
.bar { width: 70px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

/* ---------- Boats ---------- */
.boat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.boat-card { overflow: hidden; display: flex; flex-direction: column; }
.boat-img { height: 170px; overflow: hidden; background: linear-gradient(135deg, #d3e2f5, #e6f3f9); position: relative; display: grid; place-items: center; color: #6f9bd0; }
.boat-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.boat-img svg.lucide { width: 56px; height: 56px; }
.boat-img .badge { position: absolute; top: 12px; right: 12px; }
.boat-body { padding: 16px 20px 18px; display: flex; flex-direction: column; flex: 1; }
.boat-model { color: var(--primary); text-transform: uppercase; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.boat-name { font-size: 18px; font-weight: 600; margin-top: 4px; }
.boat-type { color: var(--muted); }
.boat-price { color: var(--primary); font-weight: 700; font-size: 19px; white-space: nowrap; }
.boat-price small { color: var(--muted); font-weight: 400; font-size: 12px; }
.boat-meta { display: flex; gap: 16px; color: var(--muted); margin: 12px 0 14px; }
.boat-meta span { display: inline-flex; align-items: center; gap: 6px; }
.boat-actions { display: flex; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; margin-top: auto; }
.boat-actions .btn { flex: 1; }
.st-available { background: var(--green-bg); color: var(--green-text); }
.st-maintenance { background: var(--amber-bg); color: var(--amber-text); }
.st-unavailable { background: var(--red-bg); color: var(--red-text); }

.img-drop { border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 20px; text-align: center; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.img-drop:hover, .img-drop.over { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.img-preview { position: relative; border-radius: 10px; overflow: hidden; }
.img-preview img { width: 100%; max-height: 180px; object-fit: cover; display: block; }
.img-preview .icon-btn { position: absolute; top: 8px; right: 8px; border-radius: 999px; background: rgba(15,23,42,.7); color: #fff; border: 0; width: 28px; height: 28px; }

/* ---------- Filters ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 220px; }
.toolbar .select { width: 160px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 0 14px; height: 34px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--primary); color: #fff; }
.seg button:not(.on):hover { background: var(--surface-2); }
.popover { position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 14px; }
.menu { position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; min-width: 160px; }
.menu button { display: flex; width: 100%; gap: 8px; align-items: center; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; text-align: left; color: var(--text); }
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--red); }

/* ---------- Customers ---------- */
.cust { padding: 14px 18px; margin-bottom: 12px; }
.cust-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cust-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.cust-name svg.lucide { color: var(--muted); }
.cust-main { cursor: pointer; flex: 1; }
.cust-main:hover .cust-name { color: var(--primary); }
.cust-contact { display: flex; gap: 18px; color: var(--text-2); margin-top: 6px; flex-wrap: wrap; }
.cust-contact span { display: inline-flex; gap: 5px; align-items: center; }
.cust-note { font-style: italic; color: var(--text-2); font-size: 12.5px; margin-top: 6px; }
.cust-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.stars { color: #f5b301; letter-spacing: 1px; font-size: 13px; white-space: nowrap; }
.stars .off { color: #d6d9de; }
.star-input { display: flex; gap: 6px; }
.star-input button { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: #d6d9de; padding: 0; }
.star-input button.on { color: #f5b301; }
.cust-history { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.clip { color: var(--primary); display: inline-flex; }

.doc-pill { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.doc-pill a { display: inline-flex; gap: 6px; align-items: center; }
.ocr-status { font-size: 12.5px; color: var(--primary); display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--primary-50); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Maintenance ---------- */
.m-stats { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 16px; margin-bottom: 18px; }
.cost-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); padding: 3px 0; }
.cost-line span:first-child { color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-line span:last-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.cost-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; font-weight: 600; }
.cost-total .money { font-size: 20px; }
.alert { display: flex; align-items: center; gap: 10px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 10px 16px; margin-bottom: 10px; color: var(--text-2); }
.alert svg.lucide { color: #ea580c; }
.alert strong { color: var(--text); }
.alert a { margin-left: auto; color: #ea580c; font-size: 12.5px; text-decoration: underline; }
.alert.overdue { background: var(--red-bg); border-color: #fecaca; }
.m-item { padding: 16px 18px; margin-bottom: 12px; display: flex; justify-content: space-between; gap: 16px; }
.m-title { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.m-desc { color: var(--text-2); margin-top: 4px; }
.m-meta { display: flex; gap: 18px; color: var(--text-2); margin-top: 8px; font-size: 13px; flex-wrap: wrap; }
.m-meta span { display: inline-flex; align-items: center; gap: 6px; }
.m-right { display: flex; align-items: flex-start; gap: 8px; }
.m-cost { color: var(--primary); font-weight: 700; font-size: 18px; white-space: nowrap; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 27, 46, .55); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 16px; overflow-y: auto; }
.modal { background: #fbfcfe; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 500px; padding: 22px 24px; position: relative; animation: pop .14s ease-out; }
.modal.lg { max-width: 640px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-title { font-size: 19px; font-weight: 700; margin: 0 0 18px; padding-right: 30px; display: flex; align-items: center; gap: 10px; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.total-box { background: linear-gradient(135deg, #f3f8fe, #eaf2fb); border: 1px solid var(--primary-100); border-radius: 10px; padding: 16px; display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.total-box label { color: var(--primary-600); font-weight: 500; }
.total-box .input { width: 150px; text-align: right; font-weight: 600; color: var(--primary); font-size: 15px; }
.form-error { color: var(--red-text); background: var(--red-bg); border-radius: 9px; padding: 9px 12px; margin-top: 12px; font-size: 13px; }

.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-lg); z-index: 20; max-height: 240px; overflow-y: auto; }
.ac-item { padding: 8px 12px; cursor: pointer; }
.ac-item:hover, .ac-item.hl { background: var(--primary-50); }
.cust-btns { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 4px; }
.cust-btn { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--muted); cursor: pointer; }
.cust-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.cust-btn svg.lucide { width: 15px; height: 15px; }
.ac input[name=customerName] { padding-right: 70px; }
.ac .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; display: grid; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #16243a; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 380px; animation: pop .15s; display: flex; align-items: center; gap: 10px; }
.toast.error { background: var(--red); }
.toast.success { background: #17654a; }

/* ---------- Month calendar (Bookings) ---------- */
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-title { font-size: 19px; font-weight: 700; min-width: 170px; text-align: center; }
.cal-head .seg { margin-left: auto; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); border-radius: 8px; overflow: hidden; }
.month .dow { text-align: center; color: var(--text-2); font-size: 13px; padding: 8px 0 14px; }
.month .day { min-height: 92px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px 4px; cursor: pointer; background: var(--surface); }
.month .day:nth-child(7n) { border-right: 0; }
.month .day.out { background: var(--surface-3); cursor: default; }
.month .day.today .dnum { background: var(--primary); color: #fff; border-radius: 999px; }
.dnum { font-size: 12.5px; font-weight: 500; display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin: 0 0 4px 4px; }
.ev { display: block; font-size: 11px; padding: 2px 5px; border-radius: 4px; margin-bottom: 3px; border: 1px solid; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ev-pending { background: #fef9c3; border-color: #fde047; color: #854d0e; }
.ev-confirmed { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.ev-in-progress { background: #ccfbf1; border-color: #5eead4; color: #115e59; }
.ev-completed { background: #dcfce7; border-color: #86efac; color: #166534; }
.ev-cancelled { background: #fee2e2; border-color: #fca5a5; color: #991b1b; text-decoration: line-through; }
.ev-scheduled { background: #e0e7ff; border-color: #a5b4fc; color: #3730a3; }
.ev-due { border-style: dashed; font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-top: 14px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; border: 1px solid; display: inline-block; }
.week-list .wday { border-bottom: 1px solid var(--border); padding: 10px 4px; display: grid; grid-template-columns: 120px 1fr; gap: 10px; cursor: pointer; }
.week-list .wday:hover { background: var(--surface-2); }
.week-list .wday .ev { display: inline-block; margin-right: 6px; font-size: 12px; padding: 4px 8px; }

/* ---------- Planner ---------- */
.planner { overflow-x: auto; }
.pl-grid { min-width: 100%; }
.pl-row { display: grid; border-bottom: 1px solid var(--border); position: relative; }
.pl-row:last-child { border-bottom: 0; }
.pl-head { background: var(--surface); position: sticky; top: 0; z-index: 3; }
.pl-boat { padding: 10px 14px; border-right: 1px solid var(--border); display: flex; gap: 10px; align-items: center; background: var(--surface); position: sticky; left: 0; z-index: 2; grid-row: 1 / -1; }
.pl-boat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex-shrink: 0; }
.pl-boat .dot.maintenance { background: var(--amber); }
.pl-boat .dot.unavailable { background: var(--red); }
.pl-boat-name { font-weight: 500; }
.pl-boat-type { font-size: 11.5px; color: var(--muted); }
.pl-hcell { text-align: center; font-size: 10.5px; color: var(--muted); padding: 8px 0; border-right: 1px solid #edf1f6; line-height: 1.5; text-transform: uppercase; }
.pl-hcell.we, .pl-cell.we { background: #f3f5f9; }
.pl-cell.today { background: rgba(42,100,173,.09); }
.pl-hcell.today { background: var(--primary); color: #fff; font-weight: 600; }
.pl-cell { border-right: 1px solid #edf1f6; min-height: 48px; grid-row: 1 / -1; cursor: pointer; }
.pl-cell:hover { background: rgba(42,100,173,.05); }
.pl-cell.drop { background: var(--primary-100) !important; }
.pl-bar {
  margin: 6px 2px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500; display: flex; align-items: center;
  height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; border: 1px solid; z-index: 1; position: relative;
}
.pl-bar:active { cursor: grabbing; }
.pl-bar.dragging { opacity: .4; }
.pl-bar span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.section-title { font-size: 16px; font-weight: 600; margin: 0 0 14px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.login-art { background: radial-gradient(circle at 20% 20%, rgba(59,163,201,.35), transparent 45%), radial-gradient(circle at 80% 80%, rgba(42,100,173,.5), transparent 50%), linear-gradient(160deg, #18253d, #1f3a60 55%, #2a64ad); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.05); }
.login-art > * { position: relative; z-index: 1; }
.login-art h2 { font-size: 34px; line-height: 1.2; margin: 0 0 14px; font-weight: 700; letter-spacing: -.02em; max-width: 460px; }
.login-art p { color: #c4d3e8; max-width: 440px; line-height: 1.6; margin: 0; }
.login-feats { display: grid; gap: 12px; margin-top: 30px; max-width: 420px; }
.login-feats div { display: flex; gap: 12px; align-items: center; color: #dbe6f5; }
.login-feats svg.lucide { width: 18px; height: 18px; color: #7cc7e3; }
.login-side { display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; padding: 34px; }
.login-logo { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 26px; }
.login-logo img { width: 84px; height: 84px; object-fit: contain; }
.login-logo .t1 { font-size: 18px; font-weight: 700; }
.login-logo .t2 { font-size: 13px; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 40px; }
.pw-wrap button { position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .m-stats { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 90; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .nav-toggle, html.nav-hidden .nav-show { display: none; }
  html.nav-hidden .sidebar { margin-left: 0; visibility: visible; }
  html.nav-hidden .main { padding-left: 0; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--sidebar); color: #fff; position: sticky; top: 0; z-index: 50; }
  .mobile-bar .icon-btn { background: transparent; border-color: rgba(255,255,255,.2); color: #fff; }
  .page { padding: 20px 16px 40px; }
  .two-col { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .page-title { font-size: 26px; }
  .toolbar .select { width: auto; flex: 1; }
  .cust-row, .m-item { flex-direction: column; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
}
.maint-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); column-gap: 12px; }
.cost-chart { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 28px; align-items: center; }
@media (max-width: 860px) { .cost-chart { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Dashboard: prilagodljiv raspored kartica ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.dash-block { min-width: 0; position: relative; }
.dash-block.full { grid-column: 1 / -1; }
.dash-block > .card { height: 100%; }
.dash-edit .dash-block { outline: 2px dashed var(--border-strong); outline-offset: 6px; border-radius: 12px; cursor: grab; }
.dash-edit .dash-block.is-hidden > :not(.dash-tools) { opacity: .35; }
.dash-edit .dash-block a { pointer-events: none; }
.dash-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.dash-grip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-2); }
.dash-block.dragging { opacity: .4; }
.dash-block.drop-before { box-shadow: -4px 0 0 var(--primary), 0 -4px 0 var(--primary); }
.dash-block.drop-after { box-shadow: 4px 0 0 var(--primary), 0 4px 0 var(--primary); }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } .dash-block.half { grid-column: auto; } }
