/* MS Checker dashboard — cloned styling from booking-checker for familiarity */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: #0f1117;
  color: #e1e4e8;
  min-height: 100vh;
  font-size: 14px;
}
a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #0d1117; padding: 1px 6px; border-radius: 4px; font-family: Consolas, monospace; }

/* Nav / Top bar */
.nav {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.nav h1 { font-size: 18px; font-weight: 600; color: #f0f6fc; }
.nav-links { display: flex; gap: 16px; }
.nav-links a {
  color: #8b949e;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.nav-links a:hover,
.nav-links a.active { color: #f0f6fc; background: #21262d; }

.nav-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill {
  background: #0d1117;
  border: 1px solid #30363d;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  color: #8b949e;
}
.pill b { font-weight: 700; margin-right: 4px; color: #e1e4e8; }
.pill.pill-live b { color: #3fb950; }
.pill.pill-twofa b { color: #d29922; }
.pill.pill-dead b { color: #f85149; }
.pill.pill-err b { color: #ffa657; }
.pill.pill-queue b { color: #58a6ff; }

.logout-form button {
  background: transparent;
  border: 1px solid #30363d;
  color: #8b949e;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.logout-form button:hover { color: #e1e4e8; background: #21262d; }

/* Layout */
.container { max-width: 1400px; margin: 0 auto; padding: 24px; }
.page { display: none; }
.page.active { display: block; }

/* Stats cards */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 16px;
}
.stat-card .label {
  font-size: 12px;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-card .value { font-size: 24px; font-weight: 700; margin-top: 4px; color: #e1e4e8; }
.stat-card .value.green  { color: #3fb950; }
.stat-card .value.red    { color: #f85149; }
.stat-card .value.yellow { color: #d29922; }
.stat-card .value.blue   { color: #58a6ff; }
.stat-card .value.orange { color: #ffa657; }

/* Panels (card wrappers) */
.panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  margin-bottom: 20px;
}
.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid #30363d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-header h2 { font-size: 16px; font-weight: 600; color: #f0f6fc; }
.panel-body { padding: 20px; }

/* Forms */
textarea, input[type="text"], input[type="password"], input[type="number"], select {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e1e4e8;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
textarea { min-height: 110px; resize: vertical; font-family: Consolas, monospace; font-size: 13px; }
textarea:focus, input:focus, select:focus { outline: none; border-color: #58a6ff; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #8b949e;
}
label.chk { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: #8b949e; cursor: pointer; }

/* Dropzone */
.dropzone {
  border: 2px dashed #30363d;
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  color: #8b949e;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 12px;
}
.dropzone.drag  { border-color: #58a6ff; color: #e1e4e8; background: #0d1117; }
.dropzone.ready { border-color: #3fb950; color: #e1e4e8; }

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #30363d;
  background: #21262d;
  color: #e1e4e8;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #30363d; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: #238636; border-color: #2ea043; color: #fff; }
.btn-primary:hover { background: #2ea043; }
.btn-danger  { background: #da3633; border-color: #f85149; color: #fff; }
.btn-danger:hover { background: #f85149; }
.btn-blue    { background: #1f6feb; border-color: #388bfd; color: #fff; }
.btn-blue:hover { background: #388bfd; }
.btn-ghost   { background: transparent; }
.btn-warn    { background: #2d1b00; color: #d29922; border: 1px solid #d29922; }
.btn-warn:hover { filter: brightness(1.2); }
.btn-good    { background: #0d3321; color: #3fb950; border: 1px solid #3fb950; }
.btn-good:hover { filter: brightness(1.2); }
.btn-sm      { padding: 4px 10px; font-size: 12px; }

/* Flex helpers */
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.hidden { display: none !important; }
.muted { color: #8b949e; font-size: 12px; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #21262d; vertical-align: middle; }
th {
  color: #8b949e;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #0d1117;
}
tr:hover td { background: #1c2128; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-live, .badge-valid, .badge-running   { background: #0d3321; color: #3fb950; }
.badge-2fa,  .badge-twofa, .badge-paused, .badge-pending { background: #2d1b00; color: #d29922; }
.badge-dead, .badge-stopped, .badge-fail    { background: #3d1114; color: #f85149; }
.badge-error, .badge-err                    { background: #3d1d0a; color: #ffa657; }
.badge-unknown, .badge-queued               { background: #1f242c; color: #8b949e; }
.badge-retry                                { background: #2d1b00; color: #fbbf24; }
.badge-done                                 { background: #0c2d6b; color: #58a6ff; }

/* Progress bar */
.progress-bar {
  height: 8px;
  background: #21262d;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-fill {
  height: 100%;
  background: #238636;
  transition: width 0.3s;
}
.progress-fill.paused { background: #d29922; }
.progress-fill.stopped { background: #f85149; }

/* Log box — newest at top, monospace */
.log-box {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 12px;
  max-height: 420px;
  overflow-y: auto;
  font-family: Consolas, "SF Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-all;
}
.log-box .line { color: #8b949e; display: block; padding: 1px 0; }
.log-box .line .ts { color: #6e7681; margin-right: 6px; }
.log-box .line .email { color: #e1e4e8; }
.log-box .line .arrow { color: #6e7681; margin: 0 4px; }
.log-box .line .meta { color: #8b949e; font-size: 11px; margin-left: 6px; }
.log-box .line.live   .status { color: #3fb950; font-weight: 600; }
.log-box .line.twofa  .status { color: #d29922; font-weight: 600; }
.log-box .line.dead   .status { color: #f85149; font-weight: 600; }
.log-box .line.error  .status { color: #ffa657; font-weight: 600; }
.log-box .line.retry  .status { color: #fbbf24; font-weight: 600; }
.log-box .line.unknown .status { color: #8b949e; font-weight: 600; }

/* Meta grid for batch detail */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.meta-grid .m {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px 12px;
}
.meta-grid .m .k { font-size: 11px; color: #8b949e; text-transform: uppercase; letter-spacing: 0.4px; }
.meta-grid .m .v { font-size: 14px; color: #e1e4e8; font-weight: 600; margin-top: 2px; }

/* Section header inside panel */
.section-title {
  font-size: 13px;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 8px;
}

/* Messages */
.note { font-size: 12px; color: #8b949e; }
.error { background: #3d1114; color: #f85149; padding: 8px 12px; border-radius: 6px; }
.success { background: #0d3321; color: #3fb950; padding: 8px 12px; border-radius: 6px; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #161b22; padding: 28px 32px; border-radius: 8px; width: 340px; border: 1px solid #30363d; }
.login-form input { width: 100%; margin-top: 12px; padding: 10px; }
.login-form button { width: 100%; margin-top: 12px; padding: 10px; background: #238636; border: none; color: #fff; border-radius: 6px; font-weight: 600; cursor: pointer; }
.login-form button:hover { filter: brightness(1.1); }

/* Responsive */
@media (max-width: 1024px) {
  .container { padding: 12px; }
}
@media (max-width: 768px) {
  .nav { flex-direction: column; align-items: flex-start; gap: 12px; }
  .nav-right { margin-left: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
