/* ==========================================================================
   OKVMG – Elektronický stavební deník
   public/css/style.css
   Monochromní základ (černá / bílá / šedá). Barva pouze pro štítky,
   upozornění a jména uživatelů. Ikony: jednotná sada v partials/icon.ejs.
   ========================================================================== */

:root {
  /* hodnoty bere z public/css/brand.css (jediný zdroj barev značky) */
  --ink:        var(--ocel);
  --dark:       var(--ocel-2);
  --dark-2:     var(--ocel-3);
  --steel:      var(--popisek);
  --steel-light:var(--popisek-svetly);
  --line:       var(--linka);
  --line-soft:  var(--linka-jemna);
  --light:      var(--pozadi);
  --white:      var(--papir);

  /* barvy pouze pro signály a štítky */
  --red:        var(--chyba);
  --red-soft:   var(--chyba-svetla);
  --green:      var(--ok);
  --green-soft: var(--ok-svetla);
  --amber:      var(--pozor);
  --amber-soft: var(--pozor-svetla);

  --sidebar-w: 248px;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Archivo', -apple-system, 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--light);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .16s var(--ease); }
a:hover { color: var(--dark); }
::selection { background: var(--ink); color: #fff; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---- Ikony ---- */
.ico {
  display: inline-block;
  vertical-align: -0.18em;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
}
.btn .ico, .project-tabs .ico, .sidebar .ico { margin-right: 7px; }
.btn.small .ico { margin-right: 5px; }
.quiet-link { color: var(--steel); display: inline-flex; align-items: center; gap: 5px; }
.quiet-link:hover { color: var(--ink); }

/* ---- Animace ---- */
@keyframes okReveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes okBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes okSpin { to { transform: rotate(360deg); } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.reveal { opacity: 0; transform: translateY(8px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .42s var(--ease), transform .42s var(--ease);
}
button.is-busy { opacity: .6; pointer-events: none; }
button.is-busy::after {
  content: ''; display: inline-block; width: 11px; height: 11px; margin-left: 8px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -1px; animation: okSpin .7s linear infinite;
}

.app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  color: #f2f0ef;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar .brand { padding: 24px 20px 20px; border-bottom: 2px solid #fff; }
.sidebar .brand .name {
  font-weight: 800; text-transform: uppercase; font-size: 14px;
  letter-spacing: 0.02em; line-height: 1.2;
}
.sidebar .brand .sub {
  color: var(--steel-light); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.16em; margin-top: 8px;
}
.sidebar nav { flex: 1; padding: 16px 0; }
.sidebar nav a {
  display: flex; align-items: center;
  padding: 12px 20px;
  color: #c9c5c2; font-size: 13.5px;
  border-left: 3px solid transparent;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.sidebar nav a .ico { color: var(--steel-light); transition: color .18s var(--ease), transform .18s var(--ease); }
.sidebar nav a:hover { background: #2b2928; color: #fff; }
.sidebar nav a:hover .ico { color: #fff; transform: translateX(1px); }
.sidebar nav a.active {
  background: #2b2928; border-left-color: #fff; color: #fff; font-weight: 700;
}
.sidebar nav a.active .ico { color: #fff; }
.sidebar .user-box {
  padding: 16px 20px; border-top: 1px solid #3a3735;
  font-size: 12.5px; color: var(--steel-light);
}
.sidebar .user-box .u-name { font-weight: 700; font-size: 13px; color: #fff; }
.sidebar .user-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sidebar .user-box form { margin-top: 12px; }
.sidebar .user-box button {
  display: inline-flex; align-items: center;
  background: none; border: 1px solid #4d4946; color: #d8d4d2;
  padding: 6px 12px; font-family: inherit; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em; border-radius: 0; cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.sidebar .user-box button:hover { background: #34312f; border-color: #fff; color: #fff; }

/* ---- Hlavní obsah ---- */
.main { flex: 1; min-width: 0; }
.topbar {
  background: var(--white); border-bottom: 2px solid var(--ink);
  padding: 20px 28px; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
}
.topbar h1 {
  font-size: 24px; margin: 0; text-transform: uppercase;
  letter-spacing: -0.01em; font-weight: 800; line-height: 1.1;
}
.topbar .crumbs { color: var(--steel); font-size: 12.5px; margin-top: 5px; }
.content { padding: 26px 28px; max-width: 1180px; animation: okReveal .35s var(--ease) both; }
.content-wide { max-width: none; }
.pkz-table th, .pkz-table td { padding: 7px 9px; font-size: 11.5px; }
.pkz-table th { font-size: 10px; }

/* ---- Tlačítka ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: flex-start;
  padding: 10px 16px; background: var(--ink); color: var(--white);
  border: 2px solid var(--ink); border-radius: 0;
  font-family: inherit; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.btn:hover { background: #000; color: #fff; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.secondary { background: var(--white); color: var(--ink); }
.btn.secondary:hover { background: var(--ink); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.danger:hover { background: #a51f15; border-color: #a51f15; }
.btn.small { padding: 6px 10px; font-size: 11px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }

/* ---- Karty a tabulky ---- */
.card {
  background: var(--white); border: 2px solid var(--ink); border-radius: 0;
  padding: 22px; margin-bottom: 20px;
}
.card h2, .black-bar {
  background: var(--ink); color: var(--white); padding: 11px 16px;
  font-size: 13px; text-transform: uppercase; font-weight: 800; letter-spacing: 0.1em;
  margin: -22px -22px 20px -22px; border-radius: 0;
  display: flex; align-items: center;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
th {
  text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.14em;
  color: #fff; background: var(--ink); white-space: nowrap; font-weight: 700;
}
tbody tr { transition: background .16s var(--ease); }
tr:hover td { background: var(--light); }

/* ---- Štítky: jediné místo, kde se používá barva ---- */
.badge {
  display: inline-block; padding: 4px 9px; border-radius: 0;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; white-space: nowrap;
}
.badge.draft { background: var(--white); color: var(--steel); border: 1px solid var(--line); }
.badge.locked { background: var(--ink); color: var(--white); }
.badge.role-admin { background: var(--red); color: #fff; }
.badge.role-member { background: var(--ink); color: #fff; }
.badge.role-viewer { background: var(--white); color: var(--steel); border: 1px solid var(--steel-light); }
.badge.status-open { background: var(--white); color: var(--steel); border: 1px solid var(--line); }
.badge.status-in_progress { background: var(--amber-soft); color: var(--amber); border: 1px solid #e8c877; }
.badge.status-done { background: var(--green-soft); color: var(--green); border: 1px solid #a8d3b6; }
.due-overdue { color: var(--red); font-weight: 700; }

/* jméno osoby nese barvu svého štítku (inline style ze šablony) */
.user-name { font-weight: 700; }

.new-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 0;
  background: var(--red); margin-left: 8px; vertical-align: middle;
  animation: pulse-dot 2s infinite;
}

/* ---- Formuláře ---- */
label {
  display: block; font-weight: 700; font-size: 10.5px; margin: 16px 0 6px;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--steel);
}
input[type=text], input[type=date], input[type=number], input[type=password],
input[type=email], input[type=tel], input[type=time], select, textarea {
  width: 100%; padding: 11px 12px; border: 2px solid var(--line); border-radius: 0;
  font-size: 14px; font-family: inherit; color: var(--ink); background: var(--white);
  transition: border-color .18s var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
input[readonly] { background: var(--light); color: var(--steel); }
textarea { min-height: 76px; resize: vertical; line-height: 1.55; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }
.form-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }

.error-box, .success-box {
  padding: 12px 14px; border-radius: 0; margin-bottom: 18px; font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 8px;
  animation: okReveal .3s var(--ease) both;
}
.error-box { background: var(--red-soft); border-left: 4px solid var(--red); color: var(--red); }
.success-box { background: var(--green-soft); border-left: 4px solid var(--green); color: var(--green); }

.step { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; }
.step .num {
  background: var(--ink); color: var(--white); font-weight: 800; font-size: 12px;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: 0; flex: 0 0 30px;
}

.info-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.info-row .k {
  color: var(--steel); min-width: 170px; font-weight: 700;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; padding-top: 2px;
}

/* ---- Záložky projektu ---- */
.project-tabs {
  display: flex; gap: 4px; padding: 0 28px; background: var(--white);
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.project-tabs a {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 14px 16px; font-size: 11.5px; font-weight: 700; color: var(--steel);
  text-transform: uppercase; letter-spacing: 0.12em;
  border-bottom: 3px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.project-tabs a:hover { color: var(--ink); }
.project-tabs a.active { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- Editor formátovaného textu ---- */
.rte-wrap { border: 2px solid var(--line); border-radius: 0; overflow: hidden; transition: border-color .18s var(--ease); }
.rte-wrap:focus-within { border-color: var(--ink); }
.rte-toolbar { display: flex; gap: 2px; padding: 6px; background: var(--light); border-bottom: 2px solid var(--line); flex-wrap: wrap; }
.rte-toolbar button, .rte-toolbar select {
  border: 1px solid var(--line); background: #fff; border-radius: 0; padding: 5px 9px;
  font-family: inherit; font-size: 12.5px; cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.rte-toolbar button:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.rte-toolbar input[type=color] { width: 30px; height: 28px; padding: 1px; border: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.rte-editable { min-height: 100px; padding: 12px 14px; font-size: 14px; line-height: 1.6; outline: none; }
.rte-editable:empty:before { content: attr(data-placeholder); color: var(--steel-light); }
.rte-display { line-height: 1.6; }
.rte-display p, .rte-display div { margin: 0 0 6px; }

/* ---- Kalendář ---- */
table.calendar { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.calendar th {
  text-align: center; padding: 8px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.12em; color: #fff; background: var(--ink);
}
table.calendar td {
  border: 1px solid var(--line-soft); height: 78px; vertical-align: top; padding: 7px;
  position: relative; transition: background .16s var(--ease);
}
table.calendar td:hover { background: var(--light); }
table.calendar tr:hover td { background: transparent; }
table.calendar tr:hover td:hover { background: var(--light); }
table.calendar td.cal-empty { background: #fafafa; border-color: var(--line-soft); }
table.calendar td.cal-today { background: var(--white); box-shadow: inset 0 0 0 2px var(--ink); }
.cal-daynum { font-size: 12px; color: var(--steel); font-weight: 700; }
.cal-badge {
  position: absolute; bottom: 7px; right: 7px;
  width: 26px; height: 26px; border-radius: 0;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  transition: transform .16s var(--ease);
}
.cal-badge:hover { transform: translateY(-1px); }
.cal-badge.locked { background: var(--ink); color: #fff; }
.cal-badge.draft { background: var(--white); border: 2px solid var(--line); color: var(--steel); }
.cal-add {
  position: absolute; bottom: 7px; right: 7px;
  width: 24px; height: 24px; border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--steel-light); border: 1px dashed var(--line); text-decoration: none; font-size: 15px;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.cal-add:hover { background: var(--ink); color: #fff; border-color: var(--ink); border-style: solid; }

/* ---- Fotky a soubory ---- */
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.photo-grid img {
  width: 132px; height: 132px; object-fit: cover; border-radius: 0;
  border: 1px solid var(--line); filter: grayscale(1);
  transition: filter .25s var(--ease), transform .25s var(--ease);
}
.photo-grid img:hover { filter: none; transform: translateY(-2px); }
.file-chip {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 132px; height: 132px; padding: 10px;
  border: 1px solid var(--line); border-radius: 0; background: var(--light);
  font-size: 11.5px; text-align: center; word-break: break-word; color: var(--ink);
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.file-chip:hover { background: var(--white); border-color: var(--ink); }

/* ---- Přihlášení (animovaná obrazovka) ---- */
@keyframes okGridDrift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-56px, -56px, 0); } }
@keyframes okScan { 0% { transform: translateY(-20%); opacity: 0; } 12% { opacity: .55; } 88% { opacity: .55; } 100% { transform: translateY(120vh); opacity: 0; } }
@keyframes okLineIn { from { clip-path: inset(0 0 100% 0); transform: translateY(24%); } to { clip-path: inset(0 0 -12% 0); transform: none; } }
@keyframes okRule { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes okFieldIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes okCardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--dark); padding: 24px;
}
.login-wrap--stage { padding: 0; }
.login-stage {
  display: grid; grid-template-columns: 1.15fr 420px;
  width: 100%; min-height: 100vh; background: var(--dark);
}

.login-hero { position: relative; overflow: hidden; color: #f2f0ef; }
.login-hero-grid {
  position: absolute; inset: -60px;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(to right, rgba(255,255,255,.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px, 168px 168px, 168px 168px;
  animation: okGridDrift 26s linear infinite;
}
.login-hero-scan {
  position: absolute; left: 0; right: 0; height: 34vh; top: 0;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.05) 55%, rgba(255,255,255,.16));
  border-bottom: 1px solid rgba(255,255,255,.28);
  animation: okScan 9s cubic-bezier(.5,0,.5,1) infinite;
}
.login-hero-body {
  position: relative; z-index: 2;
  height: 100%; display: flex; flex-direction: column; justify-content: center;
  padding: 60px clamp(32px, 6vw, 92px);
}
.login-hero-kicker {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.24em; color: var(--steel-light);
  animation: okFieldIn .6s var(--ease) both;
}
.login-hero-title {
  margin-top: 22px; display: grid; gap: 2px;
  font-size: clamp(38px, 5.4vw, 74px); font-weight: 800; line-height: .98;
  text-transform: uppercase; letter-spacing: -0.03em;
}
.login-hero-title span { display: block; }
.login-hero-title span:nth-child(1) { animation: okLineIn .8s var(--ease) both .1s; }
.login-hero-title span:nth-child(2) { animation: okLineIn .8s var(--ease) both .2s; }
.login-hero-title span:nth-child(3) { animation: okLineIn .8s var(--ease) both .3s; }
.login-hero-rule {
  height: 3px; width: 88px; background: #fff; margin: 32px 0 26px;
  transform-origin: left; animation: okRule .7s var(--ease) both .55s;
}
.login-hero-list {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  font-size: 13.5px; color: #c9c5c2; max-width: 42ch;
}
.login-hero-list li {
  display: flex; align-items: baseline; gap: 12px;
  animation: okFieldIn .6s var(--ease) both;
}
.login-hero-list li:nth-child(1) { animation-delay: .62s; }
.login-hero-list li:nth-child(2) { animation-delay: .72s; }
.login-hero-list li:nth-child(3) { animation-delay: .82s; }
.login-hero-list li::before {
  content: ''; flex: 0 0 18px; height: 1px; background: var(--steel-light);
  transform: translateY(-4px);
}

.login-box {
  background: var(--white); padding: 34px 34px 30px; border-radius: 0; width: 360px;
  border-top: 4px solid var(--ink); animation: okCardIn .5s var(--ease) both;
}
.login-wrap--stage .login-box {
  width: auto; border-top: none; border-left: 2px solid var(--ink);
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px clamp(28px, 3vw, 44px);
}
.login-mark {
  width: 40px; height: 40px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  animation: okFieldIn .5s var(--ease) both .1s;
}
.login-box .brand-title {
  font-weight: 800; text-transform: uppercase; font-size: 15px;
  margin-bottom: 4px; line-height: 1.2;
  animation: okFieldIn .5s var(--ease) both .16s;
}
.login-box .brand-sub {
  color: var(--steel); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.16em; margin-bottom: 22px;
  animation: okFieldIn .5s var(--ease) both .22s;
}
.login-field { animation: okFieldIn .55s var(--ease) both; }
.login-field:nth-of-type(1) { animation-delay: .28s; }
.login-field:nth-of-type(2) { animation-delay: .36s; }
.login-field:nth-of-type(3) { animation-delay: .44s; }
.login-box input { transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.login-box input:focus { box-shadow: inset 0 -3px 0 var(--ink); }
.login-submit {
  width: 100%; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-submit .ico { margin-right: 0; transition: transform .22s var(--ease); }
.login-submit:hover .ico { transform: translateX(4px); }
.login-foot {
  margin-top: 18px; font-size: 13px;
  animation: okFieldIn .5s var(--ease) both .52s;
}

@media (max-width: 900px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-hero { min-height: 42vh; }
  .login-hero-body { padding: 48px 24px; }
  .login-wrap--stage .login-box {
    width: 100%; border-left: none; border-top: 2px solid var(--ink); padding: 34px 24px 40px;
  }
}

.comment { padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.comment .meta { color: var(--steel); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 5px; }

/* ---- Tabulka pracovniku u zaznamu ---- */
.workers-table { border: 2px solid var(--line); padding: 10px; }
.workers-row { display: grid; grid-template-columns: 1.2fr 1.6fr 0.6fr 30px; gap: 8px; align-items: center; margin-bottom: 7px; }
.workers-row.workers-head { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--steel); font-weight: 700; margin-bottom: 9px; }
.workers-row input { padding: 8px 9px; font-size: 13px; }
.workers-remove {
  background: none; border: none; color: var(--red); font-size: 19px; cursor: pointer; line-height: 1;
  transition: transform .16s var(--ease);
}
.workers-remove:hover { transform: scale(1.2); }
.workers-display-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.workers-display-table th, .workers-display-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.workers-display-table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: #fff; background: var(--ink); }

/* ---- Docházka - vyber a prehled ---- */
.attendance-picker { max-height: 300px; overflow-y: auto; border: 2px solid var(--line); padding: 12px; }
.attendance-picker label {
  display: flex; align-items: center; gap: 10px; font-weight: 400; text-transform: none;
  margin: 8px 0; color: var(--ink); font-size: 13.5px; letter-spacing: normal;
}
.attendance-picker input[type=checkbox] { width: auto; }
.att-day-row.is-weekend td { background: var(--light); }

/* ---- Docházka - dashboard ---- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 20px; }
.dash-tile {
  background: var(--white); border: 2px solid var(--ink); padding: 20px;
}
.dash-tile .dash-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--steel); font-weight: 700;
}
.dash-tile .dash-value { font-size: 30px; font-weight: 800; margin-top: 6px; line-height: 1.1; }
.dash-tile .dash-sub { font-size: 12px; color: var(--steel); margin-top: 4px; }
.dash-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dash-bar-row .dash-bar-label { width: 190px; flex: 0 0 190px; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-bar-track { flex: 1; height: 20px; background: var(--light); border: 1px solid var(--line); position: relative; }
.dash-bar-fill { height: 100%; background: var(--ink); animation: okBar .5s var(--ease) both; transform-origin: left; }
.dash-bar-value { width: 70px; flex: 0 0 70px; text-align: right; font-size: 13px; font-weight: 700; }

@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; min-height: 0; }
  .sidebar nav { display: flex; overflow-x: auto; padding: 0; }
  .sidebar nav a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .sidebar nav a.active { border-left: none; border-bottom-color: #fff; }
  .content, .topbar { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .no-print { display: none !important; }
  body { background: white; font-size: 12px; }
  .card { border: 1px solid #000; }
  .reveal { opacity: 1 !important; transform: none !important; }
  th { background: #fff; color: #000; border-bottom: 2px solid #000; }
}

/* ==========================================================================
   Responzivní doladění pro tablet a mobil
   ========================================================================== */

/* Tabulky uvnitr karet - vodorovne rolovani misto rozbiti layoutu na uzkych obrazovkach */
@media (max-width: 760px) {
  .card { padding: 16px; }
  .card h2, .black-bar { margin: -16px -16px 16px -16px; padding: 10px 14px; font-size: 12px; }
  .card > table,
  .card > div > table:not(.calendar) {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .card > table thead, .card > table tbody,
  .card > div > table:not(.calendar) thead, .card > div > table:not(.calendar) tbody { display: table; width: 100%; }
}

/* Kalendar - zmenseni na uzkych obrazovkach, cely radek jde rolovat vodorovne */
@media (max-width: 700px) {
  table.calendar { min-width: 560px; }
  table.calendar td { height: 58px; padding: 5px; }
  .cal-badge, .cal-add { width: 20px; height: 20px; font-size: 12px; }
}
.card:has(table.calendar) { overflow-x: auto; }

/* Radek pracovnika u zaznamu - na mobilu se rozpadne na sloupec */
@media (max-width: 560px) {
  .workers-row { grid-template-columns: 1fr; gap: 6px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
  .workers-row.workers-head { display: none; }
  .workers-remove { justify-self: end; }
}

/* Docházka - sloupcovy graf se na mobilu prizpusobi (popisek nad pruhem) */
@media (max-width: 620px) {
  .dash-bar-row { flex-wrap: wrap; row-gap: 4px; }
  .dash-bar-row .dash-bar-label { flex-basis: 100%; width: 100%; }
  .dash-bar-row .dash-bar-value { width: auto; margin-left: auto; }
}

/* Info-radky (detail zaznamu) - na mobilu popisek nad hodnotou, ne vedle */
@media (max-width: 560px) {
  .info-row { flex-direction: column; gap: 3px; }
  .info-row .k { min-width: 0; }
}

/* Tlacitka ve form-actions na mobilu na plnou sirku, snazsi klepnuti prstem */
@media (max-width: 560px) {
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .topbar > div:last-child { width: 100%; }
  .topbar > div:last-child .btn { flex: 1; justify-content: center; }
}

/* Grid formularu - uz je auto-fit, jen doladeni mezery na mobilu */
@media (max-width: 560px) {
  .grid-2 { gap: 0; }
}

/* V1.14: odkaz "Upravit" u PDF/DWG priloh (PDF editor, Vykresy) */
.file-cell { display: flex; flex-direction: column; align-items: flex-start; }
.file-open { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--accent, #c2261a); text-decoration: none; white-space: nowrap; }
.file-open:hover { text-decoration: underline; }
td .file-open { margin: 0 0 0 10px; }
