:root {
  --bg: #050816;
  --bg-elevated: #0b1020;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --accent-strong: rgba(129, 140, 248, 0.32);
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: rgba(148, 163, 184, 0.35);
  --radius-lg: 18px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.8);
  --transition-fast: 160ms ease-out;
  --transition-med: 220ms ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1e293b 0, #020617 55%, #000 100%);
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 32px 20px;
}

.header {
  max-width: 880px;
  margin: 0 auto 24px auto;
  text-align: center;
}

.header h1 {
  margin: 0 0 8px 0;
  font-size: clamp(2rem, 3vw, 2.4rem);
  letter-spacing: 0.04em;
}

.header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.dashboard {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.dashboard--superadmin {
  max-width: 560px;
}

@media (min-width: 640px) {
  .dashboard--superadmin {
    max-width: 900px;
    grid-template-columns: repeat(2, 1fr);
  }
}

.tile {
  position: relative;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  min-height: 52px;
  padding: 20px 24px;
  background: radial-gradient(circle at 0 0, var(--accent-soft), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(15, 23, 42, 0.9), #020617 60%);
  color: inherit;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-fast),
    background var(--transition-med),
    outline-offset var(--transition-fast);
  outline: none;
}

.tile::before {
  content: none;
}

.tile-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.tile-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .tile {
    min-height: 60px;
    padding: 22px 28px;
  }

  .tile-title {
    font-size: 1.15rem;
  }

  .tile-subtitle {
    font-size: 0.95rem;
  }
}

.tile:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.95);
  border-color: var(--accent-strong);
  background: radial-gradient(circle at 0 0, var(--accent-strong), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(15, 23, 42, 0.95), #020617 55%);
}

.tile:active {
  transform: translateY(-1px) scale(0.995);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.9);
}

.tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(120%);
  min-width: 220px;
  max-width: min(480px, 90vw);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--text);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  opacity: 0;
  transition:
    transform 180ms ease-out,
    opacity 180ms ease-out;
  z-index: 50;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Kotelna: toast s chybou PLC – výběr textu + kopírování (globální .toast má pointer-events: none) */
.toast.toast--with-actions {
  border-radius: 14px;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
}

.toast.toast--with-actions.toast--visible {
  pointer-events: auto;
  z-index: 2147483000;
}

.toast__text {
  user-select: text;
  -webkit-user-select: text;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.4;
  word-break: break-word;
}

