/* KX Sandbox – společný vzhled administrace a portálu (bez buildu, bez CDN) */
:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #1d2330; --muted: #667085; --line: #e3e6eb;
  --brand: #1f5eff; --brand-ink: #fff; --ok: #12805c; --warn: #b54708; --bad: #c4320a;
  --side: #121826; --side-ink: #c9d1e1; --side-active: #1f2a40; --radius: 4px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }

/* rozložení */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 14px 0; display: flex; flex-direction: column; }
.side .brand { color: #fff; font-weight: 700; font-size: 15px; padding: 4px 18px 14px; letter-spacing: .2px; }
.side .brand small { display: block; color: #7d8aa5; font-weight: 500; font-size: 11.5px; letter-spacing: .4px; text-transform: uppercase; }
.side nav a { display: block; color: var(--side-ink); padding: 7px 18px; border-left: 3px solid transparent; }
.side nav a:hover { background: var(--side-active); text-decoration: none; color: #fff; }
.side nav a.active { background: var(--side-active); border-left-color: var(--brand); color: #fff; }
.side nav .sep { margin: 10px 18px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #6b7894; }
.side .foot { margin-top: auto; padding: 10px 18px; font-size: 12px; color: #7d8aa5; }
.side .foot form { display: inline; }
.side .foot button { background: none; border: 0; color: #9fb0d0; cursor: pointer; padding: 0; font: inherit; }
.main { padding: 20px 24px 40px; min-width: 0; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.head h1 { font-size: 19px; margin: 0; }
.head .sub { color: var(--muted); font-size: 13px; }

/* panely a mřížky */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.panel > h2, .panel > .ph { font-size: 13.5px; margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel .pb { padding: 12px 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.stat .v { font-size: 22px; font-weight: 650; margin-top: 2px; }
.stat .s { color: var(--muted); font-size: 12px; }

/* tabulky */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 18px 14px; text-align: center; }

/* formuláře */
label { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid #cfd4dc; border-radius: var(--radius); font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #c7d6ff; border-color: var(--brand); }
.field { margin-bottom: 10px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius); border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(.95); text-decoration: none; }
.btn.sec { background: #fff; color: var(--ink); border-color: #cfd4dc; }
.btn.danger { background: #fff; color: var(--bad); border-color: #f1b9a7; }
.btn.sm { padding: 4px 8px; font-size: 12.5px; }
.inline { display: inline; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* štítky a hlášky */
.tag { display: inline-block; padding: 1px 7px; border-radius: var(--radius); font-size: 12px; font-weight: 550; background: #eef1f5; color: #344054; }
.tag.ok { background: #e3f6ee; color: var(--ok); }
.tag.warn { background: #fdf0e3; color: var(--warn); }
.tag.bad { background: #fde8e3; color: var(--bad); }
.tag.info { background: #e8efff; color: var(--brand); }
.flash { padding: 9px 12px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: #e9f8f1; border-color: #a8e0c8; color: #0b5c41; }
.flash.err { background: #fdeee9; border-color: #f4b8a6; color: #8a2408; }
.secret { font-family: var(--mono); background: #101828; color: #d1fadf; padding: 9px 11px; border-radius: var(--radius); word-break: break-all; margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* konzole */
.console { background: #0b1020; color: #d7e0f0; border-radius: var(--radius); padding: 10px 12px; min-height: 160px; max-height: 420px; overflow: auto; white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; }
.console .err { color: #ffb4a2; }
.console .meta { color: #7f8db0; }
pre.code { background: #101828; color: #e4e7ec; padding: 10px 12px; border-radius: var(--radius); overflow: auto; margin: 6px 0 10px; }

/* přihlášení */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .box { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.auth h1 { font-size: 18px; margin: 0 0 4px; }
.auth .sub { color: var(--muted); margin-bottom: 16px; }

/* graf spotřeby (sloupce) */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 6px 0; }
.bars .b { flex: 1; max-width: 32px; background: #c7d6ff; border-radius: 2px 2px 0 0; min-height: 1px; position: relative; }
.bars .b:hover { background: var(--brand); }
.bars-x { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; }
  .side nav { display: flex; flex-wrap: wrap; }
  .side nav .sep { display: none; }
  .side .foot { margin: 0 0 0 auto; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  th, td { padding: 6px 8px; }
}
