/* SAAS III – vzhled vychází z původního SAAS (barvy, rozložení), s modernějším dotykem. */
:root {
  --dark: #35414f;
  --dark-text: #e1e463;
  --navy: #2c4359;
  --blue: #b0c1de;
  --blue-border: #707b8f;
  --lime: #ccd232;
  --lime-dark: #a9ae1e;
  --magenta: #c92c87;
  --yellow: #ffff38;
  --red: #ff3853;
  --text: #2c4359;
  --muted: #6b7a8c;
  --line: #d5dbe5;
  --row-nova: #ffb3bc;
  --row-prijato: #fff38a;
  --row-hotovo: #c6e88f;
  --radius: 3px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 13px/1.5 Verdana, Geneva, "DejaVu Sans", sans-serif;
  color: var(--text);
  background: #fff;
  padding-bottom: 60px;
}
a { color: var(--navy); }
a:hover { color: var(--magenta); }
h1, h2, h3 { margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; }
h3 { font-size: 13px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.strong { font-weight: bold; }
.inline { display: inline; }
.hidden, [hidden] { display: none !important; }
.error-text { color: var(--red); font-weight: bold; }
.req { color: var(--red); }

/* ---------- horní menu (záložky) ---------- */
.topbar { background: #fff; padding: 6px 10px 0; border-bottom: 4px solid var(--dark); }
.tabs { display: flex; flex-wrap: wrap; gap: 3px; }
.tab {
  display: inline-block; padding: 6px 14px; text-decoration: none; font-weight: bold; color: #333;
  background: var(--blue) url(img/bg-b0c1de.png) 50% 50% repeat;
  border: 1px solid var(--blue-border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
}
.tab:hover { background: var(--lime) url(img/bg-ccd232.png) 50% 50% repeat; color: #222; }
.tab.active { background: var(--magenta) url(img/bg-c92c87.png) 50% 50% repeat; border-color: var(--magenta); color: #fff; }
.tab-home { background: var(--dark) url(img/bg-35414f.png); color: var(--dark-text); border-color: var(--navy); }
.tab-home:hover { color: #222; }

/* ---------- pruh s nadpisem stránky ---------- */
.titlebar {
  background: var(--lime) url(img/bg-ccd232.png) 50% 50% repeat;
  padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px;
}
.titlebar h1 { font-size: 17px; color: #1d1f05; }
.inner { padding: 15px 20px; }

/* ---------- zprávy ---------- */
.flash { padding: 9px 14px; margin-bottom: 14px; border-radius: var(--radius); font-weight: bold; }
.flash-ok { background: #eef5c4; border: 1px solid var(--lime-dark); color: #3d4205; }
.flash-error { background: var(--red) url(img/bg-ff3853.png); border: 1px solid #c81d35; color: #fff; }
.field-error { color: var(--red); font-size: 12px; font-weight: bold; margin-top: 2px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }

/* ---------- tlačítka ---------- */
.btn {
  display: inline-block; padding: 5px 12px; font: bold 12px/1.4 Verdana, Geneva, sans-serif; color: #333; text-decoration: none; cursor: pointer;
  background: var(--blue) url(img/bg-b0c1de.png) 50% 50% repeat; border: 1px solid var(--blue-border); border-radius: var(--radius);
  white-space: nowrap; vertical-align: middle;
}
.btn:hover, .btn:focus-visible { background: var(--lime) url(img/bg-ccd232.png); border-color: var(--lime-dark); color: #222; }
.btn-primary { background: var(--lime) url(img/bg-ccd232.png); border-color: var(--lime-dark); color: #222; }
.btn-primary:hover { background: var(--magenta) url(img/bg-c92c87.png); border-color: var(--magenta); color: #fff; }
.btn-danger { background: var(--red) url(img/bg-ff3853.png); border-color: #c81d35; color: #fff; }
.btn-danger:hover { background: #c81d35; color: #fff; border-color: #a01126; }
.btn-small { padding: 2px 8px; font-size: 11px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn-col { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.btn-col .btn, .btn-col form .btn { width: 100%; text-align: center; }
.icon-btn { display: inline-block; padding: 1px 6px; border-radius: var(--radius); text-decoration: none; font-weight: bold; border: 1px solid transparent; background: none; cursor: pointer; color: var(--navy); font-size: 12px; }
.icon-btn:hover { background: var(--lime); border-color: var(--lime-dark); color: #222; }

/* ---------- panely (widgety) ---------- */
.panel { border: 1px solid var(--navy); border-radius: var(--radius); margin-bottom: 18px; background: #fff; }
.panel-head {
  background: var(--dark) url(img/bg-35414f.png); color: var(--dark-text); padding: 7px 12px; font-weight: bold;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 13px; color: var(--dark-text); }
.panel-head .btn { font-size: 11px; padding: 2px 9px; }
.panel-body { padding: 12px; }
.panel-body.flush { padding: 0; }
.panel-foot { background: var(--dark) url(img/bg-35414f.png); color: #e9ecef; padding: 6px 12px; }

/* ---------- toolbar nad tabulkou ---------- */
.toolbar {
  background: var(--dark) url(img/bg-35414f.png); color: var(--dark-text); padding: 7px 10px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-radius: var(--radius) var(--radius) 0 0;
}
.toolbar form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.toolbar label { color: var(--dark-text); font-weight: bold; font-size: 12px; }
.toolbar input, .toolbar select { padding: 3px 6px; font-size: 12px; }
.toolbar .spacer { flex: 1; }
.toolbar-bottom { border-radius: 0 0 var(--radius) var(--radius); }
.grid-wrap { border: 1px solid var(--navy); border-radius: var(--radius); margin-bottom: 18px; }
.grid-wrap > .toolbar { border-radius: 0; }

/* ---------- tabulky ---------- */
.table-scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th {
  background: var(--blue) url(img/bg-b0c1de.png); color: #333; text-align: left; padding: 5px 8px;
  border-bottom: 1px solid var(--blue-border); border-right: 1px solid #c3cfe3; white-space: nowrap; font-size: 12px;
}
table.grid td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tbody tr:hover td { background-color: #fbfbc6; }
table.grid tr.row-nova td { background: var(--row-nova); }
table.grid tr.row-prijato td { background: var(--row-prijato); }
table.grid tr.row-hotovo td { background: var(--row-hotovo); }
table.grid tr.row-zruseno td { color: #9aa3ad; text-decoration: line-through; }
table.grid tr.row-sum td { font-weight: bold; background: #f1f4f9; border-top: 2px solid var(--blue-border); }
table.grid tbody tr.row-nova:hover td, table.grid tbody tr.row-prijato:hover td, table.grid tbody tr.row-hotovo:hover td { filter: brightness(.96); }
table.grid td.actions { text-align: right; white-space: nowrap; width: 1%; }
table.grid td.num, table.grid th.num { text-align: right; white-space: nowrap; }
table.grid td.empty { text-align: center; color: var(--muted); padding: 20px; }
table.grid a.rowlink { font-weight: bold; text-decoration: none; }
.prijem { color: #3b7a0a; font-weight: bold; }
.vydej { color: #c81d35; font-weight: bold; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--muted); margin: -10px 0 16px; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 1px solid #aab; margin-right: 5px; vertical-align: -2px; }
.legend .l-nova::before { background: var(--row-nova); }
.legend .l-prijato::before { background: var(--row-prijato); }
.legend .l-hotovo::before { background: var(--row-hotovo); }
.legend .l-vydano::before { background: #fff; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--dark) url(img/bg-35414f.png); color: var(--dark-text); padding: 6px 10px; }
.pager-links { display: flex; gap: 4px; align-items: center; }
.pager-current { padding: 0 8px; }

/* ---------- formuláře ---------- */
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=time], select, textarea {
  font: 13px Verdana, Geneva, sans-serif; color: #222; padding: 5px 7px; border: 1px solid #a9b4c4; border-radius: var(--radius); background: #fff; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--lime); outline-offset: 0; border-color: var(--lime-dark); }
textarea { width: 100%; min-height: 80px; resize: vertical; }
.form { max-width: 820px; }
.form-row { display: grid; grid-template-columns: 190px 1fr; gap: 6px 14px; align-items: start; padding: 6px 0; }
.form-row > label, .form-row > .label { font-weight: bold; padding-top: 5px; }
.form-row input[type=text], .form-row input[type=email], .form-row input[type=tel], .form-row input[type=password], .form-row select { width: 100%; max-width: 420px; }
.form-row input.short { max-width: 160px; }
.form-row .hint { color: var(--muted); font-size: 11px; }
.form-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.form-actions .left { display: flex; gap: 8px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 5px; }
.radio-row label, .check { font-weight: normal; cursor: pointer; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; }
legend { font-weight: bold; padding: 0 6px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.inline-form label { display: flex; flex-direction: column; gap: 3px; font-weight: bold; font-size: 12px; }

/* našeptávač zákazníků */
.ac-wrap { position: relative; max-width: 420px; }
.ac-wrap input { width: 100%; }
.ac-list { position: absolute; z-index: 50; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--navy); border-top: 0; max-height: 280px; overflow-y: auto; box-shadow: 0 6px 16px rgba(0,0,0,.15); }
.ac-item { padding: 6px 9px; cursor: pointer; border-bottom: 1px solid #eef0f4; }
.ac-item small { display: block; color: var(--muted); }
.ac-item:hover, .ac-item.active { background: var(--lime); }
.ac-chosen { margin-top: 6px; padding: 7px 10px; background: #f3f6fb; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- detail (dva sloupce) ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.detail-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
table.info { width: 100%; border-collapse: collapse; }
table.info th { text-align: left; width: 180px; padding: 4px 10px 4px 0; vertical-align: top; color: var(--muted); font-weight: bold; }
table.info td { padding: 4px 0; vertical-align: top; }
.status { display: inline-block; padding: 2px 10px; border-radius: 10px; font-weight: bold; font-size: 12px; border: 1px solid rgba(0,0,0,.15); }
.status-0 { background: var(--row-nova); }
.status-1 { background: var(--row-prijato); }
.status-3 { background: var(--row-hotovo); }
.status-10 { background: #fff; }
.big-price { font-size: 20px; font-weight: bold; color: var(--navy); }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile { border: 1px solid var(--navy); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.tile-head { background: var(--dark) url(img/bg-35414f.png); color: var(--dark-text); padding: 6px 10px; font-weight: bold; }
.tile-body { display: flex; gap: 12px; padding: 12px; align-items: flex-start; flex: 1; }
.tile-body img { width: 64px; height: 64px; flex: none; }
.tile-body ul { list-style: none; margin: 0; padding: 0; }
.tile-body li { margin-bottom: 4px; }
.tile-body li a { text-decoration: none; }
.tile-body li a:hover { text-decoration: underline; }
.tile .btn { margin-bottom: 8px; }
.stat { font-size: 12px; color: var(--muted); }
.stat strong { color: var(--navy); }

/* ---------- podzáložky v modulu ---------- */
.subnav { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 14px; border-bottom: 2px solid var(--dark); }
.subtab { padding: 5px 12px; text-decoration: none; font-weight: bold; color: #333; background: #e8edf5; border: 1px solid #c3cfe3; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.subtab:hover { background: var(--lime); }
.subtab.active { background: var(--dark) url(img/bg-35414f.png); color: var(--dark-text); border-color: var(--dark); }

/* souhrn pokladny */
.summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.summary-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; min-width: 160px; background: #f8fafc; }
.summary-box .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.summary-box .value { font-size: 17px; font-weight: bold; }
.summary-box.main { background: var(--lime) url(img/bg-ccd232.png); border-color: var(--lime-dark); }
.summary-box.main .label { color: #3d4205; }

/* ---------- kalendář rentu ---------- */
.cal-wrap { overflow-x: auto; border: 1px solid var(--navy); border-radius: var(--radius); }
table.cal { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 11px; }
table.cal th, table.cal td { border: 1px solid #dde3ec; padding: 2px; text-align: center; }
table.cal th { background: var(--blue) url(img/bg-b0c1de.png); font-weight: bold; }
table.cal th.we, table.cal td.we { background-color: #eef1f6; }
table.cal th.today { background: var(--magenta); color: #fff; }
table.cal td.name { text-align: left; white-space: nowrap; padding: 3px 8px; font-weight: bold; position: sticky; left: 0; background: #fff; z-index: 1; }
table.cal td.busy { background: var(--magenta); }
table.cal td.busy a { display: block; color: #fff; text-decoration: none; min-height: 16px; }
table.cal td.busy.st-rezervace { background: #e48ac0; }
table.cal td.busy.st-vydano { background: var(--magenta); }
table.cal td.busy.st-vraceno { background: #9aa3ad; }
.month-tabs { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 10px; align-items: center; }
.month-tabs .subtab { border-bottom: 1px solid #c3cfe3; border-radius: var(--radius); }

/* ---------- spodní lišta zaměstnance ---------- */
.userbar { position: fixed; left: 0; bottom: 0; z-index: 100; display: flex; align-items: flex-end; flex-direction: column-reverse; }
.userbar-toggle {
  font: 12px Verdana, Geneva, sans-serif; cursor: pointer; padding: 6px 14px; border: 1px solid var(--navy); border-bottom: 0;
  background: var(--dark) url(img/bg-35414f.png); color: var(--dark-text); border-radius: 0 var(--radius) 0 0;
}
.userbar-toggle strong { color: #fff; }
.userbar-menu { background: var(--blue) url(img/bg-b0c1de.png); border: 1px solid var(--blue-border); padding: 10px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-radius: 0 var(--radius) 0 0; }
.userbar-role { font-weight: bold; margin-right: 6px; }

/* ---------- přihlášení / instalace ---------- */
body.plain { background: #eef1f6; padding: 0; }
.plain-wrap { max-width: 720px; margin: 30px auto; padding: 0 12px; }
.plain-logo { text-align: center; margin-bottom: 10px; }
.login-box { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.login-users { border-right: 1px solid var(--line); max-height: 330px; overflow-y: auto; padding: 8px; }
.login-user { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: #fff; border: 1px solid #cfcfcf; border-radius: var(--radius); padding: 5px; margin-bottom: 5px; cursor: pointer; font: 12px Verdana, Geneva, sans-serif; color: var(--text); }
.login-user img { width: 40px; height: 40px; }
.login-user strong { display: block; font-size: 13px; }
.login-user:hover, .login-user.active { background: var(--lime); border-color: var(--lime-dark); }
.login-form { padding: 16px; }
.login-form label { display: block; font-weight: bold; margin: 8px 0 3px; }
.login-form input { width: 100%; }
.login-form .btn { margin-top: 14px; }
.login-box.single { grid-template-columns: 1fr; }

@media (max-width: 800px) {
  .inner { padding: 12px 10px; }
  .detail, .detail-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 3px; }
  .form-row > label { padding-top: 0; }
  .login-box { grid-template-columns: 1fr; }
  .login-users { border-right: 0; border-bottom: 1px solid var(--line); max-height: 200px; }
  table.info th { width: 120px; }
}
.pt { padding-top: 5px; }
table.cal td a.cal-free { display: block; min-height: 16px; text-decoration: none; }
table.cal td a.cal-free:hover { background: var(--lime); }
.month-tabs .spacer, .btn-group .spacer { flex: 1; }
.legend .l-rez::before { background: #e48ac0; }
.legend .l-vyd::before { background: var(--magenta); }
.legend .l-vra::before { background: #9aa3ad; }
.inline-form .check { flex-direction: row; align-items: center; gap: 5px; padding-bottom: 6px; }
input.w-num { width: 70px; }
table.grid tr.row-off td { background: #f3f3f3; color: #8a929c; }
.panel-head .status { color: #222; }
.legend.pt { margin: 8px 0 16px; }
.panel-head { border-radius: 2px 2px 0 0; }
.panel-foot { border-radius: 0 0 2px 2px; }
.kat-head { font-weight: bold; color: var(--magenta); margin: 8px 0 2px; }
.kat-head:first-child { margin-top: 3px; }
table.cal tr.cal-kat td.name { background: var(--dark) url(img/bg-35414f.png); color: var(--dark-text); text-align: left; }
table.grid tr.row-prijem td { background: #e6f4d9; }
table.grid tr.row-vydej td { background: #fde3e6; }
table.grid tbody tr.row-prijem:hover td { background: #d6ecc3; }
table.grid tbody tr.row-vydej:hover td { background: #f9cfd5; }
table.grid tr.row-zal-open td { background: #fde3e6; }
table.grid tr.row-zal-ok td { background: #e6f4d9; }
table.grid tbody tr.row-zal-open:hover td { background: #f9cfd5; }
table.grid tbody tr.row-zal-ok:hover td { background: #d6ecc3; }
.legend .l-zal-open::before { background: #fde3e6; }
.legend .l-zal-ok::before { background: #e6f4d9; }
textarea.mono { font-family: Consolas, "DejaVu Sans Mono", monospace; font-size: 12px; }
.legend .l-zruseno::before { background: #fff; border-style: dashed; }
.rte { border: 1px solid #a9b4c4; border-radius: var(--radius); background: #fff; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: #eef1f6; border-bottom: 1px solid #c3cfe3; }
.rte-area { min-height: 180px; max-height: 480px; overflow-y: auto; padding: 8px 12px; font-size: 12px; line-height: 1.5; outline: none; }
.rte-area:focus { box-shadow: inset 0 0 0 2px var(--lime); }
.rte-area h3 { font-size: 13px; text-align: center; margin: 8px 0 4px; }
.rte-area ul, .rte-area ol { margin: 0 0 6px; padding-left: 22px; }
.rte-area p { margin: 0 0 6px; }
.tile-body > a { flex: none; }
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btn-pair .btn { white-space: normal; text-align: center; display: flex; align-items: center; justify-content: center; line-height: 1.25; }
.panel.narrow { max-width: 760px; }
.question { font-size: 15px; margin-bottom: 14px; }
.summary-zapis { background: #f3f6fb; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-top: 10px; }
