/* FEZO Property Manager — front-end styles. All scoped to .fezo-app. */

.fezo-app{
    --f-text:#1a1a1a;
    --f-text-muted:#666;
    --f-text-tertiary:#999;
    --f-bg:#fff;
    --f-bg-soft:#f5f4ef;
    --f-border:rgba(0,0,0,.10);
    --f-border-strong:rgba(0,0,0,.20);
    --f-radius:8px;
    --f-radius-lg:12px;
    --f-info-bg:#E6F1FB;
    --f-info-tx:#0C447C;
    --f-ok-bg:#EAF3DE;
    --f-ok-tx:#27500A;
    --f-warn-bg:#FAEEDA;
    --f-warn-tx:#633806;
    --f-danger-bg:#FCEBEB;
    --f-danger-tx:#791F1F;
    --f-empty-bg:#F1EFE8;
    --f-empty-tx:#444441;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    color:var(--f-text);
    max-width:880px;
    margin:0 auto;
    padding:1rem 0;
    line-height:1.5;
    font-size:15px;
    box-sizing:border-box;
}
.fezo-app *,.fezo-app *::before,.fezo-app *::after{box-sizing:inherit}

/* Top bar */
.fezo-bar{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:8px;
    padding:10px 12px;
    background:var(--f-bg-soft);
    border-radius:var(--f-radius);
    margin:0 0 16px;
    font-size:13px;
}
.fezo-bar-actions{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap}
.fezo-crumb{color:var(--f-text-muted);text-decoration:none}
.fezo-crumb:hover{color:var(--f-text)}
.fezo-crumb-now{color:var(--f-text);font-weight:500}
.fezo-crumb-sep{color:var(--f-text-tertiary)}

/* Buttons */
.fezo-btn{
    display:inline-block;
    padding:8px 14px;
    border-radius:var(--f-radius);
    border:0.5px solid var(--f-border-strong);
    background:transparent;
    color:var(--f-text);
    font-size:13px;
    font-weight:500;
    cursor:pointer;
    text-decoration:none;
    transition:background .12s,border-color .12s;
    line-height:1.3;
}
.fezo-btn:hover{background:var(--f-bg-soft)}
.fezo-btn:active{transform:scale(.98)}
.fezo-btn-ghost{border-color:var(--f-border)}
.fezo-btn-primary{background:#1a1a1a;color:#fff;border-color:#1a1a1a}
.fezo-btn-primary:hover{background:#000}
.fezo-btn-danger{background:transparent;color:var(--f-danger-tx);border-color:var(--f-danger-tx)}
.fezo-btn-danger:hover{background:var(--f-danger-bg)}

/* Metric cards */
.fezo-metrics{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
    gap:10px;
    margin:0 0 18px;
}
.fezo-metric{
    background:var(--f-bg-soft);
    border-radius:var(--f-radius);
    padding:12px 14px;
    position:relative;
}
.fezo-metric .lbl{font-size:12px;color:var(--f-text-muted);margin-bottom:4px}
.fezo-metric .val{font-size:22px;font-weight:500;line-height:1.1}
.fezo-metric .hint{position:absolute;top:8px;right:10px;font-size:10px;color:var(--f-text-tertiary);text-transform:lowercase}
.fezo-metric-soon .val{color:var(--f-text-tertiary)}

/* Card grid */
.fezo-grid-2{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:12px;
}
.fezo-card{
    background:var(--f-bg);
    border:0.5px solid var(--f-border);
    border-radius:var(--f-radius-lg);
    padding:14px 16px;
    text-decoration:none;
    color:inherit;
    display:block;
    transition:border-color .12s,background .12s;
}
.fezo-card:hover{border-color:var(--f-border-strong)}
.fezo-card-link:hover{background:var(--f-bg-soft)}
.fezo-card-title{font-weight:500;margin-bottom:4px;font-size:16px}
.fezo-card-sub{font-size:13px;color:var(--f-text-muted);margin-bottom:12px}

/* Pin badges */
.fezo-pin-row{display:flex;flex-wrap:wrap;gap:6px}
.fezo-pin{
    display:inline-block;
    padding:3px 9px;
    border-radius:4px;
    font-size:12px;
    font-weight:500;
    line-height:1.3;
    white-space:nowrap;
}
.fezo-ok{background:var(--f-ok-bg);color:var(--f-ok-tx)}
.fezo-empty{background:var(--f-empty-bg);color:var(--f-empty-tx)}
.fezo-info{background:var(--f-info-bg);color:var(--f-info-tx)}
.fezo-warn{background:var(--f-warn-bg);color:var(--f-warn-tx)}
.fezo-danger{background:var(--f-danger-bg);color:var(--f-danger-tx)}

/* Rows */
.fezo-section-title{
    font-size:14px;
    font-weight:500;
    margin:18px 0 8px;
    color:var(--f-text);
}
.fezo-rows{display:flex;flex-direction:column;gap:6px}
.fezo-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:11px 14px;
    border:0.5px solid var(--f-border);
    border-radius:var(--f-radius);
    text-decoration:none;
    color:inherit;
    transition:background .12s;
}
.fezo-row:hover{background:var(--f-bg-soft)}
.fezo-row-title{font-weight:500;font-size:14px}
.fezo-row-sub{font-size:12px;color:var(--f-text-muted);margin-top:2px}

/* Unit detail */
.fezo-unit-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    flex-wrap:wrap;
    gap:8px;
    margin:0 0 14px;
}
.fezo-unit-title{font-size:18px;font-weight:500}

