﻿:root {
    --bg: #ffffff;
    --bg-subtle: #fafbfa;
    --bg-muted: #f4f6f4;
    --bg-rail: #0a0d0b;
    --bg-rail-hover: #131815;
    --bg-rail-active: #1a211d;
    --border: #e6e9e7;
    --border-strong: #d3d8d4;
    --border-subtle: #eef1ef;
    --border-rail: rgba(255,255,255,0.08);
    --text: #0a0f0c;
    --text-2: #3d4842;
    --text-3: #6b7670;
    --text-4: #9aa39d;
    --text-rail: #f0f3f1;
    --text-rail-2: rgba(240,243,241,0.7);
    --text-rail-3: rgba(240,243,241,0.45);
    --accent: #0f766e;
    --accent-deep: #115e59;
    --accent-bg: #ecfdf5;
    --accent-bg-2: #ccfbf1;
    --accent-border: #99f6e4;
    --status-occupied: #0f766e;
    --status-reserved: #7c3aed;
    --status-reserved-bg: #f5f3ff;
    --status-reserved-border: #ddd6fe;
    --status-warning: #ca8a04;
    --status-warning-bg: #fefce8;
    --status-warning-border: #fde68a;
    --status-empty: #94a3b8;
    --status-expired: #dc2626;
    --status-expired-bg: #fef2f2;

    /* Plan tlocrta - topli zemljani tonovi */
    --plan-bg: #f7f5ee;
    --plan-grid: #e8e2d0;
    --plan-grid-major: #ddd5be;
    --plan-path: #ebe5d2;
    --plan-path-edge: #c9bf9e;
    --plan-field: #e3e8d6;
    --plan-field-edge: #b8c4a3;
    --plan-special: #f0e3c2;
    --plan-special-edge: #c9a96b;
    --plan-tree: #6b8e4e;
    --plan-building: #c8b896;
    --plan-building-edge: #8a7a5a;
    --plan-fence: #a8997a;

    --shadow-sm: 0 1px 2px rgba(10, 15, 12, 0.04);
    --shadow: 0 1px 3px rgba(10, 15, 12, 0.06), 0 1px 2px rgba(10, 15, 12, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(10, 15, 12, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(10, 15, 12, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(10, 15, 12, 0.10);

    --radius-sm: 4px;
    --radius: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; overflow: hidden; }
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
  }
  .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
  button, input, select, textarea { font-family: inherit; }
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

  /* SPLASH */
  .splash {
    position: fixed; inset: 0;
    background: var(--bg-rail);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s;
  }
  .splash.hidden { opacity: 0; visibility: hidden; }
  .splash::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse 600px 400px at 30% 20%, rgba(15, 118, 110, 0.18) 0%, transparent 60%),
      radial-gradient(ellipse 500px 300px at 70% 80%, rgba(20, 184, 166, 0.10) 0%, transparent 60%);
  }
  .splash::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 32px 32px;
  }
  .splash-card {
    position: relative; z-index: 2;
    width: 100%; max-width: 420px;
    padding: 40px;
    text-align: center;
  }
  .splash-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
  }
  .splash-brand-logo {
    display: block;
    width: min(260px, 78vw);
    height: auto;
  }
  .splash-title {
    color: var(--text-rail);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    line-height: 1.2;
  }
  .splash-sub {
    color: var(--text-rail-2);
    font-size: 14px;
    margin-bottom: 32px;
  }
  .splash-actions { display: flex; flex-direction: column; gap: 8px; }
  .splash-btn {
    padding: 11px 20px;
    background: rgba(255,255,255,0.04);
    color: var(--text-rail);
    border: 1px solid var(--border-rail);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.15s;
  }
  .splash-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
  }
  .splash-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
  }
  .splash-btn.primary:hover {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
  }
  .splash-foot {
    margin-top: 32px;
    color: var(--text-rail-3);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .splash-foot .dot { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; }

  /* APP */
  .app { display: flex; height: 100vh; }

  .rail {
    width: 240px;
    background: var(--bg-rail);
    color: var(--text-rail);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid var(--bg-rail-active);
  }
  .rail-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-rail);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
  }
  .rail-mark {
    width: 28px; height: 28px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
  }
  .rail-brand { font-size: 14px; font-weight: 600; line-height: 1.2; }
  .rail-brand-sub { font-size: 11px; color: var(--text-rail-3); margin-top: 1px; }
  .rail-section {
    padding: 16px 8px 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-rail-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .rail-nav { padding: 0 8px; display: flex; flex-direction: column; gap: 1px; }
  .rail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-rail-2);
    cursor: pointer;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.1s;
    text-align: left;
    width: 100%;
  }
  .rail-item svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.7; }
  .rail-item:hover { background: var(--bg-rail-hover); color: var(--text-rail); }
  .rail-item:hover svg { opacity: 1; }
  .rail-item.active {
    background: var(--bg-rail-active);
    color: var(--text-rail);
    box-shadow: inset 2px 0 0 var(--accent);
  }
  .rail-item.active svg { opacity: 1; color: var(--accent); }
  .rail-item .badge {
    margin-left: auto;
    background: rgba(202, 138, 4, 0.18);
    color: #fbbf24;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.4;
  }
  .rail-item.admin-only { display: none; }
  body.admin .rail-item.admin-only { display: flex; }
  .field-only { display: none; }
  body.admin .rail-item.field-only, body.field-mode .rail-item.field-only { display: flex; }
  body.admin .rail-section.field-only, body.field-mode .rail-section.field-only { display: block; }
  body.field-mode .admin-only { display: none !important; }
  .rail-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border-rail); }
  .rail-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.1s;
  }
  .rail-user:hover { background: var(--bg-rail-hover); }
  .rail-avatar {
    width: 26px; height: 26px;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
  }
  .rail-user-info { flex: 1; min-width: 0; }
  .rail-user-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-user-role { font-size: 11px; color: var(--text-rail-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-user .ic-out { width: 14px; height: 14px; color: var(--text-rail-3); }

  .main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

  .topbar {
    height: 56px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    background: var(--bg);
    flex-shrink: 0;
    position: relative;
  }
  .topbar-left { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; flex-shrink: 0; min-width: max-content; }
  .topbar-left .crumb-sep { color: var(--text-4); }
  .topbar-left .crumb-current { color: var(--text); font-weight: 500; }

  /* Statistika u sredini topbara */
  .topbar-stats { flex: 1; display: flex; justify-content: center; }
  body:not(.admin):not(.field-mode) .topbar-stats { display: none; }
  .stat-strip.top {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: none;
  }
  .stat-strip.top .stat-cell {
    padding: 6px 14px;
    min-width: 80px;
    border-right-color: var(--border-subtle);
  }
  .stat-strip.top .stat-label {
    font-size: 9px;
    margin-bottom: 2px;
  }
  .stat-strip.top .stat-value {
    font-size: 15px;
  }

  .search-wrap { flex: 0 0 320px; max-width: 320px; position: relative; }
  .search-wrap input {
    width: 100%;
    height: 32px;
    padding: 0 34px 0 34px;
    background: var(--bg-muted);
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: all 0.1s;
  }
  .search-wrap input:focus {
    background: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg-2);
  }
  .search-wrap input::placeholder { color: var(--text-4); }
  .search-wrap .ic-search {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    color: var(--text-4);
  }
  .search-clear {
    display: none;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-4);
    cursor: pointer;
    align-items: center;
    justify-content: center;
  }
  .search-clear.show { display: flex; }
  .search-clear:hover { background: var(--border-subtle); color: var(--text-2); }
  .search-clear svg { width: 14px; height: 14px; }
  .topbar-actions { display: flex; align-items: center; gap: 6px; }
  .admin-layout-toggle[aria-pressed="true"] {
    background: var(--accent-bg);
    border-color: var(--accent-border);
    color: var(--accent-deep);
  }
  .role-pill {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    background: var(--accent-bg);
    color: var(--accent-deep);
    border: 1px solid var(--accent-border);
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }
  .role-pill::before { content: ''; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }
  .role-pill.public { background: var(--bg-muted); color: var(--text-3); border-color: var(--border); }
  .role-pill.public::before { background: var(--text-4); }

  .content { flex: 1; display: flex; min-height: 0; }

  .side {
    width: 380px;
    border-right: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.18s ease;
  }
  body.admin-wide-sheet .side { width: clamp(520px, 48vw, 680px); }
  .side-head { padding: 16px 20px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
  .side-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 2px; }
  .side-meta { font-size: 12px; color: var(--text-3); }
  .side-meta .num { color: var(--text); font-weight: 500; }
  .side-body { flex: 1; overflow-y: auto; }
  .side-foot {
    padding: 12px 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    font-size: 12px;
    color: var(--text-3);
    flex-shrink: 0;
  }

  /* PLAN AREA */
  .plan-area {
    flex: 1;
    position: relative;
    background: var(--plan-bg);
    min-width: 0;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
  }
  .plan-area.grabbing { cursor: grabbing; }
  .plan-area.tool-add, .plan-area.tool-row { cursor: crosshair; }
  .plan-area.tool-delete { cursor: not-allowed; }
  #plan {
    width: 100%; height: 100%;
    display: block;
    user-select: none;
  }
  #plan text { user-select: none; pointer-events: none; }

  .plan-overlay-tl { position: absolute; top: 12px; left: 12px; z-index: 10; display: flex; flex-direction: column; gap: 8px; }
  .plan-overlay-tr { position: absolute; top: 12px; right: 12px; z-index: 10; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
  .plan-overlay-bl { position: absolute; bottom: 16px; left: 12px; z-index: 10; display: flex; align-items: flex-end; gap: 10px; }
  .plan-overlay-br { position: absolute; bottom: 16px; right: 12px; z-index: 10; }

  .stat-strip {
    display: flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .stat-cell { padding: 10px 16px; border-right: 1px solid var(--border-subtle); min-width: 100px; }
  .stat-cell:last-child { border-right: none; }
  .stat-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    margin-bottom: 4px;
  }
  .stat-value { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
  .stat-value.warn { color: var(--status-expired); }

  .zoom-controls {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .zoom-btn {
    width: 32px; height: 32px;
    border: none;
    background: var(--bg);
    color: var(--text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.1s;
  }
  .zoom-btn:last-child { border-bottom: none; }
  .zoom-btn:hover { background: var(--bg-muted); color: var(--text); }
  .zoom-btn svg { width: 14px; height: 14px; }
  .zoom-level {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-3);
    text-align: center;
    padding: 4px 6px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
  }

  .scale-bar {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-2);
    font-family: 'JetBrains Mono', monospace;
  }
  .scale-bar-line {
    height: 6px;
    border-left: 1px solid var(--text-2);
    border-right: 1px solid var(--text-2);
    border-bottom: 1px solid var(--text-2);
    width: 60px;
  }

  .compass {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px; height: 38px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .compass svg { width: 100%; height: 100%; }

  .legend {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 12px 14px;
    min-width: 180px;
  }
  .legend-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    margin-bottom: 8px;
  }
  .legend-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; color: var(--text-2); }
  .legend-swatch { width: 12px; height: 12px; border-radius: 2px; border: 1px solid rgba(0,0,0,0.08); }

  .draw-banner {
    background: var(--accent);
    color: white;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.28);
  }
  .draw-banner.show { display: inline-flex; }
  .draw-banner svg { width: 14px; height: 14px; }
  .draw-banner button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
  }
  .draw-banner button:hover { background: rgba(255,255,255,0.3); }

  /* SVG popup */
  .plan-popup {
    position: absolute;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 12px 14px;
    width: 240px;
    z-index: 20;
    display: none;
  }
  .plan-popup.show { display: block; }
  .plan-popup-arrow {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px; height: 10px;
    background: var(--bg);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .popup-name { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; line-height: 1.2; }
  .popup-years { font-size: 12px; color: var(--text-3); margin-top: 2px; }
  .popup-loc {
    font-size: 11px;
    color: var(--text-4);
    margin-top: 6px;
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .popup-loc-tag {
    background: var(--bg-muted);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-2);
  }

  .public-route-overlay {
    pointer-events: none;
  }
  .public-route-line {
    fill: none;
    stroke: #0f766e;
    stroke-width: 1.05;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0.35px 0.5px rgba(255,255,255,0.95)) drop-shadow(0 0 1.2px rgba(15,118,110,0.35));
  }
  .public-route-connector {
    fill: none;
    stroke: #f59e0b;
    stroke-width: 0.72;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1.1 0.75;
    filter: drop-shadow(0 0.3px 0.45px rgba(255,255,255,0.95));
  }
  .public-route-marker {
    fill: #ffffff;
    stroke: #0f766e;
    stroke-width: 0.42;
    pointer-events: none;
  }
  .public-route-marker.end {
    stroke: #f59e0b;
  }
  .public-route-card {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    display: grid;
    gap: 10px;
  }
  .public-route-meta {
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.45;
    margin-top: 4px;
  }

  .grave.focus-pulse rect:first-child {
    animation: gravePulse 0.9s ease-out 2;
    transform-box: fill-box;
    transform-origin: center;
  }
  @keyframes gravePulse {
    0% { filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0)); transform: scale(1); }
    45% { filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.8)); transform: scale(1.08); }
    100% { filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0)); transform: scale(1); }
  }
  /* RESULTS */
  .results { padding: 6px; }
  .result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.1s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }
  .result-item:hover { background: var(--bg-subtle); }
  .result-item.selected {
    background: var(--accent-bg);
    box-shadow: inset 2px 0 0 var(--accent);
  }
  .result-avatar {
    width: 32px; height: 32px;
    background: var(--bg-muted);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
  }
  .result-item.selected .result-avatar { background: var(--accent); color: white; }
  .result-main { flex: 1; min-width: 0; }
  .result-name { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.3; }
  .result-meta {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .result-meta .sep { width: 2px; height: 2px; background: var(--text-4); border-radius: 50%; }
  .mobile-search-dropdown { display: none; }

  .empty { padding: 60px 24px; text-align: center; }
  .empty-icon {
    width: 36px; height: 36px;
    background: var(--bg-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--text-4);
  }
  .empty-icon svg { width: 16px; height: 16px; }
  .empty-text { font-size: 13px; color: var(--text-3); margin-bottom: 4px; }
  .empty-hint { font-size: 12px; color: var(--text-4); }
  .empty-cta {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-3);
    background: var(--bg-muted);
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
  }
  /* DETAIL */
  .detail { padding: 20px; }
  .detail-name { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; color: var(--text); }
  .detail-years { font-size: 14px; color: var(--text-3); margin-top: 4px; }
  .detail-status { margin-top: 12px; }

  .pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-muted);
    color: var(--text-2);
    border: 1px solid var(--border);
  }
  .pill::before { content: ''; width: 5px; height: 5px; background: currentColor; border-radius: 50%; opacity: 0.7; }
  .pill.success { background: var(--accent-bg); color: var(--accent-deep); border-color: var(--accent-border); }
  .pill.warn { background: var(--status-warning-bg); color: var(--status-warning); border-color: var(--status-warning-border); }
  .pill.reserved { background: var(--status-reserved-bg); color: var(--status-reserved); border-color: var(--status-reserved-border); }
  .pill.danger { background: var(--status-expired-bg); color: var(--status-expired); border-color: #fecaca; }
  .pill.muted { background: var(--bg-muted); color: var(--text-3); }

  .field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 16px;
  }
  .field-cell { padding: 10px 12px; background: var(--bg); }
  .field-cell.full { grid-column: 1 / -1; }
  .field-key {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    margin-bottom: 4px;
  }
  .field-val { font-size: 13px; color: var(--text); }
  .field-val.muted { color: var(--text-4); font-style: italic; font-size: 12px; }
  .field-cell select {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    outline: none;
  }

  .field-panel .field-grid { margin-top: 12px; }
  .field-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
  }
  .field-actions .btn { flex: 1 1 auto; min-width: 0; }
  .field-quick-form {
    display: grid;
    gap: 12px;
  }
  .field-selected-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
  }
  .field-selected-title { font-size: 15px; font-weight: 700; color: var(--text); }
  .field-selected-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
  .field-work-list { padding: 0; }
  .field-row { border: 1px solid var(--border-subtle); margin-bottom: 6px; }
  .field-row.active { border-color: var(--accent); background: var(--accent-bg); }

  .detail-note {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-2);
    margin-top: 16px;
    line-height: 1.5;
    position: relative;
  }
  .detail-note::before {
    content: '';
    width: 3px;
    background: var(--accent);
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    border-radius: 2px;
  }
  .detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
  }
  .detail-actions .btn { flex: 1 1 calc(50% - 4px); min-width: 0; max-width: 100%; }
  .detail-actions .btn.row-break {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }

  .btn {
    height: 32px;
    padding: 0 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    transition: all 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
  }
  .btn svg { width: 13px; height: 13px; }
  .btn:hover { background: var(--bg-muted); }
  .btn.primary { background: var(--text); color: white; border-color: var(--text); }
  .btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
  .btn.accent { background: var(--accent); color: white; border-color: var(--accent); }
  .btn.accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
  .btn.full { width: 100%; }

  .admin-section { padding: 16px 20px; border-bottom: 1px solid var(--border-subtle); }
  .admin-section h3 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; letter-spacing: -0.01em; }
  .admin-section .desc { font-size: 12px; color: var(--text-3); margin-bottom: 12px; line-height: 1.5; }
  .audit-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-width: 100%;
    overflow: hidden;
  }
  .audit-filter-grid :is(input, select, button) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 32px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.2;
  }
  .audit-filter-grid :is(input, select) {
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    outline: none;
  }
  .audit-filter-grid :is(input, select):focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg-2);
  }
  .audit-filter-wide { grid-column: 1 / -1; }
  .tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .tool {
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.1s;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .tool:hover { border-color: var(--accent); background: var(--accent-bg); }
  .tool.active {
    border-color: var(--accent);
    background: var(--accent-bg);
    box-shadow: 0 0 0 3px var(--accent-bg-2);
  }
  .tool-icon {
    width: 24px; height: 24px;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    margin-bottom: 4px;
  }
  .tool:hover .tool-icon, .tool.active .tool-icon { background: var(--accent); color: white; }
  .tool-icon svg { width: 13px; height: 13px; }
  .tool-title { font-size: 12px; font-weight: 600; color: var(--text); }
  .tool-desc { font-size: 11px; color: var(--text-3); line-height: 1.4; }

  .form-group { margin-bottom: 12px; }
  .form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 5px; }
  .form-group input, .form-group select, .form-group textarea {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    outline: none;
    background: var(--bg);
    transition: all 0.1s;
  }
  .form-group textarea { height: auto; min-height: 60px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg-2);
  }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .modal-section {
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
  }
  .modal-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }
  .modal-section-title { font-size: 13px; font-weight: 600; color: var(--text); }
  .modal-section-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
  .check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-size: 12px;
    margin-top: 10px;
  }
  .check-row input { width: auto; }
  .mini-card {
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: var(--radius);
    padding: 10px;
    margin-top: 8px;
  }
  .mini-card:first-child { margin-top: 0; }
  .mini-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }
  .mini-card-title { font-size: 12px; font-weight: 600; color: var(--text-2); }
  .btn.icon-only {
    width: 28px;
    height: 28px;
    padding: 0;
    justify-content: center;
  }
  .empty-mini {
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-3);
    font-size: 12px;
    background: var(--bg);
  }

  .reg-list { padding: 4px; }
  .reg-row {
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.1s;
  }
  .reg-row:hover { background: var(--bg-subtle); }
  .reg-row .reg-main { flex: 1; min-width: 0; }
  .reg-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .reg-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
  .reg-right { text-align: right; flex-shrink: 0; }
  .reg-date { font-size: 11px; color: var(--text-3); }
  .lease-row {
    align-items: flex-start;
  }
  .lease-row-main {
    display: grid;
    gap: 2px;
  }
  .lease-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
  }
  .lease-expiry-pill {
    font-size: 10px;
    padding: 2px 6px;
  }
  .lease-action-btn {
    padding: 6px 8px;
    font-size: 11px;
  }
  body.admin-wide-sheet .lease-row {
    align-items: center;
  }

  .modal-bg {
    position: fixed; inset: 0;
    background: rgba(10, 13, 11, 0.4);
    backdrop-filter: blur(2px);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .modal-bg.show { display: flex; }
  .modal {
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
  }
  .modal-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--border-subtle); }
  .modal-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
  .modal-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
  .calc-context {
    margin-top: 8px;
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius);
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    color: var(--accent-deep);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
  }
  .modal-body { padding: 16px 20px; }
  .modal-foot {
    padding: 12px 20px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--bg-subtle);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .toast.show { transform: translateX(-50%) translateY(0); }
  .toast .check {
    width: 14px; height: 14px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .toast .check svg { width: 9px; height: 9px; color: white; }

  .page { display: none; flex: 1; min-height: 0; flex-direction: column; }
  .page.active { display: flex; }
  /* #page-detail nema .side-body wrapper, pa #detail-content sam mora skrolati */
  #detail-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 8px;
  }
  body:not(.admin) .admin-only { display: none !important; }

  @media (max-width: 1100px) { .rail { width: 200px; } .side { width: 340px; } }
  @media (max-width: 900px) {
    .rail { width: 56px; }
    .rail-brand, .rail-brand-sub, .rail-section, .rail-item span:not(.badge), .rail-user-info, .rail-user .ic-out { display: none; }
    .rail-item .badge { display: none; }
    .rail-header { justify-content: center; padding: 14px 8px; }
    .rail-item { justify-content: center; padding: 7px; }
    .side { width: 320px; }
    body.admin-wide-sheet .side { width: min(520px, calc(100vw - 56px)); }
    .admin-layout-toggle .admin-layout-toggle-label { display: none; }
  }
  @media (max-width: 760px) {
    .app { flex-direction: column; }
    .rail {
      width: 100%;
      height: 52px;
      flex-direction: row;
      align-items: center;
      border-right: none;
      border-bottom: 1px solid var(--bg-rail-active);
    }
    .rail-header { width: 52px; height: 52px; min-height: 52px; border-bottom: none; border-right: 1px solid var(--border-rail); }
    .rail-nav { flex-direction: row; padding: 0 6px; }
    .rail-section, .rail-foot, .topbar-left, .topbar-stats { display: none; }
    .main { min-height: 0; }
    .topbar { height: auto; padding: 10px; gap: 10px; }
    .search-wrap { flex: 1; max-width: none; }
    body.mobile-search-open .mobile-search-dropdown {
      display: block;
      position: absolute;
      top: calc(100% + 6px);
      left: 10px;
      right: 10px;
      max-height: min(38vh, 320px);
      overflow-y: auto;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-xl);
      z-index: 80;
      padding: 6px;
    }
    .mobile-search-dropdown .empty {
      padding: 24px 16px;
    }
    .mobile-search-dropdown .empty-cta {
      display: none;
    }
    .content { flex: 1; position: relative; min-height: 0; }
    .side {
      position: absolute;
      left: 0;
      right: 0;
      bottom: max(18px, env(safe-area-inset-bottom));
      z-index: 40;
      width: 100%;
      height: min(54vh, 430px);
      border-right: none;
      border-top: 1px solid var(--border);
      border-radius: 12px 12px 0 0;
      box-shadow: 0 -10px 24px rgba(10, 15, 12, 0.14);
      transform: translateY(calc(100% - 96px));
      transition: transform 0.24s ease;
      touch-action: pan-y;
      overscroll-behavior: contain;
    }
    body.field-mode .side {
      height: min(82dvh, calc(100dvh - 58px));
      max-height: 760px;
    }
    body.admin-wide-sheet .side { width: 100%; }
    body.mobile-sheet-open .side { transform: translateY(0); }
    body:not(.mobile-sheet-open) .side {
      background: transparent;
      border-top-color: transparent;
      box-shadow: none;
    }
    .sheet-handle {
      display: none;
    }
    .side .sheet-handle {
      appearance: none;
      border: none;
      position: absolute;
      top: 18px;
      left: 50%;
      transform: translateX(-50%);
      width: 96px;
      height: 42px;
      padding: 0;
      margin: 0;
      background: transparent;
      z-index: 10;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      touch-action: none;
    }
    .side .sheet-handle::before {
      content: '';
      width: 72px;
      height: 7px;
      border-radius: 999px;
      background: var(--text-3);
      box-shadow: 0 0 0 10px rgba(255,255,255,0.92), 0 4px 12px rgba(10, 15, 12, 0.16);
    }
    body:not(.mobile-sheet-open) .side-head,
    body:not(.mobile-sheet-open) .side-body,
    body:not(.mobile-sheet-open) .side-foot,
    body:not(.mobile-sheet-open) #detail-content {
      visibility: hidden;
      pointer-events: none;
    }
    .side .page {
      padding-top: 68px;
      min-height: 0;
      overflow: hidden;
    }
    .side .page .side-head { padding-top: 16px; }
    #detail-content {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      padding-top: 8px;
      padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
    .side-foot { display: none; }
    .plan-area { width: 100%; height: 100%; min-height: 0; }
    .legend { display: none; }
    .plan-popup { width: 220px; }
    .splash-card { padding: 28px 20px; }
    .splash-title { font-size: 23px; }
    .splash-btn.admin-login { display: none; }
  }
  @media (min-width: 761px) and (max-width: 1100px) {
    .tool-grid { grid-template-columns: repeat(2, 1fr); }
    .modal { max-width: 620px; }
  }

  /* ============================================================ */
  /* Login modal za administratorsku prijavu                      */
  /* ============================================================ */
  .login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    padding: 20px;
  }
  .login-overlay.show {
    display: flex;
  }
  .login-card {
    background: var(--bg-1, #fff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
    padding: 28px 28px 22px;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: login-pop 0.18s ease-out;
  }
  @keyframes login-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  .login-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-1, #0f172a);
  }
  .login-sub {
    font-size: 13px;
    color: var(--text-2, #64748b);
    margin-top: -8px;
  }
  .login-error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    display: none;
  }
  .login-error.show {
    display: block;
  }
  .login-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
  }
  .login-actions .btn {
    min-width: 96px;
  }
  .login-card .form-group {
    margin-bottom: 0;
  }
  @media (max-width: 480px) {
    .login-card { padding: 22px 18px 18px; }
  }

  /* Document upload UI */
  .doc-path-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
  }
  .doc-path-row input[data-field="putanja"] {
    flex: 1;
    min-width: 0;
  }
  .doc-upload-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .doc-upload-status {
    font-size: 12px;
    margin-top: 4px;
    color: var(--text-3);
    min-height: 16px;
  }
  .doc-upload-status.uploading {
    color: var(--accent);
  }
  .doc-upload-status.success {
    color: var(--status-occupied, #15803d);
  }
  .doc-upload-status.error {
    color: var(--status-expired, #dc2626);
  }
  @media (max-width: 600px) {
    .doc-path-row {
      flex-direction: column;
    }
  }

  /* ============================================================ */
  /* Kalkulator najma                                             */
  /* ============================================================ */
  .calc-modal { max-width: 720px; }
  .calc-info {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 13px;
  }
  .calc-info-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
  }
  .calc-info-row span { color: var(--text-3); }
  .calc-extras {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .calc-extra-row {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
  }
  .calc-extra-row:hover { background: var(--bg-subtle); }
  .calc-extra-amount { font-family: 'JetBrains Mono', monospace; color: var(--text-2); font-size: 12px; }
  .calc-result { margin-top: 18px; }
  .calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .calc-table thead th {
    text-align: left;
    font-weight: 600;
    color: var(--text-3);
    border-bottom: 1px solid var(--border);
    padding: 8px 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .calc-table th.num, .calc-table td.num { text-align: right; font-family: 'JetBrains Mono', monospace; }
  .calc-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .calc-table tr.subtotal td {
    font-weight: 600;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
  }
  .calc-table tr.total td {
    font-weight: 700;
    font-size: 15px;
    border-top: 2px solid var(--accent);
    color: var(--accent-deep);
  }
  .calc-note {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fef3c7;
    border-left: 3px solid #d97706;
    border-radius: 4px;
    font-size: 12px;
    color: #78350f;
  }
  .calc-warning {
    margin-top: 8px;
    padding: 10px 12px;
    background: #fef2f2;
    border-left: 3px solid #dc2626;
    border-radius: 4px;
    font-size: 12px;
    color: #7f1d1d;
    line-height: 1.45;
  }

  /* ============================================================ */
  /* Cjenovnik admin editor                                       */
  /* ============================================================ */
  .pricelist-modal { max-width: 880px; }
  .accounting-payment-modal { max-width: 620px; }
  .pl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .pl-table thead th {
    text-align: left;
    padding: 8px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
  }
  .pl-table tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .pl-table input,
  .pl-table select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    font-size: 13px;
    background: var(--bg);
  }
  .pl-table input:focus,
  .pl-table select:focus {
    outline: none;
    border-color: var(--accent);
  }

  /* ============================================================ */
  /* Print — stylesheet za PDF izvod i Rjesenje                   */
  /* ============================================================ */
  .print-area {
    display: none;
  }
  body.printing .app,
  body.printing .splash,
  body.printing .login-overlay,
  body.printing .modal-bg,
  body.printing .toast {
    display: none !important;
  }
  body.printing .print-area {
    display: block;
    position: fixed;
    inset: 0;
    background: white;
    overflow: auto;
    z-index: 99999;
    padding: 30px;
  }

  @media print {
    .app, .splash, .login-overlay, .modal-bg, .toast { display: none !important; }
    body { background: white; }
    .print-area {
      display: block !important;
      position: static !important;
      padding: 0 !important;
    }
    @page {
      size: A4;
      margin: 18mm 16mm;
    }
  }

  .print-doc {
    max-width: 720px;
    margin: 0 auto;
    color: #111;
    font-family: 'Inter', sans-serif;
    font-size: 11pt;
    line-height: 1.45;
  }
  .print-doc .print-header {
    text-align: center;
    border-bottom: 2px solid #111;
    padding-bottom: 8px;
    margin-bottom: 14px;
  }
  .print-doc .print-title {
    font-size: 14pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .print-doc .print-sub {
    font-size: 10pt;
    color: #444;
    margin-top: 3px;
  }
  .print-doc .print-klasa {
    margin: 14px 0;
    font-size: 10pt;
    color: #333;
  }
  .print-doc .print-klasa div { margin: 2px 0; }
  .print-doc .print-h1 {
    font-size: 14pt;
    font-weight: 700;
    margin: 18px 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .print-doc .print-h1.center { text-align: center; }
  .print-doc .print-h2 {
    font-size: 11pt;
    font-weight: 700;
    margin: 14px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #333;
  }
  .print-doc .print-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    margin: 10px 0 16px;
    font-size: 10.5pt;
  }
  .print-doc .print-p {
    margin: 8px 0;
    text-align: justify;
  }
  .print-doc .print-table,
  .print-doc .print-kv {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 10pt;
  }
  .print-doc .print-table th,
  .print-doc .print-table td,
  .print-doc .print-kv th,
  .print-doc .print-kv td {
    border: 1px solid #888;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
  }
  .print-doc .print-table thead th {
    background: #eee;
    font-weight: 700;
    font-size: 9.5pt;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .print-doc .print-table th.num,
  .print-doc .print-table td.num {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
  }
  .print-doc .print-table tr.subtotal td { background: #f5f5f5; }
  .print-doc .print-table tr.total td {
    background: #e8e8e8;
    font-size: 11pt;
    border-top: 2px solid #111;
  }
  .print-doc .print-kv th {
    background: #f5f5f5;
    width: 30%;
    font-weight: 600;
  }
  .print-doc .print-empty {
    padding: 14px;
    text-align: center;
    color: #777;
    font-style: italic;
    border: 1px dashed #bbb;
    margin: 8px 0;
  }
  .print-doc .print-footer {
    margin-top: 36px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    page-break-inside: avoid;
  }
  .print-doc .print-sign {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10pt;
    text-align: right;
  }
  .print-doc .print-sign-block {
    margin-left: auto;
    text-align: center;
  }
  .print-doc .print-sign-label {
    font-size: 9pt;
    color: #555;
    margin-top: 3px;
  }
  .print-doc .print-notice {
    font-style: italic;
    background: #f8f8f8;
    padding: 8px 12px;
    border-left: 3px solid #667eea;
    margin: 10px 0 18px;
    page-break-inside: avoid;
  }
