* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Segoe UI, Arial, sans-serif;
  background: #1e1f24;
  color: #e6e6e6;
}
a { color: #6cb2ff; }

.topnav {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; background: #26272e; border-bottom: 1px solid #3a3b42;
}
.topnav .brand { font-weight: 600; margin-right: 12px; }
.topnav a { color: #d6d6d6; text-decoration: none; font-size: 14px; }
.topnav a:hover { color: #fff; }
.topnav .logout { margin-left: auto; color: #ff8a8a; }

.page { padding: 20px 24px; max-width: 1200px; margin: 0 auto; }
h1 { font-size: 20px; }
h2 { font-size: 15px; color: #9aa0a6; text-transform: uppercase; margin-top: 28px; }
.hint { color: #9aa0a6; font-size: 13px; }

/* login */
.login-box {
  max-width: 320px; margin: 80px auto; padding: 24px;
  background: #26272e; border: 1px solid #3a3b42; border-radius: 8px;
}
.login-box label { display: block; margin: 10px 0 4px; font-size: 13px; color: #9aa0a6; }
.login-box input {
  width: 100%; padding: 8px; background: #1e1f24; color: #e6e6e6;
  border: 1px solid #4a4b52; border-radius: 4px;
}
.login-box button {
  margin-top: 16px; width: 100%; padding: 10px; background: #2d7d46; color: #fff;
  border: none; border-radius: 4px; cursor: pointer; font-size: 14px;
}
.login-box button:hover { background: #35994f; }
.error { color: #ff8a8a; font-size: 13px; }

/* dashboard cards */
.cards { display: flex; gap: 16px; margin: 16px 0; }
.card {
  flex: 1; background: #26272e; border: 1px solid #3a3b42; border-radius: 8px;
  padding: 16px; text-align: center;
}
.card .num { display: block; font-size: 28px; font-weight: 700; }
.card .label { font-size: 12px; color: #9aa0a6; }

.msg { margin-top: 8px; font-size: 13px; }
.msg.success { color: #7bdc8f; }
.msg.error { color: #ff8a8a; }

table.jobs-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
table.jobs-table th, table.jobs-table td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid #3a3b42;
}
.status-done { color: #7bdc8f; }
.status-error { color: #ff8a8a; }
.status-running { color: #ffd479; }
.status-queued { color: #9aa0a6; }

/* forms */
form.inline-form {
  display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin: 10px 0 18px;
  background: #26272e; border: 1px solid #3a3b42; border-radius: 8px; padding: 14px;
}
form.inline-form label {
  display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #9aa0a6;
}
form.inline-form input, form.inline-form select {
  padding: 6px; background: #1e1f24; color: #e6e6e6; border: 1px solid #4a4b52; border-radius: 4px;
}
form.inline-form fieldset { border: 1px solid #4a4b52; border-radius: 4px; padding: 10px; }
form.inline-form legend { color: #9aa0a6; font-size: 12px; }
form.inline-form button {
  padding: 8px 14px; background: #2d7d46; color: #fff; border: none; border-radius: 4px; cursor: pointer;
}
form.inline-form button:hover { background: #35994f; }

.log-box {
  background: #101114; border: 1px solid #3a3b42; border-radius: 6px;
  padding: 10px; height: 260px; overflow-y: auto; font-size: 12px; white-space: pre-wrap;
}

.infer-result img { max-width: 100%; border-radius: 6px; margin-top: 12px; }
.infer-result table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.infer-result th, .infer-result td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #3a3b42; }

/* annotate page (canvas) */
.annotate-layout { display: flex; height: calc(100vh - 130px); margin-top: 10px; }
.toolbar { display: flex; align-items: center; gap: 8px; }
.toolbar button {
  background: #3a3b42; color: #e6e6e6; border: 1px solid #4a4b52;
  padding: 6px 10px; border-radius: 4px; cursor: pointer;
}
.toolbar button:hover { background: #4a4b52; }
#status { margin-left: auto; font-size: 13px; color: #9aa0a6; }

.canvas-wrap {
  flex: 1; overflow: auto; background: #101114;
  display: flex; align-items: flex-start; justify-content: center; padding: 12px;
}
#canvas { background: #fff; cursor: crosshair; }

#sidebar {
  width: 300px; padding: 12px; background: #26272e; border-left: 1px solid #3a3b42; overflow-y: auto;
}
#sidebar select { width: 100%; padding: 6px; background: #1e1f24; color: #e6e6e6; border: 1px solid #4a4b52; }
#boxList { list-style: none; padding: 0; margin: 0; font-size: 13px; }
#boxList li { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-bottom: 1px solid #3a3b42; }
#boxList li .swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; }
#boxList button { background: #703; border: none; color: #fff; border-radius: 3px; padding: 2px 6px; cursor: pointer; }
.help { font-size: 12px; color: #9aa0a6; padding-left: 18px; }
#saveBtn { width: 100%; margin-top: 14px; padding: 10px; font-size: 14px; background: #2d7d46; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
#saveBtn:hover { background: #35994f; }