.fezo-tabs{
    display:flex;
    gap:4px;
    overflow-x:auto;
    border-bottom:0.5px solid var(--f-border);
    margin:0 0 16px;
    padding:0;
}
.fezo-tab{
    padding:8px 12px;
    font-size:13px;
    color:var(--f-text-muted);
    border-bottom:2px solid transparent;
    white-space:nowrap;
}
.fezo-tab-active{color:var(--f-text);border-bottom-color:var(--f-text);font-weight:500}
.fezo-tab-soon{color:var(--f-text-tertiary);font-style:italic}

.fezo-kv{
    display:grid;
    grid-template-columns:160px 1fr;
    gap:8px 16px;
    font-size:14px;
    margin:0 0 16px;
}
.fezo-kv dt{color:var(--f-text-muted)}
.fezo-kv dd{margin:0}

.fezo-soon-note{
    margin:16px 0;
    padding:12px 14px;
    background:var(--f-bg-soft);
    border-radius:var(--f-radius);
    font-size:13px;
    color:var(--f-text-muted);
}

/* Forms */
.fezo-form{display:flex;flex-direction:column;gap:12px;max-width:480px}
.fezo-form label{display:flex;flex-direction:column;gap:4px;font-size:13px}
.fezo-form label > span{color:var(--f-text-muted)}
.fezo-form input[type=text],
.fezo-form input[type=number],
.fezo-form input[type=date],
.fezo-form select,
.fezo-form textarea{
    font:inherit;
    padding:8px 10px;
    border:0.5px solid var(--f-border-strong);
    border-radius:var(--f-radius);
    background:var(--f-bg);
    color:var(--f-text);
    width:100%;
}
.fezo-form input:focus,.fezo-form select:focus,.fezo-form textarea:focus{
    outline:none;
    border-color:var(--f-text);
    box-shadow:0 0 0 2px rgba(0,0,0,.08);
}
.fezo-fieldset{
    border:0.5px solid var(--f-border);
    border-radius:var(--f-radius);
    padding:12px 14px;
    display:flex;
    flex-direction:column;
    gap:10px;
    margin:0;
}
.fezo-fieldset legend{font-size:13px;font-weight:500;padding:0 6px}
.fezo-form-actions{display:flex;gap:8px;margin-top:6px}

.fezo-error{
    background:var(--f-danger-bg);
    color:var(--f-danger-tx);
    padding:10px 14px;
    border-radius:var(--f-radius);
    font-size:13px;
    margin:0 0 12px;
}
.fezo-muted{color:var(--f-text-muted);font-size:13px}
.fezo-empty-state{text-align:center;padding:40px 20px;color:var(--f-text-muted)}

form.fezo-danger{margin-top:24px}

