/* Účtoria PWA – Hlavné štýly */

:root {
  --primary:       #00ac69;
  --primary-dark:  #008f57;
  --primary-soft:  #eef8f3;
  --primary-border:#c3e8d6;
  --danger:        #e74c3c;
  --danger-soft:   #fdf2f2;
  --warning:       #f59e0b;
  --warning-soft:  #fef9ec;
  --info:          #3b82f6;
  --text:          #24323d;
  --muted:         #7a8793;
  --border:        #e7ecef;
  --bg:            #f3f6f5;
  --white:         #ffffff;
  --dark:          #1a2e2d;
  --dark2:         #213837;
  --radius-sm:     10px;
  --radius:        16px;
  --radius-lg:     22px;
  --radius-xl:     28px;
  --shadow-sm:     0 2px 10px rgba(15,40,35,0.07);
  --shadow:        0 6px 20px rgba(15,40,35,0.10);
  --shadow-lg:     0 12px 36px rgba(15,40,35,0.14);
  --tab-h:         68px;
  --header-h:      76px;
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
  /* OPRAVENE: Odstraneny limit min(..., 6px), aby lista na iPhone klesla uplne dole */
  --tab-safe-bottom: 0px;
  --safe-top:      env(safe-area-inset-top, 0px);
  --pwa-status-top: max(env(safe-area-inset-top, 0px), 14px);
  --tab-y-shift:   0px;
  --tab-content-drop: 0px;
}
@media (display-mode: standalone) {
  :root {
    /* Len safe-area (34px) — ios-extra-bottom ide do #root, nie sem */
    --tab-safe-bottom: 0px;
  }
  html, body, #root, #app { background: var(--bg); }
}

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

html { height: 100%; height: 100dvh; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
/* Tmavé strany na širokých obrazovkách (desktop), biela dole na mobile */
#root {
  background: var(--bg);
}

#root {
  width: 100%;
  height: 100%;
  height: 100dvh;
}

@media (max-width: 699px) {
  #root {
    position: fixed;
    inset: 0;
    height: auto;
    min-height: 100%;
    overflow: hidden;
  }

  #app {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 100%;
    margin: 0;
    box-shadow: none;
  }
}

#app {
  /* 100% (nie 100dvh): #root je na mobile fixed inset:0 = celá fyzická obrazovka.
     100dvh je na iOS kratšie (odpočíta safe-area) → pod #app by presvitalo
     pozadie #root-u = medzera pod tab barom. */
  height: 100%;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  box-shadow: 0 0 60px rgba(0,0,0,0.15);
  overflow: hidden;
}

/* DEBUG marker (zmazať po potvrdení) */
@media (max-width: 699px) {
  #app {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 100%;
    margin: 0;
    box-shadow: none;
  }
}

.app-header-main::after {
  content: "CSS v2.22 - Calls";
  position: absolute;
  right: 14px;
  bottom: 4px;
  font-size: 10px;
  font-weight: 900;
  color: #00ff95;
  background: rgba(0,0,0,0.5);
  padding: 2px 7px;
  border-radius: 6px;
  z-index: 5;
  pointer-events: none;
}

