/* ===========================================================================
   Nájemné — standalone app UI (Apple-style, full-screen, responsive)
   =========================================================================== */

:root {
  --nt-bg:        #f5f5f7;
  --nt-card:      #ffffff;
  --nt-ink:       #1d1d1f;
  --nt-ink-2:     #6e6e73;
  --nt-ink-3:     #8e8e93;
  --nt-line:      rgba(0,0,0,.08);
  --nt-line-soft: rgba(0,0,0,.05);
  --nt-blue:      #0071e3;
  --nt-green:     #248a3d;
  --nt-red:       #d70015;
  --nt-amber:     #8a6d00;
  --nt-shadow:    0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
  --nt-radius:    20px;
  --nt-radius-sm: 12px;
  --nt-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
             "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nt-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

body.nt-app {
  margin: 0;
  background: var(--nt-bg);
  color: var(--nt-ink);
  font-family: var(--nt-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ── LOGIN ───────────────────────────────────────────────────────────────── */
.nt-fe--login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.nt-login-box {
  background: var(--nt-card);
  border-radius: 24px;
  padding: clamp(32px, 5vw, 48px) clamp(28px, 4vw, 44px);
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--nt-shadow);
}
.nt-login-icon { font-size: 2.4rem; margin-bottom: 14px; }
.nt-login-box h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--nt-ink); margin: 0 0 8px; }
.nt-login-box p  { font-size: 15px; color: var(--nt-ink-2); margin: 0 0 26px; }

.nt-login-error {
  background: rgba(215,0,21,.1);
  color: var(--nt-red);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  margin-bottom: 18px;
}

.nt-login-box form { display: flex; flex-direction: column; gap: 12px; }
.nt-login-box input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--nt-line);
  border-radius: 14px;
  font-size: 16px;            /* 16px = no iOS zoom on focus */
  font-family: var(--nt-font);
  color: var(--nt-ink);
  background: #fbfbfd;
  outline: none;
  text-align: center;
  letter-spacing: .12em;
  box-sizing: border-box;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.nt-login-box input[type="password"]:focus {
  border-color: var(--nt-blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0,113,227,.15);
}
.nt-login-box button {
  background: var(--nt-blue);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--nt-font);
  cursor: pointer;
  transition: filter .18s, transform .1s;
}
.nt-login-box button:hover  { filter: brightness(1.06); }
.nt-login-box button:active { transform: scale(.98); }

/* ── APP SHELL ───────────────────────────────────────────────────────────── */
.nt-fe {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 56px) 80px;
  box-sizing: border-box;
}

.nt-fe-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(24px, 4vw, 40px);
}
.nt-fe-header h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.05;
  margin: 0 0 6px;
}
.nt-fe-sub { font-size: clamp(13px, 1.6vw, 15px); color: var(--nt-ink-2); margin: 0; }
.nt-fe-logout {
  flex: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--nt-ink);
  text-decoration: none;
  padding: 9px 18px;
  background: rgba(0,0,0,.05);
  border-radius: 980px;
  white-space: nowrap;
  transition: background .18s;
}
.nt-fe-logout:hover { background: rgba(0,0,0,.09); }

