:root {
  --bg: #0f1115;
  --card: #171a21;
  --border: #2a2e38;
  --text: #e8e9ec;
  --muted: #8b8f9a;
  --accent: #4f8cff;
  --red: #e63946;
  --yellow: #ffd60a;
  --green: #2ecc71;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 60px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

header h1 { font-size: 18px; margin: 0; }
header nav a { color: var(--muted); text-decoration: none; margin-left: 14px; font-size: 14px; }
header nav a.active { color: var(--text); }

main { max-width: 640px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

h2 { font-size: 16px; margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

input[type=text], input[type=number], input[type=password], input[type=datetime-local], textarea {
  width: 100%;
  background: #10131a;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 10px;
}

textarea { min-height: 70px; resize: vertical; }

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

button.secondary { background: #2a2e38; }
button.danger { background: var(--red); }
button:disabled { opacity: .5; cursor: not-allowed; }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.clip-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #10131a;
}

.clip-item .drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--red);
  width: auto;
  padding: 0 6px;
  font-size: 18px;
}

.title-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.word-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  background: #10131a;
}

.word-chip.white { color: #ffffff; }
.word-chip.red { color: var(--red); }
.word-chip.yellow { color: var(--yellow); }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #2a2e38;
}

.status-pill.success { background: var(--green); color: #06210f; }
.status-pill.failed { background: var(--red); }
.status-pill.busy { background: var(--accent); }

video, img.preview {
  width: 100%;
  max-height: 480px;
  border-radius: 10px;
  background: black;
  margin-bottom: 10px;
}

.muted { color: var(--muted); font-size: 13px; }
.error-box { background: #3a1418; border: 1px solid var(--red); padding: 10px; border-radius: 8px; margin-bottom: 10px; }
.hidden { display: none !important; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; }
a { color: var(--accent); }

.stat-grid { display: flex; gap: 10px; margin-bottom: 16px; }
.stat-box { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.stat-box .num { font-size: 26px; font-weight: 700; }
.stat-box .label { font-size: 12px; color: var(--muted); }

.day-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.day-bar-row .day { width: 80px; color: var(--muted); }
.day-bar-track { flex: 1; background: #10131a; border-radius: 4px; overflow: hidden; height: 14px; }
.day-bar-fill { background: var(--accent); height: 100%; }
