/* Grainshop panel – vzhled */
:root {
  --teal: #014040; --teal-2: #0b5c55; --green: #32BE87; --green-dark: #23996b; --mint: #CDECD2; --mint-light: #F3F8F5;
  --sun: #FFDC6E; --red: #e25555; --orange: #E9A04B; --blue: #4C8DF6; --violet: #8B6CF6;
  --text: #17302d; --muted: #66807b; --line: #e3ece6; --bg: #f1f6f3; --card: #ffffff;
  --radius: 16px; --shadow: 0 1px 2px rgba(1,64,64,.05), 0 6px 20px rgba(1,64,64,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--teal-2); }
img, svg { max-width: 100%; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; background: #eef4f0; padding: 1px 6px; border-radius: 6px; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -3px; }

/* ---------- hlavička ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: linear-gradient(110deg, #013535 0%, #014040 55%, #0b5c55 100%); color: #fff; box-shadow: 0 2px 12px rgba(1,40,40,.18); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { background: #fff; border-radius: 9px; padding: 3px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; font-size: 1.05rem; }
.brand-txt small { font-weight: 400; opacity: .7; font-size: .72rem; letter-spacing: .02em; }
.top-user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; }
.who { display: flex; flex-direction: column; line-height: 1.15; font-size: .85rem; }
.who em { font-style: normal; opacity: .7; font-size: .75rem; }
.top-user form { margin: 0; }
.btn-icon { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 10px; padding: 8px 12px; cursor: pointer; font: inherit; font-size: .85rem; }
.btn-icon:hover { background: rgba(255,255,255,.22); }

/* ---------- rozvržení + boční menu ---------- */
.shell { display: flex; align-items: flex-start; max-width: 1360px; margin: 0 auto; }
.side { position: sticky; top: 64px; flex: 0 0 230px; padding: 20px 10px 20px 16px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; font-size: .93rem; }
.side-nav a .ic { width: 19px; height: 19px; color: var(--muted); }
.side-nav a:hover { background: #e4efe8; }
.side-nav a.active { background: var(--teal); color: #fff; box-shadow: 0 4px 14px rgba(1,64,64,.25); }
.side-nav a.active .ic { color: var(--sun); }
.wrap { flex: 1; min-width: 0; padding: 20px 20px 40px; }
.page-title { font-size: 1.45rem; margin: 4px 0 16px; color: var(--teal); letter-spacing: -.01em; }
.foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)); }

