:root {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

body {
  margin: 24px;
  max-width: 980px;
}

h1 {
  margin: 0 0 16px;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

input,
button {
  font: inherit;
  padding: 10px 12px;
}

input {
  min-width: 320px;
}

button {
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid #bbb;
}

.muted {
  color: #666;
  font-size: 14px;
}

.card {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 14px;
  margin: 14px 0;
}

.task {
  display: grid;
  grid-template-columns: 140px 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.client-wrap {
  position: relative;
}

.client-input {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.client-input:focus {
  border-color: #4a90d9;
  outline: none;
}

.client-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 2px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.client-dropdown.open {
  display: block;
}

.client-option {
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.client-option:hover,
.client-option.active {
  background: #eef3fb;
}

.client-del {
  opacity: 0;
  border: none;
  background: none;
  color: #c00;
  cursor: pointer;
  font-size: 15px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}

.client-option:hover .client-del {
  opacity: 1;
}

.task:last-child {
  border-bottom: 0;
}

.title {
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
}

.title:hover {
  background: #f0f0f0;
}

.title-edit {
  font: inherit;
  font-weight: 600;
  padding: 2px 4px;
  margin: -2px -4px;
  border: 1px solid #4a90d9;
  border-radius: 4px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #ddd;
}

.running {
  background: #eef9f0;
  border-color: #bfe6c8;
}

.paused {
  background: #f7f7f7;
}

.danger {
  border-color: #f1b6b6;
  background: #fff0f0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th,
td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.right {
  text-align: right;
}

dialog {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 14px;
  width: min(920px, 96vw);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .35);
}

.toolbar {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}

.small {
  font-size: 13px;
  padding: 8px 10px;
}

/* Token bar */
.token-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.token-bar code {
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  user-select: all;
}

/* Export section in summary */
.export-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.export-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.export-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.export-row input[type="date"] {
  min-width: 140px;
  padding: 8px 10px;
  font-size: 13px;
}