.toast__copy {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  font: inherit;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(30, 41, 59, 0.95);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.toast__copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.toast__copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Kotelna: overlay při ukládání (fotky + pomalé sítě) */
.save-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.save-overlay[hidden] {
  display: none !important;
}

.save-overlay__panel {
  width: min(360px, 100%);
  padding: 22px 20px 18px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.save-overlay__msg {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.35;
}

.save-overlay__hint {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.save-overlay__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  border: 1px solid rgba(71, 85, 105, 0.6);
}

.save-overlay__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  transition: width 160ms ease-out;
}

.save-overlay.save-overlay--indeterminate .save-overlay__fill {
  width: 38%;
  transition: none;
  animation: save-overlay-scan 1.15s ease-in-out infinite alternate;
}

@keyframes save-overlay-scan {
  0% {
    margin-left: 0;
  }
  100% {
    margin-left: 62%;
  }
}

/* Přihlášení – stránka a panel na střed */
.auth-page {
  justify-content: flex-start;
}

.auth-main {
  max-width: 420px;
  margin: 32px auto 0 auto;
  width: 100%;
  text-align: center;
}

.auth-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 28px 24px 32px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  background: radial-gradient(circle at 0 0, var(--accent-soft), transparent 70%),
    radial-gradient(circle at 100% 100%, rgba(15, 23, 42, 0.92), #020617 60%);
  box-shadow: var(--shadow-soft);
}

.auth-title {
  margin: 0 0 20px 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.auth-field label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-field input {
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.auth-field input:focus-visible {
  border-color: var(--accent);
}

.auth-error {
  margin: 0;
  font-size: 0.88rem;
  color: #f87171;
}

.auth-submit {
  margin-top: 4px;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.auth-submit:hover {
  transform: translateY(-2px);
}

.auth-hint {
  margin: 20px 0 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-hint code {
  background: rgba(99, 102, 241, 0.2);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}

.auth-copyright {
  display: block;
  width: 100%;
  margin: 20px 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.header-subtitle {
  margin: 4px 0 0 0;
  font-size: 1rem;
  color: var(--text-muted);
}

/* Přehled pro majitele kotelny */
.owner-prehled-page .header {
  margin-bottom: 8px;
}
.owner-prehled-page .header-subtitle {
  margin-top: 16px;
  font-size: 1.25rem;
  font-weight: 600;
}
.owner-prehled-page .auth-main {
  margin-top: 12px;
}
.owner-prehled-main {
  max-width: 420px;
}

.owner-prehled-card {
  text-align: center;
}

.owner-prehled-title {
  margin: 0 0 20px 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.owner-prehled-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.owner-value-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.6);
}

.owner-value-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.owner-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.owner-value-unit {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.owner-prehled-update {
  margin: 16px 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Header – tlačítka Zpět / Odhlásit */
.header-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.logout-button {
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.logout-button:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.15);
}

/* Kotelna – formulář */
.kotelna-main {
  max-width: 560px;
}

.kotelna-card {
  text-align: left;
}

.kotelna-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.kotelna-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.kotelna-header-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kotelna-header-item--right {
  align-items: flex-end;
  text-align: right;
  margin-left: auto;
}

.kotelna-header-box {
  font-weight: 600;
  font-size: 1rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  display: inline-block;
}

.kotelna-header-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kotelna-header-value {
  font-weight: 600;
  font-size: 1rem;
}

.kotelna-header-input {
  font-weight: 600;
  font-size: 1rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition-fast);
  text-align: right;
}

.kotelna-header-input:focus-visible {
  border-color: var(--accent);
}

/* Datum a čas – wrapper s viditelnou ikonou kalendáře */
.kotelna-datetime-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.kotelna-datetime-wrap .kotelna-header-input {
  flex: 1;
  min-width: 0;
}

.kotelna-datetime-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.25);
  color: #e5e7eb;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.kotelna-datetime-btn:hover {
  background: rgba(99, 102, 241, 0.4);
  border-color: var(--accent);
}

.kotelna-datetime-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skrýt nativní ikonu – používáme vlastní viditelné tlačítko */
.kotelna-datetime-wrap .kotelna-header-input::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.kotelna-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-section-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.form-field input,
.form-field textarea {
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-field input:focus-visible,
.form-field textarea:focus-visible {
  border-color: var(--accent);
}

.form-field textarea {
  resize: vertical;
  min-height: 72px;
}

.form-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-field-row input[type="number"],
.form-field-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.foto-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.foto-pick-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.foto-pick-btn:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.15);
}

.anomalie-foto-label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.anomalie-foto-hint {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.anomalie-foto-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.anomalie-foto-slot {
  display: flex;
  align-items: center;
  gap: 6px;
}

.anomalie-foto-slot-num {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 1em;
}

/* Tepelná čerpadla */
.hp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.hp-card {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hp-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.hp-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
}

.hp-checkbox input {
  width: 18px;
  height: 18px;
}

/* Akce formuláře */
.form-actions {
  padding-top: 8px;
}

.btn-submit {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  display: block;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.btn-submit:hover {
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .kotelna-main {
    max-width: 100%;
  }

  .form-grid,
  .hp-grid {
    grid-template-columns: 1fr;
  }

}

/* Přehled přístupů (superadmin) */
.login-log-page .header {
  max-width: 960px;
}

.login-log-header-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.login-log-main {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-log-hint {
  margin: 0 0 12px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.login-log-hint code {
  font-size: 0.85em;
  color: var(--text);
}

.login-log-secondary {
  margin-top: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.login-log-secondary:hover {
  color: var(--text);
}

.login-log-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.login-log-toolbar .auth-title {
  margin: 0;
}

.login-log-meta {
  margin: 0 0 10px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.login-log-scroll {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.login-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.login-log-table th,
.login-log-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.login-log-table th {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.login-log-table tbody tr:last-child td {
  border-bottom: none;
}

.login-log-cell-detail {
  max-width: 320px;
  word-break: break-word;
}

.login-log-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.login-log-badge--ok {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.login-log-badge--fail {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}

/* Reporty deniku */
.reporty-main {
  max-width: 1100px;
}

.reporty-card {
  text-align: left;
}

.reporty-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reporty-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.reporty-field {
  min-width: 0;
}

.reporty-field select,
.reporty-field input {
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.reporty-field select:focus-visible,
.reporty-field input:focus-visible {
  border-color: var(--accent);
}

.reporty-field--button {
  display: flex;
  flex-direction: column;
}

.reporty-button-label {
  visibility: hidden;
  height: 1.1rem;
  margin-bottom: 6px;
}

.reporty-submit {
  margin: 0;
  min-width: 170px;
}

@media (max-width: 900px) {
  .reporty-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .reporty-button-label {
    display: none;
  }

  .reporty-submit {
    width: 100%;
  }
}

.reporty-preview {
  margin-top: 20px;
  text-align: left;
}

.reporty-preview-head {
  margin-bottom: 12px;
}

.reporty-preview .auth-title {
  margin-bottom: 6px;
}

.reporty-meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.reporty-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.reporty-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.reporty-table thead,
.reporty-table tbody {
  display: table-header-group;
}

.reporty-table tbody {
  display: table-row-group;
}

.reporty-table tr {
  display: table-row;
}

.reporty-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 6px;
  text-align: left;
  font-weight: 600;
  color: #e0e7ff;
  background: linear-gradient(180deg, #312e81 0%, #1e1b4b 100%);
  border-bottom: 1px solid rgba(129, 140, 248, 0.45);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.25;
  vertical-align: bottom;
  max-width: 6rem;
  min-width: 2.75rem;
  hyphens: auto;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.reporty-th-title {
  display: block;
  white-space: normal;
  overflow-wrap: break-word;
}

.reporty-th-unit {
  display: block;
  margin-top: 2px;
  min-height: 1em;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 500;
  color: rgba(224, 231, 255, 0.9);
}

.reporty-table tbody td {
  padding: 8px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  vertical-align: middle;
  white-space: nowrap;
}

.reporty-row--data td {
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
}

.reporty-row--data:nth-child(4n + 1) td {
  background: rgba(30, 41, 59, 0.65);
}

.reporty-row--note td {
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.35;
  padding-top: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.22);
}

.reporty-note-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.reporty-note-text {
  flex: 1 1 200px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reporty-foto-open-btn {
  flex-shrink: 0;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.18);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.reporty-foto-open-btn:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.28);
}

.reporty-foto-dialog {
  max-width: min(920px, 96vw);
  width: 100%;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.98);
  color: var(--text);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.reporty-foto-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.reporty-foto-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.25);
}

.reporty-foto-dialog__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.reporty-foto-dialog__close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.9);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.reporty-foto-dialog__close:hover {
  background: rgba(248, 113, 113, 0.25);
}

.reporty-foto-dialog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 16px;
  max-height: min(70vh, 640px);
  overflow: auto;
}

.reporty-foto-dialog__empty {
  margin: 0;
  padding: 12px 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.reporty-foto-figure {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: rgba(15, 23, 42, 0.6);
}

.reporty-foto-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background: #0f172a;
}

.reporty-foto-figure figcaption {
  padding: 8px 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(99, 102, 241, 0.15);
}

.reporty-foto-figure__err {
  margin: 0;
  padding: 12px 10px;
  font-size: 0.8rem;
  color: #f87171;
}

.reporty-row--empty td {
  text-align: center;
  padding: 20px 12px;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: rgba(15, 23, 42, 0.35);
}
