:root {
  --bg: #eef6fd;
  --sidebar: #d9ecfb;
  --sidebar-active: #bfe0f8;
  --accent: #2f9be8;
  --accent-dark: #1d7fc4;
  --text: #16344d;
  --muted: #5b7a94;
  --card: #ffffff;
  --border: #cfe5f5;
  --ok: #1fa971;
  --warn: #e0a800;
  --err: #e05252;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar), #cde7fa);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { font-size: 20px; font-weight: 700; margin: 4px 8px 20px; }

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 12px 8px 4px;
}

.nav-item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.55); }
.nav-item.active { background: var(--accent); color: #fff; }

.content { flex: 1; padding: 32px 40px; max-width: 980px; }

h1 { font-size: 24px; margin-bottom: 6px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.page-head { margin-bottom: 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(22, 52, 77, 0.06);
  margin-bottom: 18px;
}

a.tool-card {
  display: block;
  max-width: 420px;
  text-decoration: none;
  color: inherit;
  transition: 0.15s;
}

a.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(22, 52, 77, 0.1);
}

a.tool-card h3 { margin-bottom: 4px; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

textarea,
input[type="number"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  background: #fbfdff;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

textarea { resize: vertical; }
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.row { display: flex; gap: 14px; align-items: flex-end; margin-top: 14px; }
.field { width: 220px; }

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 26px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: var(--accent-dark); }
button:disabled { opacity: 0.6; cursor: default; }

button.ghost { background: transparent; color: var(--accent-dark); padding: 6px 12px; }
button.ghost:hover { background: var(--sidebar-active); }

.logs-card { padding: 14px 16px; }
.logs-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

.logs {
  max-height: 380px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.logs .empty { padding: 12px 0; }

.log-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 6px;
}

.log-row:nth-child(odd) { background: #f4fafe; }
.log-row .idx { width: 56px; color: var(--muted); flex-shrink: 0; }

.badge {
  min-width: 46px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11.5px;
  color: #fff;
  flex-shrink: 0;
}

.badge.ok { background: var(--ok); }
.badge.warn { background: var(--warn); }
.badge.err { background: var(--err); }

.log-row .dur { width: 90px; flex-shrink: 0; }
.log-row .size { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.summary.hidden { display: none; }

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.stat strong { font-size: 15px; }