/* ---------- karty ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card h1, .card h2, .card h3 { margin: 0 0 10px; color: var(--teal); }
.card h2, .section-head h2 { font-size: 1.12rem; display: flex; align-items: center; gap: 8px; }
.card h2 .ic, .section-head h2 .ic { color: var(--green-dark); width: 20px; height: 20px; }
.card h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 16px; }
.card-head, .section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2, .section-head h2 { margin: 0; }
.section-head { margin: 6px 2px 12px; }
.section-head h2 { color: var(--teal); }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.right { text-align: right; }

/* ---------- ukazatele a statistiky ---------- */
.grid { display: grid; gap: 16px; }
.grid.gauges { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 18px; }
.grid.gauges .card { margin: 0; }
.gauge-card { display: flex; align-items: center; gap: 16px; }
.gauge { position: relative; width: 86px; height: 86px; flex: 0 0 86px; }
.ring { width: 86px; height: 86px; }
.ring-bg { fill: none; stroke: #e8f0eb; stroke-width: 10; }
.ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring-fg.ok { stroke: var(--green); } .ring-fg.warn { stroke: var(--orange); } .ring-fg.bad { stroke: var(--red); }
.gauge-val { position: absolute; inset: 0; display: grid; place-items: center; }
.gauge-val strong { font-size: 1.35rem; color: var(--teal); } .gauge-val small { font-size: .7rem; margin-left: 1px; color: var(--muted); }
.gauge-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gauge-label { display: flex; align-items: center; gap: 7px; font-weight: 700; color: var(--teal); }
.gauge-label .ic { color: var(--green-dark); }
.stat-card { display: flex; gap: 14px; align-items: center; }
.stat-card > div { display: flex; flex-direction: column; gap: 2px; }
.stat-ic { width: 52px; height: 52px; border-radius: 14px; background: #e6f6ee; color: var(--green-dark); display: grid; place-items: center; flex: 0 0 52px; }
.stat-ic .ic { width: 26px; height: 26px; }
.big { font-size: 1.5rem; font-weight: 700; color: var(--teal); }

/* ---------- grafy ---------- */
.charts-wrap { margin-bottom: 8px; }
.grid.charts { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: 18px; }
.grid.charts .card { margin: 0; }
.chart { padding: 14px 16px 10px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; color: var(--teal); margin-bottom: 4px; }
.chart-head strong { font-size: 1.15rem; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .grid { stroke: #e8f0eb; stroke-width: 1; }
.chart-svg .axis { fill: #8aa19c; font-size: 11px; font-family: inherit; }
.chart-svg .area { opacity: .16; } .chart-svg .line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.c1 .area { fill: var(--green); } .c1 .line { stroke: var(--green-dark); }
.c2 .area { fill: var(--blue); } .c2 .line { stroke: var(--blue); }
.c3 .area { fill: var(--orange); } .c3 .line { stroke: var(--orange); }
.c4 .area { fill: var(--violet); } .c4 .line { stroke: var(--violet); }
.chart-foot { margin-top: 2px; }
.chart-empty { padding: 30px 0; text-align: center; }

/* ---------- dlaždice služeb ---------- */
.grid.tiles { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.tile:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(1,64,64,.1); }
.tile-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 40px; background: #e6f6ee; color: var(--green-dark); }
.tile.bad .tile-ic { background: #fdeaea; color: var(--red); }
.tile-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.tile-txt strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.pill.ok { background: #e1f6ec; color: #14794f; } .pill.bad { background: #fde4e4; color: #b42c2c; }

/* ---------- prvky ---------- */
.bar { height: 8px; background: #e8efea; border-radius: 99px; overflow: hidden; margin: 6px 0; min-width: 80px; }
.bar-fill { height: 100%; width: 0; border-radius: 99px; }
.bar-fill.ok { background: var(--green); } .bar-fill.warn { background: var(--orange); } .bar-fill.bad { background: var(--red); }
.services { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.services.dns { flex-direction: column; gap: 6px; }
.services em { color: var(--muted); font-style: normal; font-size: .85rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; flex: 0 0 auto; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(50,190,135,.18); } .dot.bad { background: var(--red); box-shadow: 0 0 0 3px rgba(226,85,85,.18); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: #f8fbf9; }
thead th:first-child { border-top-left-radius: 10px; } thead th:last-child { border-top-right-radius: 10px; }
tbody tr:hover td { background: #fafcfb; }
tr:last-child td { border-bottom: 0; }
table.records td { font-size: .88rem; }
.wrap-code { word-break: break-all; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--green); color: #fff; font-weight: 700; padding: 9px 16px; border-radius: 11px; cursor: pointer; text-decoration: none; font-size: .9rem; font-family: inherit; box-shadow: 0 2px 8px rgba(50,190,135,.25); }
.btn:hover { background: var(--green-dark); }
.btn-small { padding: 7px 12px; font-size: .83rem; }
.btn-ghost { background: #eef4f0; color: var(--teal); box-shadow: none; }
.btn-ghost:hover { background: var(--mint); }
.btn-danger { background: var(--red); box-shadow: 0 2px 8px rgba(226,85,85,.25); } .btn-danger:hover { background: #c43c3c; }
.btn-link { background: none; border: 0; padding: 0; color: var(--teal-2); text-decoration: underline; cursor: pointer; font: inherit; }
.btn-link.danger { color: var(--red); }
input, select { font: inherit; padding: 9px 11px; border: 1px solid #cfdcd3; border-radius: 10px; background: #fff; min-width: 0; color: var(--text); }
input:focus, select:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px rgba(50,190,135,.18); }
label { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; color: var(--muted); font-weight: 600; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.create-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.addr { display: flex; align-items: center; gap: 4px; color: var(--text); }
.addr input { width: 160px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin: 10px 0 0; }
details.actions { display: inline-block; text-align: left; }
details.actions > summary { list-style: none; }
details.actions > summary::-webkit-details-marker { display: none; }
.actions-body { margin-top: 8px; padding: 14px; background: #f6faf7; border: 1px solid var(--line); border-radius: 12px; min-width: 290px; }
.actions-body form { margin: 0 0 10px; }
.danger-zone { border-color: #f4cfcf; }
.danger-zone label { color: var(--red); }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--teal); color: #fff; margin-left: 6px; vertical-align: middle; }
.badge-alt { background: var(--sun); color: var(--teal); }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: #e7f7ef; border-color: #bfe6d0; color: #145c3c; }
.flash-error { background: #fdeeee; border-color: #f2caca; color: #8a2424; }
.flash-secret { background: #fff8db; border-color: var(--sun); display: flex; flex-direction: column; gap: 6px; }
code.secret { font-size: 1.15rem; padding: 6px 10px; background: #fff; border: 1px dashed var(--orange); cursor: pointer; user-select: all; align-self: flex-start; }
.crumbs { margin: -8px 0 12px; color: var(--muted); font-size: .9rem; }
.login { max-width: 420px; margin: 40px auto; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.login .btn { align-self: flex-start; }
ul.plain { padding-left: 18px; }
form.inline { display: inline; }
details > summary { cursor: pointer; color: var(--teal-2); font-weight: 600; }
.grid.kv { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 12px; }
.grid.kv > div { background: #f6faf7; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.seg { display: inline-flex; background: #eaf2ed; border-radius: 11px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 12px; text-decoration: none; font-size: .84rem; border-radius: 9px; color: var(--teal); font-weight: 600; }
.seg a.active { background: #fff; box-shadow: 0 1px 4px rgba(1,64,64,.12); }
.log { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; background: #0f2626; color: #d6e6e0; border-radius: 12px; padding: 10px 12px; max-height: 70vh; overflow: auto; }
.log div { white-space: pre-wrap; word-break: break-all; padding: 1px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.log .l-err { color: #ff9b9b; } .log .l-warn { color: #ffd98a; }
.logs-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.logs-layout > .card { margin: 0; min-width: 0; }
.log-menu .log-group { margin-bottom: 12px; display: flex; flex-direction: column; gap: 2px; }
.log-menu a { display: block; padding: 6px 9px; border-radius: 9px; text-decoration: none; font-size: .9rem; }
.log-menu a.active, .log-menu a:hover { background: var(--mint); }
.ext-list { columns: 2 280px; padding-left: 18px; margin: 0; } .ext-list li { break-inside: avoid; margin-bottom: 3px; }
details.pool { padding: 10px 0; border-bottom: 1px dashed var(--line); }
details.pool > summary { font-size: 1.02rem; }
.php-table td { vertical-align: middle; }
.php-table input { width: 110px; }
.aliases { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.health { border-left: 5px solid var(--green); }
.health.bad { border-left-color: var(--red); background: #fffafa; }
.health.warn { border-left-color: var(--orange); background: #fffcf5; }
.dot.warn { background: var(--orange); box-shadow: 0 0 0 3px rgba(233,160,75,.2); }
.health .ai { background: #f6faf7; border-radius: 10px; padding: 9px 12px; margin: 8px 0; }
.settings { display: flex; flex-direction: column; gap: 10px; max-width: 540px; margin: 12px 0; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: .92rem; font-weight: 500; }
label.check input { width: auto; accent-color: var(--green); }
.settings .btn { align-self: flex-start; }
.toc { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.toc a { white-space: nowrap; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; text-decoration: none; }
.ipban { display: inline-flex; gap: 6px; align-items: center; margin: 0 8px 4px 0; }
.mfa-setup { max-width: 640px; margin: 20px auto; }
.steps { padding-left: 20px; } .steps li { margin-bottom: 12px; }
.qr { margin: 10px 0; } .qr img { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.tabs { display: none; }

/* ================= mobil a tablet ================= */
@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: sticky; top: 56px; z-index: 15; padding: 8px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .side-nav { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 6px; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { flex: 0 0 auto; padding: 8px 12px; background: #fff; border: 1px solid var(--line); white-space: nowrap; font-size: .88rem; }
  .side-nav a.active { border-color: var(--teal); }
}
@media (max-width: 760px) {
  .wrap { padding: 14px 12px 32px; }
  .top { padding: 9px 12px; }
  .who { display: none; }
  .btn-icon span { display: none; }
  .page-title { font-size: 1.25rem; margin: 2px 0 12px; }
  .card { padding: 14px; border-radius: 14px; margin-bottom: 14px; }
  .card-head, .section-head { flex-direction: column; align-items: stretch; }
  .card-head > .seg, .card-head > div, .card-head > a.btn, .section-head > .seg { align-self: flex-start; }
  .grid.gauges { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gauge-card { flex-direction: column; text-align: center; gap: 8px; padding: 14px 10px; }
  .gauge-txt { align-items: center; } .gauge, .ring { width: 74px; height: 74px; flex-basis: 74px; }
  .stat-card { grid-column: 1 / -1; }
  .grid.charts { grid-template-columns: 1fr; gap: 12px; }
  .grid.tiles { grid-template-columns: 1fr; gap: 8px; }
  .grid.kv { grid-template-columns: 1fr 1fr; gap: 8px; }
  .table-wrap { overflow: visible; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { display: none; }
  table.stack tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; background: #fff; }
  table.stack td { border: 0; padding: 5px 0; text-align: left; }
  table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 1px; font-weight: 700; }
  table.stack td.right { text-align: left; padding-top: 8px; }
  table.stack td:empty { display: none; }
  table.stack td[data-label=""]::before { display: none; }
  table.php-table, table.php-table tbody, table.php-table tr, table.php-table td { display: block; width: 100%; }
  table.php-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.php-table td { border: 0; padding: 3px 0; }
  .bar { min-width: 0; }
  details.actions { display: block; width: 100%; }
  details.actions > summary { display: inline-flex; }
  .actions-body { min-width: 0; width: 100%; }
  .create-form, .row, .inline-form { flex-direction: column; align-items: stretch; }
  .create-form label, .row label, .inline-form > input { width: 100%; }
  input, select { width: 100%; font-size: 16px; }
  label.check input { width: auto; }
  .addr { width: 100%; } .addr input { width: auto; flex: 1; min-width: 0; }
  .php-table input, .pool input { width: 100%; }
  .btn { padding: 11px 16px; min-height: 42px; }
  .btn-small { padding: 9px 14px; min-height: 38px; }
  .create-form .btn, .row .btn, .inline-form .btn, .login .btn, .settings .btn { width: 100%; align-self: stretch; }
  form.inline { display: inline-block; margin: 0 4px 6px 0; }
  .logs-layout { grid-template-columns: 1fr; gap: 12px; }
  .log-menu { max-height: 40vh; overflow-y: auto; }
  .log { font-size: .74rem; max-height: 60vh; padding: 8px; }
  .seg { flex-wrap: wrap; }
  .ext-list { columns: 1; }
  .login { margin: 16px auto; }
  code.secret { font-size: 1.05rem; word-break: break-all; align-self: stretch; }
}
@media (max-width: 380px) {
  .grid.gauges, .grid.kv { grid-template-columns: 1fr; }
  .brand-txt small { display: none; }
}

.c5 .area { fill: #E96631; } .c5 .line { stroke: #E96631; }
.c6 .area { fill: #0b5c55; } .c6 .line { stroke: #0b5c55; }
.stat-ic.bad { background: #fdeaea; color: var(--red); }

.proc-summary { display: flex; gap: 10px; align-items: flex-start; background: #f3faf6; border: 1px solid #d7eee1; border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; }
.proc-summary .ic { color: var(--green-dark); margin-top: 2px; }
.procs { display: flex; flex-direction: column; }
.proc { display: grid; grid-template-columns: 1fr 300px; gap: 16px; padding: 12px 2px; border-top: 1px solid var(--line); align-items: center; }
.proc:first-child { border-top: 0; }
.proc-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.proc-bars { display: flex; flex-direction: column; gap: 4px; }
.proc-bar .bar { margin: 3px 0 0; }
@media (max-width: 760px) { .proc { grid-template-columns: 1fr; gap: 8px; } }

.tile-link { text-decoration: none; color: inherit; display: block; }
.tile-link .card { height: 100%; transition: transform .12s ease, box-shadow .12s ease; border-color: #cfe7da; }
.tile-link:hover .card { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(1,64,64,.1); }
.pill.warn { background: #fff1dc; color: #9a5b00; }
.mailrow { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 12px 2px; border-top: 1px solid var(--line); }
.mailrow:first-child { border-top: 0; }
.mail-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mail-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mail-prev { overflow: hidden; text-overflow: ellipsis; }
.mail-act { display: flex; gap: 6px; align-items: flex-start; }
.mail-act form { margin: 0; }
@media (max-width: 760px) { .mailrow { grid-template-columns: 1fr; } .mail-act .btn { width: auto; } }

.map td:first-child { width: 46%; } .map code { word-break: break-all; }
@media (max-width: 760px) { .map td:first-child { width: auto; } }

/* ---------- detail grafu ---------- */
a.chart-link { display: block; color: inherit; text-decoration: none; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
a.chart-link:hover, a.chart-link:focus-visible { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(1,64,64,.12); }
.chart-open { float: right; color: var(--teal-2); font-weight: 600; opacity: .75; }
a.chart-link:hover .chart-open { opacity: 1; }
.chart-open .ic { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.crumbs { margin: 0 0 8px; font-size: .85rem; }
.graph-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.graph-tabs a { padding: 7px 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--teal); text-decoration: none; font-size: .85rem; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 2px rgba(1,64,64,.04); transition: background .12s, border-color .12s, transform .12s; }
.graph-tabs a:hover { background: var(--mint-light); border-color: var(--green); transform: translateY(-1px); }
.graph-tabs a.active { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 4px 12px rgba(1,64,64,.22); }
@media (max-width: 700px) { .graph-tabs { gap: 6px; } .graph-tabs a { padding: 6px 10px; font-size: .8rem; border-radius: 9px; } }
.graph-card { padding: 14px 16px; --gc: var(--green-dark); --gf: var(--green); }
.graph-card.c2 { --gc: var(--blue); --gf: var(--blue); }
.graph-card.c3 { --gc: var(--orange); --gf: var(--orange); }
.graph-card.c4 { --gc: var(--violet); --gf: var(--violet); }
.graph-card.c5 { --gc: #E96631; --gf: #E96631; }
.graph-card.c6 { --gc: #0b5c55; --gf: #0b5c55; }
.graph-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.graph-ranges, .graph-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.graph-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; margin-bottom: 6px; min-height: 1.4em; color: var(--muted); }
.graph-stats b { color: var(--teal); }
.graph-box { position: relative; height: 420px; }
.graph-box canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; user-select: none; }
.graph-box canvas.dragging { cursor: grabbing; }
.graph-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--teal); color: #fff; padding: 5px 9px; border-radius: 8px; font-size: .8rem; line-height: 1.3; white-space: nowrap; box-shadow: 0 4px 14px rgba(1,40,40,.25); }
.graph-tip[hidden] { display: none; }
.graph-overview { position: relative; height: 60px; margin-top: 8px; }
.graph-overview canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: ew-resize; }
.graph-help { margin: 10px 0 0; }
@media (max-width: 700px) { .graph-box { height: 300px; } .graph-card { padding: 12px; } }
.graph-tabs a .ic { width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; opacity: .85; }
.graph-events { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.graph-events h3 { margin: 0 0 6px; font-size: 1rem; }
.graph-events h3 .ic { margin-right: 6px; }
#gevents { list-style: none; margin: 0 0 6px; padding: 0; max-height: 260px; overflow-y: auto; }
#gevents li { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
#gevents li:last-child { border-bottom: 0; }
#gevents .ev-t { flex: 0 0 auto; color: var(--muted); min-width: 92px; }
#gevents .ev-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); align-self: center; }
#gevents .ev-dot.ok { background: var(--green); } #gevents .ev-dot.bad { background: var(--red); }
#gevents li.ev-hl { background: var(--mint-light); }
