/* ---------- Písma (lokálne, bez Google) – ako na gajniak.sk ---------- */
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url(fonts/nunito-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url(fonts/nunito-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url(fonts/nunito-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url(fonts/nunito-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url(fonts/nunito-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url(fonts/nunito-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url(fonts/montserrat-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url(fonts/montserrat-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url(fonts/montserrat-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url(fonts/montserrat-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* ---------- Farby – červená GAJNIAK (#c70c0c) ---------- */
:root {
  --red: #c70c0c; --red-dark: #a10808; --red-soft: #fbe9e9; --red-line: #f0c4c4;
  --bg: #f4f4f4; --card: #fff; --ink: #262626; --text: #3d3d3d; --muted: #777; --line: #e2e2e2;
  --head: #1c1c1c; --head-2: #2a2a2a;
  --ok: #1d7a46; --radius: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Nunito, "Segoe UI", Arial, Helvetica, sans-serif; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: Montserrat, Arial, Helvetica, sans-serif; color: var(--ink); }
h1 { font-size: 1.4rem; font-weight: 700; margin: 0 0 .3rem; }
h2 { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 1.5rem 0 .7rem;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2::before { content: ""; width: 14px; height: 3px; background: var(--red); border-radius: 2px; }
section.card > h2:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { background: #efefef; padding: 1px 5px; border-radius: 4px; }
mark { background: #ffe08a; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------- Horná lišta: logo | menu v strede | používateľ ---------- */
.topbar { background: var(--head); color: #fff; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 12px; padding: 0 24px; min-height: 64px; position: sticky; top: 0; z-index: 20;
  border-bottom: 3px solid var(--red); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; justify-self: start; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; display: block; }
.brand span { font: 700 .72rem Montserrat, Arial, sans-serif; text-transform: uppercase; letter-spacing: .14em;
  color: #fff; background: var(--red); padding: 3px 7px; border-radius: 3px; }
.topbar nav { display: flex; gap: 2px; align-items: center; }
.mainnav { justify-self: center; }
.usernav { justify-self: end; }
.topbar nav a { color: #e6e6e6; padding: 21px 14px; font: 700 .8rem Montserrat, Arial, sans-serif;
  text-transform: uppercase; letter-spacing: .06em; position: relative; }
.topbar nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 12px; height: 2px;
  background: var(--red); transform: scaleX(0); transition: transform .15s; }
.topbar nav a:hover { color: #fff; text-decoration: none; }
.topbar nav a:hover::after, .topbar nav a.on::after { transform: scaleX(1); }
.topbar nav a.on { color: #fff; }
.topbar nav a.btn-new { background: var(--red); color: #fff; padding: 9px 16px; border-radius: 4px; margin-left: 10px; }
.topbar nav a.btn-new::after { display: none; }
.topbar nav a.btn-new:hover, .topbar nav a.btn-new.on { background: var(--red-dark); }
.usernav a { font-family: Nunito, Arial, sans-serif !important; text-transform: none !important; letter-spacing: 0 !important;
  font-weight: 600 !important; font-size: .85rem !important; padding: 21px 10px !important; color: #bdbdbd !important; }
.usernav a::after { left: 10px !important; right: 10px !important; }
.usernav a:hover, .usernav a.on { color: #fff !important; }
.usernav a.muted { color: #8a8a8a !important; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 20px 30px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card.narrow { max-width: 440px; margin: 40px auto; }
.card.empty { text-align: center; padding: 40px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid.wide-left { grid-template-columns: 1.6fr 1fr; }

/* prihlásenie */
body:has(.login) { background: var(--head) linear-gradient(180deg, #262626, #141414); min-height: 100vh; }
.login { text-align: center; border-top: 4px solid var(--red); margin-top: 12vh !important; }
.login form { text-align: left; }
.login h1 { margin-bottom: 18px; }
.login-logo { max-width: 240px; width: 100%; margin: 6px 0 14px; }

/* ---------- Formuláre ---------- */
label { display: block; margin-bottom: 12px; font-size: .88rem; color: #444; font-weight: 600; }
.field { margin-bottom: 12px; }
.lbl { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; color: #444; font-weight: 600; margin-bottom: 4px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400; color: var(--ink);
  padding: 8px 10px; border: 1px solid #cfcfcf; border-radius: 4px; background: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(199, 12, 12, .18); border-color: var(--red); }
input[type=checkbox], input[type=radio] { accent-color: var(--red); }
label.short { max-width: 300px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radios { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 12px; }
.radios > input { flex: 1; min-width: 180px; margin-top: 0; }
label.rc { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; font-weight: 400; cursor: pointer; }
label.rc input { width: auto; margin: 0; }
.chips-r label.rc { border: 1px solid #cfcfcf; border-radius: 20px; padding: 4px 11px; margin: 0; }
.chips-r label.rc:has(input:checked) { background: var(--red-soft); border-color: var(--red); color: var(--red-dark); font-weight: 600; }

.btn { display: inline-block; font: inherit; font-weight: 600; padding: 8px 15px; border-radius: 4px; cursor: pointer;
  border: 1px solid #cfcfcf; background: #fff; color: var(--ink); white-space: nowrap; }
.btn:hover { background: #f6f6f6; text-decoration: none; border-color: #b5b5b5; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn.red { color: var(--red); }
.btn.small { padding: 4px 10px; font-size: .85rem; }

.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; background: #e8f5ec; border: 1px solid #b9dfc6; border-left: 4px solid var(--ok); }
.flash.err { background: var(--red-soft); border-color: var(--red-line); border-left-color: var(--red); color: #7a1010; }

/* ---------- Zoznamy ---------- */
.listhead { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.search { display: flex; gap: 8px; }
.search input { margin: 0; font-size: 1rem; padding: 11px 14px 11px 40px; border-width: 1.5px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") 13px 50% no-repeat; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 13px; border-radius: 20px; background: #fff; border: 1px solid var(--line); color: #444; font-size: .88rem; font-weight: 600; }
.chip:hover { text-decoration: none; border-color: #bbb; }
.chip.on { background: var(--red); color: #fff; border-color: var(--red); }
.chip b { font-weight: 800; margin-left: 2px; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font: 700 .7rem Montserrat, Arial, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: #888;
  padding: 11px 12px; border-bottom: 2px solid var(--line); }
table.list td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
table.list tbody tr, table.list tr[data-href] { cursor: pointer; }
table.list tbody tr:hover { background: #fdf5f5; box-shadow: inset 3px 0 0 var(--red); }
table.list.plain tr:not([data-href]) { cursor: default; }
table.list.plain tr:not([data-href]):hover { background: none; box-shadow: none; }
table.list tr.off td { opacity: .55; }
.num a { font-weight: 700; font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); font-size: .83rem; }
.sub.late { color: var(--red); font-weight: 700; }
.clip { max-width: 380px; }
.r, table.items .r, table.list .r { text-align: right; }
.c { text-align: center; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; font-size: .7rem; font-weight: 800; padding: 1px 6px; border-radius: 3px; background: #ececec; color: #444; margin-left: 4px; vertical-align: 1px; }
.tag.hot { background: var(--red-soft); color: var(--red); }
.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.s-new { background: #e7eefb; color: #1b4597; }
.s-work { background: #fff0d6; color: #8a4b00; }
.s-wait { background: #f1e7fb; color: #67239f; }
.s-done { background: #def3e6; color: #11663a; }
.s-bad { background: var(--red-soft); color: var(--red-dark); }
.s-closed { background: #ececec; color: #666; }
.pager { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.pager a { padding: 5px 10px; border-radius: 4px; background: #fff; border: 1px solid var(--line); }
.pager a.on { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Detail zákazky ---------- */
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
table.items { width: 100%; border-collapse: collapse; }
table.items th { font-size: .75rem; color: var(--muted); font-weight: 700; text-align: left; padding: 4px; }
table.items td { padding: 3px 4px; vertical-align: middle; }
table.items td input { margin: 0; padding: 6px 8px; }
#items td:nth-child(2) { width: 70px; }
#items td:nth-child(3) { width: 100px; }
#items td.sum { width: 100px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.items tfoot td { padding-top: 8px; }
td.pop { position: relative; }
.tocen { display: block; margin: 2px 0 2px 2px; border: 0; background: none; padding: 0; font: inherit; font-size: .76rem;
  color: var(--red); cursor: pointer; font-weight: 600; }
.tocen[hidden] { display: none; }
.tocen:hover { text-decoration: underline; }
.x { border: 0; background: none; font-size: 1.3rem; color: #aaa; cursor: pointer; line-height: 1; padding: 0 4px; }
.x:hover { color: var(--red); }
.hist { margin-top: 14px; font-size: .88rem; }
.hist summary { cursor: pointer; font-weight: 700; color: #444; }
.hist ul { padding-left: 18px; margin: 8px 0 0; }
.hist li { margin-bottom: 3px; }
.savebar { position: sticky; bottom: 0; z-index: 5; background: #fff; box-shadow: 0 -4px 14px rgba(0,0,0,.07);
  padding: 12px 16px; margin: 16px -1px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.danger { display: flex; gap: 8px; margin-top: 24px; justify-content: flex-end; }
form.inline { display: inline-flex; gap: 4px; align-items: center; }
input.mini { width: 130px; margin: 0; padding: 4px 8px; font-size: .85rem; }

/* klient – štítok a našepkávač */
.kchip { font: 600 .78rem Nunito, Arial, sans-serif; text-transform: none; letter-spacing: 0; color: #11663a;
  background: #def3e6; border-radius: 20px; padding: 2px 4px 2px 10px; display: inline-flex; align-items: center; gap: 4px; }
.kchip[hidden] { display: none; }
.kchip a { color: inherit; font-weight: 700; }
.kchip.new { color: #8a4b00; background: #fff0d6; padding-right: 10px; }
.kchip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; opacity: .6; }
.kchip button:hover { opacity: 1; }
.ac { position: absolute; z-index: 30; width: 340px; max-width: calc(100% - 20px); background: #fff; border: 1px solid #cfcfcf;
  border-top: 3px solid var(--red); border-radius: 0 0 6px 6px; box-shadow: 0 10px 28px rgba(0,0,0,.16); max-height: 360px; overflow-y: auto; }
.ac[hidden] { display: none; }
.ac-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f0f0f0; display: grid; gap: 1px; }
.ac-item:last-child { border-bottom: 0; }
.ac-item b { color: var(--ink); }
.ac-item span { font-size: .83rem; color: #555; }
.ac-item em { font-style: normal; font-size: .76rem; color: var(--muted); }
.ac-item em:empty { display: none; }
.ac-item:hover, .ac-item.on { background: var(--red-soft); }

/* cenník */
.tablebar { display: flex; gap: 8px; margin-bottom: 10px; }
.tablebar input { margin: 0; }
table.cen td:nth-child(2) { width: 100px; }
table.cen td:nth-child(3) { width: 70px; }
table.cen td:nth-child(4) { width: 60px; }
table.cen td:nth-child(5) { width: 50px; }
table.cen td:nth-child(6) { width: 30px; }
table.cen tr.off input:not([type=checkbox]) { color: #999; background: #fafafa; }
table.cen tr.todel input:not([type=checkbox]) { text-decoration: line-through; color: var(--red); background: var(--red-soft); }
table.cen td.c input { width: auto; margin: 0 auto; }
label.del { margin: 0; cursor: pointer; display: inline-flex; }
label.del input { display: none; }
label.del span { font-size: 1.3rem; line-height: 1; color: #aaa; padding: 0 4px; }
label.del:hover span, label.del input:checked + span { color: var(--red); }
.card .savebar { margin: 16px -20px -20px; border-radius: 0 0 var(--radius) var(--radius); border-width: 1px 0 0; box-shadow: none; position: static; }

@media (max-width: 1080px) {
  .topbar { grid-template-columns: auto 1fr; padding: 0 16px; }
  .mainnav { justify-self: end; }
  .usernav { grid-column: 1 / -1; justify-self: center; border-top: 1px solid #333; width: 100%; justify-content: center; }
  .usernav a { padding: 8px 10px !important; }
  .usernav a::after { bottom: 3px; }
}
@media (max-width: 900px) {
  .grid, .grid.wide-left, .row2 { grid-template-columns: 1fr; gap: 0 12px; }
  .grid, .grid.wide-left { gap: 16px; }
  .wrap { padding: 16px; }
  table.list th:nth-child(2), table.list td:nth-child(2) { display: none; }
  .clip { max-width: 200px; }
}
@media (max-width: 640px) {
  .topbar { grid-template-columns: 1fr; justify-items: center; padding: 8px 12px 0; }
  .mainnav { justify-self: center; flex-wrap: wrap; justify-content: center; }
  .topbar nav a { padding: 12px 9px; }
  .topbar nav a::after { bottom: 5px; left: 9px; right: 9px; }
  .topbar nav a.btn-new { margin: 4px 0 6px 6px; padding: 7px 12px; }
  .brand img { height: 28px; }
  .topbar { position: static; }
}
