:root {
  --sidebar-w: 230px;
  --bg: #f4f5f7;
  --ink: #1f2933;
  --muted: #6b7280;
  --accent: #1d4ed8;
}
body { background: var(--bg); color: var(--ink); font-size: .94rem; }
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: #111827; color: #cbd5e1;
  display: flex; flex-direction: column; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; padding: .25rem .75rem 1.25rem; display: block; }
.sidebar .nav-link { color: #cbd5e1; border-radius: .4rem; padding: .5rem .75rem; display: flex; gap: .6rem; align-items: center; }
.sidebar .nav-link:hover { background: #1f2937; color: #fff; }
.sidebar .nav-link.active { background: var(--accent); color: #fff; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.content { flex: 1; padding: 1.5rem 2rem; min-width: 0; }
@media (max-width: 991px) {
  .app { flex-direction: column; }
  .sidebar { position: fixed; left: -100%; top: 0; z-index: 1050; transition: left .2s; overflow-y: auto;
             padding-top: max(1rem, env(safe-area-inset-top)); padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .sidebar.open ~ .sidebar-zavoj { display: block; }
  .sidebar-zavoj { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1040; }
  .mobil-lista { position: sticky; top: 0; z-index: 1030; background: #111827; display: flex; align-items: center;
                 justify-content: space-between; padding: .25rem .5rem; padding-top: max(.25rem, env(safe-area-inset-top)); }
  .mobil-lista a { text-decoration: none; }
  .content { padding: 1rem .75rem; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: 1.25rem; }
  .stat { padding: .75rem .9rem; }
  .stat .value { font-size: 1.2rem; }
  .table { font-size: .85rem; }
  .btn-sm { padding: .3rem .6rem; }              /* větší dotykové plochy */
  input, select, textarea, .ts-control { font-size: 16px !important; }  /* iPhone nezvětšuje stránku při psaní */
}
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.5rem; margin: 0; font-weight: 650; }
.page-head .sub { color: var(--muted); font-size: .9rem; }
.card { border: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card-header { background: #fff; font-weight: 600; }
.stat { padding: 1rem 1.25rem; }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--muted); font-size: .8rem; }
.table { margin-bottom: 0; }
.table td, .table th { vertical-align: middle; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: #fafafa; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.termin { font-size: .82rem; padding: .15rem .45rem; border-radius: .3rem; white-space: nowrap; background: #eef2f7; color: #374151; }
.termin-po { background: #fee2e2; color: #991b1b; font-weight: 600; }
.termin-dnes { background: #ffedd5; color: #9a3412; font-weight: 600; }
.termin-brzy { background: #fef9c3; color: #854d0e; }
.termin-hotovo { background: #dcfce7; color: #166534; text-decoration: line-through; }
.stav { font-size: .75rem; padding: .2rem .5rem; border-radius: 1rem; font-weight: 600; white-space: nowrap; }
.stav-koncept { background: #e5e7eb; color: #374151; }
.stav-vystavena, .stav-odeslana, .stav-realizace { background: #dbeafe; color: #1e40af; }
.stav-uhrazena, .stav-prijata, .stav-dokonceno { background: #dcfce7; color: #166534; }
.stav-storno, .stav-odmitnuta, .stav-zruseno { background: #fee2e2; color: #991b1b; }
.stav-poptavka, .stav-nabidka { background: #f3e8ff; color: #6b21a8; }
.stav-pozastaveno { background: #fef3c7; color: #92400e; }
.stav-po-splatnosti { background: #fee2e2; color: #991b1b; }
.progress { height: .45rem; }
.ukol-hotovo .ukol-nazev { text-decoration: line-through; color: var(--muted); }
.btn-check-ukol { border: none; background: none; padding: 0; font-size: 1.15rem; color: #9ca3af; line-height: 1; }
.btn-check-ukol:hover { color: #16a34a; }
.btn-check-ukol.done { color: #16a34a; }
.prio-1 { border-left: 3px solid #dc2626; }
.prio-2 { border-left: 3px solid transparent; }
.prio-3 { border-left: 3px solid #d1d5db; }
.form-label { font-weight: 500; font-size: .88rem; margin-bottom: .25rem; }
.form-text { font-size: .78rem; }
.polozky td { padding: .3rem; }
.polozky input, .polozky select { font-size: .88rem; }
.nav-tabs .nav-link { color: var(--muted); }
.nav-tabs .nav-link.active { color: var(--ink); font-weight: 600; }
a { text-decoration: none; }
.table a:not(.btn) { color: inherit; font-weight: 500; }
.table a:not(.btn):hover { color: var(--accent); }
.empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }
.login-box { max-width: 380px; margin: 12vh auto; }

/* Tom Select uvnitř input-group (výběr + tlačítko „+“) */
.input-group > .ts-wrapper { flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group > .ts-wrapper .ts-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ts-dropdown .active { background: #e7efff; color: inherit; }