/* ── Screens ─────────────────────────────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.screen.active { display: flex; }
#screen-main {
  padding-bottom: 0;
  position: relative;
}


/* ── Header ──────────────────────────────────────────────────────────────── */
.app-header {
  background: var(--dark);
  padding: max(calc(env(safe-area-inset-top, 0px) + 28px), 52px) 18px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-height: calc(var(--header-h) + 28px);
  position: relative;
}
.app-header .title { font-size: 18px; font-weight: 800; color: #fff; }
.app-header-main .title { font-size: 21px; line-height: 1.05; }
.app-header .subtitle { font-size: 10px; color: rgba(255,255,255,0.75); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
/* Header ikony (zvonček, chat, profil) biele na zelenej */
.app-header .header-icon-btn { color: rgba(255,255,255,0.9); }
.app-header .header-icon-btn:hover { background: rgba(255,255,255,0.15); }
.app-header .header-round { color: rgba(255,255,255,0.9); }
.logo-chip {
  width: 38px; height: 38px; border-radius: 50%;
  background: #fff url('/static/brand/favicon-64.png') center / 32px 32px no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-size: 0; font-weight: 900; color: transparent; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
#tab-bar {
  background: var(--white);
  border-top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: var(--tab-h);
  padding-bottom: 0;
  flex-shrink: 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.07);
  position: relative;
  margin-top: auto;
  z-index: 10;
  overflow: visible;
}
@media (max-width: 699px) {
  #tab-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin-top: 0;
    /* padding-bottom = safe-area-inset-bottom posunie ikony nad gesture bar */
    padding-bottom: 0;
    height: var(--tab-h);
  }
  /* Obsah nesmie byť skrytý pod fixed tab barom */
  .scroll-area {
    padding-bottom: calc(var(--tab-h) + 14px);
  }
}
.tab-btn {
  flex: 1;
  height: var(--tab-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 7px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ui-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex-shrink: 0;
  color: currentColor;
  vertical-align: -3px;
}
.tab-btn .tab-icon {
  width: 22px;
  height: 22px;
  color: var(--muted);
  opacity: 0.75;
  transition: opacity 0.2s, color 0.2s;
}
.tab-btn .tab-label { font-size: 10px; font-weight: 800; color: var(--muted); transition: color 0.2s; font-family: inherit; }
.tab-btn.active .tab-icon { opacity: 1; color: var(--primary); }
.tab-btn.active .tab-label { color: var(--primary); }

.tab-scan-wrap {
  flex: 1;
  height: var(--tab-h);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 7px;
}
.tab-scan-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: 3px solid var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff; font-weight: 300;
  box-shadow: 0 6px 22px rgba(0,172,105,0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
  line-height: 1;
  padding-bottom: 2px;
}
.tab-scan-btn .ui-icon {
  width: 28px;
  height: 28px;
  color: #fff;
}
.tab-scan-btn:active { transform: scale(0.93); }

/* ── Scrollable content ───────────────────────────────────────────────────── */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  /* Bottom content can scroll behind the overlay tab bar without creating a fake blank area. */
  padding: 14px 14px calc(var(--tab-h) + 14px);
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-pad { padding: 16px; }
.card + .card { margin-top: 10px; }

/* ── Balance card ─────────────────────────────────────────────────────────── */
.balance-card {
  background: linear-gradient(140deg, var(--dark) 0%, #2a4a47 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 12px;
}
.balance-label { font-size: 11px; color: rgba(255,255,255,0.55); font-weight: 700; margin-bottom: 6px; }
.balance-value { font-size: 30px; font-weight: 900; color: #fff; letter-spacing: -0.5px; }
.balance-sub { font-size: 12px; color: var(--primary); margin-top: 6px; font-weight: 700; }

/* ── Stat grid ───────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--primary);
}
.stat-label { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; margin-bottom: 4px; }
.stat-value { font-size: 17px; font-weight: 900; }

/* ── Section header ──────────────────────────────────────────────────────── */
.section-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.section-title { font-size: 15px; font-weight: 800; }
.section-link { font-size: 13px; color: var(--primary); font-weight: 800;
  background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; }

/* Dashboard work summary */
.dash-work-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.dash-work-pill {
  min-width: 0;
  min-height: 72px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}
.dash-pill-count { font-size: 22px; line-height: 1; font-weight: 900; }
.dash-pill-label { font-size: 11px; font-weight: 900; line-height: 1.2; }
.dash-tasks-card,
.dash-event-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}
.dash-tasks-label,
.dash-event-label {
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .35px;
  margin-bottom: 8px;
}
.dash-task-row,
.dash-event-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 6px 0;
}
.dash-task-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-task-title,
.dash-event-title {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-task-date,
.dash-event-time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.dash-event-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Invoice row ─────────────────────────────────────────────────────────── */
.inv-row {
  background: var(--white);
  border-radius: 15px;
  padding: 11px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 7px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: transform 0.12s;
}
.inv-row:active { transform: scale(0.98); }
.inv-main { flex: 1; min-width: 0; padding-top: 1px; }
.inv-side { text-align: right; flex-shrink: 0; min-width: 96px; }
.inv-name {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 178px;
}
.inv-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-height: 17px;
}
.inv-date {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1;
}
.inv-amount {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 900;
  white-space: nowrap;
  margin-top: 2px;
}
.inv-unpaid {
  font-size: 9px;
  color: var(--danger);
  font-weight: 900;
  margin-top: 4px;
}
.inv-unsync {
  color: var(--warning);
}

/* ── Badge ───────────────────────────────────────────────────────────────── */
.badge {
  font-size: 8.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.25px;
  padding: 3px 6px; border-radius: 5px; line-height: 1;
}
.badge-vydana  { background: var(--primary-soft);  color: var(--primary-dark); }
.badge-prijata { background: var(--danger-soft);   color: var(--danger); }
.badge-zalohova{ background: #fef3c7;              color: #92400e; }
.badge-interny { background: #f3f4f6;              color: #374151; }
.badge-blok { background: #fef3c7; color: #b45309; }
.pay-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 14px;
  padding: 0 4px;
  border-radius: 4px;
  background: #eef2f4;
  color: #7a8793;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1;
}
.pay-chip .ui-icon {
  width: 10px;
  height: 10px;
}

/* ── Quick actions ───────────────────────────────────────────────────────── */
.qa-grid {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.qa-btn {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s;
}
.qa-btn:active { transform: scale(0.96); }
.qa-icon { font-size: 24px; }
.qa-label { font-size: 11px; font-weight: 800; color: var(--text); text-align: center; line-height: 1.4; }

/* Work hub */
.work-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.work-mini {
  min-height: 74px; border: 0; border-radius: var(--radius); padding: 10px 8px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  color: #fff; box-shadow: var(--shadow-sm); font-family: inherit; cursor: pointer; text-align: left;
}
.work-mini-blue { background: linear-gradient(140deg, #2563eb, #60a5fa); }
.work-mini-violet { background: linear-gradient(140deg, #6d28d9, #a78bfa); }
.work-mini-cyan { background: linear-gradient(140deg, #0284c7, #67e8f9); }
.work-mini-icon {
  width: 24px; height: 24px; border-radius: 9px; background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900;
}
.work-mini-text strong { display: block; font-size: 18px; line-height: 1; }
.work-mini-text small { display: block; font-size: 10px; font-weight: 800; opacity: 0.88; margin-top: 4px; }
.work-preview {
  background: linear-gradient(180deg, #f8fbff, #fff); border: 1px solid #dbeafe;
  border-radius: var(--radius); padding: 10px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.work-chip-row { display: flex; gap: 7px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.work-chip-row::-webkit-scrollbar { display: none; }
.work-chip {
  flex: 0 0 auto; border: 1px solid #dbeafe; background: #fff; border-radius: 999px;
  padding: 7px 10px; color: #1e3a8a; font-size: 11px; font-weight: 800; white-space: nowrap;
}
.work-panel {
  background: var(--white); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-sm);
  margin-bottom: 12px; border: 1px solid #e6efff;
}
.work-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.work-panel-title { font-size: 14px; font-weight: 900; color: var(--text); }
.work-panel-pill { border-radius: 999px; padding: 4px 9px; background: #eff6ff; color: #1d4ed8; font-size: 11px; font-weight: 900; }
.work-row {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  padding: 11px 12px; margin-top: 8px; text-align: left; font-family: inherit;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.work-row:first-of-type { margin-top: 0; }
.work-row-mark { width: 9px; height: 38px; border-radius: 999px; background: #3b82f6; flex-shrink: 0; }
.work-row-main { flex: 1; min-width: 0; }
.work-row-title { font-size: 13px; font-weight: 900; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-row-sub { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.work-row-value { font-size: 12px; color: #1d4ed8; font-weight: 900; white-space: nowrap; }
.work-calendar-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.work-day { border-radius: 14px; padding: 9px 4px; background: #f8fafc; border: 1px solid #e2e8f0; text-align: center; }
.work-day strong { display: block; font-size: 14px; color: #0f172a; }
.work-day span { display: block; font-size: 9px; color: var(--muted); text-transform: uppercase; font-weight: 800; margin-top: 3px; }
.work-empty { padding: 13px; border-radius: var(--radius); background: #f8fafc; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }

/* ── Search & filters ────────────────────────────────────────────────────── */
.search-wrap { padding: 10px 14px 6px; }
.search-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); }

.filter-chips {
  display: flex;
  gap: 8px;
  padding: 6px 14px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Bank transaction row ────────────────────────────────────────────────── */
.bank-row {
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}
.bank-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.bank-popis { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bank-meta { font-size: 11px; color: var(--muted); }
.bank-amount { font-size: 13px; font-weight: 900; white-space: nowrap; }
.bank-zostatok { font-size: 10px; color: var(--muted); text-align: right; margin-top: 2px; }

.phone-extra-screen { flex-direction: column; overflow: hidden; background: var(--bg); }
.phone-extra-screen.active { display: flex; }
.phone-native-empty {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.phone-native-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.phone-native-tools button,
.phone-native-tools strong {
  min-height: 38px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  font-weight: 900;
  color: var(--text);
}
.phone-native-tools strong { margin-left: auto; color: var(--primary-dark); }
.phone-native-list { display: grid; gap: 10px; }
.phone-native-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.phone-native-row div { min-width: 0; }
.phone-native-row strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-native-row small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-native-row b {
  color: var(--primary-dark);
  font-size: 12px;
  white-space: nowrap;
}
.phone-timer-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 8px;
}
.phone-timer-card.running {
  background: linear-gradient(120deg, var(--dark), #0d3d31);
  color: #fff;
  border-color: rgba(255,255,255,.12);
}
.phone-timer-card span {
  font-size: 10px;
  font-weight: 900;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.phone-timer-card strong { font-size: 16px; font-weight: 900; }
.phone-timer-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.phone-timer-card b { font-size: 22px; font-variant-numeric: tabular-nums; }
.phone-timer-card button,
.phone-native-sheet .btn-primary,
.phone-native-sheet .sheet-cancel {
  border: 0;
  border-radius: 999px;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 900;
}
.phone-timer-card button { background: var(--primary); color: #fff; }
.phone-timer-card.running button { background: #fee2e2; color: #991b1b; }
.phone-sheet-body { display: grid; gap: 8px; }
.phone-sheet-body label {
  font-size: 10px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
}
.phone-sheet-body input,
.phone-sheet-body select,
.phone-sheet-body textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 11px 13px;
  font: 700 14px 'Segoe UI', Arial, sans-serif;
  outline: none;
}
.phone-perm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.phone-perm-grid label {
  min-height: 42px;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: #fff;
  text-transform: none;
  font-size: 12px;
}
.phone-perm-grid input {
  width: 16px;
  height: 16px;
  padding: 0;
  flex-shrink: 0;
}

/* ── Sprievodca zamestnanca + IČO klient ─────────────────────────────────── */
.phone-wz-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.phone-wz-steps { display: flex; gap: 6px; }
.phone-wz-steps span {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: #e8edeb; color: #8a968f;
}
.phone-wz-steps span.on { background: #00a966; color: #fff; }
.phone-wz-steps span.done { background: #b8e6cf; color: #0b6b43; }
.phone-wz-subtitle { font-size: 12px; font-weight: 700; color: #00875a; margin: 2px 2px 10px; }
.phone-wz-actions { display: flex; gap: 8px; margin-top: 14px; }
.phone-wz-actions .btn-primary { flex: 1 1 auto; width: auto; }
.phone-wz-actions .sheet-cancel { flex: 0 0 auto; width: auto; padding: 0 20px; }
.phone-wz-hint { font-size: 11.5px; color: #7d8985; margin: 6px 2px 0; line-height: 1.45; }
.phone-wz-hint.ok { color: #00875a; font-weight: 700; }
.phone-perm-toggle {
  display: flex; align-items: center; gap: 9px; margin: 8px 0 2px; font-size: 13px;
  padding: 11px 12px; border: 1.5px solid var(--border); border-radius: 13px; background: #fff;
}
.phone-perm-toggle input { width: 17px; height: 17px; flex-shrink: 0; }
.phone-ico-row { display: flex; gap: 8px; align-items: stretch; }
.phone-ico-row input { flex: 1; }
.phone-ico-btn {
  flex: 0 0 auto; padding: 0 16px; border: 0; border-radius: 10px;
  background: #00a966; color: #fff; font-weight: 800; font-size: 12px; cursor: pointer;
}
.phone-ico-btn:disabled { opacity: .55; }

/* ── Login screen ────────────────────────────────────────────────────────── */
#screen-login {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
}

#screen-faktury {
  background: #eef3f1;
}
#screen-faktury .app-header-main {
  min-height: 67px;
  padding-bottom: 13px;
}
#screen-faktury .search-wrap {
  padding: 8px 10px 7px;
}
#screen-faktury .search-input {
  height: 35px;
  border-radius: 8px;
  border-color: #e3e9eb;
  font-size: 12px;
  padding: 0 12px;
}
#screen-faktury .chips-row {
  padding: 4px 10px 8px;
  gap: 8px;
}
#screen-faktury .chip {
  padding: 8px 12px;
  font-size: 10px;
  box-shadow: var(--shadow-sm);
}
#screen-faktury #faktury-list {
  padding: 0 10px 84px;
}
.login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 36px;
}
.login-logo {
  width: 80px; height: 80px; border-radius: 50%;
  background: #fff url('/static/brand/uctoria-logo.png') center / 72px 72px no-repeat;
  border: 2px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 0; font-weight: 900; color: transparent;
  margin-bottom: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}
.login-brand { font-size: 30px; font-weight: 900; color: #fff; letter-spacing: -0.5px; }
.login-sub { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 4px; font-weight: 600; }

.login-form-wrap {
  flex: 1;
  background: var(--bg);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 24px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}
.login-card-title { font-size: 19px; font-weight: 900; color: var(--text); margin-bottom: 20px; }
.field-label {
  font-size: 11px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: block;
}
.field-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  font-family: inherit;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}
.field-input:focus { border-color: var(--primary); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(0,172,105,0.35);
  transition: transform 0.12s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-danger-outline {
  width: 100%;
  background: var(--white);
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  font-weight: 800;
  color: var(--danger);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  -webkit-tap-highlight-color: transparent;
}

/* ── Scan screen ─────────────────────────────────────────────────────────── */
.typ-grid {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.typ-btn {
  flex: 1;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 6px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.typ-btn.active-vydany  { border-color: var(--primary); background: var(--primary-soft); }
.typ-btn.active-prijaty { border-color: var(--danger);  background: var(--danger-soft); }
.typ-btn.active-blok    { border-color: var(--warning); background: var(--warning-soft); }
.typ-icon { font-size: 22px; display: block; margin-bottom: 4px; }
.typ-label { font-size: 10px; font-weight: 800; color: var(--text); line-height: 1.3; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  margin-bottom: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.drop-zone.has-file { border-color: var(--primary); background: var(--primary-soft); }
.drop-icon { font-size: 44px; }
.drop-text { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6; font-weight: 600; }

.btn-row { display: flex; gap: 10px; margin-bottom: 14px; }
.btn-cam {
  flex: 1;
  background: var(--dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btn-gallery {
  flex: 1;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* ── Profil screen ───────────────────────────────────────────────────────── */
.profil-card {
  background: linear-gradient(140deg, var(--dark), #2a4a47);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
  box-shadow: var(--shadow-lg);
}
.profil-avatar {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; color: #fff;
  margin-bottom: 12px;
}
.profil-name { font-size: 17px; font-weight: 900; color: #fff; text-align: center; }
.profil-id { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 4px; }

.settings-row {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: default;
}
.settings-row.clickable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.settings-icon { font-size: 20px; flex-shrink: 0; }
.settings-label { font-size: 14px; font-weight: 800; color: var(--text); }
.settings-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings-arrow { font-size: 18px; color: var(--muted); margin-left: auto; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: flex-end;
  z-index: 100;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: var(--bg);
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 14px 18px calc(24px + var(--safe-bottom));
  animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border);
  margin: 0 auto 16px;
}
.modal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; padding: 4px;
}
.modal-close-title { font-size: 15px; font-weight: 900; color: var(--text); }
.modal-pdf-btn {
  background: none; border: none; color: var(--primary);
  font-size: 14px; font-weight: 800; cursor: pointer; font-family: inherit; padding: 4px;
}

.detail-amount-card {
  background: var(--dark);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
  margin-bottom: 14px;
}
.detail-amount-label { font-size: 11px; color: rgba(255,255,255,0.55); font-weight: 700; margin-bottom: 8px; }
.detail-amount-val { font-size: 32px; font-weight: 900; }

.detail-rows { background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-row-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.detail-row-val { font-size: 13px; font-weight: 800; color: var(--text); text-align: right; max-width: 55%; }

/* ── Success state ───────────────────────────────────────────────────────── */
.success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 24px;
  gap: 14px;
  text-align: center;
}
.success-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
}
.success-title { font-size: 20px; font-weight: 900; color: var(--primary-dark); }
.success-text { font-size: 14px; color: var(--muted); line-height: 1.7; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(.2,.72,.3,1), transform 0.3s cubic-bezier(.2,.72,.3,1);
  pointer-events: none;
  z-index: 200;
  max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Loader ──────────────────────────────────────────────────────────────── */
.loader-wrap { display: flex; justify-content: center; padding: 36px; }
.loader {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.empty-text { font-size: 15px; color: var(--muted); font-weight: 700; }

/* ── Install banner (iOS) ────────────────────────────────────────────────── */
.install-banner {
  background: var(--dark);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 600;
}
.install-banner button {
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-size: 18px; cursor: pointer; margin-left: auto; flex-shrink: 0; padding: 0;
}

/* ── Utils ───────────────────────────────────────────────────────────────── */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.hint-text { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; margin-top: 12px; }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }

@media (min-width: 700px) {
  html, body {
    background: #cfd9d5;
  }
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
  }
  #root {
    width: 402px !important;
    height: min(874px, calc(100vh - 36px)) !important;
    max-height: 874px !important;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: 0 22px 80px rgba(15, 40, 35, .28);
    border: 10px solid #111827;
    background: #111827;
  }
  #app {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: none;
  }
  .modal-overlay,
  .sheet-overlay,
  .flow-overlay,
  .detail-overlay,
  .toast,
  .install-banner {
    position: absolute;
  }
}

/* iOS PWA bottom lock: use the large viewport so the app reaches the real screen bottom. */
@media (max-width: 699px) {
  html,
  body,
  #root,
  #app,
  #screen-main {
    width: 100% !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: none !important;
  }

  @supports (height: 100lvh) {
    html,
    body,
    #root,
    #app,
    #screen-main {
      height: 100lvh !important;
      min-height: 100lvh !important;
    }
  }

  body,
  #root,
  #app,
  #screen-main {
    overflow: hidden !important;
  }

  #root,
  #app,
  #screen-main {
    position: fixed !important;
    inset: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  #screen-main {
    display: flex !important;
    flex-direction: column !important;
  }

  #screen-main > .screen {
    min-height: 0 !important;
  }

  #screen-main > #tab-bar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 430px !important;
    height: var(--tab-h) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    align-items: flex-end !important;
  }

  #screen-main > #tab-bar .tab-btn,
  #screen-main > #tab-bar .tab-scan-wrap {
    height: var(--tab-h) !important;
    padding-bottom: 13px !important;
  }

  #screen-main .scroll-area {
    padding-bottom: calc(var(--tab-h) + 10px) !important;
  }

  .detail-overlay .detail-header {
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 14px !important;
    min-height: calc(env(safe-area-inset-top, 0px) + 58px) !important;
    align-items: center !important;
  }

  .detail-overlay .detail-header > div {
    min-width: 0 !important;
    flex: 1 !important;
  }

  .detail-overlay .detail-header .title {
    line-height: 1.08 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .modal-overlay.open .modal-toolbar {
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 14px !important;
    min-height: calc(env(safe-area-inset-top, 0px) + 58px) !important;
    align-items: center !important;
  }
}

.header-round, .header-action {
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,0.12); color: #fff; font: 800 22px/1 'Segoe UI', Arial, sans-serif;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.header-action { font-size: 18px; }
.search-wrap { padding: 10px 14px 6px; flex-shrink: 0; }
.search-input { width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; font: 600 14px 'Segoe UI', Arial, sans-serif; outline: none; color: var(--text); }
.chips-row { display: flex; gap: 7px; padding: 4px 14px 10px; overflow-x: auto; flex-shrink: 0; }
.chip { white-space: nowrap; padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff; color: var(--text); font: 800 12px 'Segoe UI', Arial, sans-serif; cursor: pointer; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.praca-tabs, .detail-tabs { display: flex; background: #fff; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.praca-subtab, .detail-tabs button { flex: 1; padding: 12px 4px; background: none; border: 0; border-bottom: 2.5px solid transparent; color: var(--muted); font: 800 12px 'Segoe UI', Arial, sans-serif; cursor: pointer; }
.praca-subtab.active, .detail-tabs button.active { color: var(--text); border-bottom-color: var(--primary); }
.zakazka-card, .uloha-row, .kal-row, .doc-row, .finance-card { background: #fff; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 8px; padding: 13px 14px; width: 100%; text-align: left; font-family: inherit; }
.zakazka-card { cursor: pointer; }
.zakazka-cislo { font-size: 10px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.zakazka-nazov { font-size: 14px; color: var(--text); font-weight: 900; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zakazka-partner { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stav-badge { display: inline-flex; border-radius: 999px; padding: 3px 9px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.zakazka-progress-wrap { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.zakazka-progress-bar { height: 100%; border-radius: 999px; }
.uloha-row {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 13px 14px;
  border: 1px solid transparent;
}
.uloha-row.po-termine {
  border-color: #fca5a5;
  background: #fff;
}
.uloha-row.hotova {
  opacity: .72;
}
.uloha-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #dfe7e9;
  background: #fff;
  color: #fff;
  font-weight: 900;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.uloha-check.checked { background: var(--primary); border-color: var(--primary); }
.uloha-check .ui-icon { width: 15px; height: 15px; }
.uloha-main { flex: 1; min-width: 0; }
.uloha-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uloha-row.hotova .uloha-title { text-decoration: line-through; }
.uloha-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}
.uloha-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.uloha-meta .ui-icon { width: 11px; height: 11px; }
.uloha-status {
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 6px;
  border-radius: 999px;
}
.uloha-row.po-termine .uloha-status,
.uloha-meta .danger { color: var(--danger); }
.uloha-row.hotova .uloha-status { color: var(--primary-dark); }

.calendar-mode {
  width: max-content;
  margin: 8px auto 10px;
  padding: 3px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 3px;
}
.calendar-mode button {
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.calendar-mode button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 14px rgba(0,172,105,.25);
}
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 6px 14px 12px; }
.week-day-btn {
  min-width: 0;
  min-height: 52px;
  border: 0;
  background: #fff;
  border-radius: 13px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.week-day-btn.active { background: var(--primary); color: #fff; }
.week-day-num { font-size: 17px; font-weight: 900; line-height: 1; }
.week-day-label { font-size: 8px; font-weight: 900; color: var(--muted); text-transform: uppercase; }
.week-day-btn.active .week-day-label { color: rgba(255,255,255,.82); }
.week-day-dot { width: 4px; height: 4px; border-radius: 50%; background: #3b82f6; }
.week-day-btn.active .week-day-dot { background: #fff; }
.month-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  margin: 6px 14px 12px;
}
.month-title {
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
  text-transform: capitalize;
  margin-bottom: 12px;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.month-label {
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}
.month-day {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: 800 13px 'Segoe UI', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.month-day.active {
  background: var(--primary);
  color: #fff;
}
.month-day i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--info);
}
.month-day.active i { background: #fff; }
.calendar-day-empty {
  margin: 0 14px 16px;
  padding: 14px 12px;
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  border: 1px dashed #e2e8eb;
}
.calendar-upcoming { padding: 0 14px 90px; }
.calendar-section-label {
  margin-bottom: 8px;
  color: #8b99a4;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.kal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  background: #fff;
  border-radius: 15px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.kal-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
}
.kal-main { flex: 1; min-width: 0; }
.kal-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kal-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.kal-meta .ui-icon {
  width: 11px;
  height: 11px;
}
.profile-top {
  min-height: 88px;
  padding-top: 28px;
  background: radial-gradient(circle at 20% 0%, #284743, var(--dark) 64%);
}
.profile-scroll { padding: 18px 18px 92px; background: #fff; }
.profile-hero {
  background: linear-gradient(140deg, var(--dark), #214a43);
  border-radius: 22px;
  padding: 22px 18px;
  color: #fff;
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow-lg);
  margin: 2px 0 18px;
  position: relative;
}
.profile-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid rgba(255,255,255,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.profile-hero-main { min-width: 0; padding-bottom: 44px; }
.profile-name { font-size: 24px; font-weight: 900; line-height: 1.05; margin-bottom: 12px; }
.profile-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255,255,255,.68);
  font-size: 14px;
  font-weight: 800;
  margin-top: 8px;
}
.profile-meta .ui-icon { width: 17px; height: 17px; }
.profile-edit-btn {
  position: absolute;
  right: 18px;
  bottom: 18px;
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: 999px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  font: 900 13px 'Segoe UI', Arial, sans-serif;
}
.profile-edit-btn .ui-icon { width: 16px; height: 16px; }
.profile-menu, .profile-tech {
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 14px;
}
.profile-menu-row, .profile-tech-row {
  width: 100%;
  min-height: 76px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: 52px 1fr 24px;
  gap: 14px;
  align-items: center;
  text-align: left;
  font-family: inherit;
}
.profile-menu-row:last-child, .profile-tech-row:last-child { border-bottom: 0; }
.profile-menu-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-menu-icon .ui-icon { width: 25px; height: 25px; }
.profile-menu-row strong {
  display: block;
  color: #111827;
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 4px;
}
.profile-menu-row small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.profile-menu-row > .ui-icon, .profile-tech-row > .ui-icon {
  color: #64748b;
  justify-self: end;
}
.profile-tech-row {
  min-height: 58px;
  grid-template-columns: 1fr auto;
  color: var(--text);
  font: 700 14px 'Segoe UI', Arial, sans-serif;
}
.profile-tech-row span {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-tech-row strong { font-size: 14px; font-weight: 800; }
.profile-tech-row .ui-icon { width: 20px; height: 20px; color: #64748b; }
.danger-btn {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--danger);
  color: var(--danger);
  border-radius: 16px;
  padding: 15px;
  font: 900 17px 'Segoe UI', Arial, sans-serif;
  margin-top: 16px;
}
.profile-detail-overlay {
  background: var(--bg);
  color: var(--text);
}
.profile-detail-overlay .detail-header {
  background: linear-gradient(140deg, var(--dark), #183b36);
  color: #fff;
}
.profile-detail-body {
  padding-top: 16px;
}
.profile-fields {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.profile-field-row {
  min-height: 58px;
  border-bottom: 1px solid var(--border);
  padding: 13px 15px;
  display: grid;
  grid-template-columns: minmax(110px, 42%) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.profile-field-row:last-child { border-bottom: 0; }
.profile-field-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.profile-field-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}
.profile-field-row strong.ok { color: var(--primary); }
.profile-list-title {
  margin: 16px 2px 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.profile-user-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.profile-user-row {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 12px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
}
.profile-user-row > span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
}
.profile-user-row strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
}
.profile-user-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.profile-empty {
  background: rgba(255,255,255,.65);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.profile-action-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font: 900 14px 'Segoe UI', Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.profile-action-btn .ui-icon { width: 19px; height: 19px; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.typ-btn { background: #fff; border: 2px solid var(--border); border-radius: var(--radius); padding: 13px 8px; font: 800 12px 'Segoe UI', Arial, sans-serif; }
.typ-btn.active-prijaty, .typ-btn.active-blok { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.drop-zone { border: 2px dashed var(--border); background: #fff; border-radius: var(--radius-lg); padding: 34px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 12px; cursor: pointer; }
.drop-zone.has-file { border-color: var(--primary); background: var(--primary-soft); }
.drop-icon { font-size: 42px; }
.drop-text { font-size: 13px; color: var(--muted); font-weight: 700; text-align: center; line-height: 1.5; }
.scan-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.scan-actions button { flex: 1; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: #fff; padding: 14px; font: 800 14px 'Segoe UI', Arial, sans-serif; }
.btn-qr-scan { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }
.success-state { min-height: 320px; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.success-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 900; margin-bottom: 14px; }
.success-title { font-size: 20px; font-weight: 900; margin-bottom: 6px; }
.success-text { color: var(--muted); font-size: 13px; line-height: 1.6; }
.sheet-overlay, .flow-overlay, .detail-overlay { position: absolute; inset: 0; z-index: 80; display: none; background: rgba(0,0,0,.48); }
/* Invoice item fields */
.item-field-wrap { display: flex; flex-direction: column; gap: 4px; }
.item-field-label { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; text-align: center; }
.item-total-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.item-total-label { font-size: 12px; color: var(--muted); }
.item-total-val { font-size: 15px; font-weight: 900; color: var(--text); }
/* position:fixed (nie absolute) aby bottom-sheet vždy sedel na viditeľnom
   viewporte aj keď je obsah odscrolovaný. Žiadny predok nepoužíva transform,
   takže fixed je relatívny k viewportu. Desktop-rámček si absolute prebíja
   cez svoju media query (r. ~1228, ~2503). Oprava 2026-08. */
.sheet-overlay { position: fixed; align-items: flex-end; backdrop-filter: blur(2px); }
.bottom-sheet { width: 100%; max-height: 88%; overflow-y: auto; background: var(--bg); border-top-left-radius: 26px; border-top-right-radius: 26px; padding: 14px 18px 28px; animation: slideUp .28s cubic-bezier(.32,.72,0,1); }
.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 14px; }
.sheet-title { font-size: 17px; font-weight: 900; margin-bottom: 4px; }
.sheet-subtitle { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.choice-row { width: 100%; background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 14px; text-align: left; font-family: inherit; box-shadow: var(--shadow-sm); cursor: pointer; }
/* 2-stĺpcové kartičky vo výbere dokladu */
.choice-card { background: #fff; border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 16px 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-family: inherit; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; min-height: 130px; justify-content: center; }
.choice-card:active { transform: scale(0.97); }
.choice-card-primary { border-color: #fbbf24; box-shadow: 0 4px 18px rgba(245,158,11,.18); }
.choice-card strong { font-size: 13px; font-weight: 800; color: var(--text); line-height: 1.2; }
.choice-card small { font-size: 11px; color: var(--muted); line-height: 1.35; }
.choice-card-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.choice-card-icon .ui-icon { width: 26px; height: 26px; }
.choice-row span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.choice-row small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.choice-icon { width: 52px; height: 52px; border-radius: 14px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 22px; flex-shrink: 0; }
.choice-icon.warn { background: linear-gradient(135deg,#f59e0b,#d97706); }
.choice-icon.ok { background: linear-gradient(135deg,var(--primary),var(--primary-dark)); }
.choice-icon.info { background: linear-gradient(135deg,#3b82f6,#1d4ed8); }
.sheet-cancel { width: 100%; background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 13px; font: 800 14px 'Segoe UI', Arial, sans-serif; color: var(--text); margin-top: 6px; cursor: pointer; }
.flow-overlay { z-index: 85; background: var(--bg); }
.flow-panel { height: 100%; width: 100%; display: flex; flex-direction: column; background: var(--bg); }
.stepper { display: flex; gap: 6px; padding: 12px 14px 0; }
.stepper span { flex: 1; height: 4px; border-radius: 999px; background: var(--border); }
.stepper span.active { background: var(--primary); }
.flow-footer { padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--border); }
.peppol-chip { font-size: 10px; font-weight: 900; color: #fff; background: var(--primary); padding: 4px 8px; border-radius: 999px; }
.date-grid, .item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.item-grid { grid-template-columns: 1fr 1fr 72px; }
.lookup-btn { align-self: flex-start; height: 44px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--dark); color: #fff; font-weight: 800; }
.item-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.item-head button { border: 0; background: none; color: var(--danger); font-size: 20px; }
.dashed-btn { width: 100%; background: #fff; border: 2px dashed var(--primary); color: var(--primary-dark); border-radius: var(--radius); padding: 14px; font: 900 13px 'Segoe UI', Arial, sans-serif; }
.summary-label { font-size: 11px; font-weight: 900; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.info-box { background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: var(--radius); padding: 12px; color: var(--primary-dark); font-size: 12px; font-weight: 700; line-height: 1.5; }
.msg-contact {
  width: 100%;
  min-height: 74px;
  border: 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-family: inherit;
}
#messages-overlay {
  z-index: 88;
  background: var(--bg);
  flex-direction: column;
}
#messages-overlay .detail-header {
  min-height: 66px;
  padding: 12px 14px 12px;
  align-items: center;
}
#messages-overlay .scroll-area { padding: 10px 12px 20px; }
#messages-mark-read {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
#messages-mark-read .ui-icon { width: 17px; height: 17px; }
.chat-list-row {
  border-radius: 18px;
  min-height: 74px;
}
.msg-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}
.msg-contact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.msg-contact-main strong { font-size: 14px; color: var(--text); }
.msg-contact-main small { font-size: 11px; color: var(--muted); font-weight: 800; }
.msg-contact-main em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-time {
  align-self: flex-start;
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
}
.msg-contact b {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.thread-context {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin: 2px 0 14px;
}
.thread-context b { color: #2563eb; }
.thread-context .ui-icon { width: 14px; height: 14px; }
.msg-thread { display: flex; flex-direction: column; gap: 8px; padding-bottom: 76px; }
.msg-bubble {
  max-width: 82%;
  align-self: flex-start;
  background: #fff;
  border-radius: 16px 16px 16px 5px;
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 700;
}
.msg-bubble.mine {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-radius: 16px 16px 5px 16px;
}
.msg-bubble small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  opacity: .72;
}
.msg-compose {
  position: sticky;
  bottom: -20px;
  display: flex;
  gap: 8px;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(243,246,245,0), var(--bg) 22%);
}
.msg-compose .field-input { margin: 0; }
.msg-compose button {
  width: 46px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.msg-compose .msg-attach {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--border);
}
.call-row {
  min-height: 66px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  margin-bottom: 10px;
}
.call-row button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.notifications-sheet {
  z-index: 90;
  background: rgba(15, 23, 42, .56);
  backdrop-filter: blur(5px);
}
.notifications-sheet .bottom-sheet {
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 12px 10px 18px;
}
.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px 10px;
}
.notif-head strong { font-size: 15px; }
.notif-head button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: 900 11px 'Segoe UI', Arial, sans-serif;
}
.notif-row {
  width: 100%;
  min-height: 64px;
  background: #fff;
  border: 0;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 8px;
  text-align: left;
  font-family: inherit;
  position: relative;
}
.notif-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef8f3;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-row.info .notif-icon { background: #eff6ff; color: #2563eb; }
.notif-row.warn .notif-icon { background: #fef9ec; color: var(--warning); }
.notif-row.muted .notif-icon { background: #f3f4f6; color: var(--muted); }
.notif-row span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.notif-row strong { font-size: 12px; color: var(--text); }
.notif-row small { font-size: 10px; color: var(--muted); font-weight: 700; }
.notif-row i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  right: 10px;
  top: 10px;
}
.modal-card { background: #fff; border-radius: var(--radius-lg); padding: 20px; width: min(92%,420px); max-height: 86vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; right: 12px; top: 10px; border: 0; background: transparent; font-size: 24px; color: var(--muted); }
.modal-amount { font-size: 30px; font-weight: 900; margin-bottom: 4px; }
.modal-subtitle { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.detail-row-label { font-size: 11px; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.detail-row-val { font-size: 13px; color: var(--text); font-weight: 800; text-align: right; }
.detail-overlay { z-index: 70; background: var(--bg); flex-direction: column; }
.detail-header { background: var(--dark); padding: 14px; display: flex; align-items: center; gap: 8px; color: #fff; }
.timeline-row { display: flex; gap: 12px; }
.timeline-mark { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.timeline-mark span { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--primary); background: var(--primary-soft); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 12px; }
.timeline-card { flex: 1; background: #fff; border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 14px; }
.timeline-meta { font-size: 10px; color: var(--muted); font-weight: 900; text-transform: uppercase; margin-bottom: 3px; }
.timeline-title { font-size: 13px; color: var(--text); font-weight: 900; }
.timeline-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; font-weight: 800; }
.timeline-foot button { border: 0; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); padding: 5px 9px; font-weight: 900; }
.doc-row, .finance-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.doc-row small, .card small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.finance-card span { color: var(--muted); font-size: 12px; font-weight: 800; }
.finance-card strong { font-size: 18px; font-weight: 900; }
.install-banner { position: absolute; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); z-index: 60; display: none; gap: 10px; align-items: center; background: var(--dark); color: #fff; border-radius: var(--radius); padding: 12px 14px; font-size: 12px; box-shadow: var(--shadow-lg); }
.install-banner button { margin-left: auto; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 26px; height: 26px; border-radius: 50%; }

.app-header-main {
  background: #193330;
  padding: calc(var(--pwa-status-top) - 2px) 14px 10px;
  min-height: calc(var(--pwa-status-top) + 48px);
}
.app-header-main .title {
  font-size: 20px;
  letter-spacing: 0;
}
.app-header-main .subtitle {
  font-size: 10px;
  color: rgba(255,255,255,.58);
}
.app-header-main > div:first-child {
  position: relative;
  z-index: 1;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  z-index: 1;
}
.header-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.1);
  color: #d9e5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.badge-dot {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  border: 2px solid #193330;
  font-size: 10px;
  line-height: 14px;
  font-weight: 900;
}
.avatar-chip {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.header-round .ui-icon,
.header-icon-btn .ui-icon {
  width: 18px;
  height: 18px;
}
.empty-icon .ui-icon {
  width: 40px;
  height: 40px;
  color: #cbd5dc;
}
.dash-work-pill {
  color: #fff;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 88px;
  border: 0;
  padding: 12px;
}
.dash-work-blue { background: linear-gradient(140deg, #3b82f6, #60a5fa) !important; }
.dash-work-purple { background: linear-gradient(140deg, #7c3aed, #a78bfa) !important; }
.dash-work-cyan { background: linear-gradient(140deg, #0891b2, #67e8f9) !important; }
.dash-pill-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255,255,255,.18);
  color: rgba(255,255,255,.95);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: auto;
}
.dash-pill-icon .ui-icon {
  width: 16px;
  height: 16px;
}
.dash-work-pill .dash-pill-count,
.dash-work-pill .dash-pill-label {
  color: #fff !important;
  text-align: left;
}
.dash-work-pill .dash-pill-count { font-size: 24px; }
.dash-event-icon .ui-icon,
.kal-icon .ui-icon {
  width: 18px;
  height: 18px;
  color: #2563eb;
}

.modal-overlay.open {
  align-items: stretch;
  background: var(--bg);
}
.modal-overlay.open .modal-sheet {
  height: 100%;
  max-height: none;
  border-radius: 0;
  padding: 0 8px calc(24px + var(--safe-bottom));
  background: var(--bg);
}
.modal-overlay.open .modal-handle { display: none; }
.modal-overlay.open .modal-toolbar {
  margin: 0 -8px 14px;
  padding: 14px 14px 16px;
  min-height: 62px;
  background: var(--dark);
  color: #fff;
}
.modal-overlay.open .modal-close,
.modal-overlay.open .modal-pdf-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
}
.modal-overlay.open .modal-close::before {
  content: "<";
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 18px;
  color: currentColor;
}
.modal-overlay.open .modal-pdf-btn::before {
  content: "PDF";
  width: 18px;
  height: 18px;
  font-size: 10px;
  line-height: 18px;
  color: currentColor;
  font-weight: 900;
}
.modal-overlay.open .modal-close-title {
  flex: 1;
  color: #fff;
  font-size: 16px;
  text-align: left;
}
.modal-overlay.open .detail-amount-card {
  display: none;
}
.doklad-paper {
  background: #fff;
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-sm);
}
.doklad-party {
  text-align: center;
  padding: 4px 0 20px;
  border-bottom: 1px dashed var(--border);
}
.doklad-party h2 {
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--text);
}
.doklad-party p {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.doklad-info {
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
}
.doklad-info div,
.doklad-subtotals div,
.doklad-total,
.vat-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.doklad-info div {
  padding: 7px 0;
  font-size: 13px;
}
.doklad-info span,
.doklad-subtotals span,
.doklad-items-head,
.vat-title,
.vat-head {
  color: var(--muted);
  font-weight: 900;
}
.doklad-info strong {
  color: var(--text);
  text-align: right;
}
.doklad-items-head {
  display: grid;
  grid-template-columns: 1fr 48px 78px;
  gap: 8px;
  padding: 15px 0 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.doklad-items-head span:nth-child(2),
.doklad-items-head span:nth-child(3) {
  text-align: right;
}
.doklad-item {
  display: grid;
  grid-template-columns: 1fr 48px 78px;
  gap: 8px;
  padding: 8px 0 10px;
  border-bottom: 1px solid #eef2f3;
}
.doklad-item strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  line-height: 1.35;
}
.doklad-item small {
  color: var(--muted);
  font-weight: 700;
  margin-top: 3px;
}
.doklad-item span,
.doklad-item b {
  text-align: right;
  font-size: 12px;
}
.doklad-subtotals {
  padding: 12px 0;
  border-bottom: 2px solid var(--text);
}
.doklad-subtotals div {
  padding: 3px 0;
  font-size: 12px;
}
.doklad-total {
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px dashed var(--border);
}
.doklad-total span {
  font-size: 16px;
  font-weight: 900;
}
.doklad-total strong {
  font-size: 28px;
}
.doklad-vat {
  padding-top: 15px;
}
.doklad-original {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.doklad-original svg {
  width: 16px;
  height: 16px;
}
.vat-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.vat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  font-size: 12px;
  font-weight: 900;
  padding: 4px 0;
}
.doklad-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.doklad-actions button {
  height: 48px;
  border-radius: 12px;
  border: 0;
  background: #fff;
  color: var(--text);
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}
.doklad-actions .ui-icon {
  margin-right: 6px;
}

.modal-sheet .modal-close {
  position: static;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}
.modal-sheet .modal-pdf-btn {
  color: var(--primary);
  background: none;
  border: 0;
  font-size: 14px;
  font-weight: 900;
}
.modal-sheet .detail-amount-card {
  background: linear-gradient(140deg, var(--dark), #2a4a47);
}

@media (min-width: 700px) {
  html, body { background: #cfd9d5; }
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
  }
  #root {
    width: 402px;
    height: min(874px, calc(100vh - 36px));
    max-height: 874px;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: 0 22px 80px rgba(15, 40, 35, .28);
    border: 10px solid #111827;
    background: #111827;
  }
  #app {
    width: 100%;
    max-width: none;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: none;
  }
  .modal-overlay,
  .sheet-overlay,
  .flow-overlay,
  .detail-overlay,
  .toast,
  .install-banner {
    position: absolute;
  }
}

.pwa-work-fab {
  position: fixed;
  right: max(16px, calc((100vw - 430px) / 2 + 16px));
  bottom: calc(var(--tab-h) + 18px);
  z-index: 96;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 118px;
  height: 52px;
  padding: 0 18px 0 15px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font: 900 14px 'Segoe UI', Arial, sans-serif;
  letter-spacing: 0;
  box-shadow: 0 14px 34px rgba(0,172,105,0.36), 0 4px 12px rgba(15,40,35,0.14);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pwa-install-banner-on .pwa-work-fab {
  bottom: calc(var(--tab-h) + 110px);
}
.pwa-work-fab.is-visible { display: inline-flex; }
.pwa-work-fab[hidden] { display: none !important; }
.pwa-work-fab .ui-icon {
  width: 24px;
  height: 24px;
  color: #fff;
}
.pwa-work-fab-icon {
  min-width: 54px;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 18px;
}
.pwa-work-fab-icon .ui-icon {
  width: 28px;
  height: 28px;
}
.pwa-work-fab:active { transform: translateY(1px) scale(0.98); }

.pwa-job-overlay {
  z-index: 92;
}
.pwa-job-sheet {
  max-height: min(88vh, 720px);
  background: #fff;
  padding: 12px 16px calc(18px + env(safe-area-inset-bottom, 0px));
}
.pwa-job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.pwa-job-kicker {
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 3px;
}
.pwa-job-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #f7faf9;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pwa-job-close .ui-icon {
  width: 20px;
  height: 20px;
}
.pwa-job-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0 14px;
}
.pwa-job-stepper button {
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fbfa;
  color: var(--muted);
  font: 900 12px 'Segoe UI', Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pwa-job-stepper span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  color: var(--muted);
  font-size: 10px;
}
.pwa-job-stepper button.active,
.pwa-job-stepper button.done {
  border-color: rgba(0,172,105,.35);
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.pwa-job-stepper button.active span,
.pwa-job-stepper button.done span {
  background: var(--primary);
  color: #fff;
}
.pwa-job-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}
.pwa-job-step { display: none; }
.pwa-job-step.active { display: block; }
.pwa-job-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.pwa-job-grid .field.full { grid-column: 1 / -1; }
.pwa-job-grid .field-input {
  margin-bottom: 0;
  background: #f8fbfa;
}
.pwa-job-textarea {
  min-height: 82px;
  resize: vertical;
}
.pwa-job-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}
.pwa-job-lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.pwa-job-lookup {
  height: 48px;
  padding: 0 13px;
  border: 0;
  border-radius: 13px;
  background: var(--dark);
  color: #fff;
  font: 900 12px 'Segoe UI', Arial, sans-serif;
}
.pwa-job-lookup:disabled,
.pwa-job-primary:disabled {
  opacity: .68;
}
.pwa-job-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
  margin-top: 15px;
}
.pwa-job-secondary,
.pwa-job-primary {
  height: 50px;
  border-radius: 14px;
  font: 900 14px 'Segoe UI', Arial, sans-serif;
  cursor: pointer;
}
.pwa-job-secondary {
  border: 1px solid var(--border);
  background: #f8fbfa;
  color: var(--text);
}
.pwa-job-primary {
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,172,105,.24);
}

.pwa-calendar-overlay {
  position: absolute;
  inset: 0;
  z-index: 94;
  display: none;
  background: rgba(13, 32, 30, .58);
}
.pwa-calendar-panel {
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pwa-calendar-head {
  min-height: calc(env(safe-area-inset-top, 0px) + 82px);
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 18px 14px;
  background: linear-gradient(145deg, var(--dark), #203f3b);
  color: #fff;
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.pwa-calendar-title {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
}
.pwa-calendar-round {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  background: rgba(255,255,255,.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pwa-calendar-round.is-save {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: rgba(255,255,255,.24);
  box-shadow: 0 10px 24px rgba(0,172,105,.26);
}
.pwa-calendar-round:disabled { opacity: .65; }
.pwa-calendar-round .ui-icon {
  width: 25px;
  height: 25px;
}
.pwa-calendar-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px calc(var(--tab-h) + 18px);
  -webkit-overflow-scrolling: touch;
}
.pwa-calendar-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: #dfe8e5;
}
.pwa-calendar-segment button {
  height: 40px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font: 900 14px 'Segoe UI', Arial, sans-serif;
}
.pwa-calendar-segment button.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}
.pwa-calendar-card {
  background: #fff;
  border: 1px solid rgba(231,236,239,.9);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  overflow: hidden;
}
.pwa-calendar-title-card {
  padding: 0 14px;
}
.pwa-calendar-input,
.pwa-calendar-note {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.pwa-calendar-input {
  min-height: 56px;
  font-size: 18px;
  font-weight: 800;
}
.pwa-calendar-input + .pwa-calendar-input {
  border-top: 1px solid var(--border);
  font-weight: 700;
  color: var(--muted);
}
.pwa-calendar-note {
  min-height: 96px;
  padding: 15px 14px;
  resize: vertical;
  font-size: 15px;
  font-weight: 700;
}
.pwa-calendar-row {
  min-height: 56px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}
.pwa-calendar-row + .pwa-calendar-row {
  border-top: 1px solid var(--border);
}
.pwa-calendar-row select,
.pwa-calendar-date-pair input {
  border: 0;
  border-radius: 13px;
  background: var(--bg);
  color: var(--text);
  min-height: 38px;
  padding: 0 10px;
  font: 800 14px 'Segoe UI', Arial, sans-serif;
  outline: none;
}
.pwa-calendar-row select {
  color: var(--muted);
  text-align: right;
}
.pwa-calendar-date-pair {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}
.pwa-calendar-date-pair.is-all-day input[type="time"] {
  display: none;
}
.pwa-calendar-switch-row {
  cursor: pointer;
}
.pwa-calendar-switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pwa-calendar-switch-row i {
  width: 54px;
  height: 32px;
  border-radius: 999px;
  background: #cfd8d5;
  position: relative;
  transition: background .18s;
}
.pwa-calendar-switch-row i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transition: transform .18s;
}
.pwa-calendar-switch-row input:checked + i {
  background: var(--primary);
}
.pwa-calendar-switch-row input:checked + i::after {
  transform: translateX(22px);
}

@media (max-width: 360px) {
  .pwa-work-fab {
    min-width: 52px;
    width: 52px;
    padding: 0;
    border-radius: 18px;
  }
  .pwa-work-fab span { display: none; }
  .pwa-job-grid { grid-template-columns: 1fr; }
  .pwa-job-grid .field.full { grid-column: 1; }
}

.pwa-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: none;
  align-items: stretch;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background:
    radial-gradient(circle at 50% 18%, rgba(0,172,105,.28), transparent 34%),
    linear-gradient(180deg, #163c38 0%, #102826 52%, #071816 100%);
  color: #fff;
}
.pwa-call-overlay.is-visible { display: flex; }
.pwa-call-card {
  width: min(100%, 430px);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0 8px;
  color: #fff;
  text-align: center;
}
.pwa-call-topline {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pwa-call-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.pwa-call-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(0,172,105,.16);
}
.pwa-call-mini {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.pwa-call-mini .ui-icon { width: 21px; height: 21px; }
.pwa-call-avatar-wrap {
  position: relative;
  width: 178px;
  height: 178px;
  margin-top: auto;
  display: grid;
  place-items: center;
}
.pwa-call-ring {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,172,105,.34);
  opacity: .72;
  animation: pwaCallPulse 2.25s ease-out infinite;
}
.pwa-call-ring.r2 {
  inset: 0;
  animation-delay: .45s;
  opacity: .42;
}
.pwa-call-orb {
  position: relative;
  z-index: 2;
  width: 122px;
  height: 122px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 38px;
  font-weight: 900;
  box-shadow: 0 24px 60px rgba(0,172,105,.34), inset 0 1px 0 rgba(255,255,255,.22);
}
.pwa-call-kicker {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.58);
}
.pwa-call-name {
  width: 100%;
  margin-top: 3px;
  font-size: clamp(30px, 9vw, 42px);
  line-height: 1.02;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.pwa-call-status {
  min-height: 24px;
  margin-top: 8px;
  color: rgba(255,255,255,.78);
  font-size: 15px;
  font-weight: 800;
}
.pwa-call-health {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 4px 0 0;
}
.pwa-call-health span {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 8px;
  border-radius: 14px;
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.74);
  font-size: 10px;
  line-height: 1.15;
  font-weight: 900;
}
.pwa-call-audio-unlock {
  min-height: 42px;
  margin-top: 4px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: var(--primary-dark);
  font: 900 13px 'Segoe UI', Arial, sans-serif;
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
}
.pwa-call-audio-unlock[hidden] { display: none !important; }
.pwa-call-audio-unlock .ui-icon { width: 18px; height: 18px; }
.pwa-call-actions {
  width: 100%;
  margin-top: auto;
  display: flex;
  justify-content: center;
  gap: 26px;
  padding-bottom: 2px;
}
.pwa-call-btn {
  border: 0;
  width: 86px;
  min-width: 86px;
  height: 86px;
  border-radius: 50%;
  color: #fff;
  font: 900 10px 'Segoe UI', Arial, sans-serif;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(0,0,0,.24);
  -webkit-tap-highlight-color: transparent;
}
.pwa-call-btn span {
  max-width: 76px;
  line-height: 1.1;
}
.pwa-call-btn .ui-icon { width: 29px; height: 29px; }
.pwa-call-btn.is-accept { background: linear-gradient(145deg, var(--primary), var(--primary-dark)); }
.pwa-call-btn.is-decline { background: linear-gradient(145deg, #ff5a5f, #dc2626); }
.pwa-call-btn.is-mute { background: rgba(255,255,255,.16); color: #fff; }
.pwa-call-btn.is-mute.is-muted { background: #f59e0b; }
.pwa-call-overlay audio { display: none; }
.pwa-call-overlay.has-remote-audio #pwa-call-audio-state { color: #bbf7d0; }
.pwa-call-overlay.needs-audio-tap #pwa-call-audio-state { color: #fde68a; }
@keyframes pwaCallPulse {
  0% { transform: scale(.84); opacity: .72; }
  78% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}
@media (max-width: 360px) {
  .pwa-call-overlay { padding-left: 14px; padding-right: 14px; }
  .pwa-call-avatar-wrap { width: 150px; height: 150px; }
  .pwa-call-orb { width: 104px; height: 104px; font-size: 32px; }
  .pwa-call-health { grid-template-columns: 1fr; }
  .pwa-call-btn { width: 78px; min-width: 78px; height: 78px; }
}
/* Final mobile viewport lock. Must stay at the end of this file. */
@media (max-width: 699px) {
  html,
  body,
  #root,
  #app,
  #screen-main {
    width: 100% !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: none !important;
  }

  @supports (height: 100lvh) {
    html,
    body,
    #root,
    #app,
    #screen-main {
      height: 100lvh !important;
      min-height: 100lvh !important;
    }
  }

  body,
  #root,
  #app,
  #screen-main {
    overflow: hidden !important;
  }

  #root,
  #app,
  #screen-main {
    position: fixed !important;
    inset: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  #screen-main {
    display: none !important;
    flex-direction: column !important;
    pointer-events: none !important;
    z-index: 1 !important;
  }

  #screen-main.active {
    display: flex !important;
    pointer-events: auto !important;
    z-index: 10 !important;
  }

  #screen-login.active {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    width: 100% !important;
    height: 100vh !important;
    min-height: 100vh !important;
    z-index: 20 !important;
    pointer-events: auto !important;
  }

  @supports (height: 100lvh) {
    #screen-login.active {
      height: 100lvh !important;
      min-height: 100lvh !important;
    }
  }

  #screen-main > .screen {
    min-height: 0 !important;
  }

  #screen-main > #tab-bar {
    display: none !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 430px !important;
    height: var(--tab-h) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    align-items: flex-end !important;
  }

  #screen-main.active > #tab-bar {
    display: flex !important;
    pointer-events: auto !important;
  }

  #screen-main > #tab-bar .tab-btn,
  #screen-main > #tab-bar .tab-scan-wrap {
    height: var(--tab-h) !important;
    padding-bottom: 13px !important;
  }

  #screen-main .scroll-area {
    padding-bottom: calc(var(--tab-h) + 10px) !important;
  }
}

/* Final top safe-area lock for full-screen overlays. Must stay at the end. */
@media (max-width: 699px) {
  .detail-overlay .detail-header {
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 14px !important;
    min-height: calc(env(safe-area-inset-top, 0px) + 58px) !important;
    align-items: center !important;
  }

  .detail-overlay .detail-header > div {
    min-width: 0 !important;
    flex: 1 !important;
  }

  .detail-overlay .detail-header .title {
    line-height: 1.08 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .modal-overlay.open .modal-toolbar {
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 14px !important;
    min-height: calc(env(safe-area-inset-top, 0px) + 58px) !important;
    align-items: center !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PWA telefón — výraznejšie prechody + touch feedback
   ═══════════════════════════════════════════════════════════════ */

/* Prechod obrazoviek a tabov: slide sprava + fade (natívny „push") */
@keyframes pwaScreenIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.screen.active:not(#screen-main):not(#screen-praca) {
  animation: pwaScreenIn .30s cubic-bezier(.2, .72, .3, 1);
}
/* Praca obsahuje fixed FAB - transform by ho pri prechode posunul, preto len fade */
@keyframes pwaScreenFade { from { opacity: 0; } to { opacity: 1; } }
#screen-praca.active {
  animation: pwaScreenFade .26s ease-out;
}

/* Press feedback na tappable kartach (doplna existujuce .inv-row/.qa-btn) */
.work-mini:active,
.stat-card-clickable:active,
[data-dashboard-nav]:active {
  transform: scale(.97);
  transition: transform .1s ease-out;
}

/* Aktivna tab ikona - jemny pop pri prepnuti */
@keyframes pwaTabPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.tab-btn.active .tab-icon {
  animation: pwaTabPop .34s cubic-bezier(.2, .72, .3, 1);
}

/* Respektuj systemove obmedzenie pohybu */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Stagger nabeh zoznamov (napr. faktury na dashboarde) */
@keyframes pwaListIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pwa-stagger > * {
  animation: pwaListIn .34s cubic-bezier(.2, .72, .3, 1) both;
}
.pwa-stagger > *:nth-child(1) { animation-delay: .02s; }
.pwa-stagger > *:nth-child(2) { animation-delay: .06s; }
.pwa-stagger > *:nth-child(3) { animation-delay: .10s; }
.pwa-stagger > *:nth-child(4) { animation-delay: .14s; }
.pwa-stagger > *:nth-child(5) { animation-delay: .18s; }
.pwa-stagger > *:nth-child(6) { animation-delay: .22s; }
.pwa-stagger > *:nth-child(7) { animation-delay: .26s; }
.pwa-stagger > *:nth-child(n+8) { animation-delay: .30s; }

/* Shared phone task workspace */
/* Taby Zákazky/Úlohy/Kalendár ostávajú viditeľné aj v Úlohách (task-mode),
   aby sa dalo prepínať späť. Skrytie odstránené 2026-08. */
#screen-praca.task-mode #praca-chips {
  display: flex; gap: 4px; margin: 8px 14px 0; padding: 0;
  overflow-x: auto; border-bottom: 1px solid #dce5e2; scrollbar-width: none;
}
#screen-praca.task-mode #praca-chips::-webkit-scrollbar { display: none; }
#screen-praca.task-mode #praca-chips .chip {
  flex: 0 0 auto; min-height: 44px; padding: 0 13px; border: 0;
  border-bottom: 2px solid transparent; border-radius: 10px 10px 0 0;
  color: #74817c; background: transparent; font-size: 12px; font-weight: 800;
}
#screen-praca.task-mode #praca-chips .chip.active { color: #008f57; border-bottom-color: #00a966; background: #eef8f3; }
#screen-praca.task-mode #praca-content { padding: 14px 14px 112px; }
.tp-task-overview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
.tp-task-overview article { min-height: 72px; padding: 11px 12px; border: 1px solid #dfe7e5; border-left: 4px solid #91a09a; border-radius: 13px; background: #fff; display: grid; }
.tp-task-overview article.overdue { border-left-color: #e25555; }
.tp-task-overview article.today { border-left-color: #00a966; }
.tp-task-overview article.upcoming { border-left-color: #e2a42e; }
.tp-task-overview article span { color: #7d8985; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.tp-task-overview article strong { font-size: 22px; color: #26362f; }
.tp-task-overview article small { color: #95a09c; font-size: 8px; }
.tp-task-list { display: grid; gap: 11px; }
.tp-task-group { overflow: hidden; border: 1px solid #dfe7e5; border-radius: 15px; background: #fff; }
.tp-task-group > header,.tp-task-group > summary { min-height: 54px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e5ecea; list-style: none; }
.tp-task-group > summary::-webkit-details-marker { display:none; }
.tp-task-group > header span,.tp-task-group > summary span { display:grid; gap:2px; }
.tp-task-group > header strong,.tp-task-group > summary strong { color:#293832; font-size:13px; }
.tp-task-group > header small,.tp-task-group > summary small { color:#85928d; font-size:9px; }
.tp-task-group > header b,.tp-task-group > summary b { min-width:25px; height:25px; padding:0 7px; display:grid; place-items:center; border-radius:99px; background:#e8eeec; font-size:10px; }
.tp-task-card { position:relative; overflow:hidden; border-bottom:1px solid #eef2f0; background:#fff; }
.tp-task-card:last-child { border-bottom:0; }
/* Červené pozadie zmazania (odkryje sa pri ťahu doľava) */
.tp-task-del { position:absolute; inset:0; display:flex; align-items:center; justify-content:flex-end; padding-right:24px; background:#ef4444; color:#fff; }
.tp-task-del svg { width:24px; height:24px; }
/* Swipeovateľná vrstva s obsahom */
.tp-task-swipe { position:relative; z-index:1; padding:13px 12px 13px 16px; display:grid; grid-template-columns:26px minmax(0,1fr); gap:11px; align-items:start; background:#fff; cursor:pointer; touch-action:pan-y; }
.tp-task-swipe.tp-snap { transition:transform .25s cubic-bezier(.22,.61,.36,1); }
.tp-task-swipe::before { content:''; position:absolute; top:11px; bottom:11px; left:0; width:4px; border-radius:0 4px 4px 0; background:#cbd4d0; }
.tp-task-card.accent-overdue .tp-task-swipe::before,.tp-task-card.accent-high .tp-task-swipe::before { background:#ef4444; }
.tp-task-card.accent-today .tp-task-swipe::before { background:#16a34a; }
.tp-task-card.accent-tomorrow .tp-task-swipe::before { background:#f59e0b; }
.tp-task-check { width:26px; height:26px; margin-top:1px; padding:0; display:grid; place-items:center; border:2px solid #cbd5d1; border-radius:50%; color:#fff; background:#fff; flex-shrink:0; }
.tp-task-check.checked { border-color:#16a34a; background:#16a34a; }
.tp-task-check .ui-icon { width:14px; height:14px; }
.tp-task-main { min-width:0; display:grid; gap:7px; }
.tp-task-main > * { min-width:0; }
.tp-task-top { display:flex; align-items:center; gap:8px; }
.tp-task-titlewrap { flex:1; min-width:0; display:flex; align-items:center; gap:6px; }
.tp-task-title { min-width:0; overflow:hidden; color:#1f2a25; font-size:14px; font-weight:800; text-overflow:ellipsis; white-space:nowrap; }
.tp-task-card.is-done .tp-task-title { color:#9aa5a0; text-decoration:line-through; }
.tp-task-pin { flex-shrink:0; display:inline-flex; color:#16a34a; }
.tp-task-pin svg { width:15px; height:15px; }
.tp-badge { flex-shrink:0; padding:4px 9px; border-radius:8px; font-size:10px; font-weight:800; white-space:nowrap; }
.tp-badge-done,.tp-badge-today { color:#0b7a43; background:#d8f3e3; }
.tp-badge-overdue,.tp-badge-high { color:#c0362b; background:#fde3e0; }
.tp-badge-tomorrow { color:#9a6212; background:#fdefd3; }
.tp-badge-day { color:#5d6b64; background:#eef2f0; }
.tp-task-more { flex-shrink:0; width:22px; height:22px; padding:0; border:0; background:transparent; color:#a4afa9; font-size:19px; line-height:1; cursor:pointer; }
.tp-task-sub { color:#7b8984; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tp-task-bottom { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.tp-task-avs { display:flex; align-items:center; }
.tp-task-av { width:24px; height:24px; margin-right:-6px; display:grid; place-items:center; border-radius:50%; border:2px solid #fff; color:#007b4b; background:#dcf4e8; font-size:9px; font-weight:850; }
.tp-task-av.more { color:#fff; background:#16a34a; margin-right:0; }
.tp-task-when { display:flex; align-items:center; gap:5px; color:#7b8984; font-size:12px; font-weight:600; white-space:nowrap; }
.tp-task-when .ui-icon { width:14px; height:14px; }

/* Vlastné potvrdzovacie okno */
.pwa-confirm-back { position:fixed; inset:0; z-index:130; display:none; align-items:center; justify-content:center; padding:24px; background:rgba(15,17,21,.55); backdrop-filter:blur(4px); }
.pwa-confirm-back.open { display:flex; animation:pwaConfFade .18s ease; }
.pwa-confirm-card { width:100%; max-width:340px; background:#fff; border-radius:20px; padding:24px 22px 18px; text-align:center; box-shadow:0 30px 70px -20px rgba(15,17,21,.5); animation:pwaConfPop .26s cubic-bezier(.22,.61,.36,1); }
.pwa-confirm-ic { width:56px; height:56px; margin:0 auto 14px; display:grid; place-items:center; border-radius:16px; background:#eef2f0; color:#5d6b64; }
.pwa-confirm-ic.danger { background:#fde3e0; color:#dc2626; }
.pwa-confirm-ic svg { width:28px; height:28px; }
.pwa-confirm-title { font-weight:800; font-size:19px; color:#1f2a25; margin-bottom:6px; }
.pwa-confirm-msg { font-size:14px; color:#6b7772; line-height:1.5; margin-bottom:20px; word-break:break-word; }
.pwa-confirm-actions { display:flex; gap:10px; }
.pwa-confirm-actions button { flex:1; min-height:46px; border:0; border-radius:12px; font-size:14px; font-weight:800; cursor:pointer; }
.pwa-confirm-cancel { color:#46544f; background:#eef2f0; }
.pwa-confirm-ok { color:#fff; background:#16a34a; }
.pwa-confirm-ok.danger { background:#ef4444; }
@keyframes pwaConfFade { from{opacity:0} to{opacity:1} }
@keyframes pwaConfPop { from{opacity:0;transform:translateY(16px) scale(.97)} to{opacity:1;transform:translateY(0) scale(1)} }
@media (prefers-reduced-motion:reduce){ .pwa-confirm-back.open,.pwa-confirm-card{animation:none;} }
.tp-task-empty { min-height:220px; display:grid; place-items:center; align-content:center; gap:8px; color:#83918b; text-align:center; }

#add-uloha-overlay .tp-task-editor { width:100%; max-height:92vh; padding:0; overflow:hidden; display:grid; grid-template-rows:auto minmax(0,1fr) auto; border-radius:24px 24px 0 0; background:#f5f8f7; }
.tp-task-editor-head { padding:17px 18px 14px; display:flex; align-items:flex-start; justify-content:space-between; gap:12px; border-bottom:1px solid #dde6e3; background:#fff; }
.tp-task-editor-head span { color:#008f57; font-size:9px; font-weight:850; text-transform:uppercase; }
.tp-task-editor-head h2 { margin:3px 0; color:#22312c; font-size:20px; }
.tp-task-editor-head p { margin:0; color:#7d8985; font-size:9px; }
.tp-task-editor-head > button { width:38px; height:38px; flex:0 0 auto; padding:0; display:grid; place-items:center; border:0; border-radius:50%; background:#eef2f0; }
.tp-task-editor-scroll { padding:12px 13px 20px; display:grid; gap:10px; overflow-y:auto; }
.tp-task-editor-section,.tp-task-advanced { padding:13px; border:1px solid #dfe7e5; border-radius:14px; background:#fff; }
.tp-task-editor-section { display:grid; gap:11px; }
.tp-task-editor-section h3 { margin:0; color:#33433d; font-size:12px; }
.tp-task-grid,.tp-task-grid.cols-2,.tp-task-grid.cols-3 { display:grid; grid-template-columns:1fr; gap:10px; }
.tp-task-field { min-width:0; display:grid; gap:5px; }
.tp-task-field > span,.tp-task-priority-picker legend,.tp-task-reminders legend { color:#68766f; font-size:9px; font-weight:800; }
.tp-task-field input,.tp-task-field select,.tp-task-field textarea { width:100%; min-height:43px; padding:9px 11px; border:1px solid #dce5e2; border-radius:10px; color:#26362f; background:#fff; font:650 12px inherit; }
.tp-task-field textarea { min-height:92px; resize:vertical; }
.tp-task-people-picker { display:grid; grid-template-columns:1fr; gap:6px; }
.tp-task-people-picker label { min-height:44px; padding:7px 9px; display:flex; align-items:center; gap:8px; border:1px solid #dfe7e5; border-radius:10px; }
.tp-task-person-avatar { width:27px; height:27px; display:grid; place-items:center; border-radius:50%; background:#dcf4e8; font-size:9px; }
.tp-task-priority-picker,.tp-task-reminders { margin:0; padding:0; border:0; display:flex; gap:6px; overflow-x:auto; }
.tp-task-priority-picker legend,.tp-task-reminders legend { margin-bottom:6px; }
.tp-task-priority-picker label,.tp-task-reminders label { flex:0 0 auto; }
.tp-task-priority-picker label span,.tp-task-reminders label span { min-height:35px; padding:0 10px; display:flex; align-items:center; border:1px solid #dce5e2; border-radius:9px; font-size:9px; font-weight:800; }
.tp-task-priority-picker input,.tp-task-reminders input,.tp-task-people-picker input { position:absolute; opacity:0; }
.tp-task-priority-picker input:checked + span,.tp-task-reminders input:checked + span,.tp-task-people-picker label:has(input:checked) { color:#008f57; border-color:#83cfad; background:#eef8f3; }
.tp-task-advanced > summary { list-style:none; cursor:pointer; }
.tp-task-advanced > summary::-webkit-details-marker { display:none; }
.tp-task-advanced > summary span { display:grid; grid-template-columns:auto 1fr; gap:2px 7px; align-items:center; }
.tp-task-advanced > summary small { grid-column:2; color:#87938e; font-size:8px; }
.tp-task-advanced-body { margin-top:13px; display:grid; gap:12px; }
.tp-task-existing-files { display:flex; flex-wrap:wrap; gap:6px; }
.tp-task-existing-files a { padding:6px 8px; border-radius:8px; color:#007b4b; background:#eef8f3; font-size:9px; }
.tp-task-editor-actions { padding:11px 14px calc(11px + env(safe-area-inset-bottom)); display:flex; justify-content:flex-end; gap:8px; border-top:1px solid #dce5e2; background:#fff; }
.tp-task-editor-actions button { min-height:43px; padding:0 16px; border:0; border-radius:10px; font-size:11px; font-weight:850; }
.tp-task-editor-actions .secondary { color:#46544f; background:#e8edeb; }
.tp-task-editor-actions .primary { color:#fff; background:#00a966; }