:root {
    --font-ui:   "Plus Jakarta Sans", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --font-alt:  "DM Sans", "Plus Jakarta Sans", -apple-system, Arial, sans-serif;
    --font-mono: "DM Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
    --font-num:  "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --navy: #0e1b2a;
    --navy-soft: #16273a;
    --sky: #00aeef;
    --sky-soft: #7fc3e8;
    --bg: #f4f6f9;
    --surface: #ffffff;
    --ink: #1f2933;
    --muted: #6b7884;
    --line: #e3e9f0;
    --green: #0f6e56;
    --amber: #b7791f;
    --red: #c0392b;
    --radius: 10px;
    --radius-sm: 7px;
    --sidebar-w: 218px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font-num); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; font-family: var(--font-ui); }
h2 { font-size: 17px; font-weight: 700; margin: 26px 0 12px; font-family: var(--font-ui); }
h3 { font-size: 15px; font-weight: 600; margin: 18px 0 10px; font-family: var(--font-ui); }

code, pre, kbd, samp,
.proj-val, .proj-date,
.fin-row .amt,
.kpi-tile .num, .kpi-card-modern .num, .dash-kpi .k-value,
.kpi-value, .kpi-card .kpi-value,
.chart-card .num, .pipe-col .n,
.total-final-value, .td-code,
.gantt-bar .bar-label { font-family: var(--font-num); }
.muted { color: var(--muted); }

.layout { display: flex; min-height: 100vh; }

