:root {
  --bg: #eaeef2;
  --surface: #ffffff;
  --surface-2: #f5f7f9;
  --line: #d3dae1;
  --line-strong: #b6c1cb;
  --ink: #16222e;
  --ink-2: #56656f;
  --ink-3: #8794a0;
  --accent: #1f4e79;
  --accent-soft: #e3edf6;
  --ok: #12683f;
  --ok-soft: #dcf0e5;
  --warn: #8a6100;
  --warn-soft: #fbf0d6;
  --bad: #9d2318;
  --bad-soft: #fadedb;
  --idle: #7b8794;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
}

button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- σκελετός ---------- */
.shell { display: grid; grid-template-columns: 208px 1fr; min-height: 100vh; }

nav.side {
  background: var(--accent);
  color: #dce7f1;
  padding: 18px 0;
  display: flex;
  flex-direction: column;
}
nav.side h1 {
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  margin: 0 18px 22px; color: #fff;
}
nav.side h1 span { display: block; font-size: 11px; font-weight: 400; color: #9dbbd6; letter-spacing: 0; }
nav.side a {
  display: block; padding: 8px 18px; color: #cfe0ee;
  text-decoration: none; border-left: 3px solid transparent; cursor: pointer;
}
nav.side a:hover { background: rgba(255,255,255,.08); color: #fff; }
nav.side a.on { background: rgba(255,255,255,.14); border-left-color: #fff; color: #fff; font-weight: 500; }
nav.side .foot { margin-top: auto; padding: 0 18px; font-size: 12px; color: #9dbbd6; }
nav.side .foot a { padding: 4px 0; border: 0; font-size: 12px; }

/* ---------- επιλογή γλώσσας ---------- */
.langpick { display: inline-flex; margin-bottom: 10px; border-radius: 3px; overflow: hidden; }
.langpick button {
  border: 1px solid rgba(255, 255, 255, .28); background: transparent;
  color: #cfe0ee; padding: 2px 9px; font-size: 11.5px; cursor: pointer;
  letter-spacing: .02em;
}
.langpick button + button { border-left: 0; }
.langpick button.on { background: #fff; color: var(--accent); border-color: #fff; font-weight: 600; }
.langpick button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.loginlang { float: right; margin-top: -6px; }
.loginlang button { border-color: var(--line-strong); color: var(--ink-2); }
.loginlang button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

main { padding: 20px 24px 60px; min-width: 0; }
header.bar { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
header.bar h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
header.bar .meta { color: var(--ink-2); font-size: 12px; }
header.bar .spacer { flex: 1; }

/* ---------- fleet strip: όλη η εγκατεστημένη βάση σε μια ματιά ---------- */
.strip {
  display: flex; flex-wrap: wrap; gap: 3px;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px; margin-bottom: 16px;
}
.strip .cell {
  width: 15px; height: 15px; border-radius: 2px; cursor: pointer;
  background: var(--idle); border: 1px solid rgba(0,0,0,.12);
}
.strip .cell.ok { background: #29a36a; }
.strip .cell.warn { background: #d9a520; }
.strip .cell.bad { background: #c8392c; }
.strip .cell.off { background: #c2cbd3; }
.strip .legend { display: flex; gap: 14px; width: 100%; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.strip .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

/* ---------- πίνακες ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-2);
  padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
}
td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.tenant td {
  background: var(--surface-2); font-weight: 600; font-size: 12px;
  color: var(--ink-2); padding: 6px 12px;
}
.fleet-search { margin-bottom: 12px; }
.fleet-search input { width: min(480px, 100%); padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: white; }
tr.group td { padding: 8px 16px; background: var(--accent-soft); color: var(--accent); cursor: pointer; font-weight: 600; }
tr.insights td { background: #fbfcfd; padding-left: 30px; }
tr.insights .pill { margin: 0 3px 3px 0; }
tr.agent td { cursor: pointer; }
tr.agent:hover td { background: var(--accent-soft); }
tr.approw td { padding-left: 30px; background: #fbfcfd; }
tr.approw td:first-child { border-left: 3px solid var(--line-strong); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.mono { font-family: var(--mono); font-size: 12.5px; }
.dim { color: var(--ink-3); }

/* ---------- ενδείξεις κατάστασης ---------- */
.pill {
  display: inline-block; padding: 1px 7px; border-radius: 3px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.idle { background: #e6eaee; color: var(--ink-2); }
.pill.new { background: var(--accent-soft); color: var(--accent); }

/* ---------- κουμπιά ---------- */
.btn {
  border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 3px; padding: 4px 10px; cursor: pointer; font-size: 13px;
}
.btn:hover { background: var(--surface-2); border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #17406a; }
.btn.danger { color: var(--bad); border-color: #dfb6b1; }
.btn.sm { padding: 2px 7px; font-size: 12px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* ---------- συρτάρι λεπτομερειών ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 92vw);
  background: var(--surface); border-left: 1px solid var(--line-strong);
  box-shadow: -8px 0 24px rgba(20,34,46,.14);
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .16s ease-out; z-index: 40;
}
.drawer.open { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }
.drawer .head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.drawer .head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.drawer .body { overflow: auto; padding: 14px 16px; flex: 1; }

pre.log {
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  background: #12202c; color: #cfe0ee; padding: 12px;
  border-radius: 3px; overflow: auto; max-height: 60vh; margin: 0;
  white-space: pre-wrap; word-break: break-word;
}
pre.log .lvl-error { color: #ff9e91; }
pre.log .lvl-warn { color: #ffd479; }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li { padding: 5px 0 5px 14px; border-left: 2px solid var(--line-strong); }
.steps li.error { border-left-color: var(--bad); color: var(--bad); }
.steps li.warn { border-left-color: var(--warn); }
.steps time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-right: 8px; }

.field { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.field label { width: 190px; font-size: 13px; color: var(--ink-2); }
.field input, .field select { flex: 1; padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 3px; }

.empty { padding: 34px 20px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 15px; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 4px;
  font-size: 13px; z-index: 90; max-width: 70vw;
}
.toast.err { background: var(--bad); }

/* ---------- login ---------- */
body.login { display: grid; place-items: center; min-height: 100vh; background: var(--accent); }
.loginbox {
  background: var(--surface); padding: 30px 32px; border-radius: 5px;
  width: 330px; box-shadow: 0 10px 34px rgba(0,0,0,.25);
}
.loginbox h1 { margin: 0 0 4px; font-size: 20px; }
.loginbox p { margin: 0 0 20px; color: var(--ink-2); font-size: 13px; }
.loginbox input { width: 100%; padding: 8px 10px; margin-bottom: 10px; border: 1px solid var(--line-strong); border-radius: 3px; }
.loginbox .btn { width: 100%; padding: 8px; }
.loginbox .err { color: var(--bad); font-size: 13px; min-height: 19px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  nav.side { flex-direction: row; align-items: center; gap: 4px; padding: 10px; overflow-x: auto; }
  nav.side h1 { display: none; }
  /* Ο διακόπτης γλώσσας μένει ορατός και σε τηλέφωνο· το υπόλοιπο footer όχι. */
  nav.side .foot { margin: 0 0 0 auto; padding: 0 4px; display: flex; align-items: center; }
  nav.side .foot #whoami, nav.side .foot a { display: none; }
  .langpick { margin-bottom: 0; }
  main { padding: 14px; }
}

/* Responsive administration panels */
.shell { grid-template-columns: 208px minmax(0, 1fr); }
.panel { overflow-x: auto; }
td { overflow-wrap: anywhere; }
td > .actions { min-width: 125px; }

/* 1.5 dashboard: compact controls, readable telemetry and resource cards. */
:root {
  --bg:#f1f5f9; --surface:#fff; --surface-2:#f7f9fc;
  --line:#e1e8ef; --line-strong:#c9d6e0;
  --ink:#142638; --ink-2:#5b7081; --ink-3:#8394a2;
  --accent:#124b69; --accent-soft:#e7f3f7;
  --ok:#11755f; --ok-soft:#e3f5ef;
}
body { background: radial-gradient(circle at 83% -10%,#d9edf4 0,transparent 38%),var(--bg); }
nav.side { background:linear-gradient(175deg,#102c45,#164e66 60%,#10716d); }
nav.side h1 { font-size:20px;font-weight:750;letter-spacing:-.035em; }
nav.side a { border-radius:0 24px 24px 0;margin-right:12px;transition:background .16s; }
nav.side a.on { background:rgba(255,255,255,.17);border-left-color:#76d9ca; }
main { padding:28px 34px 70px; }
header.bar { align-items:center;margin-bottom:22px; }
header.bar h2 { font-size:24px;font-weight:740;letter-spacing:-.035em; }
.panel,.strip { border-radius:14px;box-shadow:0 8px 30px rgba(23,55,80,.035); }
.strip { padding:16px 18px; }
.strip .cell { border-radius:4px; }
.fleet-search input,.inventory-toolbar input { border-radius:10px;padding:11px 14px;box-shadow:0 3px 12px rgba(14,54,80,.03); }
th { background:#f8fafc;letter-spacing:.025em;text-transform:uppercase;font-size:10.5px; }
tr.group td { background:#e8f3f6; }
tr.insights td { padding:0 22px 20px 30px;background:#fbfdfe; }
tr.approw td { background:#fbfdfe; }
.pill { border-radius:999px;padding:3px 9px;font-weight:600; }
.btn { border-radius:8px;transition:background .14s,transform .14s,box-shadow .14s; }
.btn:hover { transform:translateY(-1px);box-shadow:0 4px 14px rgba(15,64,87,.1); }
.btn.icon-btn,#refresh { display:inline-grid;place-items:center;width:32px;height:32px;padding:6px;flex:0 0 auto; }
.btn.icon-btn svg,#refresh svg,.resource-emblem svg { width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round; }
.actions { gap:5px;align-items:center; }
td > .actions { min-width:0; }
#refresh { width:36px;height:36px; }
.machine-overview { padding:18px 20px 4px;border:1px solid #dceaf0;border-radius:14px;background:linear-gradient(125deg,#fff,#f4fafb); }
.machine-overview-head { display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:15px; }
.machine-overview-head h3,.resource-card h3 { margin:2px 0 2px;font-size:16px;letter-spacing:-.025em; }
.machine-overview-head small,.resource-card small,.metric-tile small { color:var(--ink-2); }
.eyebrow { display:block;color:#34847d;font-size:10px;font-weight:800;letter-spacing:.13em;text-transform:uppercase; }
.metric-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px; }
.metric-tile { min-width:0;border:1px solid #e5edf2;border-radius:11px;background:#fff;padding:11px 13px;display:flex;flex-direction:column;gap:3px; }
.metric-tile > span { color:var(--ink-2);font-size:11px;font-weight:650; }
.metric-tile strong { font-size:21px;letter-spacing:-.035em;font-variant-numeric:tabular-nums; }
.metric-tile small { min-height:17px;font-size:10.5px;overflow-wrap:anywhere; }
.metric-track { height:5px;border-radius:5px;background:#eaf0f4;overflow:hidden;margin:3px 0 1px; }
.metric-track i { display:block;height:100%;background:#16a88b;border-radius:5px; }
.metric-track i.caution { background:#d9a520; }
.metric-track i.critical { background:#dc6253; }
.insight-list { display:flex;gap:6px;flex-wrap:wrap;margin:12px 0; }
.section-intro { margin-bottom:20px; }
.section-intro h2 { margin:3px 0;font-size:27px;letter-spacing:-.04em; }
.section-intro p { margin:0;color:var(--ink-2); }
.resource-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:12px; }
.resource-card { display:flex;gap:13px;align-items:center;border:1px solid var(--line);border-radius:14px;background:#fff;padding:16px;box-shadow:0 8px 24px rgba(20,52,74,.04); }
.resource-card > div:nth-child(2) { flex:1;min-width:0; }
.resource-emblem { display:grid;place-items:center;width:43px;height:43px;flex:0 0 43px;border-radius:12px;color:#0d8276;background:#e6f5f3; }
.resource-emblem svg { width:23px;height:23px; }
.resource-dialog { max-width:min(940px,96vw);width:900px; }
.inventory-toolbar { display:flex;gap:10px;margin-bottom:8px; }
.inventory-toolbar input { flex:1;min-width:0;border:1px solid var(--line-strong); }
.inventory-list { display:grid;gap:9px;max-height:65vh;overflow-y:auto; }
.inventory-row { display:flex;flex-wrap:wrap;gap:12px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:13px;background:#fff; }
.queue-details { flex-basis:100%;font-size:12px;color:var(--ink-2);padding-top:7px;border-top:1px solid var(--line); }
.queue-details summary { cursor:pointer;font-weight:650; }
.queue-details > div { padding:4px 0; }
.inventory-row.watched { border-left:4px solid #16a88b; }
.inventory-leading { min-width:145px;max-width:200px;display:flex;align-items:flex-start;gap:4px;flex-direction:column; }
.inventory-leading small { color:var(--ink-3);font-size:11px; }
.inventory-facts { display:flex;flex-wrap:wrap;gap:10px 16px;flex:1; }
.inventory-facts span { display:flex;flex-direction:column;font-size:12px;overflow-wrap:anywhere;max-width:250px; }
.inventory-facts b { font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--ink-3); }
@media(max-width:1100px) { .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:680px) { main { padding:14px; } .metric-grid { grid-template-columns:1fr 1fr; } .inventory-row { flex-wrap:wrap; } .resource-grid { grid-template-columns:1fr; } }
tr.approw td { padding-left: 12px; }
tr.approw td:first-child { padding-left: 28px; }
tr.approw[data-app] { cursor: pointer; }
tr.approw[data-app]:hover td { background: var(--accent-soft); }
.drawer { width: min(960px, 96vw); }
.drawer .head h3 { overflow-wrap: anywhere; min-width: 0; }
.drawer .body { min-height: 0; min-width: 0; }
#discList table { table-layout: fixed; }
#discList td:first-child { overflow-wrap: anywhere; word-break: break-word; }
#discList td:last-child { width: 95px; }
.field > input, .field > select { min-width: 0; }
.field > label:first-child { flex-shrink: 0; }
.field > span { min-width: 0; overflow-wrap: anywhere; }
.modal { width: min(1180px, 96vw); max-width: 96vw; max-height: 92vh; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); box-shadow: 0 20px 80px #10203055; }
.modal::backdrop { background: #10203088; backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.modal-head h2 { font-size: 18px; margin: 0; overflow-wrap: anywhere; }
.modal-body { padding: 20px 22px; overflow: auto; max-height: calc(92vh - 75px); }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 12px; }
.toolbar input:not([type=checkbox]), .cmd-directory { flex: 1; min-width: 140px; }
.modal input:not([type=checkbox]):not([type=file]), .modal select, .modal textarea { border: 1px solid var(--line-strong); border-radius: 5px; padding: 7px 9px; max-width: 100%; }
.modal .status { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.modal pre.log { min-height: 260px; max-height: 57vh; padding: 18px; border-radius: 7px; font-weight: 400; }
.modal pre.nowrap { white-space: pre; word-break: normal; }
.log-source { max-width: 400px !important; }
.tool-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tool-content { min-height: 380px; }
.file-list { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.file-list table { table-layout: fixed; }
.file-list th:nth-child(2) { width: 130px; }
.file-list th:last-child { width: 100px; }
.file-name { border: 0; background: none; color: var(--accent); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.resource-list > div { display: flex; align-items: center; gap: 15px; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 12px 0; }
.resource-list span { min-width: 0; overflow-wrap: anywhere; }
.resource-list small { display: block; color: var(--ink-2); }
.cmd-directory, .cmd-input { width: 100%; margin-bottom: 12px; }
.cmd-input { font-family: var(--mono); resize: vertical; }
@media (max-width: 860px) { .shell { grid-template-columns: minmax(0, 1fr); } .panel > table { min-width: 700px; } #discList .panel > table { min-width: 0; } }
@media (max-width: 600px) { .modal-body { padding: 14px; } .field { flex-wrap: wrap; } .field > label:first-child { width: 100%; } .field input:not([type=checkbox]), .field select { width: 100%; } .log-source { max-width: 260px !important; } }

/* 1.1.1: true reflow, not a desktop-width table inside a phone viewport. */
html { overflow-wrap: anywhere; }
.shell, #view, .panel, .toolbar, .field { min-width: 0; }
header.bar { flex-wrap: wrap; align-items: center; }
.strip .legend { flex-wrap: wrap; }
.modal-head { position: sticky; top: 0; z-index: 1; }
.modal-body { overscroll-behavior: contain; }
.toolbar > label { min-width: 0; }
.toolbar select { max-width: 100%; }
.runtime-info { margin: 0 0 16px; padding: 10px 12px; background: var(--surface-2); border-radius: 6px; font-size: 12px; }
.runtime-info p { margin: 4px 0; overflow-wrap: anywhere; }
#liveState { flex-shrink: 0; }
@media (max-width: 860px) {
  .shell { display: block; min-width: 0; }
  nav.side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 8px; overflow: visible; }
  nav.side a { min-height: 42px; padding: 10px; }
  nav.side .foot { grid-column: 1 / -1; width: 100%; margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
  nav.side .foot #whoami, nav.side .foot a { display: inline; }
  nav.side .foot a { min-height: 38px; padding: 8px; }
  .langpick button { min-height: 36px; min-width: 42px; }
  main { padding: 12px; }
  header.bar { gap: 8px; }
  header.bar .meta { flex-basis: 100%; order: 3; }
  #view > .panel { overflow: visible; }
  #view .panel > table { display: block; width: 100%; min-width: 0; }
  #view .panel > table > thead { display: none; }
  #view .panel > table > tbody { display: block; padding: 8px; }
  #view .panel > table > tbody > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
  #view .panel > table > tbody > tr > td { display: block; width: auto; min-width: 0; padding: 9px 10px; border: 0; text-align: left; overflow-wrap: anywhere; }
  #view .panel > table > tbody > tr > td::before { content: attr(data-label); display: block; color: var(--ink-2); font-size: 11px; font-weight: 500; margin-bottom: 3px; }
  #view .panel > table > tbody > tr > td:first-child,
  #view .panel > table > tbody > tr > td:last-child,
  #view .panel > table > tbody > tr > td[colspan] { grid-column: 1 / -1; }
  #view .panel > table > tbody > tr > td:first-child::before,
  #view .panel > table > tbody > tr.tenant > td::before { display: none; }
  #view .panel > table > tbody > tr.tenant { display: block; border: 0; margin: 2px 0 8px; border-radius: 0; }
  #view .panel > table > tbody > tr.tenant td { background: transparent; padding: 5px; }
  #view tr.approw { margin-left: 10px; border-left: 3px solid var(--accent); }
  #view tr.approw td:first-child { border-left: 0; }
  #view tr.approw td:last-child::before { display: none; }
  #view td > .actions { min-width: 0; }
  .btn, .btn.sm { min-height: 40px; padding: 7px 10px; }
  .actions { gap: 7px; }
  .actions .btn { flex: 1 1 auto; white-space: normal; }
  .field { flex-wrap: wrap; }
  .field > label:first-child { width: 100%; }
  .field > input:not([type=checkbox]), .field > select { flex-basis: 100%; width: 100%; }
  .drawer { width: 100%; max-width: 100vw; }
  .drawer .head { padding: 12px; }
  .drawer .body { padding: 12px; }
  #discList .panel { overflow: hidden; }
  #discList .panel > table { min-width: 0; }
  #discList td { padding: 9px 7px; }
  #discList td:last-child { width: 84px !important; }
  .modal { box-sizing: border-box; width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: auto; border-radius: 9px; }
  .modal-head { padding: 12px; gap: 8px; }
  .modal-head h2 { font-size: 16px; }
  .modal-body { padding: 12px; max-height: calc(100dvh - 88px); }
  .modal .toolbar > input:not([type=checkbox]), .modal .toolbar > label { flex: 1 1 100%; width: 100%; }
  .modal .toolbar select { max-width: 100% !important; width: 100%; }
  .modal .toolbar > label:has(input[type=checkbox]) { flex-basis: auto; width: auto; }
  .modal pre.log { min-height: 180px; max-height: 48dvh; font-size: 12px; }
  .tool-tabs { flex-wrap: wrap; }
  .tool-tabs .btn { flex: 1; }
  .tool-content { min-height: 240px; }
  .file-list table { table-layout: auto; }
  .file-list th:nth-child(2) { width: auto; }
  .file-list th:last-child { width: 76px; }
  .file-list td { padding: 8px 5px; font-size: 12px; }
  .file-list .file-name { padding: 6px 0; }
  .resource-list > div { flex-wrap: wrap; }
  .resource-list > div > span { flex: 1 1 170px; }
  .loginbox { width: min(330px, calc(100vw - 24px)); padding: 24px; }
  input, select, textarea { font-size: 16px; }
}

.modal.resource-dialog { width:min(900px,96vw);max-width:96vw; }
.actions .btn.icon-btn { flex:0 0 32px; }
@media(max-width:680px) { .modal.resource-dialog { width:calc(100vw - 16px); } }

/* 1.6.1: ο πελάτης είναι το πρώτο που βλέπει το μάτι· από κάτω ομάδες και μηχανήματα. */
tr.customer td { padding: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
tr.customer + tr.customer td, tr.approw + tr.customer td, tr.insights + tr.customer td, tr.agent + tr.customer td, tr.group + tr.customer td { border-top: 10px solid var(--surface-2); }
tr.customer .tenant-head {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  padding: 15px 18px; cursor: pointer; user-select: none;
  border-left: 6px solid var(--accent);
  background: linear-gradient(90deg, #dcecf3, #f4f9fb 55%, #fff);
  transition: background .15s;
}
tr.customer .tenant-head:hover { background: linear-gradient(90deg, #cfe4ee, #eaf4f8 55%, #fff); }
tr.customer .tenant-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
tr.customer .tenant-caret { width: 14px; font-size: 15px; color: var(--accent); }
tr.customer .tenant-name { font-size: 18px; font-weight: 800; letter-spacing: -.015em; color: var(--ink); }
tr.customer .tenant-meta { font-size: 12.5px; color: var(--ink-2); }
tr.customer .tenant-badges { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
tr.customer.open .tenant-head { background: linear-gradient(90deg, #124b69, #17647f 60%, #1b7a86); border-left-color: #76d9ca; }
tr.customer.open .tenant-name, tr.customer.open .tenant-caret { color: #fff; }
tr.customer.open .tenant-meta { color: #cfe6ee; }
/* ιεραρχία: ομάδα και μηχάνημα με εσοχή κάτω από τον πελάτη */
tr.group td { padding-left: 34px; border-left: 6px solid #cfe4ee; }
tr.agent td:first-child { padding-left: 52px; border-left: 6px solid #e4eff4; }
tr.approw td:first-child, tr.insights td { border-left: 6px solid #e4eff4; }
@media (max-width: 860px) {
  #view .panel > table > tbody > tr.customer { display: block; border: 0; margin: 14px 0 8px; border-radius: 10px; overflow: hidden; }
  #view .panel > table > tbody > tr.customer td { padding: 0; background: transparent; border: 0; }
  #view .panel > table > tbody > tr.customer .tenant-head { padding: 13px 14px; }
  #view .panel > table > tbody > tr.customer .tenant-badges { margin-left: 0; width: 100%; }
  #view tr.group td, #view tr.agent td:first-child { padding-left: 10px; border-left: 0; }
}

/* Manager-only commands: cosmetic hiding; API enforces authorization separately. */
html[data-centralops-role="support"] [data-act="remove-agent"],
html[data-centralops-role="support"] [data-act="uninstall-agent"],
html[data-centralops-role="support"] [data-act="delete-tenant"],
html[data-centralops-role="support"] [data-act="delete-group"],
html[data-centralops-role="support"] [data-act="delete-version"],
html[data-centralops-role="support"] [data-act="delete-app"],
html[data-centralops-role="support"] #addTenant,
html[data-centralops-role="support"] #addGroup,
html[data-centralops-role="support"] #uploadBtn,
html[data-centralops-role="support"] #agentUploadBtn,
html[data-centralops-role="support"] [data-ring-for] { display: none !important; }

/* 1.7.1 approval/resources hotfix: text labels disambiguate monitoring from service control. */
.inventory-row .resource-action,
tr.agent .resource-action { display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:5px 9px;font-size:12px;line-height:1.2;white-space:nowrap; }
.resource-action svg { width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0; }
.resource-action.resource-watch { border-color:#0e8874;color:#0a6b5d;background:#e6f7f3; }
.resource-action.resource-unwatch { border-color:#8293a7;color:#425569;background:#eff2f5; }
.resource-action.resource-stop { border-color:#b93838;color:#9b2828;background:#fff0f0; }
.resource-action.approval-action { font-weight:700; }
.resource-action:disabled { opacity:.64;cursor:not-allowed; }
