/* ServerHealth — tokeny z design systému TaskTracker_prace */
:root {
  color-scheme: light;
  --bg: #f6f5f1; --side: #efede6; --card: #ffffff; --hover: #f0efe9;
  --line: #e2dfd6; --line2: #edebe4;
  --txt: #17211c; --muted: #4b5851; --faint: #66726b;
  --acc: #0e3a2f; --acc-h: #155443; --acc-ink: #ffffff; --acc2: #78faae; --acc-soft: #e6f1ea;
  --late: #a61f17; --late-bg: #fbe8e5; --soon: #8a4a00; --soon-bg: #fcefd9;
  --ok: #1f6b36; --ok-bg: #e3f2e7; --info: #1a4fb5; --info-bg: #e8f0fb;
  --m-late: #c9423a; --m-soon: #e09a2b; --m-ok: #7fbf98; --m-none: #aab6ae;
  --sh1: 0 1px 2px rgba(23,33,28,.06); --sh2: 0 10px 30px -12px rgba(23,33,28,.28);
  --focus: 0 0 0 3px rgba(14,58,47,.28);
  --sans: "Aptos","Segoe UI Variable Text","Segoe UI",system-ui,sans-serif;
  --display: "Aptos Display","Segoe UI Variable Display","Segoe UI",system-ui,sans-serif;
  --serif: "Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  --mono: "Cascadia Mono",Consolas,ui-monospace,monospace;
  --r1: 6px; --r2: 10px; --r3: 12px; --pill: 999px;
  --dw: 460px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141a17; --side: #101512; --card: #1a211d; --hover: #212a25;
    --line: #2a342f; --line2: #222b26;
    --txt: #e6ece8; --muted: #b0bcb5; --faint: #8f9b94;
    --acc: #7ccc9c; --acc-h: #98d9b2; --acc-ink: #0f1814; --acc-soft: #203128;
    --late: #ff9d93; --late-bg: #3a1f1c; --soon: #f0b867; --soon-bg: #35280f;
    --ok: #8fd6a4; --ok-bg: #1c3324; --info: #9dc0f0; --info-bg: #22324a;
    --sh1: none; --sh2: 0 12px 32px -12px rgba(0,0,0,.6);
    --focus: 0 0 0 3px rgba(124,204,156,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141a17; --side: #101512; --card: #1a211d; --hover: #212a25;
  --line: #2a342f; --line2: #222b26;
  --txt: #e6ece8; --muted: #b0bcb5; --faint: #8f9b94;
  --acc: #7ccc9c; --acc-h: #98d9b2; --acc-ink: #0f1814; --acc-soft: #203128;
  --late: #ff9d93; --late-bg: #3a1f1c; --soon: #f0b867; --soon-bg: #35280f;
  --ok: #8fd6a4; --ok-bg: #1c3324; --info: #9dc0f0; --info-bg: #22324a;
  --sh1: none; --sh2: 0 12px 32px -12px rgba(0,0,0,.6);
  --focus: 0 0 0 3px rgba(124,204,156,.35);
}

@layer base, app;

@layer base {
  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body { margin: 0; background: var(--bg); color: var(--txt); font: 14px/1.45 var(--sans); }
  ::selection { background: var(--acc-soft); color: var(--txt); }
  a { color: var(--info); text-underline-offset: 3px; }
  button, input, select { font: inherit; color: inherit; }
  :focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r1); }
  .num { font-variant-numeric: tabular-nums; }
  .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; flex: none; }
  * { scrollbar-color: var(--line) transparent; }
  @media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
}

