/* Klientské centrum DRINGS */
:root {
  --brand: #006cb7;
  --brand-dark: #00548f;
  --brand-soft: #e7f1fa;
  --ink: #1d2733;
  --muted: #64707d;
  --line: #dfe4ea;
  --bg: #f4f6f9;
  --card: #fff;
  --ok: #1f8a4c;
  --ok-soft: #e4f5ea;
  --warn: #a8660b;
  --warn-soft: #fdf1dc;
  --danger: #c0352b;
  --danger-soft: #fbe7e5;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: .2rem 0 1rem; line-height: 1.25; }
h1 small { font-size: .95rem; color: var(--muted); font-weight: 500; margin-left: .4rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .75rem; }
.card h2 { margin-top: 0; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
code { background: var(--brand-soft); padding: .05em .35em; border-radius: 4px; }
code.big { font-size: 1.15rem; padding: .2em .5em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.inline { display: inline; }

/* hlavička */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none !important; }
.brand img { display: block; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-size: 1.05rem; }
.brand small { color: var(--muted); font-size: .78rem; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 600; color: var(--ink); }
.mainnav { background: var(--brand); }
.mainnav .wrap { display: flex; flex-wrap: wrap; gap: 2px; }
.mainnav a { color: #fff; padding: 11px 14px; font-weight: 500; opacity: .9; border-bottom: 3px solid transparent; }
.mainnav a:hover { opacity: 1; text-decoration: none; background: rgba(255,255,255,.08); }
.mainnav a.active { opacity: 1; border-bottom-color: #fff; background: rgba(255,255,255,.12); }
.mainnav .nav-right { margin-left: auto; }
.is-admin .mainnav { background: #24313f; }
.nav-toggle { display: none; }

.main { padding-top: 28px; padding-bottom: 48px; min-height: 60vh; }
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; padding: 18px 0 28px; background: #fff; }

/* tlačítka */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: #b9c3ce; background: #fafbfc; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #a02a21; }
.btn-sm { padding: 5px 11px; font-size: .86rem; }
.btn-lg { padding: 12px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* karty */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-danger { border-color: #f0c8c4; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .grid-2, .grid-2 + .btn, .grid-2 + .card { margin-top: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head h1 { margin-bottom: .5rem; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px; background: linear-gradient(120deg, #fff 55%, var(--brand-soft)); }
.hero h1 { margin-top: 0; }
.hero p { margin: 0; color: var(--muted); max-width: 560px; }
.auth-card { max-width: 420px; margin: 40px auto; padding: 30px; }

/* hlášky */
.alert { border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: var(--ok-soft); border-color: #b7e2c6; color: #145c33; }
.alert-error { background: var(--danger-soft); border-color: #f0c8c4; color: #8a241c; }
.alert-info { background: var(--brand-soft); border-color: #bcd7ee; color: #0b4673; }
.empty { color: var(--muted); padding: 14px 0; }

/* štítky */
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; vertical-align: middle; background: #eef1f4; color: #47525e; letter-spacing: .01em; }
.badge-latest { background: var(--ok-soft); color: var(--ok); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-private { background: #efe8fb; color: #5a35a8; }
.badge-hidden { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-db { background: #e8eef4; color: #39536d; font-size: .7rem; }
.badge-new { background: #ffefcc; color: #925d00; }

/* karty software na úvodu */
.sw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 26px; }
.sw-card { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); box-shadow: var(--shadow); border-top: 4px solid var(--brand); transition: transform .12s, box-shadow .12s; }
.sw-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(16,24,40,.1); }
.sw-name { font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: .8rem; letter-spacing: .06em; }
.sw-version { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sw-date { font-size: .84rem; color: var(--muted); }

/* aktualizace */
.releases { display: flex; flex-direction: column; gap: 10px; }
.release { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.release > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.release > summary::-webkit-details-marker { display: none; }
.release > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; width: 12px; }
.release[open] > summary::before { transform: rotate(90deg); }
.release[open] > summary { border-bottom: 1px solid var(--line); }
.release .version { font-weight: 700; font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.summary-meta { margin-left: auto; color: var(--muted); font-size: .86rem; }
.release-body { padding: 16px 18px 18px; }
pre.info { background: #f7f9fb; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; margin: 0 0 16px; font-size: .9rem; max-height: 420px; overflow: auto; }

/* tabulky */
table { width: 100%; border-collapse: collapse; }
.files th, .files td, .table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.files th, .table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.files tr:last-child td { border-bottom: 0; }
.table { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); border-collapse: separate; border-spacing: 0; overflow: hidden; margin-bottom: 20px; }
.card .table { box-shadow: none; border: 0; margin: 0; }
.table tbody tr:hover { background: #fafbfc; }
.table tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-muted td { color: var(--muted); background: #fbfbfc; }
.files td:first-child { word-break: break-all; }

/* články */
.articles { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.article { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); overflow: hidden; }
.article h3 { margin: 0 0 .2rem; font-size: 1.12rem; }
.article .meta { color: var(--muted); font-size: .84rem; margin-bottom: .6rem; display: flex; gap: 12px; }
.article-icon { float: left; max-width: 120px; margin: 0 14px 8px 0; border-radius: 6px; }
.article-img { max-width: 100%; border-radius: 6px; }
.article img { max-width: 100%; height: auto; }
.article-intro > :first-child, .article-body > :first-child { margin-top: 0; }
.article-more { clear: both; margin-top: 6px; }
.article-more > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9rem; }
.article-more[open] > summary { margin-bottom: 10px; }
.articles.compact .article { padding: 14px 18px; }
.doc-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 24px; }
.doc-list { margin: 0; padding-left: 18px; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.pager a, .pager span { min-width: 34px; text-align: center; padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.pager .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* formuláře */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; }
.form > .btn:not(.btn-block) { align-self: flex-start; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=number], input[type=date], select, textarea {
  font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid #cdd5de; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus, .editor-area:focus { outline: 2px solid rgba(0,108,183,.25); border-color: var(--brand); }
textarea { resize: vertical; }
.inline-input { width: auto !important; flex: 1; padding: 5px 8px !important; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 160px; gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.checks input[type=date] { width: auto; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 220px; width: auto; }
.toolbar select { width: auto; }
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--line); }
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0 0 10px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 600; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

.editor { border: 1px solid #cdd5de; border-radius: 8px; overflow: hidden; background: #fff; margin-top: -8px; }
.editor textarea { border: 0; border-radius: 0; font-family: ui-monospace, Consolas, monospace; font-size: .86rem; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px; background: #f4f6f9; border-bottom: 1px solid var(--line); }
.editor-bar button { font: inherit; font-size: .82rem; border: 1px solid transparent; background: none; padding: 3px 9px; border-radius: 5px; cursor: pointer; }
.editor-bar button:hover, .editor-bar button.active { background: #fff; border-color: var(--line); }
.editor-area { min-height: 130px; padding: 10px 12px; font-weight: 400; }

@media (max-width: 820px) {
  .grid-2, .row-2, .row-3 { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; font: inherit; font-weight: 600; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
  .userbox { margin-left: auto; }
  .brand small { display: none; }
  .mainnav { display: none; }
  .mainnav.open { display: block; }
  .mainnav .wrap { flex-direction: column; }
  .mainnav .nav-right { margin-left: 0; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .summary-meta { margin-left: 22px; width: 100%; }
  .files th:nth-child(3), .files td:nth-child(3) { display: none; }
  .table { display: block; overflow-x: auto; }
}
@media (max-width: 520px) {
  .brand span { display: none; }
  .user-name { display: none; }
  .userbox { order: 2; }
  .nav-toggle { order: 3; margin-left: 8px; }
  .topbar-inner { gap: 8px; }
  .brand { margin-right: auto; }
}
