:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #1d2330;
  --muted: #5f6b7a;
  --border: #dde1e7;
  --accent: #1f4e79;
  --accent-soft: #e6eef6;
  --green: #1e8e3e;
  --green-soft: #e6f4ea;
  --yellow: #b06000;
  --yellow-dot: #f9ab00;
  --yellow-soft: #fef7e0;
  --red: #c5221f;
  --red-soft: #fce8e6;
  --grey: #80868b;
  --grey-soft: #f1f3f4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans", Roboto, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --surface: #1c2027;
    --surface-2: #232832;
    --text: #e8eaed;
    --muted: #9aa4b2;
    --border: #2e3440;
    --accent: #8ab4f8;
    --accent-soft: #1f2a3a;
    --green: #81c995;
    --green-soft: #1e2d24;
    --yellow: #fdd663;
    --yellow-soft: #2f2a1a;
    --red: #f28b82;
    --red-soft: #3a2120;
    --grey: #9aa0a6;
    --grey-soft: #262a30;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
button {
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
  padding: 5px 11px; cursor: pointer;
}
button:hover { background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--red); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
input, select, textarea {
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 5px 9px;
}
textarea { width: 100%; min-height: 70px; resize: vertical; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 17px; color: var(--text); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.count:not(:empty) {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 2px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 12px; text-align: center;
}
.session { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.agent.stale { color: var(--red); font-weight: 600; }
.demo-banner { background: var(--yellow-soft); color: var(--yellow); padding: 6px 20px; font-size: 13px; }

.app { max-width: 1280px; margin: 0 auto; padding: 18px 20px 60px; }
.loading, .empty { color: var(--muted); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 16px;
}
.card > h2 { display: flex; align-items: center; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }

/* Μετρήσεις */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); text-align: left; cursor: pointer;
}
.metric:hover { border-color: var(--accent); }
.metric.selected { outline: 2px solid var(--accent); }
.metric .value { font-size: 26px; font-weight: 700; }
.metric .label { color: var(--muted); font-size: 13px; }
.metric.red .value { color: var(--red); }
.metric.yellow .value { color: var(--yellow); }

/* Ενδείξεις */
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot.green { background: var(--green); }
.dot.yellow { background: var(--yellow-dot); }
.dot.red { background: var(--red); }
.dot.grey { background: var(--grey); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 10px;
  font-size: 12px; white-space: nowrap; background: var(--grey-soft); color: var(--muted);
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* Πίνακες */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; background: var(--surface-2); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }
td.num { white-space: nowrap; }
td.step { min-width: 220px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.chip {
  border: 1px solid var(--border); border-radius: 16px; padding: 3px 11px; font-size: 13px; background: var(--surface);
}
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Σελίδα έργου */
.project-head { display: flex; gap: 12px; align-items: flex-start; }
.project-head .dot { width: 16px; height: 16px; margin-top: 5px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 18px; margin-top: 10px; }
.facts div span { display: block; font-size: 12px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.now { border-left: 4px solid var(--grey); }
.now.green { border-left-color: var(--green); }
.now.yellow { border-left-color: var(--yellow-dot); }
.now.red { border-left-color: var(--red); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 9px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.timeline > li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; }
.timeline .when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.file-link { word-break: break-word; }
.copy { font-size: 12px; margin-left: 6px; }
details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.group-title { margin: 14px 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.inline-form input[type="text"] { flex: 1 1 220px; }
.actions { margin-top: 6px; }
.pre-wrap { white-space: pre-wrap; }
.metric { color: inherit; width: 100%; }
.export-row {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.lists > summary + .export-row { border-top: 0; }
#report-days { width: 4.5em; padding: 2px 6px; }
.filters input[type="search"] { min-width: 220px; }
.list > li.row { display: flex; }
.now .card { box-shadow: none; margin: 10px 0 0; background: var(--surface-2); }

/* Σύνδεση */
.login { max-width: 420px; margin: 10vh auto; }
.login input { width: 100%; margin: 10px 0; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 9px 16px; border-radius: 8px; box-shadow: var(--shadow); z-index: 20; max-width: 90vw;
}
.summary-text { white-space: pre-wrap; margin: 0; font: inherit; }

@media (max-width: 1150px) {
  .hide-medium { display: none; }
}

@media (max-width: 640px) {
  .app { padding: 12px 12px 48px; }
  .topbar { padding: 8px 12px; }
  .session { margin-left: 0; width: 100%; justify-content: space-between; }
  th, td { padding: 7px 6px; }
  .hide-mobile { display: none; }
}