@layer app {
  .top { display: flex; align-items: center; gap: 10px; padding: 14px 28px;
         border-bottom: 1px solid var(--line2); background: var(--side); }
  .brand { display: flex; align-items: center; gap: 10px; font: 650 15px/1 var(--display);
           letter-spacing: -.01em; }
  .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--acc);
          display: grid; place-items: center; }
  .mark i { width: 8px; height: 8px; border-radius: 50%; background: var(--acc2); }
  .top .sp { flex: 1; }
  .stamp { color: var(--muted); font-size: 12.5px; }

  .btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
         border-radius: var(--r1); border: 1px solid var(--line); background: var(--card);
         cursor: pointer; transition: background .15s var(--ease); }
  .btn:hover { background: var(--hover); }
  .btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
  .btn.ghost:hover { background: var(--hover); color: var(--txt); }
  .btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 600; }
  .btn.pri:hover { background: var(--acc-h); }
  .btn.sm { height: 26px; padding: 0 8px; font-size: 12.5px; }
  .btn:disabled { opacity: .55; cursor: default; }

  .wrap { display: flex; align-items: flex-start; }
  main { flex: 1; min-width: 0; padding: 28px 28px 48px; container-type: inline-size; }
  .inner { max-width: 1180px; margin: 0 auto; display: grid; gap: 28px; }

  .head { font: 400 34px/1.2 var(--serif); letter-spacing: -.015em; margin: 4px 0 0;
          max-width: 30ch; text-wrap: balance; }
  .head b { font-weight: 400; box-shadow: inset 0 -.32em 0 color-mix(in oklab, var(--acc2) 70%, transparent); }
  .head b.bad { color: var(--late); box-shadow: none; }
  .note { color: var(--muted); margin: 10px 0 0; }
  .note.err { color: var(--late); }

  /* měřidla VPS: jeden panel, sloupce oddělené čarou */
  .meters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--card);
            border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--sh1); }
  .meter { padding: 14px 16px; border-left: 1px solid var(--line2); display: grid; gap: 6px; }
  .meter:first-child { border-left: 0; }
  .meter .l { font-size: 12.5px; font-weight: 650; color: var(--muted); }
  .meter .v { font: 650 22px/1.1 var(--display); font-variant-numeric: tabular-nums; }
  .meter .s { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
  .bar { height: 6px; border-radius: var(--pill); background: var(--line2); overflow: hidden; }
  .bar > i { display: block; height: 100%; border-radius: inherit; background: var(--m-ok); }
  .bar > i.soon { background: var(--m-soon); } .bar > i.late { background: var(--m-late); }
  .bar > i.neutral { background: var(--m-none); }
  @container (max-width: 760px) {
    .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .meter { border-left: 0; border-top: 1px solid var(--line2); }
    .meter:nth-child(-n+2) { border-top: 0; }
    .meter:nth-child(2n) { border-left: 1px solid var(--line2); }
    .head { font-size: 28px; }
  }

  section > h2 { font: 650 18px/1.2 var(--display); margin: 0 0 12px; display: flex;
                 align-items: baseline; gap: 10px; }
  section > h2 small { font: 400 12.5px var(--sans); color: var(--faint); }

  .alerts { display: grid; gap: 8px; }
  .alert { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px;
           border-radius: var(--r2); background: var(--soon-bg); color: var(--soon); }
  .alert.critical { background: var(--late-bg); color: var(--late); }
  .alert .m { flex: 1; font-weight: 600; }
  .alert .t { font-size: 12.5px; opacity: .9; }
  .alert .btn { color: var(--txt); }

  .list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r2);
          box-shadow: var(--sh1); overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; }
  th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px;
       border-bottom: 1px solid var(--line); white-space: nowrap; }
  td { padding: 10px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
  tr:last-child td { border-bottom: 0; }
  th.r, td.r { text-align: right; font-variant-numeric: tabular-nums; }
  tbody tr { cursor: pointer; transition: background .15s var(--ease); }
  tbody tr:hover { background: var(--hover); }
  tbody tr.sel { background: var(--acc-soft); }
  .nm { font-weight: 600; }
  .dm { font-size: 12.5px; color: var(--faint); }
  .empty { padding: 28px 16px; color: var(--muted); text-align: center; }

  .pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
          border-radius: var(--pill); font-size: 11.5px; font-weight: 600; white-space: nowrap;
          background: var(--line2); color: var(--muted); }
  .pill.ok { background: var(--ok-bg); color: var(--ok); }
  .pill.soon { background: var(--soon-bg); color: var(--soon); }
  .pill.late { background: var(--late-bg); color: var(--late); }
  .tone-late { color: var(--late); font-weight: 650; }
  .tone-soon { color: var(--soon); font-weight: 650; }
  .tone-ok { color: var(--ok); }
  .faint { color: var(--faint); }

  .cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; }
  @container (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

  .disk { display: grid; gap: 12px; padding: 16px; }
  .drow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .drow .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .drow .b { grid-column: 1 / -1; }
  .drow .k { grid-column: 1 / -1; font-size: 12.5px; color: var(--faint); }
  .reclaim { padding: 12px 16px; border-top: 1px solid var(--line2); color: var(--muted); }

  .chart { padding: 14px 16px 10px; display: grid; gap: 14px; }
  .ch .hd { display: flex; justify-content: space-between; font-size: 12.5px; }
  .ch .hd b { font-weight: 650; color: var(--muted); }
  .ch svg { display: block; width: 100%; height: 56px; }
  .ch .ax { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); }

  .events { list-style: none; margin: 0; padding: 0; }
  .events li { display: flex; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line2); }
  .events li:last-child { border-bottom: 0; }
  .events time { flex: none; width: 92px; font-size: 12.5px; color: var(--faint);
                 font-variant-numeric: tabular-nums; }

  /* detail portálu, dokovaný vpravo */
  .drawer { width: var(--dw); flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto;
            background: var(--card); border-left: 1px solid var(--line); padding: 20px 20px 40px;
            display: grid; align-content: start; gap: 18px; }
  .drawer[hidden] { display: none; }
  .drawer h3 { font: 650 19px/1.3 var(--display); letter-spacing: -.015em; margin: 0; }
  .dhead { display: flex; gap: 8px; align-items: flex-start; }
  .dhead > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
  .blk { display: grid; gap: 8px; }
  .blk > h4 { margin: 0; font-size: 12.5px; font-weight: 650; color: var(--muted); }
  .facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
  .facts dt { color: var(--muted); font-size: 12.5px; }
  .facts dd { margin: 0; font-variant-numeric: tabular-nums; }
  .ctr { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: var(--r1); }
  .ctr .r1 { display: flex; gap: 8px; align-items: center; }
  .ctr .r1 b { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ctr .r2 { font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  pre.logs { margin: 0; max-height: 340px; overflow: auto; padding: 10px; border-radius: var(--r1);
             background: var(--bg); border: 1px solid var(--line2); font: 12px/1.4 var(--mono);
             white-space: pre-wrap; word-break: break-all; }
  select { height: 30px; border: 1px solid var(--line); border-radius: var(--r1); background: var(--card);
           padding: 0 8px; max-width: 100%; }
  @media (max-width: 1180px) {
    .drawer { position: fixed; right: 0; top: 0; z-index: 10; box-shadow: var(--sh2);
              width: min(var(--dw), 100vw); }
  }
  @media (max-width: 640px) {
    .top { padding: 12px 16px; } main { padding: 20px 16px 40px; }
    .hide-sm { display: none; }
  }

  .skel { color: transparent; background: var(--line2); border-radius: var(--r1); }

  /* přihlášení */
  .login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
  .login form { width: min(360px, 100%); display: grid; gap: 14px; padding: 24px;
                background: var(--card); border: 1px solid var(--line); border-radius: var(--r3);
                box-shadow: var(--sh1); }
  .login h1 { font: 650 22px/1.2 var(--display); letter-spacing: -.02em; margin: 0; }
  .login label { display: grid; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
  .login input { height: 36px; border: 1px solid var(--line); border-radius: var(--r1);
                 background: var(--card); padding: 0 10px; }
  .login input:focus { outline: none; box-shadow: var(--focus); border-color: var(--acc); }
  .login .btn.pri { height: 36px; justify-content: center; }
}
