:root {
  --bg: #000000;
  --panel: #0a0a0a;
  --border: rgba(255, 255, 255, 0.14);
  --hairline: rgba(255, 255, 255, 0.09);
  --text: #ffffff;
  --muted: #a3a3a3;
  --faint: #6b6b6b;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
}

.wordmark {
  display: flex;
  align-items: center;
}

.wordmark svg {
  height: 26px;
  width: auto;
  display: block;
}

.user {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 14px 5px 7px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.user-btn:hover {
  border-color: #ffffff;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  padding: 3px;
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 280px;
  background: #0a0a0c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 30;
}

.user-menu-head {
  font-size: 14px;
  margin-bottom: 8px;
}

.user-menu-row {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

.menu-item {
  width: 100%;
  margin-top: 12px;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 10px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.menu-item:hover {
  opacity: 0.85;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.tasks {
  display: flex;
  flex-direction: column;
}

.task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--hairline);
}

.task-row:first-child {
  border-top: 1px solid var(--hairline);
}

.task-row.active {
  animation: slowflash 3.2s ease-in-out infinite;
}

@keyframes slowflash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .task-row.active { animation: none; }
}

.task-main {
  min-width: 0;
}

.task-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}

.task-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.task-main p {
  margin: 0;
  font-size: 13px;
}

.task-side {
  text-align: right;
  white-space: nowrap;
}

.percent {
  display: block;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.empty {
  padding: 12px 4px;
  font-size: 14px;
}

.section h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 14px;
}

.muted {
  color: var(--muted);
}

.time {
  font-size: 12px;
}

.badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.badge.state-running {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

.badge.state-blocked {
  color: var(--faint);
}

.badge.state-error {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
}

.badge.state-done {
  color: var(--faint);
}

.fleet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.fleet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}

.fleet-row:first-child {
  border-top: 1px solid var(--hairline);
}

.fleet-name {
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
}

.dot.online {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.dispatch-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.dispatch-actions button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dispatch-actions button:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
}

.note-form {
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
}

.note-form input {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.note-form input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.note-form button, .login-card button {
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.note-form button:hover, .login-card button:hover {
  opacity: 0.85;
}

.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}

.note:first-child {
  border-top: 1px solid var(--hairline);
}

.note-toggle {
  background: none;
  border: none;
  color: var(--faint);
  font-size: 15px;
  cursor: pointer;
  padding: 0;
}

.note-toggle:hover {
  color: #ffffff;
}

.note-text {
  flex: 1;
}

.error-panel {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #000000;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
}

footer {
  text-align: center;
  color: var(--faint);
  font-size: 12px;
  padding: 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.login-card {
  width: min(92vw, 360px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 30px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card input {
  background: #000000;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-card input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.login-card .error {
  color: #ffffff;
  font-size: 13px;
  margin: 14px 0 0;
  text-align: center;
}
