/* Emglare Projects — zákaznický portál. Brand Emglare: oranžová #f18c15, ink #17191c, Gotham.
   Klidný, čistý vzhled: zákazník sem přijde zjistit stav, ne pracovat v aplikaci. */

@font-face { font-family: Gotham; src: url('/fonts/Gotham-Book.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Gotham; src: url('/fonts/Gotham-Medium.otf') format('opentype'); font-weight: 500; font-display: swap; }
@font-face { font-family: Gotham; src: url('/fonts/Gotham-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }

:root {
  --orange: #f18c15;
  --orange-dark: #db7713;
  --ink: #17191c;
  --muted: #5b6270;
  --line: #e6e7ec;
  --bg: #f6f7f9;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(23, 25, 28, .05), 0 8px 24px rgba(23, 25, 28, .06);
  --radius: 14px;
  --urgent: #d64545;
  --high: #e07b1c;
  --ok: #2f8f5b;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: Gotham, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--orange-dark); }

h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- hlavička */

header.top {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-in {
  max-width: 1040px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .chip {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  background: linear-gradient(135deg, #f7a03c, var(--orange) 55%, var(--orange-dark));
  display: grid; place-items: center;
}
.brand .chip img { width: 20px; height: 20px; display: block; }
.brand .t { display: flex; flex-direction: column; line-height: 1; }
.brand .t img { height: 18px; width: auto; display: block; }
.brand .t small {
  font-size: 9px; font-weight: 500; letter-spacing: .16em; color: var(--orange); padding-top: 3px;
}
.top-sp { flex: 1; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.who strong { color: var(--ink); font-weight: 500; }

/* ---------------------------------------------------------------- stránka */

main { max-width: 1040px; margin: 0 auto; padding: 28px 20px 64px; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--orange-dark); }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head .grow { flex: 1; min-width: 0; }
.page-head p { margin: 5px 0 0; color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-pad { padding: 20px 22px; }

/* ---------------------------------------------------------------- dlaždice projektů */

.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.tile {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); border-left: 4px solid var(--pc, var(--orange));
  transition: box-shadow .14s, transform .14s;
}
.tile:hover { box-shadow: 0 2px 4px rgba(23,25,28,.06), 0 12px 32px rgba(23,25,28,.1); transform: translateY(-1px); color: var(--ink); }
.tile h3 { margin-bottom: 4px; }
.tile .co { font-size: 12.5px; color: var(--muted); }
.tile .nums { display: flex; gap: 18px; margin-top: 14px; font-size: 13px; }
.tile .nums b { display: block; font-size: 19px; font-weight: 700; line-height: 1.2; }
.tile .nums span { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- záložky */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  font: inherit; font-size: 14px; color: var(--muted); padding: 10px 14px; cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); font-weight: 500; border-bottom-color: var(--orange); }

/* ---------------------------------------------------------------- seznam úkolů */

.filters { display: flex; gap: 8px; margin-bottom: 14px; }

.chip {
  appearance: none; font: inherit; font-size: 13px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px; color: var(--muted);
}
.chip:hover { border-color: #d6d8df; color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.rows { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border-top: 1px solid var(--line); cursor: pointer;
}
.row:first-child { border-top: 0; }
.row:hover { background: #fbfbfc; }
.row .grow { flex: 1; min-width: 0; }
.row .ttl { font-weight: 500; }
.row .ttl .code { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-right: 7px; }
.row .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.row .right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500;
  border-radius: 999px; padding: 3px 9px; background: #f1f2f5; color: var(--muted); white-space: nowrap;
}
.tag.urgent { background: rgba(214,69,69,.1); color: var(--urgent); }
.tag.high { background: rgba(224,123,28,.12); color: var(--high); }
.tag.done { background: rgba(47,143,91,.1); color: var(--ok); }
.tag.late { background: rgba(214,69,69,.1); color: var(--urgent); }
.tag.pending { background: rgba(241,140,21,.14); color: var(--orange-dark); }

/* ---------------------------------------------------------------- detail úkolu */

.task-desc { white-space: pre-wrap; margin: 0; }

.facts { display: grid; gap: 14px 28px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 500; }

.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 12px; }
.msg .av {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--ink);
}
.msg.team .av { background: linear-gradient(135deg, #f7a03c, var(--orange) 55%, var(--orange-dark)); }
.msg .body { flex: 1; min-width: 0; }
.msg .hd { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.msg .hd b { color: var(--ink); font-weight: 500; }
.msg .txt {
  white-space: pre-wrap; background: #f7f8fa; border-radius: 12px; border-top-left-radius: 3px;
  padding: 10px 14px;
}
.msg.team .txt { background: rgba(241,140,21,.07); }

/* ---------------------------------------------------------------- co se udělalo */

.period { margin-bottom: 22px; }
.period h3 { font-size: 14px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.period ul { margin: 0; padding: 0; list-style: none; }
.period li { padding: 7px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; }
.period li:first-child { border-top: 0; }
.period li .code { color: var(--muted); font-size: 12.5px; flex: 0 0 auto; min-width: 62px; }
.period li time { color: var(--muted); font-size: 12.5px; flex: 0 0 auto; margin-left: auto; }

/* ---------------------------------------------------------------- soupisy */

.sum { display: flex; align-items: baseline; gap: 10px; }
.sum b { font-size: 30px; font-weight: 700; }
.sum span { color: var(--muted); }

table.hrs { width: 100%; border-collapse: collapse; }
table.hrs th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 0 0 8px; }
table.hrs th.n, table.hrs td.n { text-align: right; white-space: nowrap; }
table.hrs td { padding: 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
table.hrs tr.pj td { font-weight: 500; }
table.hrs tr.it td { color: var(--muted); font-size: 14px; }
table.hrs tr.it td:first-child { padding-left: 18px; }
table.hrs tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); }

/* ---------------------------------------------------------------- ovládání */

.btn {
  appearance: none; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 14px;
  font-weight: 500; cursor: pointer; border: 0; border-radius: 10px; padding: 9px 16px;
  background: var(--orange); color: #fff; box-shadow: 0 2px 8px rgba(241,140,21,.3);
}
.btn:hover { background: var(--orange-dark); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: #d6d8df; background: #fbfbfc; color: var(--ink); }
.btn.link { background: none; box-shadow: none; color: var(--muted); padding: 6px 8px; font-weight: 400; }
.btn.link:hover { background: none; color: var(--orange-dark); }

select, textarea, input[type=text] {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%;
}
select:focus, textarea:focus, input:focus { outline: 2px solid rgba(241,140,21,.35); outline-offset: 1px; border-color: var(--orange); }
textarea { resize: vertical; min-height: 84px; }
select { width: auto; min-width: 150px; cursor: pointer; }

label.fld { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.note {
  background: rgba(241,140,21,.08); border: 1px solid rgba(241,140,21,.25); border-radius: 12px;
  padding: 12px 16px; font-size: 13.5px;
}
.note b { font-weight: 500; }

.err {
  background: rgba(214,69,69,.07); border: 1px solid rgba(214,69,69,.25); color: #8e2f2f;
  border-radius: 12px; padding: 12px 16px; font-size: 13.5px;
}

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* ---------------------------------------------------------------- dialog */

.ov { position: fixed; inset: 0; background: rgba(23,25,28,.42); display: grid; place-items: center; padding: 18px; z-index: 50; }
.dlg { background: var(--card); border-radius: 16px; padding: 24px; width: 100%; max-width: 460px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.dlg h3 { margin-bottom: 8px; }
.dlg p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- přihlášení a jednoduché stránky */

body.login-view, body.page-plain { background: linear-gradient(165deg, #fff 0%, var(--bg) 60%); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login {
  display: grid; gap: 40px; grid-template-columns: 1.1fr .9fr; align-items: center;
  max-width: 940px; width: 100%;
}
.login-intro .eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .18em; color: var(--orange); margin: 0 0 14px; }
.login-intro h1 { font-size: 40px; line-height: 1.12; }
.login-intro h1 span { color: var(--orange); }
.login-intro .lead { color: var(--muted); font-size: 16px; max-width: 420px; }
.login-intro .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.login-intro .tags span { font-size: 12px; color: var(--muted); border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; }

.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
.login-card .eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .16em; color: var(--muted); margin: 0 0 10px; }
.login-card h2 { margin-bottom: 8px; }
.login-card p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; }

.plain-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 32px;
  max-width: 460px; margin: 10vh auto; box-shadow: var(--shadow);
}
.plain-card h2 { margin-bottom: 10px; }
.plain-card p { color: var(--muted); }

footer.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 28px 20px 40px; }

/* ---------------------------------------------------------------- mobil */

@media (max-width: 760px) {
  main { padding: 20px 16px 48px; }
  h1 { font-size: 22px; }
  .login { grid-template-columns: 1fr; gap: 28px; }
  .login-intro h1 { font-size: 30px; }
  .row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .row .right { width: 100%; }
  .facts { grid-template-columns: 1fr 1fr; }
  .tabs { overflow-x: auto; }
}

@media print {
  header.top, .tabs, .btn, .filters, footer.foot, .crumbs { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}