/* PIN screen */
.fezo-pin-screen{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:60vh;
    padding:20px 0;
}
.fezo-pin-card{
    background:var(--f-bg);
    border:0.5px solid var(--f-border);
    border-radius:var(--f-radius-lg);
    padding:28px 24px;
    width:100%;
    max-width:320px;
    text-align:center;
}
.fezo-pin-title{font-size:13px;color:var(--f-text-muted);margin-bottom:4px}
.fezo-pin-sub{font-size:16px;font-weight:500;margin-bottom:18px}
#fezo-pin-input{
    position:absolute;
    left:-9999px;
    opacity:0;
    width:1px;
    height:1px;
}
.fezo-pin-dots{
    display:flex;
    justify-content:center;
    gap:14px;
    margin:0 0 22px;
}
.fezo-pin-dots span{
    width:14px;
    height:14px;
    border-radius:50%;
    border:0.5px solid var(--f-border-strong);
    background:transparent;
    transition:background .15s,border-color .15s;
}
.fezo-pin-dots span.filled{background:var(--f-text);border-color:var(--f-text)}
.fezo-pin-keys{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
}
.fezo-pin-keys button{
    padding:14px 0;
    font-size:18px;
    font-weight:500;
    background:var(--f-bg-soft);
    border:0;
    border-radius:var(--f-radius);
    cursor:pointer;
    color:var(--f-text);
    font-family:inherit;
}
.fezo-pin-keys button:hover{background:#ebe9e0}
.fezo-pin-keys button:active{transform:scale(.97)}
.fezo-pin-aux{font-size:18px}
.fezo-pin-go{background:#1a1a1a !important;color:#fff !important}
.fezo-pin-err{
    margin-top:14px;
    background:var(--f-danger-bg);
    color:var(--f-danger-tx);
    padding:8px 12px;
    border-radius:var(--f-radius);
    font-size:13px;
}
.fezo-pin-msg{
    margin-top:14px;
    background:rgba(255,255,255,0.1);
    color:rgba(255,255,255,0.9);
    padding:8px 12px;
    border-radius:var(--f-radius);
    font-size:13px;
    text-align:center;
}

@media (max-width:560px){
    .fezo-kv{grid-template-columns:1fr}
    .fezo-kv dt{margin-top:6px}
    .fezo-bar-actions{margin-left:0;width:100%}
}

/* ============================================================
   Dark mode — auto-applied by JS when page background is dark.
   Can also be forced manually via class .fezo-dark on the
   .fezo-app container.
   ============================================================ */
.fezo-app.fezo-dark{
    --f-text:#ececec;
    --f-text-muted:#b8b8b8;
    --f-text-tertiary:#7e7e7e;
    --f-bg:#232323;
    --f-bg-soft:#2c2c2c;
    --f-border:rgba(255,255,255,.10);
    --f-border-strong:rgba(255,255,255,.22);
    color-scheme:dark;
}
.fezo-app.fezo-dark .fezo-btn-primary{
    background:#ececec;
    color:#111;
    border-color:#ececec;
}
.fezo-app.fezo-dark .fezo-btn-primary:hover{background:#fff}
.fezo-app.fezo-dark .fezo-btn-danger{color:#F09595;border-color:#F09595}
.fezo-app.fezo-dark .fezo-btn-danger:hover{background:rgba(240,149,149,.10)}

.fezo-app.fezo-dark .fezo-pin-keys button{
    background:#2c2c2c;
    color:#ececec;
}
.fezo-app.fezo-dark .fezo-pin-keys button:hover{background:#353535}
.fezo-app.fezo-dark .fezo-pin-go{
    background:#ececec !important;
    color:#111 !important;
}
.fezo-app.fezo-dark .fezo-pin-dots span.filled{
    background:#ececec;
    border-color:#ececec;
}

.fezo-app.fezo-dark .fezo-form input:focus,
.fezo-app.fezo-dark .fezo-form select:focus,
.fezo-app.fezo-dark .fezo-form textarea:focus{
    border-color:#ececec;
    box-shadow:0 0 0 2px rgba(255,255,255,.10);
}

/* Pin badges already use light pastel bg + dark text — they remain
   readable on dark backgrounds as "indicator chips", so no overrides
   needed for them. */

/* ============================================================
   Balík 2 — formuláre, predpisy/platby, zábezpeka
   ============================================================ */

/* 2-stĺpcový riadok pre dvojice polí (napr. dátum od / dátum do) */
.fezo-form-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}
@media (max-width:480px){
    .fezo-form-row{grid-template-columns:1fr}
}

/* Inline checkbox label */
.fezo-checkbox{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:14px;
    color:var(--f-text);
    cursor:pointer;
    user-select:none;
}
.fezo-checkbox input[type=checkbox]{
    width:16px;
    height:16px;
    margin:0;
    accent-color:var(--f-text);
}

/* Wrapper pre obsah karty (tenant card a pod.) */
.fezo-card-content{
    padding:4px 2px;
}

/* Akcie v riadku (zoznam zmlúv, platieb) */
.fezo-row-actions{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    align-items:center;
}
.fezo-row-actions .fezo-btn{
    padding:6px 10px;
    font-size:13px;
}

/* Inline textový "link" button (zmazať a pod.) */
.fezo-link{
    background:none;
    border:none;
    padding:0;
    font:inherit;
    color:var(--f-text-muted);
    text-decoration:underline;
    cursor:pointer;
}
.fezo-link:hover{color:var(--f-text)}
.fezo-link-danger{color:#B85C5C}
.fezo-link-danger:hover{color:#9A4242}
.fezo-app.fezo-dark .fezo-link-danger{color:#F09595}
.fezo-app.fezo-dark .fezo-link-danger:hover{color:#FFB5B5}

/* Karta jedného mesačného predpisu */
.fezo-due-card{
    border:1px solid var(--f-border);
    border-radius:10px;
    padding:14px 16px;
    margin-bottom:10px;
    background:var(--f-bg);
}
.fezo-due-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:8px;
}
.fezo-due-head > div:first-child{flex:1; min-width:160px}
.fezo-due-head strong{font-size:15px}

/* Zoznam čiastkových platieb v rámci predpisu */
.fezo-pay-list{
    margin:8px 0 6px;
    padding:8px 10px;
    background:var(--f-bg-soft);
    border-radius:8px;
    display:flex;
    flex-direction:column;
    gap:4px;
}
.fezo-pay-line{
    display:grid;
    grid-template-columns:1fr auto auto auto;
    gap:10px;
    align-items:center;
    font-size:13px;
}
.fezo-pay-line span{white-space:nowrap}
@media (max-width:480px){
    .fezo-pay-line{
        grid-template-columns:1fr auto;
        row-gap:2px;
    }
    .fezo-pay-line .fezo-muted{grid-column:1/-1}
    .fezo-pay-line .fezo-link{grid-column:1/-1; text-align:right}
}

.fezo-due-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
    margin-top:6px;
    padding-top:8px;
    border-top:1px dashed var(--f-border);
}

/* Progress bar pre stav zábezpeky */
.fezo-progress{
    width:100%;
    height:8px;
    background:var(--f-bg-soft);
    border:1px solid var(--f-border);
    border-radius:6px;
    overflow:hidden;
    margin:8px 0 4px;
}
.fezo-progress-bar{
    height:100%;
    background:var(--f-text);
    transition:width .3s ease;
    min-width:0;
}
.fezo-app.fezo-dark .fezo-progress-bar{background:#ececec}

/* ============================================================
   Balík 2 — fotky nehnuteľností + nedoplatky badge
   ============================================================ */

/* Karta nehnuteľnosti s titulnou fotkou */
.fezo-prop-card.has-photo{
    padding:0;
    overflow:hidden;
}
.fezo-prop-photo{
    width:100%;
    height:160px;
    background-size:cover;
    background-position:center;
    background-repeat:no-repeat;
    border-bottom:1px solid var(--f-border);
    transition:transform .25s ease;
}
.fezo-prop-card.has-photo:hover .fezo-prop-photo{
    transform:scale(1.02);
}
.fezo-prop-card-body{
    padding:14px 16px 16px;
}

/* Hero banner na detaile nehnuteľnosti */
.fezo-prop-banner{
    width:100%;
    height:200px;
    background-size:cover;
    background-position:center;
    background-repeat:no-repeat;
    border:1px solid var(--f-border);
    border-radius:12px;
    margin:8px 0 12px;
}
@media (max-width:480px){
    .fezo-prop-banner{height:140px}
    .fezo-prop-photo{height:130px}
}

/* Pin pre nedoplatky */
.fezo-pin.fezo-warn{
    background:#FFE9D6;
    color:#7A3D00;
    border-color:#FFD7B0;
}
.fezo-app.fezo-dark .fezo-pin.fezo-warn{
    background:#3A2A18;
    color:#FFC287;
    border-color:#5A3F22;
}

/* Metric tile s warning podfarbením */
.fezo-metric.fezo-metric-warn{
    background:linear-gradient(180deg, rgba(255,233,214,.5), rgba(255,233,214,.15));
    border-color:#FFD7B0;
}
.fezo-app.fezo-dark .fezo-metric.fezo-metric-warn{
    background:linear-gradient(180deg, rgba(58,42,24,.55), rgba(58,42,24,.20));
    border-color:#5A3F22;
}
.fezo-metric.fezo-metric-warn .val{color:#9A4B00}
.fezo-app.fezo-dark .fezo-metric.fezo-metric-warn .val{color:#FFC287}

/* ============================================================
   Balík 3 — matica energií + faktúry
   ============================================================ */

/* OK banner */
.fezo-ok-banner{
    padding:10px 14px;
    border-radius:10px;
    background:#E6F4EA;
    color:#1F5132;
    border:1px solid #BFE2C8;
    margin:10px 0;
    font-size:14px;
}
.fezo-app.fezo-dark .fezo-ok-banner{
    background:#1A2D1F;
    color:#A8E2B5;
    border-color:#2F4A36;
}

/* Matica energií — scrollovateľná tabuľka */
.fezo-matrix-wrap{
    overflow-x:auto;
    margin:10px 0;
    border:1px solid var(--f-border);
    border-radius:10px;
}
.fezo-matrix{
    width:100%;
    border-collapse:collapse;
    font-size:13px;
    min-width:720px;
}
.fezo-matrix th,
.fezo-matrix td{
    padding:8px 10px;
    border-bottom:1px solid var(--f-border);
    border-right:1px solid var(--f-border);
    vertical-align:middle;
    white-space:nowrap;
}
.fezo-matrix th{
    background:var(--f-bg-soft);
    font-weight:600;
    text-align:left;
    position:sticky;
    top:0;
    z-index:2;
}
.fezo-matrix th:first-child,
.fezo-matrix td:first-child{
    position:sticky;
    left:0;
    background:var(--f-bg);
    z-index:3;
    border-right:2px solid var(--f-border-strong);
}
.fezo-matrix th:first-child{
    z-index:4;
    background:var(--f-bg-soft);
}
.fezo-matrix tr:last-child td{border-bottom:none}
.fezo-matrix td:last-child,
.fezo-matrix th:last-child{border-right:none}

.fezo-matrix-rowhead strong{display:block;font-size:14px}
.fezo-matrix-rowhead .fezo-muted{font-size:11px}

/* Select v bunke matice — farebné označenie podľa módu */
.fezo-matrix-select{
    width:100%;
    min-width:120px;
    padding:5px 6px;
    border:1px solid var(--f-border);
    border-radius:6px;
    background:var(--f-bg);
    color:var(--f-text);
    font-size:12px;
    cursor:pointer;
}
.fezo-matrix-select.fezo-mode-share_m2    { background:#E8F0FE; color:#1A3A6E; border-color:#C2D8F2; }
.fezo-matrix-select.fezo-mode-share_equal { background:#EAF5EE; color:#1F5132; border-color:#C8E0CF; }
.fezo-matrix-select.fezo-mode-own         { background:#FFF4E0; color:#7A4F00; border-color:#F2DDB0; }
.fezo-matrix-select.fezo-mode-included    { background:#F1ECFA; color:#3F2876; border-color:#D7C9F1; }
.fezo-matrix-select.fezo-mode-none        { background:transparent; color:var(--f-text-tertiary); }

.fezo-app.fezo-dark .fezo-matrix-select.fezo-mode-share_m2    { background:#1B2A40; color:#9EBDE5; border-color:#2F4869; }
.fezo-app.fezo-dark .fezo-matrix-select.fezo-mode-share_equal { background:#1A2D1F; color:#A8E2B5; border-color:#2F4A36; }
.fezo-app.fezo-dark .fezo-matrix-select.fezo-mode-own         { background:#3A2A18; color:#FFC287; border-color:#5A3F22; }
.fezo-app.fezo-dark .fezo-matrix-select.fezo-mode-included    { background:#2A1F40; color:#C5B0EE; border-color:#403060; }
.fezo-app.fezo-dark .fezo-matrix-select.fezo-mode-none        { background:transparent; color:var(--f-text-tertiary); border-color:var(--f-border); }

/* ============================================================
   Balík 4 — splatné nájmy + vyúčtovania
   ============================================================ */

/* Splatné nájmy na dashboard */
.fezo-due-list-row.is-overdue{
    border-left:3px solid #B85C5C;
}
.fezo-app.fezo-dark .fezo-due-list-row.is-overdue{
    border-left-color:#F09595;
}
.fezo-due-date{
    display:inline-block;
    min-width:54px;
    font-variant-numeric:tabular-nums;
    font-weight:600;
    color:var(--f-text);
}
.fezo-due-date.is-overdue{color:#B85C5C}
.fezo-app.fezo-dark .fezo-due-date.is-overdue{color:#F09595}

/* Warn banner (proposed settlement) */
.fezo-warn-banner{
    padding:10px 14px;
    border-radius:10px;
    background:#FFF7E6;
    color:#7A4F00;
    border:1px solid #F2DDB0;
    margin:10px 0;
    font-size:14px;
}
.fezo-app.fezo-dark .fezo-warn-banner{
    background:#3A2A18;
    color:#FFC287;
    border-color:#5A3F22;
}

/* Settlement layout */
.fezo-settlement-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
    margin-top:14px;
}
@media (max-width:600px){
    .fezo-settlement-grid{grid-template-columns:1fr}
}
.fezo-settlement-block{
    border:1px solid var(--f-border);
    border-radius:10px;
    padding:12px 14px;
    background:var(--f-bg);
}

.fezo-settle-table{
    width:100%;
    border-collapse:collapse;
    font-size:14px;
}
.fezo-settle-table td{
    padding:6px 0;
    border-bottom:1px solid var(--f-border);
}
.fezo-settle-table tr:last-child td{border-bottom:none}
.fezo-settle-table td.num{
    text-align:right;
    font-variant-numeric:tabular-nums;
    white-space:nowrap;
}
.fezo-settle-total td{
    border-top:1px solid var(--f-border-strong);
    padding-top:10px;
    padding-bottom:6px;
}

/* Profit highlight */
.fezo-settle-profit{
    margin-top:14px;
    padding:14px 18px;
    border-radius:10px;
    background:linear-gradient(180deg, rgba(35,35,35,0.04), rgba(35,35,35,0));
    border:1px solid var(--f-border);
    display:grid;
    grid-template-columns:1fr auto 1fr auto;
    gap:14px;
    align-items:center;
}
.fezo-settle-profit .lbl{font-size:13px;color:var(--f-text-muted)}
.fezo-settle-profit .val{font-size:22px;font-weight:600;font-variant-numeric:tabular-nums}
@media (max-width:600px){
    .fezo-settle-profit{grid-template-columns:1fr 1fr}
}

/* Result lines */
.fezo-settle-result{
    padding:14px 18px;
    border-radius:10px;
    background:var(--f-bg-soft);
    border:1px solid var(--f-border);
}
.fezo-settle-line{
    padding:6px 0;
    font-size:15px;
}
.fezo-settle-line + .fezo-settle-line{
    border-top:1px solid var(--f-border);
}

/* Detail table */
.fezo-detail-table{
    width:100%;
    border-collapse:collapse;
    font-size:13px;
    margin-top:6px;
}
.fezo-detail-table th,
.fezo-detail-table td{
    padding:6px 8px;
    border-bottom:1px solid var(--f-border);
    text-align:left;
}
.fezo-detail-table th{
    background:var(--f-bg-soft);
    font-weight:600;
}
.fezo-detail-table td.num,
.fezo-detail-table th.num{
    text-align:right;
    font-variant-numeric:tabular-nums;
    white-space:nowrap;
}

.fezo-settle-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:flex-start;
}

/* ============================================================
   Balík 5 — inventár, fotky, odovzdávací protokol
   ============================================================ */

/* Inventory state select — farebné podľa stavu */
.fezo-state-select{
    padding:5px 8px;
    border:1px solid var(--f-border);
    border-radius:6px;
    font-size:12px;
    background:var(--f-bg);
    color:var(--f-text);
    cursor:pointer;
}
.fezo-state-select.fezo-state-ok      { background:#EAF5EE; color:#1F5132; border-color:#C8E0CF; }
.fezo-state-select.fezo-state-damaged { background:#FFF7E6; color:#7A4F00; border-color:#F2DDB0; }
.fezo-state-select.fezo-state-missing { background:#FBE5E5; color:#7A1F1F; border-color:#E5BFBF; }
.fezo-state-select.fezo-state-new     { background:#E8F0FE; color:#1A3A6E; border-color:#C2D8F2; }
.fezo-app.fezo-dark .fezo-state-select.fezo-state-ok      { background:#1A2D1F; color:#A8E2B5; border-color:#2F4A36; }
.fezo-app.fezo-dark .fezo-state-select.fezo-state-damaged { background:#3A2A18; color:#FFC287; border-color:#5A3F22; }
.fezo-app.fezo-dark .fezo-state-select.fezo-state-missing { background:#3A1818; color:#F09595; border-color:#5A2A2A; }
.fezo-app.fezo-dark .fezo-state-select.fezo-state-new     { background:#1B2A40; color:#9EBDE5; border-color:#2F4869; }

/* Photo grid (zoznam fotiek) */
.fezo-photo-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));
    gap:14px;
    margin-top:6px;
}
.fezo-photo-card{
    border:1px solid var(--f-border);
    border-radius:10px;
    overflow:hidden;
    background:var(--f-bg);
}
.fezo-photo-thumb{
    display:block;
    width:100%;
    aspect-ratio:4/3;
    background-size:cover;
    background-position:center;
    background-repeat:no-repeat;
    background-color:var(--f-bg-soft);
}
.fezo-photo-meta{
    padding:8px 10px;
    display:flex;
    flex-direction:column;
    gap:6px;
}
.fezo-caption-form input{
    width:100%;
    padding:4px 6px;
    border:1px solid var(--f-border);
    border-radius:6px;
    font-size:13px;
    background:var(--f-bg);
    color:var(--f-text);
}
.fezo-photo-actions{
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-size:12px;
}

/* Inline photo strip (pri inventárnej položke) */
.fezo-photo-strip{
    display:flex;
    gap:4px;
    margin-top:6px;
    flex-wrap:wrap;
}
.fezo-photo-thumb-sm{
    display:block;
    width:48px;
    height:48px;
    background-size:cover;
    background-position:center;
    border-radius:6px;
    border:1px solid var(--f-border);
}

/* Photo upload picker buttons (pre kameru / galériu) */
.fezo-photo-pickers{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}
@media (max-width:480px){
    .fezo-photo-pickers{grid-template-columns:1fr}
}
.fezo-photo-picker{
    display:block;
    padding:18px 14px;
    border:2px dashed var(--f-border-strong);
    border-radius:12px;
    background:var(--f-bg-soft);
    cursor:pointer;
    transition:background .15s ease;
}
.fezo-photo-picker:hover{
    background:var(--f-bg);
}
.fezo-photo-picker .lbl{
    display:block;
    font-size:15px;
    font-weight:600;
    margin-bottom:6px;
}
.fezo-photo-picker input[type=file]{
    display:block;
    margin-top:6px;
    font-size:13px;
    width:100%;
}

/* Handover protocol (printable) */
.fezo-handover-bar{
    display:flex;
    gap:10px;
    align-items:center;
    margin-bottom:14px;
}
.fezo-handover{
    background:#fff;
    color:#111;
    padding:24px 28px;
    border-radius:12px;
    border:1px solid #e5e5e5;
    max-width:780px;
    margin:0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height:1.5;
}
.fezo-handover h1.fezo-handover-title{
    font-size:24px;
    margin:0 0 4px;
    color:#111;
}
.fezo-handover-subtitle{
    color:#555;
    margin:0 0 18px;
    font-size:15px;
}
.fezo-handover h2{
    font-size:16px;
    margin:20px 0 8px;
    padding-bottom:4px;
    border-bottom:1px solid #ccc;
    color:#111;
}
.fezo-handover-meta,
.fezo-handover-meters,
.fezo-handover-keys{
    width:100%;
    border-collapse:collapse;
    margin:8px 0;
    font-size:13px;
}
.fezo-handover-meta th,
.fezo-handover-meters th,
.fezo-handover-keys th{
    text-align:left;
    padding:4px 8px 4px 0;
    font-weight:600;
    width:200px;
    color:#444;
}
.fezo-handover-meta td,
.fezo-handover-meters td,
.fezo-handover-keys td{
    padding:4px 0;
}
.fezo-handover-inventory{
    width:100%;
    border-collapse:collapse;
    font-size:13px;
    margin-top:6px;
}
.fezo-handover-inventory th,
.fezo-handover-inventory td{
    border:1px solid #bbb;
    padding:6px 8px;
    text-align:left;
    vertical-align:top;
}
.fezo-handover-inventory th{
    background:#f4f4f4;
    font-weight:600;
}
.fezo-handover-defects{
    font-size:13px;
    margin-top:4px;
}
.fezo-handover-defects > div{
    margin:3px 0;
}
.fezo-handover-blanks > div{
    margin:8px 0;
}
.fezo-handover-signatures{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:24px;
    margin-top:48px;
    font-size:13px;
}
.fezo-handover-line{
    margin-bottom:6px;
    letter-spacing:1px;
    color:#555;
}
.fezo-handover-foot{
    margin-top:32px;
    font-size:12px;
    color:#666;
    font-style:italic;
}

/* Print styles */
@media print {
    body, html{background:#fff !important; margin:0 !important; padding:0 !important}
    /* Hide common WP theme elements that wrap the shortcode output */
    header, footer, nav, aside,
    .site-header, .site-footer, .site-branding,
    .wp-block-template-part, .wp-block-navigation,
    .has-main-navigation, #wpadminbar, #masthead, #colophon,
    .breadcrumbs, .entry-meta, .post-navigation{
        display:none !important;
    }
    /* Hide our own UI chrome */
    .fezo-no-print, .fezo-bar, .fezo-tabs{
        display:none !important;
    }
    .fezo-app{
        background:#fff !important;
    }
    .fezo-handover{
        border:none;
        box-shadow:none;
        margin:0;
        padding:0;
        max-width:100%;
    }
    .fezo-handover h1.fezo-handover-title{
        font-size:20px;
    }
    .fezo-handover h2{
        page-break-after:avoid;
    }
    .fezo-handover-inventory tr,
    .fezo-handover-meters tr,
    .fezo-handover-keys tr{
        page-break-inside:avoid;
    }
}

/* Dark mode override — handover always white */
.fezo-app.fezo-dark .fezo-handover{
    background:#fff !important;
    color:#111 !important;
}

/* ============================================================
   Balík 6 — reporty
   ============================================================ */

.fezo-reports-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(320px, 1fr));
    gap:16px;
    margin-top:14px;
}
.fezo-report-card{
    border:1px solid var(--f-border);
    border-radius:12px;
    padding:18px 20px;
    background:var(--f-bg);
    display:flex;
    flex-direction:column;
}
.fezo-report-card-head h3{
    margin:0 0 6px;
    font-size:17px;
}
.fezo-report-card-head p{
    margin:0 0 14px;
    font-size:13px;
}
.fezo-report-form{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:auto;
}
.fezo-report-form label{
    display:flex;
    flex-direction:column;
    gap:4px;
    font-size:13px;
    color:var(--f-text-muted);
}
.fezo-report-form select{
    padding:7px 9px;
    border:1px solid var(--f-border);
    border-radius:6px;
    background:var(--f-bg);
    color:var(--f-text);
    font-size:14px;
}
.fezo-report-form button{
    align-self:flex-start;
    margin-top:4px;
}

/* ============================================================
   Manuál (kontextový help) + Úlohy
   ============================================================ */

/* Inline help on each page */
.fezo-help{
    margin:10px 0 16px;
    padding:0;
    border:1px solid var(--f-border);
    border-radius:8px;
    background:var(--f-bg-soft);
    overflow:hidden;
}
.fezo-help summary{
    padding:10px 14px;
    cursor:pointer;
    list-style:none;
    font-size:13px;
    color:var(--f-text-muted);
    user-select:none;
}
.fezo-help summary::-webkit-details-marker{display:none}
.fezo-help summary::before{
    content:"▸ ";
    display:inline-block;
    margin-right:4px;
    transition:transform .15s ease;
}
.fezo-help[open] summary::before{
    transform:rotate(90deg);
}
.fezo-help[open] summary{
    border-bottom:1px solid var(--f-border);
    color:var(--f-text);
}
.fezo-help-body{
    padding:14px 18px 16px;
    font-size:14px;
    line-height:1.55;
}
.fezo-help-body h4{
    margin:14px 0 6px;
    font-size:14px;
    color:var(--f-text);
}
.fezo-help-body h4:first-child{
    margin-top:0;
}
.fezo-help-body ul,
.fezo-help-body ol{
    margin:6px 0 10px;
    padding-left:22px;
}
.fezo-help-body li{
    margin:3px 0;
}
.fezo-help-body code{
    background:var(--f-bg);
    border:1px solid var(--f-border);
    border-radius:4px;
    padding:1px 5px;
    font-size:12px;
    font-family:ui-monospace, Menlo, monospace;
}
.fezo-help-body p{
    margin:6px 0;
}
.fezo-help-foot{
    margin-top:14px !important;
    padding-top:10px;
    border-top:1px dashed var(--f-border);
    font-size:13px;
}

/* Full manual page */
.fezo-manual{
    max-width:820px;
    margin:0 auto;
}
.fezo-help-toc{
    background:var(--f-bg-soft);
    border:1px solid var(--f-border);
    border-radius:8px;
    padding:14px 18px;
    margin:14px 0 24px;
    font-size:14px;
}
.fezo-help-toc ol{
    margin:8px 0 0;
    padding-left:22px;
}
.fezo-help-toc li{
    margin:4px 0;
}
.fezo-help-section{
    margin:32px 0 24px;
    padding-top:8px;
    scroll-margin-top:80px;
}
.fezo-help-section h2{
    margin:0 0 12px;
    font-size:20px;
    color:var(--f-text);
    padding-bottom:6px;
    border-bottom:2px solid var(--f-border);
}
.fezo-help-section h4{
    margin:16px 0 8px;
    font-size:15px;
    color:var(--f-text);
}
.fezo-help-section ul,
.fezo-help-section ol{
    padding-left:22px;
}
.fezo-help-section li{
    margin:4px 0;
    line-height:1.5;
}
.fezo-help-section code{
    background:var(--f-bg-soft);
    border:1px solid var(--f-border);
    border-radius:4px;
    padding:1px 6px;
    font-size:13px;
    font-family:ui-monospace, Menlo, monospace;
}

/* Tasks panel */
.fezo-tasks-dashboard,
.fezo-tasks-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}
.fezo-task-group{
    border:1px solid var(--f-border);
    border-radius:8px;
    background:var(--f-bg);
    overflow:hidden;
}
.fezo-task-group-head{
    padding:8px 12px;
    background:var(--f-bg-soft);
    border-bottom:1px solid var(--f-border);
    font-size:13px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
}
.fezo-task-row{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border-bottom:1px solid var(--f-border);
}
.fezo-task-row:last-child{
    border-bottom:none;
}
.fezo-task-state{
    font-size:18px;
    flex-shrink:0;
}
.fezo-task-text{
    flex:1;
    min-width:0;
    font-size:14px;
    line-height:1.4;
}
.fezo-task-note{
    margin-top:2px;
    font-size:12px;
    color:var(--f-text-muted);
    line-height:1.4;
}
.fezo-task-actions{
    flex-shrink:0;
}
.fezo-task-actions button{
    padding:6px 10px;
    font-size:12px;
}
@media (max-width:520px){
    .fezo-task-row{
        flex-wrap:wrap;
    }
    .fezo-task-text{
        flex-basis:100%;
    }
    .fezo-task-actions{
        margin-left:auto;
    }
}

/* Print-hide help and tasks dashboard panel */
@media print {
    .fezo-help,
    .fezo-tasks-dashboard,
    .fezo-help-toc{
        display:none !important;
    }
}

/* ========================================================================
   v0.10.0 — Future dues + Audit log widgets
   ======================================================================== */

/* Future dues: lighter visual weight than overdue/today */
.fezo-future-dues .fezo-due-list-row.is-future {
    opacity: 0.85;
    border-left: 3px solid #4a90e2;
}
.fezo-future-dues .fezo-due-list-row.is-future:hover {
    opacity: 1;
}

/* Audit log widget on dashboard */
.fezo-audit-widget {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--fezo-card-bg, #fff);
    border: 1px solid var(--fezo-border, #e3e3e3);
    border-radius: 6px;
    padding: 10px 14px;
}

.fezo-audit-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--fezo-border, #eee);
}
.fezo-audit-row:last-child {
    border-bottom: none;
}

.fezo-audit-icon {
    font-size: 18px;
    line-height: 1.2;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.fezo-audit-body {
    flex: 1;
    min-width: 0;
}

.fezo-audit-summary {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.fezo-audit-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 3px;
    font-size: 12px;
    flex-wrap: wrap;
}

/* Full audit log page */
.fezo-audit-list {
    background: var(--fezo-card-bg, #fff);
    border: 1px solid var(--fezo-border, #e3e3e3);
    border-radius: 6px;
    padding: 4px 14px;
}
.fezo-audit-list .fezo-audit-row {
    padding: 10px 0;
}

.fezo-pagination .fezo-pin {
    padding: 4px 10px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .fezo-audit-row {
        gap: 8px;
        padding: 6px 0;
    }
    .fezo-audit-icon {
        font-size: 16px;
    }
    .fezo-audit-summary {
        font-size: 13px;
    }
    .fezo-audit-meta {
        font-size: 11px;
    }
}

/* ====================================================================== */
/* Tenant portal (v0.11.0) — read-only view for tenants                   */
/* ====================================================================== */

.fezo-tenant-app {
    /* Slightly softer accent so the tenant view feels distinct from owner. */
    max-width: 720px;
    margin: 0 auto;
}

.fezo-tenant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--fezo-border, #ddd);
    border-radius: 10px;
    background: var(--fezo-card-bg, #fff);
    margin-bottom: 16px;
}

.fezo-tenant-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid;
    margin-bottom: 6px;
}
.fezo-tenant-banner.is-ok {
    background: #e8f5ee; border-color: #b6d8c2; color: #1e5e3a;
}
.fezo-tenant-banner.is-overdue {
    background: #fde8e8; border-color: #f0bcbc; color: #8b1a1a;
}
.fezo-tenant-banner.is-due {
    background: #fff4d6; border-color: #f0d68c; color: #7a5800;
}
.fezo-tenant-banner.is-upcoming {
    background: #e6f0fa; border-color: #b8d2ee; color: #1c4470;
}
.fezo-banner-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.fezo-tenant-payinfo {
    border: 1px solid var(--fezo-border, #ddd);
    border-radius: 10px;
    background: var(--fezo-card-bg, #fff);
    padding: 4px 16px;
}
.fezo-payinfo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--fezo-border-soft, #eee);
    flex-wrap: wrap;
}
.fezo-payinfo-row:last-child { border-bottom: 0; }
.fezo-iban-row { gap: 8px; }
.fezo-iban {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 14px;
    background: var(--fezo-code-bg, #f4f4f4);
    padding: 6px 10px;
    border-radius: 6px;
    user-select: all;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.fezo-tenant-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 600px) {
    .fezo-tenant-tiles { grid-template-columns: repeat(3, 1fr); }
}
.fezo-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 18px 10px;
    border: 1px solid var(--fezo-border, #ddd);
    border-radius: 10px;
    background: var(--fezo-card-bg, #fff);
    color: var(--fezo-text, #222);
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.1s, border-color 0.15s;
    position: relative;
}
.fezo-tile:hover {
    border-color: var(--fezo-accent, #1f3a52);
    transform: translateY(-1px);
    text-decoration: none;
}
.fezo-tile-icon {
    font-size: 28px;
    line-height: 1;
}
.fezo-badge {
    display: inline-block;
    background: #c33;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 7px;
    margin-left: 4px;
    vertical-align: middle;
}

.fezo-pwa-hint {
    border: 1px dashed var(--fezo-accent, #1f3a52);
    border-radius: 10px;
    padding: 16px;
    background: var(--fezo-card-bg, #fff);
    text-align: center;
}
.fezo-pwa-hint p { margin: 6px 0 12px; font-size: 13px; }

/* Messages thread styling */
.fezo-message-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.fezo-message-thread {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fezo-message-bubble {
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid var(--fezo-border, #ddd);
    max-width: 90%;
}
.fezo-message-mine {
    align-self: flex-end;
    background: #e6f0fa;
    border-color: #b8d2ee;
}
.fezo-message-theirs {
    align-self: flex-start;
    background: #f7f7f7;
}
.fezo-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    margin-bottom: 6px;
}
.fezo-message-body {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}
.fezo-message-status {
    align-self: flex-start;
    font-size: 11px;
    color: var(--fezo-muted, #777);
    padding: 2px 10px;
}

/* ====================================================================== */
/* Owner-side: messages inbox + tenant PIN display                        */
/* ====================================================================== */

.fezo-inbox-item {
    border: 1px solid var(--fezo-border, #ddd);
    border-radius: 10px;
    background: var(--fezo-card-bg, #fff);
    padding: 14px 16px;
    margin-bottom: 12px;
}
.fezo-inbox-item.is-new {
    border-left: 4px solid #c33;
    background: #fffafa;
}
.fezo-inbox-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--fezo-muted, #777);
    margin-bottom: 6px;
}
.fezo-inbox-body {
    white-space: pre-wrap;
    margin: 8px 0;
    line-height: 1.5;
}
.fezo-inbox-reply {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--fezo-border-soft, #eee);
    background: #f7f7f7;
    padding: 10px;
    border-radius: 6px;
    white-space: pre-wrap;
    font-size: 13px;
}

.fezo-pin-display {
    background: linear-gradient(135deg, #1f3a52, #2a5070);
    color: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin: 16px 0;
}
.fezo-pin-display .fezo-pin-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 38px;
    font-weight: 700;
    letter-spacing: 6px;
    margin: 12px 0;
    user-select: all;
}
.fezo-pin-display .fezo-pin-warning {
    font-size: 12px;
    color: #ffcfa0;
    margin-top: 8px;
}

/* Dashboard messages widget */
.fezo-msg-widget {
    border: 1px solid var(--fezo-border, #ddd);
    border-radius: 10px;
    background: var(--fezo-card-bg, #fff);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.fezo-msg-widget.has-unread {
    border-left: 4px solid #c33;
}
.fezo-msg-widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