/* ── STATS ───────────────────────────────────────────────────────────────── */
.nt-fe-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: clamp(12px, 1.6vw, 18px);
  margin-bottom: clamp(20px, 3vw, 28px);
}
.nt-fe-stat {
  background: var(--nt-card);
  border-radius: var(--nt-radius);
  padding: clamp(18px, 2.2vw, 24px);
  box-shadow: var(--nt-shadow);
  position: relative;
}
.nt-fe-stat--green::before,
.nt-fe-stat--red::before {
  content: "";
  position: absolute; top: 16px; right: 18px;
  width: 10px; height: 10px; border-radius: 50%;
}
.nt-fe-stat--green::before { background: #34c759; }
.nt-fe-stat--red::before   { background: #ff3b30; }
.nt-fe-stat__n {
  font-size: clamp(30px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 6px;
}
.nt-fe-stat--green .nt-fe-stat__n { color: var(--nt-green); }
.nt-fe-stat--red   .nt-fe-stat__n { color: var(--nt-red); }
.nt-fe-stat__l { font-size: 13px; font-weight: 500; color: var(--nt-ink-3); }

/* ── TABLE ───────────────────────────────────────────────────────────────── */
.nt-fe-table-wrap {
  background: var(--nt-card);
  border-radius: var(--nt-radius);
  box-shadow: var(--nt-shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nt-fe-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.nt-fe-table thead th {
  background: var(--nt-card);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--nt-ink-3);
  padding: 16px 14px;
  text-align: center;
  border-bottom: 1px solid var(--nt-line);
  white-space: nowrap;
}
.nt-fe-table thead th.nt-fe-th-name { text-align: left; }
.nt-fe-table thead th.nt-cur { color: var(--nt-blue); }

.nt-fe-table tbody tr { border-bottom: 1px solid var(--nt-line-soft); transition: background .12s; }
.nt-fe-table tbody tr:last-child { border-bottom: none; }
.nt-fe-table tbody tr:hover { background: #fafafafc; }

/* Sticky first column so names stay visible while months scroll */
.nt-fe-th-name, .nt-fe-td-name { position: sticky; left: 0; z-index: 1; }
.nt-fe-th-name { z-index: 2; }
.nt-fe-td-name {
  background: var(--nt-card);
  padding: 16px 18px;
  min-width: 200px;
}
.nt-fe-table tbody tr:hover .nt-fe-td-name { background: #fafafa; }
.nt-fe-td-name strong { display: block; font-size: 16px; font-weight: 600; color: var(--nt-ink); margin-bottom: 3px; }
.nt-fe-name2  { font-size: 13px; color: var(--nt-ink-3); display: block; }
.nt-fe-amount { display: inline-block; font-size: 13px; color: var(--nt-ink-2); font-family: var(--nt-mono); }

.nt-fe-td-s { text-align: center; padding: 12px 8px; }
.nt-fe-td-s.nt-cur { background: rgba(0,113,227,.05); }

.nt-fe-s {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  border-radius: var(--nt-radius-sm);
  min-width: 58px;
}
.nt-fe-s--yes  { background: rgba(52,199,89,.14); }
.nt-fe-s--no   { background: rgba(255,59,48,.12); }
.nt-fe-s--wait { background: rgba(0,0,0,.05); }
.nt-fe-s--na   { background: repeating-linear-gradient(45deg, #f5f5f7, #f5f5f7 6px, #ececef 6px, #ececef 12px); }

.nt-fe-s__i { font-size: 17px; font-weight: 700; line-height: 1; }
.nt-fe-s--yes  .nt-fe-s__i { color: var(--nt-green); }
.nt-fe-s--no   .nt-fe-s__i { color: var(--nt-red); }
.nt-fe-s--wait .nt-fe-s__i { color: var(--nt-ink-3); font-size: 22px; }
.nt-fe-s--na   .nt-fe-s__i { color: #c7c7cc; }

.nt-fe-s__d { font-size: 11px; font-weight: 500; }
.nt-fe-s--yes  .nt-fe-s__d { color: var(--nt-green); }
.nt-fe-s--no   .nt-fe-s__d { color: var(--nt-red); }
.nt-fe-s--wait .nt-fe-s__d { color: var(--nt-ink-3); }
.nt-fe-s--na   .nt-fe-s__d { color: #c7c7cc; }

/* ── BADGES ──────────────────────────────────────────────────────────────── */
.nt-deposit-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--nt-amber);
  background: rgba(255,196,0,.16);
  border-radius: 980px;
  padding: 3px 10px;
  margin-top: 6px;
}
.nt-deposit-badge--sm { font-size: 11px; padding: 2px 8px; }
.nt-note-badge { display: inline-block; font-size: 13px; margin-top: 6px; margin-left: 4px; cursor: help; }

/* ── EMPTY / FOOTER ──────────────────────────────────────────────────────── */
.nt-fe-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--nt-ink-3);
  font-size: 16px;
  background: var(--nt-card);
  border-radius: var(--nt-radius);
  box-shadow: var(--nt-shadow);
}
.nt-fe-footer { margin-top: 22px; font-size: 13px; color: var(--nt-ink-3); text-align: right; }
.nt-fe-footer a { color: var(--nt-ink-2); }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nt-fe-stats { grid-template-columns: 1fr 1fr; }
  .nt-fe-header { align-items: center; }
  .nt-fe-td-name { min-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