.sidebar { width: var(--sidebar-w); background: var(--navy); color: #fff; display: flex; flex-direction: column; flex-shrink: 0; position: fixed; top: 0; left: 0; bottom: 0; overflow: hidden; z-index: 50; }
.sidebar-windows { position: absolute; inset: 0; pointer-events: none; opacity: 0.07; background-image: repeating-linear-gradient(120deg, transparent 0 88px, var(--sky-soft) 88px 90px), repeating-linear-gradient(30deg, transparent 0 118px, var(--sky-soft) 118px 120px); }
.sidebar-brand { position: relative; padding: 22px 18px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.brand-logo { width: 150px; height: auto; display: block; }
.brand-sub { color: var(--sky-soft); font-size: 9px; letter-spacing: 3px; margin-top: 8px; }
.sidebar-nav { position: relative; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm); color: #9fb1c4; font-size: 13.5px; text-decoration: none; transition: background .15s, color .15s; font-family: var(--font-alt); }
.nav-item i { font-size: 18px; }
.nav-item:hover { background: rgba(127,195,232,0.08); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(127,195,232,0.15); color: #fff; }
.nav-item.active i { color: var(--sky-soft); }
.sidebar-user { position: relative; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sky); color: var(--navy); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.user-meta { flex: 1; line-height: 1.2; min-width: 0; }
.user-name { color: #fff; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: #6b7d90; font-size: 10px; }
.user-logout { color: #9fb1c4; font-size: 18px; }
.user-logout:hover { color: #fff; text-decoration: none; }

.content { flex: 1; margin-left: var(--sidebar-w); padding: 26px 30px; max-width: 1200px; }

.mobile-toggle { display: none; position: fixed; top: 14px; left: 14px; z-index: 60; width: 42px; height: 42px; border-radius: 9px; background: var(--navy); border: none; cursor: pointer; flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.menu-bar { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; }
@media (max-width: 820px) {
    .mobile-toggle { display: flex; }
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
    .sidebar.open { transform: translateX(0); }
    .content { margin-left: 0; padding: 70px 18px 30px; }
}

.flash { padding: 11px 15px; border-radius: 9px; margin-bottom: 14px; font-size: 14px; }
.flash-success { background: #e2efda; color: var(--green); }
.flash-danger { background: #fdecea; color: var(--red); }
.flash-warning { background: #fff4e0; color: var(--amber); }
.flash-info { background: #e6f4fc; color: #0c6aa6; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.form-grid { display: grid; gap: 8px; max-width: 580px; }
.form-grid label { font-size: 13px; color: var(--muted); margin-top: 8px; }
input, select, textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: var(--font-num); background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(0,174,239,0.12); }
textarea { min-height: 84px; resize: vertical; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border: 1px solid var(--line); background: #fff; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--ink); text-decoration: none; font-family: var(--font-ui); font-weight: 500; }
.btn:hover { background: #f0f3f7; text-decoration: none; }
.btn-primary { background: var(--sky); color: #fff; border-color: var(--sky); }
.btn-primary:hover { background: #009bd6; }
.btn-small { padding: 5px 11px; font-size: 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 8px; }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.kpi-value { font-size: 26px; font-weight: 600; color: #0c447c; }
.kpi-value.green { color: var(--green); }
.kpi-value.ink { color: var(--ink); }

.pipeline { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.pipeline-col { min-width: 120px; flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 8px; text-align: center; }
.pipeline-col.won { background: var(--navy); border-color: var(--navy); }
.pipeline-head { font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.pipeline-col.won .pipeline-head { color: var(--sky-soft); }
.pipeline-count { font-size: 19px; font-weight: 600; color: #0c447c; }
.pipeline-col.won .pipeline-count { color: #fff; }
.pipeline-value { font-size: 11px; color: var(--muted); margin-top: 3px; }

.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.data-table th { background: #eef4f9; color: #0c447c; font-weight: 600; font-size: 13px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafcfe; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; background: #eef4f9; color: #0c447c; }
.badge-active { background: #e2efda; color: var(--green); }
.badge-on_hold { background: #fff4e0; color: var(--amber); }
.badge-dead { background: #fdecea; color: var(--red); }

.detail-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.doc-list, .activity-list { list-style: none; padding: 0; }
.doc-list li, .activity-list li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); position: relative; overflow: hidden; padding: 20px; }
.login-page::before { content: ""; position: absolute; inset: 0; opacity: 0.06; pointer-events: none; background-image: repeating-linear-gradient(120deg, transparent 0 118px, var(--sky-soft) 118px 120px), repeating-linear-gradient(30deg, transparent 0 158px, var(--sky-soft) 158px 160px); }
.login-box { position: relative; width: 100%; max-width: 380px; text-align: center; }
.login-box .brand-logo { width: 200px; height: auto; margin: 0 auto 6px; display: block; }
.login-box .brand-sub { color: var(--sky-soft); font-size: 10px; letter-spacing: 4px; margin-bottom: 28px; }
.login-card { background: var(--surface); border-radius: 14px; padding: 28px; text-align: left; display: grid; gap: 6px; }
.login-card label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.login-card .btn-primary { margin-top: 16px; justify-content: center; padding: 11px; }

.nav-sep { height: 1px; background: rgba(255,255,255,0.08); margin: 10px 12px; }
.nav-badge { margin-left: auto; background: var(--sky); color: #fff; font-size: 11px; font-weight: 600; min-width: 19px; height: 19px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.nav-item.active .nav-badge { background: #fff; color: var(--navy); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.section-head h2 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat-card .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.stat-card .label i { font-size: 16px; color: var(--sky); }
.stat-card .value { font-size: 24px; font-weight: 600; color: #0c447c; }
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.bar-row .bar-label { width: 130px; color: var(--muted); flex-shrink: 0; }
.bar-track { flex: 1; height: 10px; background: #eef4f9; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--sky); border-radius: 6px; }
.bar-row .bar-val { width: 60px; text-align: right; font-weight: 600; color: #0c447c; }

.reminder-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.reminder-icon { width: 36px; height: 36px; border-radius: 9px; background: #e6f4fc; color: var(--sky); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.reminder-icon.overdue { background: #fdecea; color: var(--red); }
.reminder-body { flex: 1; }
.reminder-title { font-weight: 500; font-size: 14px; }
.reminder-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.reminder-date { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ===== Moderné komponenty ===== */
.kpi-card-modern { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.kpi-card-modern .top { display: flex; justify-content: space-between; align-items: flex-start; }
.kpi-ic { width: 36px; height: 36px; border-radius: 9px; background: #e6f4fc; display: flex; align-items: center; justify-content: center; }
.kpi-ic i { font-size: 19px; color: var(--sky); }
.kpi-trend { font-size: 11px; padding: 3px 8px; border-radius: 20px; }
.kpi-trend.up { color: var(--green); background: #e2efda; }
.kpi-trend.down { color: var(--red); background: #fdecea; }
.kpi-trend.flat { color: var(--muted); background: #eef4f9; }
.kpi-card-modern .num { font-size: 26px; font-weight: 600; color: #0c447c; margin-top: 12px; }
.kpi-card-modern .cap { font-size: 12px; color: var(--muted); }

.pipe { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.pipe-col { flex: 1; min-width: 96px; border-radius: 9px; padding: 13px 8px; text-align: center; background: #e6f4fc; }
.pipe-col .n { font-size: 18px; font-weight: 600; color: #0c447c; }
.pipe-col .l { font-size: 10px; color: #0c6aa6; margin-top: 3px; }
.pipe-col .v { font-size: 10px; color: #0c6aa6; opacity: .8; margin-top: 2px; }
.pipe-col.won { background: var(--navy); }
.pipe-col.won .n { color: #fff; } .pipe-col.won .l, .pipe-col.won .v { color: var(--sky-soft); }
.pipe-col.realization { background: #e2efda; }
.pipe-col.realization .n { color: var(--green); } .pipe-col.realization .l, .pipe-col.realization .v { color: var(--green); }
.pipe-col.lost { background: #fdecea; }
.pipe-col.lost .n { color: var(--red); } .pipe-col.lost .l { color: var(--red); }

.proj-list { display: flex; flex-direction: column; gap: 8px; }
.proj-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.proj-card:hover { border-color: var(--sky); text-decoration: none; }
.proj-bar { width: 4px; height: 38px; border-radius: 2px; background: var(--sky); flex-shrink: 0; }
.proj-bar.won, .proj-bar.realization { background: var(--green); }
.proj-bar.dead, .proj-bar.lost { background: var(--red); }
.proj-bar.on_hold { background: var(--amber); }
.proj-main { flex: 1; min-width: 0; }
.proj-name { font-weight: 500; font-size: 14px; }
.proj-sub { font-size: 12px; color: var(--muted); }
.proj-right { text-align: right; flex-shrink: 0; }
.proj-val { font-weight: 600; font-size: 14px; color: #0c447c; }
.proj-date { font-size: 11px; color: var(--muted); }

.pill { font-size: 11px; padding: 4px 10px; border-radius: 20px; background: #e6f4fc; color: #0c6aa6; white-space: nowrap; }
.pill.green { background: #e2efda; color: var(--green); }
.pill.amber { background: #fff4e0; color: var(--amber); }
.pill.red { background: #fdecea; color: var(--red); }
.pill.navy { background: var(--navy); color: #fff; }

.tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { font-size: 13px; padding: 7px 13px; border-radius: 7px; color: var(--muted); cursor: pointer; border: none; background: none; font-family: var(--font-ui); }
.tab:hover { background: #f0f3f7; }
.tab.active { background: var(--navy); color: #fff; }
.tab-panel { padding: 18px; display: none; }
.tab-panel.active { display: block; }
.detail-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.detail-card .head { padding: 18px; border-bottom: 1px solid var(--line); }

/* ===== Empty state ===== */
.empty-state { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 48px 24px; text-align: center; }
.empty-ic { width: 60px; height: 60px; border-radius: 14px; background: #e6f4fc; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.empty-ic i { font-size: 28px; color: var(--sky); }
.empty-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--muted); max-width: 360px; margin: 0 auto 18px; }

/* ===== Form card (zladený s dashboardom) ===== */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; max-width: 720px; box-shadow: 0 1px 3px rgba(16,27,42,0.04), 0 1px 2px rgba(16,27,42,0.03); }
.form-card .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-card label { font-size: 13px; color: var(--muted); margin: 14px 0 5px; display: block; font-weight: 500; }
.form-card input, .form-card select, .form-card textarea { width: 100%; box-sizing: border-box; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }
@media (max-width: 560px) { .form-card .row2 { grid-template-columns: 1fr; } }

/* ===== Detail info grid ===== */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.info-item .k { font-size: 12px; color: var(--muted); }
.info-item .v { font-weight: 600; font-size: 14px; margin-top: 2px; }

/* ===== Add-box (rozbaľovací formulár) ===== */
.add-box { margin-bottom: 4px; }
.add-box > summary { display: inline-flex; list-style: none; cursor: pointer; }
.add-box > summary::-webkit-details-marker { display: none; }
.add-box[open] > summary { margin-bottom: 4px; }

/* ===== Danger button + row actions ===== */
.btn-danger { background: #fff; color: var(--red); border-color: #f3c9c4; }
.btn-danger:hover { background: #fdecea; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 16px; padding: 4px; border-radius: 6px; }
.icon-btn:hover { background: #f0f3f7; color: var(--red); }
.contact-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.contact-row .mini-av { flex: 0 0 36px; }
.contact-row .ci { flex: 1 1 auto; min-width: 0; }
.contact-row .ci strong { font-weight: 600; }
.contact-row > form, .contact-row > .icon-btn { flex: 0 0 auto; margin: 0; }

/* ===== Adresný autocomplete (OSM Photon) ===== */
.addr-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 9px; margin-top: 4px; box-shadow: 0 6px 20px rgba(15,27,42,.10); overflow: hidden; }
.addr-item { padding: 9px 12px; font-size: 13px; cursor: pointer; }
.addr-item:hover { background: #eef4f9; }

/* ===== Mapa ===== */
#wgMap { height: 600px; width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.map-dot.proj { background: #00aeef; }
.map-dot.client { background: #0f6e56; }
.map-dot.supplier { background: #b7791f; }

/* ===== Adresné automatické dopĺňanie ===== */
.addr-wrap { position: relative; display: block; }
.addr-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 100; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.1); margin-top: 4px; overflow: hidden; }
.addr-item { padding: 9px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line); }
.addr-item:last-child { border-bottom: none; }
.addr-item:hover { background: #e6f4fc; color: #0c6aa6; }

/* ===== Mapa ===== */
#wgMap { height: 460px; border-radius: 12px; border: 1px solid var(--line); z-index: 1; }
.map-legend { display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.map-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.map-dot.project { background: #00aeef; }
.map-dot.client { background: #0f6e56; }
.map-dot.supplier { background: #b7791f; }

/* ============================================================
   REDIZAJN v2 - vzdušnejší layout inšpirovaný referenciou
   (firemné farby: navy, sky #00aeef, biela, sivá)
   ============================================================ */
.pg-title { font-size: 30px; font-weight: 800; letter-spacing: -0.6px; color: var(--ink); margin: 0; font-family: var(--font-ui); }
.pg-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.pg-status { font-size: 14px; font-weight: 600; }
.pg-status.active { color: var(--green); }

/* karta v2 - väčšie zaoblenie, jemný tieň, viac vzduchu */
.card2 { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: 0 1px 3px rgba(16,27,42,0.04), 0 1px 2px rgba(16,27,42,0.03); }
.card2 + .card2 { margin-top: 18px; }
.card2-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card2-head h2, .card2-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.card2-head .muted { font-size: 13px; }

/* dvojstĺpcový detail: hlavný obsah + bočný panel */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } }

/* info riadky v karte (Klient/Lokalita/Manažér...) */
.info-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 24px; }
@media (max-width: 640px) { .info-cols { grid-template-columns: 1fr 1fr; } }
.info-cols .lbl { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.info-cols .val { font-size: 15px; font-weight: 600; color: var(--ink); }

/* riadok financií (label vľavo, suma vpravo) */
.fin-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 14px; }
.fin-row .amt { font-weight: 700; }
.fin-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.amt-green { color: var(--green); } .amt-red { color: var(--red); } .amt-navy { color: var(--ink); }
.btn-block { display: block; width: 100%; text-align: center; border: 1px dashed var(--line); background: var(--bg); color: var(--ink); padding: 11px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.btn-block:hover { border-color: var(--sky); color: var(--sky); text-decoration: none; }

/* progress bar úloh */
.task-progress { height: 8px; background: #e9eef4; border-radius: 6px; overflow: hidden; margin-bottom: 16px; }
.task-progress > span { display: block; height: 100%; background: var(--sky); border-radius: 6px; }

/* task riadok s checkboxom */
.task-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: none; }
.task-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #cfd8e3; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; background: none; }
.task-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.task-main { flex: 1; min-width: 0; }
.task-name { font-size: 14px; font-weight: 500; }
.task-name.done { text-decoration: line-through; color: var(--muted); }
.task-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.task-state { font-size: 13px; font-weight: 600; color: var(--green); flex-shrink: 0; }

/* avatar v bočnom paneli (tím) */
.mini-person { display: flex; align-items: center; gap: 11px; padding: 9px 0; }
.mini-av { width: 36px; height: 36px; border-radius: 50%; background: #eef4f9; color: #0c447c; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.mini-person .nm { font-weight: 600; font-size: 14px; }
.mini-person .rl { font-size: 12px; color: var(--muted); }

/* hlavičkové akčné tlačidlá (Denník/Gantt/Upraviť) */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 9px 15px; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; }
.btn-ghost:hover { background: #f0f3f7; text-decoration: none; }
.btn-ghost i { font-size: 17px; color: var(--muted); }

/* ===== KPI dlaždice (zoznam projektov) - farebný ľavý pruh ===== */
.kpi-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 900px) { .kpi-tiles { grid-template-columns: 1fr 1fr; } }
.kpi-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 3px rgba(16,27,42,0.04); }
.kpi-tile .ic { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-tile .ic i { font-size: 22px; }
.kpi-tile .num { font-size: 26px; font-weight: 700; line-height: 1; }
.kpi-tile .cap { font-size: 13px; color: var(--muted); margin-top: 3px; }
.kpi-tile.all .ic { background: #eef4f9; } .kpi-tile.all .ic i { color: #0c447c; }
.kpi-tile.active .ic { background: #e7f6ee; } .kpi-tile.active .ic i { color: var(--green); }
.kpi-tile.planned .ic { background: #fef6e7; } .kpi-tile.planned .ic i { color: var(--amber); }
.kpi-tile.done .ic { background: #e6f4fc; } .kpi-tile.done .ic i { color: var(--sky); }

/* filtre - pill prepínače */
.filter-bar { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 18px; flex-wrap: wrap; }
.fpill { padding: 8px 16px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; text-decoration: none; }
.fpill.active { background: var(--sky); color: #fff; border-color: var(--sky); }
.fpill:hover:not(.active) { background: #f0f3f7; text-decoration: none; }

/* projekt karta v2 - s progress barom */
.proj-card2 { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--sky); border-radius: 14px; padding: 18px 22px; margin-bottom: 12px; text-decoration: none; color: var(--ink); box-shadow: 0 1px 3px rgba(16,27,42,0.04); }
.proj-card2:hover { box-shadow: 0 4px 14px rgba(16,27,42,0.08); text-decoration: none; }
.proj-card2.active { border-left-color: var(--green); }
.proj-card2.lost { border-left-color: var(--red); }
.proj-card2-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.proj-card2-name { font-size: 17px; font-weight: 700; }
.proj-card2-meta { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.proj-card2-right { text-align: right; flex-shrink: 0; }
.proj-card2-val { font-size: 18px; font-weight: 700; }
.proj-card2-prog { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.proj-card2-prog .bar { flex: 1; height: 8px; background: #e9eef4; border-radius: 6px; overflow: hidden; }
.proj-card2-prog .bar > span { display: block; height: 100%; background: var(--green); border-radius: 6px; }
.proj-card2-prog .pct { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* rozbaľovacia karta (Nový klient) */
.collapsible { display: none; }
.collapsible.open { display: block; }

/* zabráni rozťahovaniu inputov v gridoch bočných kariet */
.card2 input, .card2 select, .card2 textarea { box-sizing: border-box; }
.card2 input:not([type=checkbox]):not([type=radio]) { width: 100%; }
.card2 > form { width: 100%; }
.card2 .contact-row form, .card2 .mini-person form, .card2 .task-row form { width: auto; }

/* oprava task riadku - nech sa text neláme zbytočne a layout je úhľadný */
.task-row { flex-wrap: nowrap; align-items: flex-start; }
.task-row > form { flex: 0 0 auto; margin: 0; width: auto; display: inline-flex; }
.task-row .task-main { min-width: 0; overflow: hidden; flex: 1; }
.task-row .task-name { white-space: normal; word-break: normal; overflow-wrap: anywhere; line-height: 1.35; }
.task-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card2 .inline-form { flex-wrap: wrap; }

/* moderné nahrávanie súboru (skryje natívne tlačidlo, pekný label) */
.file-upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.file-field { position: relative; flex: 1; min-width: 200px; }
.file-field input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-label { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--line); border-radius: 10px; padding: 11px 14px; color: var(--muted); font-size: 14px; background: var(--bg); pointer-events: none; }
.file-field:hover .file-label { border-color: var(--sky); color: var(--sky); }
.file-label i { font-size: 18px; }

/* klikateľný nadpis sekcie -> detail */
.sec-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.sec-link i { font-size: 16px; color: var(--muted); transition: transform .15s; }
.sec-link:hover { color: var(--sky); text-decoration: none; }
.sec-link:hover i { color: var(--sky); transform: translateX(3px); }

/* hviezdičkové hodnotenie spoľahlivosti */
.stars { color: var(--amber); letter-spacing: 2px; }
.stars .off { color: #d8dee6; }
.rel-label { font-size: 12px; padding: 3px 9px; border-radius: 20px; font-weight: 600; }
.rel-label.spolahlivy { background: #e7f6ee; color: var(--green); }
.rel-label.problemovy { background: #fdecea; color: var(--red); }
.rel-label.novy { background: #eef4f9; color: #0c447c; }

/* ===== Mapa v2 - bočný panel + mapa ===== */
.map-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .map-layout { grid-template-columns: 1fr; } }
.map-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 1px 3px rgba(16,27,42,0.04); }
.map-panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 12px; }
.map-panel .grp { margin-bottom: 22px; }
.layer-toggle { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; font-size: 14px; }
.layer-toggle input { width: 16px; height: 16px; accent-color: var(--sky); }
.layer-toggle .dot { width: 11px; height: 11px; border-radius: 50%; }
.view-switch { display: flex; gap: 8px; }
.view-switch button { flex: 1; padding: 9px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; display:flex; align-items:center; justify-content:center; gap:6px; }
.view-switch button.active { background: var(--sky); color: #fff; border-color: var(--sky); }
.map-mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map-mini-stats .s { background: var(--bg); border-radius: 10px; padding: 12px; text-align: center; }
.map-mini-stats .s .n { font-size: 22px; font-weight: 700; }
.map-mini-stats .s .l { font-size: 11px; color: var(--muted); }
#wgMap { height: 600px; }
@media (max-width: 900px) { #wgMap { height: 420px; } }

/* moderné špendlíky na mape (kvapka s bielym stredom) */
.wg-pin-wrap { background: none; border: none; }
.wg-pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 3px 8px rgba(0,0,0,.3); border: 2.5px solid #fff; display: flex; align-items: center; justify-content: center; }
.wg-pin-inner { width: 9px; height: 9px; background: #fff; border-radius: 50%; transform: rotate(45deg); }

/* ===== Dashboard/KPI v2 - grafy a trendy ===== */
.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1000px) { .dash-kpis { grid-template-columns: 1fr 1fr; } }
.dash-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; border-left: 4px solid var(--sky); box-shadow: 0 1px 3px rgba(16,27,42,0.04); }
.dash-kpi.green { border-left-color: var(--green); }
.dash-kpi.amber { border-left-color: var(--amber); }
.dash-kpi.navy { border-left-color: var(--navy); }
.dash-kpi .k-label { font-size: 13px; color: var(--muted); display:flex; align-items:center; gap:6px; }
.dash-kpi .k-value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.dash-kpi .k-trend { font-size: 12px; margin-top: 6px; font-weight: 600; display:inline-flex; align-items:center; gap:3px; }
.k-trend.up { color: var(--green); } .k-trend.down { color: var(--red); } .k-trend.flat { color: var(--muted); }

.chart-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 1px 3px rgba(16,27,42,0.04); }
.chart-card h3 { margin: 0 0 16px; font-size: 16px; }
.chart-wrap { position: relative; height: 280px; }

/* obchodný lievik */
.funnel-row { margin-bottom: 12px; }
.funnel-row .fr-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.funnel-row .fr-bar { height: 30px; background: #eef4f9; border-radius: 8px; overflow: hidden; }
.funnel-row .fr-bar > span { display: flex; align-items: center; padding-left: 10px; height: 100%; background: linear-gradient(90deg, var(--sky), var(--sky-soft)); color: #fff; font-size: 12px; font-weight: 600; border-radius: 8px; }

/* ===== Gantt diagram ===== */
.gantt { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0; overflow: hidden; box-shadow: 0 1px 3px rgba(16,27,42,0.04); }
.gantt-scroll { overflow-x: auto; }
.gantt-inner { min-width: 760px; }
.gantt-head { display: flex; border-bottom: 1px solid var(--line); background: var(--bg); }
.gantt-head .lbl-col { flex: 0 0 220px; padding: 12px 16px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.gantt-head .timeline { flex: 1; position: relative; height: 44px; }
.gantt-month { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; align-items: center; padding-left: 8px; box-sizing: border-box; }
.gantt-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); min-height: 52px; }
.gantt-row:last-child { border-bottom: none; }
.gantt-row:hover { background: #fafbfc; }
.gantt-row .lbl-col { flex: 0 0 220px; padding: 10px 16px; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.gantt-row .lbl-col a { font-weight: 600; font-size: 14px; color: var(--ink); }
.gantt-row .lbl-col a:hover { color: var(--sky); }
.gantt-row .lbl-col .sub { font-size: 11px; color: var(--muted); }
.gantt-track { flex: 1; position: relative; }
.gantt-grid-line { position: absolute; top: 0; height: 100%; border-left: 1px solid #f0f3f7; }
.gantt-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 24px; border-radius: 8px; background: linear-gradient(135deg, #00aeef, #0095cf); display: flex; align-items: center; overflow: hidden; box-shadow: 0 2px 6px rgba(0,174,239,.3); cursor: pointer; min-width: 6px; transition: transform .12s, box-shadow .12s; }
.gantt-bar:hover { transform: translateY(-50%) scale(1.015); box-shadow: 0 4px 12px rgba(0,174,239,.4); }
.gantt-bar.won, .gantt-bar.realization { background: linear-gradient(135deg, #128466, #0f6e56); box-shadow: 0 2px 6px rgba(15,110,86,.3); }
.gantt-bar.lost { background: linear-gradient(135deg, #aebfd2, #9bb0c9); box-shadow: none; }
.gantt-bar.overdue { background: linear-gradient(135deg, #d9544a, #c0392b); box-shadow: 0 2px 6px rgba(192,57,43,.3); }
.gantt-bar .fill { position: absolute; left: 0; top: 0; height: 100%; background: rgba(255,255,255,.3); border-right: 2px solid rgba(255,255,255,.5); }
.gantt-bar .bar-label { position: relative; font-size: 11px; color: #fff; font-weight: 700; padding: 0 9px; white-space: nowrap; z-index: 1; text-shadow: 0 1px 2px rgba(0,0,0,.15); }
.gantt-today { position: absolute; top: 0; height: 100%; width: 2px; background: var(--red); z-index: 3; }
.gantt-today::after { content: 'dnes'; position: absolute; top: -2px; left: 3px; font-size: 9px; color: var(--red); font-weight: 700; }
.gantt-legend { display: flex; gap: 18px; padding: 12px 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; border-top: 1px solid var(--line); }
.gantt-legend .li { display: flex; align-items: center; gap: 6px; }
.gantt-legend .sw { width: 12px; height: 12px; border-radius: 3px; }

/* pekný formulár pridania úlohy */
.task-add-form { margin-top: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.task-add-form .ta-title { width: 100%; box-sizing: border-box; font-size: 15px; padding: 12px 14px; margin-bottom: 14px; }
.task-add-form .ta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 800px) { .task-add-form .ta-grid { grid-template-columns: 1fr 1fr; } }
.task-add-form .ta-lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.task-add-form input, .task-add-form select { width: 100%; box-sizing: border-box; }
