html, body { height: 100%; margin: 0; font-family: Roboto, Helvetica, Arial, sans-serif; }

/* dodirni elementi >= 44px na uređajima s dodirom (TS 4.1) */
@media (pointer: coarse) {
    .mud-button-root, .mud-icon-button { min-height: 44px; min-width: 44px; }
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ---- stranice računa (statički SSR) ---- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #eef2ee; padding: 16px; box-sizing: border-box; }
.auth-card { width: 100%; max-width: 440px; background: #fff; color: #222; border-radius: 8px; padding: 28px 24px; box-shadow: 0 2px 10px rgba(0,0,0,.12); box-sizing: border-box; }
.auth-brand { font-size: 1.4rem; font-weight: 700; color: #1b5e20; margin-bottom: 8px; }
.auth-card h1 { font-size: 1.4rem; margin: 4px 0 16px; }
.auth-card h2 { font-size: 1.1rem; margin: 28px 0 8px; border-top: 1px solid #ddd; padding-top: 16px; }
.field { display: flex; flex-direction: column; margin-bottom: 14px; }
.field label { font-size: .85rem; color: #555; margin-bottom: 4px; }
.field input, .field select { font: inherit; padding: 10px 12px; min-height: 44px; border: 1px solid #9aa; border-radius: 4px; box-sizing: border-box; width: 100%; }
.field input:focus, .field select:focus { outline: 2px solid #1b5e20; border-color: #1b5e20; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; min-height: 44px; }
.btn-primary, .btn-secondary, .btn-danger { display: inline-block; font: inherit; font-weight: 500; min-height: 44px; padding: 10px 20px; border-radius: 4px; border: 0; cursor: pointer; text-decoration: none; text-align: center; box-sizing: border-box; margin: 4px 0; }
.btn-primary { background: #1b5e20; color: #fff; }
.btn-secondary { background: #e0e6e0; color: #1b3a1d; }
.btn-danger { background: #b71c1c; color: #fff; }
form .btn-primary { width: 100%; }
.links { margin-top: 18px; font-size: .9rem; line-height: 1.8; }
.links a, .auth-card a:not([class]) { color: #1b5e20; }
.hint { font-size: .8rem; color: #666; }
.status { padding: 10px 12px; border-radius: 4px; margin-bottom: 14px; font-size: .9rem; }
.status-ok { background: #e8f5e9; color: #1b5e20; }
.status-error, .validation-message { background: #fdecea; color: #b71c1c; }
.validation-message { padding: 2px 6px; font-size: .8rem; margin-top: 4px; border-radius: 3px; }
ul.validation-errors { margin: 0; padding-left: 18px; }
.codes { background: #f5f5f5; padding: 12px; border-radius: 4px; font-size: 1.05rem; letter-spacing: .05em; }
.qr svg { width: 200px; height: 200px; display: block; margin: 8px auto 16px; }

/* ---- fotografije ---- */
.thumb-box { position: relative; aspect-ratio: 4 / 3; background: #e8ece8; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-status { position: absolute; left: 4px; bottom: 4px; }
.thumb-trust { position: absolute; right: 4px; top: 4px; }
.thumb-flags { position: absolute; left: 4px; top: 4px; display: flex; gap: 2px; }
.capture-button { min-height: 72px !important; font-size: 1.2rem !important; }
.drop-zone { border: 2px dashed #8aa08a; border-radius: 8px; padding: 32px 16px; text-align: center; transition: background .15s; }
.drop-zone.drop-active { background: #e8f5e9; border-color: #1b5e20; }
.photo-viewer-img { max-width: 100%; max-height: 60vh; display: block; margin: 0 auto; }
@media (max-width: 599px) { .mud-main-content { padding-bottom: 72px; } }

.set-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; aspect-ratio: 4 / 1; background: #e8ece8; overflow: hidden; }
.set-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.set-preview-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; }

/* ---- donja navigacija (samo mobitel) ---- */
.bottom-nav { display: none; }
@media (max-width: 599px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
    background: var(--mud-palette-surface, #fff); border-top: 1px solid var(--mud-palette-divider, #ddd);
    padding-bottom: env(safe-area-inset-bottom); justify-content: space-around; align-items: center;
    box-shadow: 0 -2px 6px rgba(0,0,0,.12);
  }
  .bottom-nav a { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .7rem; text-decoration: none; color: var(--mud-palette-text-secondary, #555); }
  .bottom-nav a.active { color: var(--mud-palette-primary, #1b5e20); font-weight: 600; }
  .bottom-nav .bottom-nav-fab { flex: 0 0 64px; height: 64px; min-height: 64px; margin-top: -24px; border-radius: 50%; background: var(--mud-palette-primary, #1b5e20); color: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
}

.card-link, .card-click { display: block; color: inherit; text-decoration: none; cursor: pointer; }
.card-link:focus-visible, .card-click:focus-visible { outline: 3px solid var(--mud-palette-primary, #1b5e20); outline-offset: -3px; }

/* ---- nacrti ---- */
.plan-viewer { position: relative; width: 100%; height: calc(100vh - 290px); min-height: 420px; background: #f3f3f0; border: 1px solid var(--mud-palette-lines-default, #ccc); border-radius: 6px; overflow: hidden; touch-action: none; }
.plan-scalebar { position: absolute; left: 10px; bottom: 10px; z-index: 5; background: rgba(255,255,255,.85); padding: 3px 8px 2px; border-radius: 4px; font-size: .75rem; pointer-events: none; text-align: center; }
.plan-scalebar-line { height: 5px; border: 2px solid #212121; border-top: 0; margin: 0 auto 1px; }
.sheet-thumb { width: 64px; height: 46px; object-fit: cover; border: 1px solid #ccc; border-radius: 3px; background: #fff; }
@media (max-width: 600px) { .plan-viewer { height: calc(100vh - 340px); min-height: 320px; } }

/* ---- problemi ---- */
.overdue { color: var(--mud-palette-error, #c62828); font-weight: 600; }
.issue-thumb { width: 96px; height: 72px; object-fit: cover; border: 1px solid #ccc; border-radius: 3px; background: #fff; }
.new-issue-plan .plan-viewer { height: 340px; min-height: 260px; }
.new-issue-plan.tall .plan-viewer { height: 72vh; min-height: 420px; }

/* ---- predprovjera i zapisnici ---- */
.precheck-ok { color: #2e7d32; font-size: .875rem; }
.precheck-warning { color: #e65100; font-size: .875rem; }
.precheck-blocker { color: #c62828; font-size: .875rem; font-weight: 600; }

/* ---- nadzorne ploče ---- */
.stat { min-height: 120px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: .875rem; }
.bar-label { width: 110px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { flex: 1; height: 12px; background: #e0e0e0; border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--mud-palette-primary, #1b5e20); }
.bar-n { width: 90px; flex: none; text-align: right; }

/* ---- kalendar (Heron.MudCalendar): na uskim zaslonima popis po danima umjesto rešetke ---- */
.cal-agenda { display: none; }
@media (max-width: 700px) {
  .cal-wide { display: none; }
  .cal-agenda { display: block; }
}
.cal-item { font-size: .75rem; line-height: 1.25; padding: 1px 6px; border-radius: 4px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-checkpoint { background: #1976d2; }
.cal-visit { background: #7b1fa2; }
.cal-statutory { background: #ef6c00; }
.cal-done { background: #2e7d32; }
.cal-overdue { background: #c62828; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.cal-legend { font-size: .75rem; display: inline-flex; gap: 4px; align-items: center; }
.cal-legend .cal-dot { margin-top: 0; }
.cal-owner { background: #00838f; }
